vlite3 0.4.4 → 0.4.7
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/AccordionItem.vue.js +33 -32
- package/components/Accordion/types.d.ts +2 -0
- package/components/Alert.vue.d.ts +2 -0
- package/components/Alert.vue.js +38 -36
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +37 -35
- package/components/CheckBox.vue.d.ts +1 -0
- package/components/CheckBox.vue.js +40 -40
- package/components/Chip/Chip.vue.js +55 -55
- package/components/Chip/types.d.ts +1 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
- package/components/ColorPicker/ColorPicker.vue.js +3 -2
- package/components/ConfirmationModal.vue.d.ts +4 -2
- package/components/ConfirmationModal.vue.js +48 -33
- package/components/DataList/DataList.vue.d.ts +0 -2
- package/components/DataList/DataList.vue.js +39 -35
- package/components/DataList/types.d.ts +2 -0
- package/components/DataTable/DataTable.vue.d.ts +0 -5
- package/components/DataTable/DataTable.vue.js +177 -158
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
- package/components/DataTable/DataTableToolbar.vue.js +30 -23
- package/components/DataTable/types.d.ts +4 -0
- package/components/DatePicker.vue.d.ts +1 -0
- package/components/DatePicker.vue.js +32 -25
- package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
- package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
- package/components/Dropdown/DropdownItem.vue.js +24 -23
- package/components/Dropdown/DropdownMenu.vue.js +100 -91
- package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
- package/components/Dropdown/composables/useDropdownSelection.js +19 -17
- package/components/Empty/Empty.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.js +32 -18
- package/components/FilePicker/FilePicker.vue.d.ts +3 -1
- package/components/FilePicker/FilePicker.vue.js +140 -127
- package/components/FileTree/FileTree.vue.js +68 -58
- package/components/FileTree/FileTreeNode.vue.js +35 -34
- package/components/FileTree/types.d.ts +3 -0
- package/components/Form/CustomFields.vue.d.ts +3 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +92 -80
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +60 -59
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +58 -57
- package/components/Form/composables/useForm.js +91 -88
- package/components/Form/types.d.ts +4 -0
- package/components/Form/utils/form.utils.js +104 -98
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.js +39 -32
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/IconPicker.vue.d.ts +2 -0
- package/components/IconPicker.vue.js +37 -29
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +96 -98
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +55 -54
- package/components/Kanban/types.d.ts +1 -0
- package/components/Masonry/Masonry.vue2.js +3 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +62 -57
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.vue.js +61 -54
- package/components/Navbar/Navbar.vue.js +46 -46
- package/components/Pagination/Pagination.vue.js +116 -97
- package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
- package/components/PricingPlan/types.d.ts +5 -0
- package/components/Screen/Screen.vue.d.ts +0 -4
- package/components/Screen/Screen.vue.js +231 -189
- package/components/Screen/ScreenFilter.vue.js +73 -63
- package/components/Screen/types.d.ts +5 -0
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +140 -5
- package/components/SidePanel.vue2.js +2 -135
- package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
- package/components/SidebarMenu/types.d.ts +1 -0
- package/components/Slider.vue.d.ts +1 -0
- package/components/Slider.vue.js +71 -69
- package/components/Switch.vue.d.ts +1 -0
- package/components/Switch.vue.js +23 -18
- package/components/Tabes/Tabes.vue.js +20 -19
- package/components/Tabes/types.d.ts +1 -0
- package/components/Textarea.vue.d.ts +1 -0
- package/components/Textarea.vue.js +18 -16
- package/components/ThemeToggle.vue.js +24 -14
- package/components/Timeline.vue.js +68 -82
- package/components/ToastNotification.vue.js +2 -2
- package/components/Tooltip.vue.d.ts +4 -3
- package/components/Tooltip.vue.js +17 -15
- package/components/Workbook/Sheet.vue.js +80 -71
- package/components/Workbook/WorkbookAddButton.vue.js +14 -10
- package/components/Workbook/types.d.ts +1 -0
- package/core/config.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +28 -26
- package/package.json +1 -1
- package/style.css +1 -2
- package/types/button.d.ts +1 -0
- package/types/config.type.d.ts +10 -0
- package/types/form.type.d.ts +2 -0
- package/types/styles.d.ts +3 -0
- package/types/timeline.type.d.ts +2 -0
- package/utils/i18n.d.ts +8 -0
- package/utils/i18n.js +5 -0
- package/utils/index.d.ts +1 -0
|
@@ -1,149 +1,152 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { initializeFormValues as B, deepClone as m, cleanSubmitValues as Q, getNestedValue as M, evaluateConditional as
|
|
1
|
+
import { ref as p, computed as J, watch as K } from "vue";
|
|
2
|
+
import { initializeFormValues as B, deepClone as m, cleanSubmitValues as Q, getNestedValue as M, evaluateConditional as x, setNestedValue as h, collectFileFields as W, filterNullCustomFields as X } from "../utils/form.utils.js";
|
|
3
3
|
import { useFileUpload as Y } from "./useFileUpload.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { $t as Z } from "../../../utils/i18n.js";
|
|
5
|
+
function re(V) {
|
|
6
|
+
const { schema: u, values: U, isUpdate: F = !1, folderId: j, onSubmit: E } = V, { handleUploadFile: C } = Y(), i = p(B(u, U)), c = p({}), S = p(!1), d = p(!1), A = p(m(i.value)), y = J(() => u ? Array.isArray(u[0]) ? u.flat() : u : []);
|
|
7
|
+
K(
|
|
7
8
|
() => U,
|
|
8
9
|
(e) => {
|
|
9
|
-
e && (
|
|
10
|
+
e && (i.value = B(u, e), A.value = m(i.value), d.value = !1);
|
|
10
11
|
},
|
|
11
12
|
{ deep: !0 }
|
|
12
13
|
);
|
|
13
|
-
const
|
|
14
|
-
values:
|
|
14
|
+
const z = () => ({
|
|
15
|
+
values: i.value,
|
|
15
16
|
isUpdate: F
|
|
16
|
-
}),
|
|
17
|
-
l ?
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
const l =
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
}), N = (e) => M(i.value, e), T = (e) => c.value[e] || "", O = (e, l) => {
|
|
18
|
+
l ? c.value[e] = l : delete c.value[e];
|
|
19
|
+
}, w = () => {
|
|
20
|
+
c.value = {};
|
|
21
|
+
}, $ = (e) => e.when ? x(e.when, z()) : !0, D = (e) => x(e.disabled, z()), L = (e) => x(e.readonly, z()), P = (e) => {
|
|
22
|
+
const l = N(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) {
|
|
26
|
+
const r = e.maxFileSize * 1024 * 1024;
|
|
25
27
|
if (l != null && l !== "") {
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
28
|
+
const t = Array.isArray(l) ? l : [l];
|
|
29
|
+
for (const n of t) {
|
|
30
|
+
const s = n instanceof File ? n.size : n?.fileSize || n?.file?.size || n?.size;
|
|
31
|
+
if (s !== void 0 && s > r) {
|
|
32
|
+
a = `${o} size must be less than ${e.maxFileSize}MB`;
|
|
31
33
|
break;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
if (!a && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
39
|
+
const r = e.maxFiles || e.props?.maxFiles;
|
|
40
|
+
r && Array.isArray(l) && l.length > r && (a = `Maximum ${r} files allowed`);
|
|
39
41
|
}
|
|
40
|
-
return !
|
|
42
|
+
return !a && e.validation && (a = e.validation({
|
|
41
43
|
value: l,
|
|
42
|
-
values:
|
|
44
|
+
values: i.value,
|
|
43
45
|
isUpdate: F
|
|
44
|
-
})),
|
|
45
|
-
},
|
|
46
|
-
|
|
46
|
+
})), a ? c.value[e.name] = a : delete c.value[e.name], a;
|
|
47
|
+
}, I = () => {
|
|
48
|
+
w();
|
|
47
49
|
let e = !0;
|
|
48
50
|
for (const l of y.value) {
|
|
49
|
-
if (
|
|
51
|
+
if (!$(l) || D(l)) continue;
|
|
50
52
|
P(l) && (e = !1);
|
|
51
53
|
}
|
|
52
54
|
return e;
|
|
53
|
-
}, R = (e, l,
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
values:
|
|
59
|
-
data:
|
|
55
|
+
}, R = (e, l, a) => {
|
|
56
|
+
i.value = h(i.value, e, l), d.value = !0, delete c.value[e];
|
|
57
|
+
const o = y.value.find((r) => r.name === e);
|
|
58
|
+
if (o?.updateValues) {
|
|
59
|
+
const r = o.updateValues({
|
|
60
|
+
values: i.value,
|
|
61
|
+
data: a,
|
|
60
62
|
isUpdate: F,
|
|
61
|
-
updateError:
|
|
63
|
+
updateError: O
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
r && typeof r == "object" && (i.value = { ...i.value, ...r });
|
|
64
66
|
}
|
|
65
67
|
}, G = async () => {
|
|
66
|
-
const e = m(
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
...typeof
|
|
71
|
-
fileName:
|
|
72
|
-
fileUrl:
|
|
73
|
-
fileType:
|
|
74
|
-
fileSize:
|
|
68
|
+
const e = m(i.value), l = W(u, e), a = (t, n) => {
|
|
69
|
+
let s = null;
|
|
70
|
+
t instanceof File ? s = t : t && typeof t == "object" && t.file instanceof File && (s = t.file);
|
|
71
|
+
const b = {
|
|
72
|
+
...typeof t == "object" ? t : {},
|
|
73
|
+
fileName: t?.fileName || s?.name || n.split("/").pop() || "unknown",
|
|
74
|
+
fileUrl: n,
|
|
75
|
+
fileType: t?.fileType || s?.type || "application/octet-stream",
|
|
76
|
+
fileSize: t?.fileSize || s?.size || 0
|
|
75
77
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
return delete b.file, b;
|
|
79
|
+
}, o = l.map(async (t) => {
|
|
80
|
+
const { name: n, value: s, field: b } = t, k = b.returnFileObject === !0;
|
|
81
|
+
if (Array.isArray(s)) {
|
|
82
|
+
const q = s.map(async (f) => {
|
|
80
83
|
if (f instanceof File || f && typeof f == "object" && f.file instanceof File) {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
84
|
+
const g = await C(f, j);
|
|
85
|
+
return g ? k ? a(f, g) : g : null;
|
|
83
86
|
}
|
|
84
87
|
return f;
|
|
85
|
-
}),
|
|
86
|
-
return { name:
|
|
88
|
+
}), v = await Promise.all(q);
|
|
89
|
+
return { name: n, value: v };
|
|
87
90
|
} else {
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
return { name:
|
|
91
|
+
if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
|
|
92
|
+
const v = await C(s, j);
|
|
93
|
+
if (v)
|
|
94
|
+
return { name: n, value: k ? a(s, v) : v };
|
|
92
95
|
}
|
|
93
96
|
return null;
|
|
94
97
|
}
|
|
95
98
|
});
|
|
96
|
-
return (await Promise.all(
|
|
97
|
-
|
|
99
|
+
return (await Promise.all(o)).forEach((t) => {
|
|
100
|
+
t && (Object.assign(e, h(e, t.name, t.value)), i.value = h(i.value, t.name, t.value));
|
|
98
101
|
}), e;
|
|
99
102
|
}, H = (e) => {
|
|
100
103
|
const l = { ...e };
|
|
101
|
-
for (const
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (Array.isArray(
|
|
105
|
-
const
|
|
106
|
-
Object.assign(l,
|
|
104
|
+
for (const a of y.value)
|
|
105
|
+
if (a.type === "customFields" && a.props?.schema) {
|
|
106
|
+
const o = M(l, a.name);
|
|
107
|
+
if (Array.isArray(o)) {
|
|
108
|
+
const r = X(o, a.props.schema);
|
|
109
|
+
Object.assign(l, h(l, a.name, r));
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
return l;
|
|
110
113
|
};
|
|
111
114
|
return {
|
|
112
|
-
formValues:
|
|
113
|
-
errors:
|
|
114
|
-
isSubmitting:
|
|
115
|
+
formValues: i,
|
|
116
|
+
errors: c,
|
|
117
|
+
isSubmitting: S,
|
|
115
118
|
isDirty: d,
|
|
116
119
|
handleFieldChange: R,
|
|
117
120
|
validateField: P,
|
|
118
|
-
validateAll:
|
|
119
|
-
isFieldVisible:
|
|
121
|
+
validateAll: I,
|
|
122
|
+
isFieldVisible: $,
|
|
120
123
|
isFieldDisabled: D,
|
|
121
|
-
isFieldReadonly:
|
|
122
|
-
getFieldValue:
|
|
124
|
+
isFieldReadonly: L,
|
|
125
|
+
getFieldValue: N,
|
|
123
126
|
getFieldError: T,
|
|
124
|
-
setFieldError:
|
|
125
|
-
clearErrors:
|
|
127
|
+
setFieldError: O,
|
|
128
|
+
clearErrors: w,
|
|
126
129
|
resetForm: () => {
|
|
127
|
-
|
|
130
|
+
i.value = m(A.value), w(), d.value = !1;
|
|
128
131
|
},
|
|
129
132
|
handleSubmit: async () => {
|
|
130
|
-
if (
|
|
131
|
-
|
|
133
|
+
if (I()) {
|
|
134
|
+
S.value = !0;
|
|
132
135
|
try {
|
|
133
136
|
let l = await G();
|
|
134
137
|
l = H(l), l = Q(
|
|
135
138
|
l,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
),
|
|
139
|
+
u,
|
|
140
|
+
V.emitFields,
|
|
141
|
+
V.emitFields
|
|
142
|
+
), E && await E({
|
|
140
143
|
values: l,
|
|
141
144
|
isUpdate: F
|
|
142
|
-
}), d.value = !1,
|
|
145
|
+
}), d.value = !1, A.value = m(l);
|
|
143
146
|
} catch (l) {
|
|
144
147
|
throw console.error("[useForm] Submit error:", l), l;
|
|
145
148
|
} finally {
|
|
146
|
-
|
|
149
|
+
S.value = !1;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
},
|
|
@@ -151,5 +154,5 @@ function te(b) {
|
|
|
151
154
|
};
|
|
152
155
|
}
|
|
153
156
|
export {
|
|
154
|
-
|
|
157
|
+
re as useForm
|
|
155
158
|
};
|
|
@@ -85,8 +85,12 @@ export interface IForm {
|
|
|
85
85
|
transform?: (value: any, formValues: Record<string, any>) => any;
|
|
86
86
|
/** Field label - can be string or Vue component */
|
|
87
87
|
label?: string | Component;
|
|
88
|
+
/** I18n translation key for the label */
|
|
89
|
+
labelI18n?: string;
|
|
88
90
|
/** Placeholder text */
|
|
89
91
|
placeholder?: string;
|
|
92
|
+
/** I18n translation key for the placeholder */
|
|
93
|
+
placeholderI18n?: string;
|
|
90
94
|
/** Field type - determines which component renders */
|
|
91
95
|
type?: IFormFieldType;
|
|
92
96
|
/** Initial/default value - can be static or function */
|
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
function k(e) {
|
|
2
2
|
return !!e && typeof e == "object";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
for (const
|
|
9
|
-
if (
|
|
10
|
-
|
|
4
|
+
function d(e, r) {
|
|
5
|
+
if (!r || !e) return;
|
|
6
|
+
const f = r.split(".");
|
|
7
|
+
let y = e;
|
|
8
|
+
for (const n of f) {
|
|
9
|
+
if (y == null) return;
|
|
10
|
+
y = y[n];
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return y;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
let o =
|
|
18
|
-
for (let i = 0; i <
|
|
19
|
-
const c =
|
|
14
|
+
function v(e, r, f) {
|
|
15
|
+
if (!r) return e;
|
|
16
|
+
const y = r.split("."), n = { ...e };
|
|
17
|
+
let o = n;
|
|
18
|
+
for (let i = 0; i < y.length - 1; i++) {
|
|
19
|
+
const c = y[i];
|
|
20
20
|
Array.isArray(o[c]) ? o[c] = [...o[c]] : o[c] = o[c] ? { ...o[c] } : {}, o = o[c];
|
|
21
21
|
}
|
|
22
|
-
return o[
|
|
22
|
+
return o[y[y.length - 1]] = f, n;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return !k(
|
|
24
|
+
function h(e, r) {
|
|
25
|
+
return !k(r) || !r.name ? e : d(e, r.name) === void 0 && r.value !== void 0 ? v(e, r.name, r.value) : e;
|
|
26
26
|
}
|
|
27
|
-
function E(e,
|
|
28
|
-
let
|
|
29
|
-
const
|
|
30
|
-
for (const
|
|
31
|
-
if (!
|
|
32
|
-
const o =
|
|
33
|
-
let i =
|
|
27
|
+
function E(e, r) {
|
|
28
|
+
let f = r ? m(r) : {};
|
|
29
|
+
const y = Array.isArray(e[0]) ? e.flat() : e;
|
|
30
|
+
for (const n of y) {
|
|
31
|
+
if (!n.name) continue;
|
|
32
|
+
const o = n.mapFrom || n.name;
|
|
33
|
+
let i = r ? d(r, o) : void 0;
|
|
34
34
|
if (i != null) {
|
|
35
|
-
const c =
|
|
35
|
+
const c = n.valueKey || n.key;
|
|
36
36
|
c && (Array.isArray(i) ? i = i.map(
|
|
37
|
-
(
|
|
38
|
-
) : typeof i == "object" && (i =
|
|
37
|
+
(u) => u && typeof u == "object" ? d(u, c) : u
|
|
38
|
+
) : typeof i == "object" && (i = d(i, c))), n.format && (i = n.format(i, r || {}));
|
|
39
39
|
}
|
|
40
40
|
if (i === void 0) {
|
|
41
|
-
if (
|
|
42
|
-
const c =
|
|
41
|
+
if (n.mapFrom && r) {
|
|
42
|
+
const c = d(r, n.name);
|
|
43
43
|
c !== void 0 && (i = c);
|
|
44
44
|
}
|
|
45
45
|
if (i === void 0) {
|
|
46
|
-
const c = typeof
|
|
47
|
-
c !== void 0 && Object.assign(
|
|
46
|
+
const c = typeof n.value == "function" ? n.value() : n.value;
|
|
47
|
+
c !== void 0 && Object.assign(f, v(f, n.name, c));
|
|
48
48
|
} else
|
|
49
|
-
Object.assign(
|
|
49
|
+
Object.assign(f, v(f, n.name, i));
|
|
50
50
|
} else
|
|
51
|
-
Object.assign(
|
|
52
|
-
|
|
51
|
+
Object.assign(f, v(f, n.name, i));
|
|
52
|
+
f = h(f, n.addonLeft), f = h(f, n.addonRight);
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return f;
|
|
55
55
|
}
|
|
56
|
-
function O(e,
|
|
57
|
-
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(
|
|
56
|
+
function O(e, r) {
|
|
57
|
+
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(r) : !1;
|
|
58
58
|
}
|
|
59
|
-
function S(e,
|
|
60
|
-
return Array.isArray(e) ? e.filter((
|
|
61
|
-
const o =
|
|
59
|
+
function S(e, r) {
|
|
60
|
+
return Array.isArray(e) ? e.filter((f) => f ? !r.every((n) => {
|
|
61
|
+
const o = f[n.name];
|
|
62
62
|
return o == null || o === "";
|
|
63
63
|
}) : !1) : [];
|
|
64
64
|
}
|
|
65
|
-
function F(e,
|
|
66
|
-
const
|
|
67
|
-
for (const
|
|
68
|
-
if (!
|
|
69
|
-
const o =
|
|
65
|
+
function F(e, r) {
|
|
66
|
+
const f = [], y = Array.isArray(e[0]) ? e.flat() : e;
|
|
67
|
+
for (const n of y) {
|
|
68
|
+
if (!n.name) continue;
|
|
69
|
+
const o = n.type;
|
|
70
70
|
if (o === "file" || o === "avatarUpload" || o === "fileUploader") {
|
|
71
|
-
const i =
|
|
72
|
-
i &&
|
|
73
|
-
name:
|
|
71
|
+
const i = d(r, n.name);
|
|
72
|
+
i && f.push({
|
|
73
|
+
name: n.name,
|
|
74
74
|
value: i,
|
|
75
75
|
type: o,
|
|
76
|
-
field:
|
|
76
|
+
field: n
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
if (o === "customFields" &&
|
|
80
|
-
const i =
|
|
79
|
+
if (o === "customFields" && n.props?.schema) {
|
|
80
|
+
const i = d(r, n.name);
|
|
81
81
|
if (Array.isArray(i)) {
|
|
82
|
-
const
|
|
82
|
+
const u = n.props.schema.filter(
|
|
83
83
|
(s) => s.type === "file" || s.type === "avatarUpload" || s.type === "fileUploader"
|
|
84
84
|
);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
name: `${
|
|
90
|
-
value:
|
|
85
|
+
u.length > 0 && i.forEach((s, t) => {
|
|
86
|
+
u.forEach((a) => {
|
|
87
|
+
const l = s?.[a.name];
|
|
88
|
+
l && f.push({
|
|
89
|
+
name: `${n.name}.${t}.${a.name}`,
|
|
90
|
+
value: l,
|
|
91
91
|
type: a.type,
|
|
92
92
|
field: a
|
|
93
93
|
});
|
|
@@ -96,64 +96,70 @@ function F(e, n) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return f;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function m(e) {
|
|
102
102
|
if (e === null || typeof e != "object") return e;
|
|
103
103
|
if (e instanceof Date) return new Date(e.getTime());
|
|
104
104
|
if (e instanceof File) return e;
|
|
105
|
-
if (Array.isArray(e)) return e.map((
|
|
106
|
-
const
|
|
107
|
-
for (const
|
|
108
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
109
|
-
return
|
|
105
|
+
if (Array.isArray(e)) return e.map((f) => m(f));
|
|
106
|
+
const r = {};
|
|
107
|
+
for (const f in e)
|
|
108
|
+
Object.prototype.hasOwnProperty.call(e, f) && (r[f] = m(e[f]));
|
|
109
|
+
return r;
|
|
110
110
|
}
|
|
111
111
|
function x(e) {
|
|
112
112
|
return e ? typeof e == "object" && (typeof e.render == "function" || typeof e.setup == "function" || e.__name !== void 0 || e.name !== void 0) : !1;
|
|
113
113
|
}
|
|
114
|
-
function g(e,
|
|
115
|
-
const
|
|
114
|
+
function g(e, r, f, y) {
|
|
115
|
+
const n = f === void 0 && y === void 0, o = n ? m(e) : {}, i = Array.isArray(r[0]) ? r.flat() : r, c = f || [], u = y || [];
|
|
116
116
|
for (const s of i) {
|
|
117
117
|
if (!s.name) continue;
|
|
118
|
-
let
|
|
119
|
-
if (
|
|
120
|
-
if (s.type === "customFields" && s.props?.schema && Array.isArray(
|
|
118
|
+
let t = d(e, s.name);
|
|
119
|
+
if (t === void 0) continue;
|
|
120
|
+
if (t = m(t), s.type === "customFields" && s.props?.schema && Array.isArray(t)) {
|
|
121
121
|
const A = s.props.schema;
|
|
122
|
-
|
|
122
|
+
t = t.map((p) => g(p, A, f, y));
|
|
123
123
|
}
|
|
124
124
|
let a = !1;
|
|
125
|
-
s.transform && (
|
|
126
|
-
const
|
|
127
|
-
|
|
125
|
+
s.transform && (t = s.transform(t, e), a = !0);
|
|
126
|
+
const l = s.mapTo || s.name;
|
|
127
|
+
l !== s.name && (a = !0, n && !s.name.includes(".") && delete o[s.name]), !n || a ? Object.assign(o, v(o, l, t)) : Object.assign(o, v(o, s.name, t));
|
|
128
128
|
}
|
|
129
129
|
if (c.length > 0) {
|
|
130
|
-
const s = (
|
|
131
|
-
if (!(!
|
|
132
|
-
if (Array.isArray(
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
const s = (t, a) => {
|
|
131
|
+
if (!(!t || typeof t != "object") && !(!a || typeof a != "object"))
|
|
132
|
+
if (Array.isArray(t) && Array.isArray(a)) {
|
|
133
|
+
for (const l of c) {
|
|
134
|
+
const A = t.find((p) => p && typeof p == "object" && p[l] !== void 0)?.[l];
|
|
135
|
+
A !== void 0 && a.forEach((p) => {
|
|
136
|
+
p && typeof p == "object" && p[l] === void 0 && (p[l] = m(A));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
t.forEach((l, A) => {
|
|
140
|
+
a[A] && s(l, a[A]);
|
|
135
141
|
});
|
|
136
|
-
else {
|
|
137
|
-
for (const
|
|
138
|
-
|
|
139
|
-
for (const
|
|
140
|
-
typeof a[
|
|
142
|
+
} else {
|
|
143
|
+
for (const l of c)
|
|
144
|
+
t[l] !== void 0 && a[l] === void 0 && (a[l] = m(t[l]));
|
|
145
|
+
for (const l in a)
|
|
146
|
+
typeof a[l] == "object" && typeof t[l] == "object" && s(t[l], a[l]);
|
|
141
147
|
}
|
|
142
148
|
};
|
|
143
|
-
for (const
|
|
144
|
-
e[
|
|
149
|
+
for (const t of c)
|
|
150
|
+
e[t] !== void 0 && o[t] === void 0 && (o[t] = m(e[t]));
|
|
145
151
|
s(e, o);
|
|
146
152
|
}
|
|
147
|
-
if (
|
|
148
|
-
const s = (
|
|
149
|
-
if (!(!
|
|
150
|
-
if (Array.isArray(
|
|
151
|
-
|
|
153
|
+
if (u.length > 0) {
|
|
154
|
+
const s = (t) => {
|
|
155
|
+
if (!(!t || typeof t != "object"))
|
|
156
|
+
if (Array.isArray(t))
|
|
157
|
+
t.forEach(s);
|
|
152
158
|
else {
|
|
153
|
-
for (const a of
|
|
154
|
-
delete
|
|
155
|
-
for (const a in
|
|
156
|
-
s(
|
|
159
|
+
for (const a of u)
|
|
160
|
+
delete t[a];
|
|
161
|
+
for (const a in t)
|
|
162
|
+
s(t[a]);
|
|
157
163
|
}
|
|
158
164
|
};
|
|
159
165
|
s(o);
|
|
@@ -163,12 +169,12 @@ function g(e, n, r, l) {
|
|
|
163
169
|
export {
|
|
164
170
|
g as cleanSubmitValues,
|
|
165
171
|
F as collectFileFields,
|
|
166
|
-
|
|
172
|
+
m as deepClone,
|
|
167
173
|
O as evaluateConditional,
|
|
168
174
|
S as filterNullCustomFields,
|
|
169
|
-
|
|
175
|
+
d as getNestedValue,
|
|
170
176
|
E as initializeFormValues,
|
|
171
177
|
k as isAddonObject,
|
|
172
178
|
x as isComponent,
|
|
173
|
-
|
|
179
|
+
v as setNestedValue
|
|
174
180
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface GoogleLoginProps {
|
|
2
2
|
buttonText?: string;
|
|
3
|
+
buttonTextI18n?: string;
|
|
3
4
|
btnClass?: string;
|
|
4
5
|
variant?: any;
|
|
5
6
|
size?: any;
|
|
@@ -30,7 +31,6 @@ declare const __VLS_component: import('vue').DefineComponent<GoogleLoginProps, {
|
|
|
30
31
|
size: any;
|
|
31
32
|
variant: any;
|
|
32
33
|
rounded: any;
|
|
33
|
-
buttonText: string;
|
|
34
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
35
35
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
36
|
export default _default;
|