vlite3 1.4.30 → 1.4.32
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 +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +3 -2
- package/components/Chart/GanttChart.vue.d.ts +13 -1
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +1185 -607
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +113 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +76 -1
- package/components/Chart/types.js +8 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
- package/components/FilePicker/index.vue.js +2 -4
- package/components/Form/AccordionView.vue2.js +5 -2
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.d.ts +0 -2
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +415 -354
- package/components/Form/FormField.vue.js +175 -196
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +8 -8
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +18 -17
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.d.ts +10 -1
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +271 -170
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/Tabes/tabes.utils.d.ts +14 -0
- package/components/Tabes/tabes.utils.js +26 -0
- package/components/Tabes/types.d.ts +32 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/index.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +415 -387
- package/package.json +3 -2
- package/style.css +1 -1
- package/components/Form/AccordionView.vue.js +0 -222
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { deepClone as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
import { resolveI18nText as
|
|
5
|
-
function
|
|
6
|
-
let { schema:
|
|
7
|
-
const { handleUploadFile:
|
|
8
|
-
|
|
9
|
-
),
|
|
10
|
-
|
|
1
|
+
import { shallowRef as g, computed as ae, watch as le } from "vue";
|
|
2
|
+
import { deepClone as A, initializeFormValues as se, cleanSubmitValues as ie, getNestedValue as K, evaluateConditional as j, setNestedValue as I, collectFileFields as re, filterNullCustomFields as oe } from "../utils/form.utils.js";
|
|
3
|
+
import { useFileUpload as ne } from "./useFileUpload.js";
|
|
4
|
+
import { resolveI18nText as ue } from "../../../utils/i18n.js";
|
|
5
|
+
function he(M) {
|
|
6
|
+
let { schema: Q, values: b, isUpdate: F = !1, folderId: C, onSubmit: R } = M;
|
|
7
|
+
const { handleUploadFile: O } = ne(), o = g(b ? A(b) : {}), m = g({}), D = g(!1), z = g(!1), E = g({}), x = g(Q), N = g(
|
|
8
|
+
b ? A(b) : {}
|
|
9
|
+
), S = (e, t) => {
|
|
10
|
+
if (t) {
|
|
11
|
+
if (m.value[e] === t) return;
|
|
12
|
+
m.value = { ...m.value, [e]: t };
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!(e in m.value)) return;
|
|
16
|
+
const r = { ...m.value };
|
|
17
|
+
delete r[e], m.value = r;
|
|
18
|
+
}, h = (e, t) => {
|
|
19
|
+
E.value[e] !== t && (E.value = { ...E.value, [e]: t });
|
|
20
|
+
}, U = ae(() => {
|
|
21
|
+
const e = x.value;
|
|
11
22
|
return e ? Array.isArray(e[0]) ? e.flat() : e : [];
|
|
12
|
-
}),
|
|
23
|
+
}), P = async (e) => {
|
|
13
24
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
console.error("[useForm] Initialization error:",
|
|
25
|
+
const t = await se(x.value, e, o.value, F);
|
|
26
|
+
o.value = t, N.value = A(t), z.value = !1;
|
|
27
|
+
} catch (t) {
|
|
28
|
+
console.error("[useForm] Initialization error:", t);
|
|
18
29
|
}
|
|
19
30
|
};
|
|
20
|
-
|
|
21
|
-
() =>
|
|
31
|
+
P(b), le(
|
|
32
|
+
() => b,
|
|
22
33
|
(e) => {
|
|
23
|
-
e &&
|
|
34
|
+
e && P(e);
|
|
24
35
|
},
|
|
25
36
|
{ deep: !0 }
|
|
26
37
|
);
|
|
27
|
-
const
|
|
28
|
-
values:
|
|
29
|
-
globalValues:
|
|
30
|
-
isUpdate:
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
m.value = {};
|
|
35
|
-
},
|
|
36
|
-
const
|
|
38
|
+
const T = () => ({
|
|
39
|
+
values: o.value,
|
|
40
|
+
globalValues: o.value,
|
|
41
|
+
isUpdate: F
|
|
42
|
+
}), W = (e) => K(o.value, e), X = (e) => m.value[e] || "", H = (e, t) => {
|
|
43
|
+
S(e, t);
|
|
44
|
+
}, k = () => {
|
|
45
|
+
Object.keys(m.value).length !== 0 && (m.value = {});
|
|
46
|
+
}, $ = (e) => e.when ? j(e.when, T()) : !0, L = (e) => j(e.disabled, T()), G = (e) => j(e.readonly, T()), B = async (e, t = "") => {
|
|
47
|
+
const r = t ? `${t}.${e.name}` : e.name, s = W(r);
|
|
37
48
|
let i = "";
|
|
38
|
-
const
|
|
49
|
+
const l = typeof e.label == "string" ? e.label : e.name, c = ue(e.labelI18n, l) ?? l;
|
|
39
50
|
if (e.required) {
|
|
40
|
-
const
|
|
41
|
-
(s == null || s === "" || Array.isArray(s) && s.length === 0 ||
|
|
51
|
+
const a = typeof s == "string" && /<\/?[a-z][^>]*>/i.test(s) && s.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim() === "";
|
|
52
|
+
(s == null || s === "" || Array.isArray(s) && s.length === 0 || a) && (i = `${c} is required`);
|
|
42
53
|
}
|
|
43
54
|
if (!i && e.maxFileSize) {
|
|
44
|
-
const
|
|
55
|
+
const a = e.maxFileSize * 1024 * 1024;
|
|
45
56
|
if (s != null && s !== "") {
|
|
46
57
|
const v = Array.isArray(s) ? s : [s];
|
|
47
58
|
for (const p of v) {
|
|
48
59
|
const y = p instanceof File ? p.size : p?.fileSize || p?.file?.size || p?.size;
|
|
49
|
-
if (y !== void 0 && y >
|
|
60
|
+
if (y !== void 0 && y > a) {
|
|
50
61
|
i = `${c} size must be less than ${e.maxFileSize}MB`;
|
|
51
62
|
break;
|
|
52
63
|
}
|
|
@@ -54,94 +65,94 @@ function Fe(L) {
|
|
|
54
65
|
}
|
|
55
66
|
}
|
|
56
67
|
if (!i && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
57
|
-
const
|
|
58
|
-
|
|
68
|
+
const a = e.maxFiles || e.props?.maxFiles;
|
|
69
|
+
a && Array.isArray(s) && s.length > a && (i = `Maximum ${a} files allowed`);
|
|
59
70
|
}
|
|
60
71
|
if (!i && e.validation) {
|
|
61
|
-
|
|
72
|
+
h(r, !0);
|
|
62
73
|
try {
|
|
63
74
|
i = await e.validation({
|
|
64
75
|
value: s,
|
|
65
|
-
values:
|
|
66
|
-
globalValues:
|
|
67
|
-
isUpdate:
|
|
76
|
+
values: o.value,
|
|
77
|
+
globalValues: o.value,
|
|
78
|
+
isUpdate: F
|
|
68
79
|
});
|
|
69
|
-
} catch (
|
|
70
|
-
console.error(`[useForm] Validation error in field ${
|
|
80
|
+
} catch (a) {
|
|
81
|
+
console.error(`[useForm] Validation error in field ${r}:`, a), i = "Validation failed";
|
|
71
82
|
} finally {
|
|
72
|
-
|
|
83
|
+
h(r, !1);
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
86
|
+
if (S(r, i), e.type === "customFields" && e.props?.schema) {
|
|
87
|
+
const a = e.props.schema, v = Array.isArray(s) ? s : [];
|
|
77
88
|
let p = !1;
|
|
78
89
|
for (let y = 0; y < v.length; y++) {
|
|
79
|
-
const u = { values: v[y] || {}, globalValues:
|
|
80
|
-
for (const n of
|
|
81
|
-
const
|
|
82
|
-
|
|
90
|
+
const u = { values: v[y] || {}, globalValues: o.value, isUpdate: F };
|
|
91
|
+
for (const n of a) {
|
|
92
|
+
const V = !n.when || j(n.when, u), d = j(n.disabled, u);
|
|
93
|
+
V && !d ? await B(n, `${r}.${y}`) && (p = !0) : S(`${r}.${y}.${n.name}`, "");
|
|
83
94
|
}
|
|
84
95
|
}
|
|
85
|
-
p && !i && (i = "Please fix errors in the list.",
|
|
96
|
+
p && !i && (i = "Please fix errors in the list.", S(r, i));
|
|
86
97
|
}
|
|
87
98
|
return i;
|
|
88
|
-
},
|
|
89
|
-
|
|
99
|
+
}, J = async () => {
|
|
100
|
+
k();
|
|
90
101
|
let e = !0;
|
|
91
|
-
for (const
|
|
92
|
-
if (
|
|
93
|
-
await
|
|
102
|
+
for (const t of U.value) {
|
|
103
|
+
if (!$(t) || L(t)) continue;
|
|
104
|
+
await B(t) && (e = !1);
|
|
94
105
|
}
|
|
95
106
|
return e;
|
|
96
|
-
},
|
|
97
|
-
const s =
|
|
98
|
-
let i = s.find((
|
|
99
|
-
if (!i && s.length > 0 && (i = s[0]), i && (
|
|
107
|
+
}, Y = async (e, t, r) => {
|
|
108
|
+
const s = U.value.filter((l) => l.name === e);
|
|
109
|
+
let i = s.find((l) => $(l));
|
|
110
|
+
if (!i && s.length > 0 && (i = s[0]), i && (!$(i) || L(i) || G(i))) {
|
|
100
111
|
console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly/hidden field: ${e}`);
|
|
101
112
|
return;
|
|
102
113
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
114
|
+
if (o.value = I(o.value, e, t), z.value = !0, S(e, ""), i?.updateValues) {
|
|
115
|
+
h(e, !0);
|
|
105
116
|
try {
|
|
106
|
-
const
|
|
107
|
-
value:
|
|
117
|
+
const l = await i.updateValues({
|
|
118
|
+
value: t,
|
|
108
119
|
// Exposing the explicitly requested value
|
|
109
|
-
values:
|
|
110
|
-
globalValues:
|
|
111
|
-
data:
|
|
112
|
-
isUpdate:
|
|
113
|
-
updateError:
|
|
120
|
+
values: o.value,
|
|
121
|
+
globalValues: o.value,
|
|
122
|
+
data: r,
|
|
123
|
+
isUpdate: F,
|
|
124
|
+
updateError: H
|
|
114
125
|
});
|
|
115
|
-
|
|
116
|
-
} catch (
|
|
117
|
-
console.error(`[useForm] Error in updateValues for ${e}:`,
|
|
126
|
+
l && typeof l == "object" && (o.value = { ...o.value, ...l });
|
|
127
|
+
} catch (l) {
|
|
128
|
+
console.error(`[useForm] Error in updateValues for ${e}:`, l);
|
|
118
129
|
} finally {
|
|
119
|
-
|
|
130
|
+
h(e, !1);
|
|
120
131
|
}
|
|
121
132
|
}
|
|
122
|
-
},
|
|
123
|
-
const e =
|
|
124
|
-
let
|
|
125
|
-
|
|
133
|
+
}, Z = async () => {
|
|
134
|
+
const e = A(o.value), t = re(x.value, e, o.value, F), r = (l, c) => {
|
|
135
|
+
let a = null;
|
|
136
|
+
l instanceof File ? a = l : l && typeof l == "object" && l.file instanceof File && (a = l.file);
|
|
126
137
|
const v = {
|
|
127
|
-
...typeof
|
|
128
|
-
fileName:
|
|
138
|
+
...typeof l == "object" ? l : {},
|
|
139
|
+
fileName: l?.fileName || a?.name || c.split("/").pop() || "unknown",
|
|
129
140
|
fileUrl: c,
|
|
130
|
-
fileType:
|
|
131
|
-
fileSize:
|
|
141
|
+
fileType: l?.fileType || a?.type || "application/octet-stream",
|
|
142
|
+
fileSize: l?.fileSize || a?.size || 0
|
|
132
143
|
};
|
|
133
144
|
return delete v.file, delete v.base64, v;
|
|
134
|
-
}, s =
|
|
135
|
-
const { name: c, value:
|
|
136
|
-
if (
|
|
137
|
-
const f =
|
|
138
|
-
|
|
145
|
+
}, s = t.map(async (l) => {
|
|
146
|
+
const { name: c, value: a, field: v } = l;
|
|
147
|
+
if (l.type === "thumbnailSelector") {
|
|
148
|
+
const f = a, u = Array.isArray(f.images) ? f.images : [], n = f.thumbnail;
|
|
149
|
+
h(c, !0);
|
|
139
150
|
try {
|
|
140
|
-
const
|
|
151
|
+
const V = await Promise.all(
|
|
141
152
|
u.map(async (w) => {
|
|
142
153
|
if (w.startsWith("data:image/")) {
|
|
143
|
-
const
|
|
144
|
-
return await
|
|
154
|
+
const q = await (await fetch(w)).blob(), te = new File([q], `thumbnail-${Date.now()}.${q.type.split("/")[1] || "jpg"}`, { type: q.type });
|
|
155
|
+
return await O(te, C) || w;
|
|
145
156
|
}
|
|
146
157
|
return w;
|
|
147
158
|
})
|
|
@@ -149,23 +160,23 @@ function Fe(L) {
|
|
|
149
160
|
let d = n;
|
|
150
161
|
if (n && n.startsWith("data:image/")) {
|
|
151
162
|
const w = u.indexOf(n);
|
|
152
|
-
w !== -1 &&
|
|
163
|
+
w !== -1 && V[w] && (d = V[w]);
|
|
153
164
|
}
|
|
154
|
-
return { name: c, value: { images:
|
|
165
|
+
return { name: c, value: { images: V, thumbnail: d } };
|
|
155
166
|
} finally {
|
|
156
|
-
|
|
167
|
+
h(c, !1);
|
|
157
168
|
}
|
|
158
169
|
}
|
|
159
|
-
const p = v.returnFileObject === !0, y = Array.isArray(
|
|
170
|
+
const p = v.returnFileObject === !0, y = Array.isArray(a) ? a.some(
|
|
160
171
|
(f) => f instanceof File || f && typeof f == "object" && f.file instanceof File
|
|
161
|
-
) :
|
|
162
|
-
y && (
|
|
172
|
+
) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
|
|
173
|
+
y && h(c, !0);
|
|
163
174
|
try {
|
|
164
|
-
if (Array.isArray(
|
|
165
|
-
const f =
|
|
175
|
+
if (Array.isArray(a)) {
|
|
176
|
+
const f = a.map(async (n) => {
|
|
166
177
|
if (n instanceof File || n && typeof n == "object" && n.file instanceof File) {
|
|
167
|
-
const d = await
|
|
168
|
-
return d ? p ?
|
|
178
|
+
const d = await O(n, C);
|
|
179
|
+
return d ? p ? r(n, d) : d : null;
|
|
169
180
|
}
|
|
170
181
|
if (n && typeof n == "object") {
|
|
171
182
|
const d = { ...n };
|
|
@@ -175,83 +186,83 @@ function Fe(L) {
|
|
|
175
186
|
}), u = await Promise.all(f);
|
|
176
187
|
return { name: c, value: u };
|
|
177
188
|
} else {
|
|
178
|
-
if (
|
|
179
|
-
const u = await
|
|
189
|
+
if (a instanceof File || a && typeof a == "object" && a.file instanceof File) {
|
|
190
|
+
const u = await O(a, C);
|
|
180
191
|
if (u)
|
|
181
|
-
return { name: c, value: p ?
|
|
182
|
-
} else if (
|
|
183
|
-
const u = { ...
|
|
192
|
+
return { name: c, value: p ? r(a, u) : u };
|
|
193
|
+
} else if (a && typeof a == "object") {
|
|
194
|
+
const u = { ...a };
|
|
184
195
|
return delete u.file, delete u.base64, { name: c, value: u };
|
|
185
196
|
}
|
|
186
197
|
return null;
|
|
187
198
|
}
|
|
188
199
|
} finally {
|
|
189
|
-
y && (
|
|
200
|
+
y && h(c, !1);
|
|
190
201
|
}
|
|
191
202
|
});
|
|
192
|
-
return (await Promise.all(s)).forEach((
|
|
193
|
-
|
|
203
|
+
return (await Promise.all(s)).forEach((l) => {
|
|
204
|
+
l && (Object.assign(e, I(e, l.name, l.value)), o.value = I(o.value, l.name, l.value));
|
|
194
205
|
}), e;
|
|
195
|
-
},
|
|
196
|
-
const
|
|
197
|
-
for (const
|
|
198
|
-
if (
|
|
199
|
-
const s =
|
|
206
|
+
}, _ = (e) => {
|
|
207
|
+
const t = { ...e };
|
|
208
|
+
for (const r of U.value)
|
|
209
|
+
if ($(r) && r.type === "customFields" && r.props?.schema) {
|
|
210
|
+
const s = K(t, r.name);
|
|
200
211
|
if (Array.isArray(s)) {
|
|
201
|
-
const i = oe(s,
|
|
202
|
-
Object.assign(
|
|
212
|
+
const i = oe(s, r.props.schema);
|
|
213
|
+
Object.assign(t, I(t, r.name, i));
|
|
203
214
|
}
|
|
204
215
|
}
|
|
205
|
-
return
|
|
216
|
+
return t;
|
|
206
217
|
};
|
|
207
218
|
return {
|
|
208
|
-
formValues:
|
|
219
|
+
formValues: o,
|
|
209
220
|
errors: m,
|
|
210
|
-
isSubmitting:
|
|
211
|
-
isDirty:
|
|
212
|
-
fieldLoading:
|
|
213
|
-
handleFieldChange:
|
|
214
|
-
validateField:
|
|
215
|
-
validateAll:
|
|
216
|
-
isFieldVisible:
|
|
217
|
-
isFieldDisabled:
|
|
218
|
-
isFieldReadonly:
|
|
219
|
-
getFieldValue:
|
|
220
|
-
getFieldError:
|
|
221
|
-
setFieldError:
|
|
222
|
-
clearErrors:
|
|
221
|
+
isSubmitting: D,
|
|
222
|
+
isDirty: z,
|
|
223
|
+
fieldLoading: E,
|
|
224
|
+
handleFieldChange: Y,
|
|
225
|
+
validateField: B,
|
|
226
|
+
validateAll: J,
|
|
227
|
+
isFieldVisible: $,
|
|
228
|
+
isFieldDisabled: L,
|
|
229
|
+
isFieldReadonly: G,
|
|
230
|
+
getFieldValue: W,
|
|
231
|
+
getFieldError: X,
|
|
232
|
+
setFieldError: H,
|
|
233
|
+
clearErrors: k,
|
|
223
234
|
resetForm: () => {
|
|
224
|
-
|
|
235
|
+
o.value = A(N.value), k(), z.value = !1;
|
|
225
236
|
},
|
|
226
237
|
handleSubmit: async () => {
|
|
227
|
-
if (await
|
|
228
|
-
|
|
238
|
+
if (await J()) {
|
|
239
|
+
D.value = !0;
|
|
229
240
|
try {
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
241
|
+
let t = await Z();
|
|
242
|
+
t = _(t), t = await ie(
|
|
243
|
+
t,
|
|
244
|
+
x.value,
|
|
245
|
+
M.emitFields,
|
|
235
246
|
void 0,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
),
|
|
239
|
-
values:
|
|
240
|
-
isUpdate:
|
|
241
|
-
}),
|
|
242
|
-
} catch (
|
|
243
|
-
throw console.error("[useForm] Submit error:",
|
|
247
|
+
o.value,
|
|
248
|
+
F
|
|
249
|
+
), R && await R({
|
|
250
|
+
values: t,
|
|
251
|
+
isUpdate: F
|
|
252
|
+
}), z.value = !1, N.value = A(t);
|
|
253
|
+
} catch (t) {
|
|
254
|
+
throw console.error("[useForm] Submit error:", t), t;
|
|
244
255
|
} finally {
|
|
245
|
-
|
|
256
|
+
D.value = !1;
|
|
246
257
|
}
|
|
247
258
|
}
|
|
248
259
|
},
|
|
249
|
-
flatSchema:
|
|
250
|
-
reinitialize: async (e,
|
|
251
|
-
e !== void 0 && (
|
|
260
|
+
flatSchema: U,
|
|
261
|
+
reinitialize: async (e, t) => {
|
|
262
|
+
e !== void 0 && (x.value = e), t !== void 0 && (b = t), await P(t !== void 0 ? t : b);
|
|
252
263
|
}
|
|
253
264
|
};
|
|
254
265
|
}
|
|
255
266
|
export {
|
|
256
|
-
|
|
267
|
+
he as useForm
|
|
257
268
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as b, computed as d, openBlock as n, createElementBlock as g, createElementVNode as R, createBlock as r, withCtx as x, createTextVNode as k, toDisplayString as I, createCommentVNode as v, unref as l } from "vue";
|
|
2
2
|
import B from "./TableView.vue.js";
|
|
3
|
-
import C from "./AccordionView.
|
|
3
|
+
import C from "./AccordionView.vue2.js";
|
|
4
4
|
import U from "../Label.vue.js";
|
|
5
5
|
import N from "../Button.vue.js";
|
|
6
|
-
import { useCustomFieldRows as
|
|
7
|
-
import { createRowHelpers as
|
|
6
|
+
import { useCustomFieldRows as V } from "./composables/useCustomFieldRows.js";
|
|
7
|
+
import { createRowHelpers as A } from "./rowHelpers.js";
|
|
8
8
|
import { resolveI18nText as s } from "../../utils/i18n.js";
|
|
9
|
-
const
|
|
9
|
+
const F = { class: "custom-fields-wrapper min-w-0 w-full" }, T = { class: "flex justify-between items-center mb-2" }, O = /* @__PURE__ */ b({
|
|
10
10
|
name: "CustomFields",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -42,7 +42,7 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, A = { class: "flex
|
|
|
42
42
|
"vlite.customFields.emptyDescription",
|
|
43
43
|
"Add a new item to get started"
|
|
44
44
|
) ?? "Add a new item to get started"
|
|
45
|
-
), t =
|
|
45
|
+
), t = V(
|
|
46
46
|
{
|
|
47
47
|
// Getters (not snapshots) — see the long-form note in the composable
|
|
48
48
|
// file. The `watch(() => options.modelValue, ...)` source must
|
|
@@ -64,7 +64,7 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, A = { class: "flex
|
|
|
64
64
|
o.labelI18n,
|
|
65
65
|
typeof o.label == "string" ? o.label : o.name
|
|
66
66
|
) ?? o.name : typeof o.label == "string" ? o.label : o.name)), p = d(() => e.schema.slice(0, c.value.length)), w = d(
|
|
67
|
-
() =>
|
|
67
|
+
() => A({
|
|
68
68
|
rows: t.rows.value,
|
|
69
69
|
schema: e.schema,
|
|
70
70
|
name: e.name,
|
|
@@ -73,8 +73,8 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, A = { class: "flex
|
|
|
73
73
|
errors: e.errors
|
|
74
74
|
})
|
|
75
75
|
), y = d(() => s(e.labelI18n, e.label ?? "Item") ?? "Item");
|
|
76
|
-
return (o, z) => (n(), g("div",
|
|
77
|
-
R("div",
|
|
76
|
+
return (o, z) => (n(), g("div", F, [
|
|
77
|
+
R("div", T, [
|
|
78
78
|
i.value ? (n(), r(U, {
|
|
79
79
|
key: 0,
|
|
80
80
|
class: "text-sm font-medium text-foreground"
|
|
@@ -11,6 +11,8 @@ export declare function isComponent(value: any): boolean;
|
|
|
11
11
|
* Resolves the dynamic field type evaluator (if present) to return the actual field type component or string
|
|
12
12
|
*/
|
|
13
13
|
export declare function resolveFieldType(field: IForm, context: IFormContext): IFormFieldType | undefined;
|
|
14
|
+
/** Field controls that render and ARIA-link their own validation message. */
|
|
15
|
+
export declare function fieldRendersOwnErrorMessage(type: unknown): boolean;
|
|
14
16
|
/**
|
|
15
17
|
* Get a nested value from an object using dot notation path
|
|
16
18
|
* @example getNestedValue({ pricing: { amount: 100 } }, 'pricing.amount') => 100
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function
|
|
1
|
+
function U(e) {
|
|
2
2
|
return !!e && typeof e == "object";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function k(e) {
|
|
5
5
|
return e ? typeof e == "object" && (typeof e.render == "function" || typeof e.setup == "function" || e.__name !== void 0 || e.name !== void 0) : !1;
|
|
6
6
|
}
|
|
7
7
|
function b(e, n) {
|
|
8
|
-
if (typeof e.type == "function" && !
|
|
8
|
+
if (typeof e.type == "function" && !k(e.type))
|
|
9
9
|
try {
|
|
10
10
|
return e.type(n);
|
|
11
11
|
} catch (i) {
|
|
@@ -13,6 +13,9 @@ function b(e, n) {
|
|
|
13
13
|
}
|
|
14
14
|
return e.type;
|
|
15
15
|
}
|
|
16
|
+
function P(e) {
|
|
17
|
+
return e === "richTextEditor";
|
|
18
|
+
}
|
|
16
19
|
function y(e, n) {
|
|
17
20
|
if (!n || !e) return;
|
|
18
21
|
const i = n.split(".");
|
|
@@ -33,8 +36,8 @@ function A(e, n, i) {
|
|
|
33
36
|
}
|
|
34
37
|
return a[f[f.length - 1]] = i, o;
|
|
35
38
|
}
|
|
36
|
-
function
|
|
37
|
-
return !
|
|
39
|
+
function E(e, n) {
|
|
40
|
+
return !U(n) || !n.name ? e : y(e, n.name) === void 0 && n.value !== void 0 ? A(e, n.name, n.value) : e;
|
|
38
41
|
}
|
|
39
42
|
async function T(e, n, i, f) {
|
|
40
43
|
let o = n ? S(n) : {};
|
|
@@ -64,7 +67,7 @@ async function T(e, n, i, f) {
|
|
|
64
67
|
Object.assign(o, A(o, t.name, s));
|
|
65
68
|
} else
|
|
66
69
|
Object.assign(o, A(o, t.name, s));
|
|
67
|
-
if (o =
|
|
70
|
+
if (o = E(o, t.addonLeft), o = E(o, t.addonRight), b(t, h) === "customFields" && t.props?.schema) {
|
|
68
71
|
const u = t.props.schema;
|
|
69
72
|
let r = y(o, t.name);
|
|
70
73
|
if (Array.isArray(r) && r.length > 0) {
|
|
@@ -80,7 +83,7 @@ async function T(e, n, i, f) {
|
|
|
80
83
|
function v(e, n) {
|
|
81
84
|
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(n) : !1;
|
|
82
85
|
}
|
|
83
|
-
function
|
|
86
|
+
function $(e, n) {
|
|
84
87
|
return Array.isArray(e) ? e.filter((i) => i ? !n.every((o) => {
|
|
85
88
|
const a = i[o.name];
|
|
86
89
|
return a == null || a === "";
|
|
@@ -89,7 +92,7 @@ function P(e, n) {
|
|
|
89
92
|
function N(e) {
|
|
90
93
|
return typeof e == "string" && e.startsWith("data:image/");
|
|
91
94
|
}
|
|
92
|
-
function
|
|
95
|
+
function D(e, n, i, f) {
|
|
93
96
|
const o = [], a = i || n, c = Array.isArray(e[0]) ? e.flat() : e;
|
|
94
97
|
for (const t of c) {
|
|
95
98
|
if (!t.name) continue;
|
|
@@ -118,7 +121,7 @@ function $(e, n, i, f) {
|
|
|
118
121
|
if (m === "customFields" && t.props?.schema) {
|
|
119
122
|
const s = y(n, t.name);
|
|
120
123
|
if (Array.isArray(s)) {
|
|
121
|
-
const r = t.props.schema.filter((p) => !
|
|
124
|
+
const r = t.props.schema.filter((p) => !k(p.type));
|
|
122
125
|
r.length > 0 && s.forEach((p, l) => {
|
|
123
126
|
r.forEach((g) => {
|
|
124
127
|
const F = { values: p || {}, globalValues: a, isUpdate: f };
|
|
@@ -205,14 +208,15 @@ async function K(e, n, i, f, o, a) {
|
|
|
205
208
|
}
|
|
206
209
|
export {
|
|
207
210
|
K as cleanSubmitValues,
|
|
208
|
-
|
|
211
|
+
D as collectFileFields,
|
|
209
212
|
S as deepClone,
|
|
210
213
|
v as evaluateConditional,
|
|
211
|
-
P as
|
|
214
|
+
P as fieldRendersOwnErrorMessage,
|
|
215
|
+
$ as filterNullCustomFields,
|
|
212
216
|
y as getNestedValue,
|
|
213
217
|
T as initializeFormValues,
|
|
214
|
-
|
|
215
|
-
|
|
218
|
+
U as isAddonObject,
|
|
219
|
+
k as isComponent,
|
|
216
220
|
b as resolveFieldType,
|
|
217
221
|
A as setNestedValue
|
|
218
222
|
};
|
|
@@ -32,8 +32,8 @@ declare const __VLS_component: import('vue').DefineComponent<GoogleMapProps, {},
|
|
|
32
32
|
height: string | number;
|
|
33
33
|
options: import('..').GoogleMapOptions;
|
|
34
34
|
zoom: number;
|
|
35
|
-
markers: GoogleMapMarker[];
|
|
36
35
|
ariaLabel: string;
|
|
36
|
+
markers: GoogleMapMarker[];
|
|
37
37
|
loadingText: string;
|
|
38
38
|
errorText: string;
|
|
39
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|