vlite3 1.4.20 → 1.4.22
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/CategoryManager/CategoryManager.vue2.js +2 -2
- package/components/Form/AccordionView.vue.js +80 -77
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +164 -162
- package/components/Form/FormField.vue.js +93 -95
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +21 -18
- package/components/Form/composables/useForm.js +150 -150
- package/components/Form/index.vue.js +1 -1
- package/components/Form/index.vue2.js +43 -39
- package/components/Input.vue.js +3 -3
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/components/Textarea.vue.js +14 -14
- package/index.js +389 -388
- package/package.json +1 -1
- package/style.css +1 -1
- package/utils/i18n.d.ts +10 -4
- package/utils/i18n.js +14 -3
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -1,254 +1,254 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { deepClone as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
import {
|
|
5
|
-
function Fe(
|
|
6
|
-
let { schema: K, values:
|
|
7
|
-
const { handleUploadFile:
|
|
8
|
-
|
|
9
|
-
),
|
|
10
|
-
const e =
|
|
1
|
+
import { ref as x, shallowRef as G, computed as ae, watch as le } from "vue";
|
|
2
|
+
import { deepClone as V, initializeFormValues as te, cleanSubmitValues as se, getNestedValue as J, evaluateConditional as $, setNestedValue as E, collectFileFields as ie, filterNullCustomFields as oe } from "../utils/form.utils.js";
|
|
3
|
+
import { useFileUpload as re } from "./useFileUpload.js";
|
|
4
|
+
import { resolveI18nText as ne } from "../../../utils/i18n.js";
|
|
5
|
+
function Fe(L) {
|
|
6
|
+
let { schema: K, values: F, isUpdate: h = !1, folderId: U, onSubmit: q } = L;
|
|
7
|
+
const { handleUploadFile: I } = re(), r = x(F ? V(F) : {}), m = x({}), C = x(!1), A = x(!1), b = x({}), z = G(K), D = G(
|
|
8
|
+
F ? V(F) : {}
|
|
9
|
+
), j = ae(() => {
|
|
10
|
+
const e = z.value;
|
|
11
11
|
return e ? Array.isArray(e[0]) ? e.flat() : e : [];
|
|
12
|
-
}),
|
|
12
|
+
}), N = async (e) => {
|
|
13
13
|
try {
|
|
14
|
-
const a = await
|
|
15
|
-
|
|
14
|
+
const a = await te(z.value, e, r.value, h);
|
|
15
|
+
r.value = a, D.value = V(a), A.value = !1;
|
|
16
16
|
} catch (a) {
|
|
17
17
|
console.error("[useForm] Initialization error:", a);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
() =>
|
|
20
|
+
N(F), le(
|
|
21
|
+
() => F,
|
|
22
22
|
(e) => {
|
|
23
|
-
e &&
|
|
23
|
+
e && N(e);
|
|
24
24
|
},
|
|
25
25
|
{ deep: !0 }
|
|
26
26
|
);
|
|
27
|
-
const
|
|
28
|
-
values:
|
|
29
|
-
globalValues:
|
|
30
|
-
isUpdate:
|
|
31
|
-
}), M = (e) => J(
|
|
32
|
-
a ?
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
const
|
|
27
|
+
const O = () => ({
|
|
28
|
+
values: r.value,
|
|
29
|
+
globalValues: r.value,
|
|
30
|
+
isUpdate: h
|
|
31
|
+
}), M = (e) => J(r.value, e), Q = (e) => m.value[e] || "", R = (e, a) => {
|
|
32
|
+
a ? m.value[e] = a : delete m.value[e];
|
|
33
|
+
}, P = () => {
|
|
34
|
+
m.value = {};
|
|
35
|
+
}, S = (e) => e.when ? $(e.when, O()) : !0, T = (e) => $(e.disabled, O()), W = (e) => $(e.readonly, O()), k = async (e, a = "") => {
|
|
36
|
+
const o = a ? `${a}.${e.name}` : e.name, s = M(o);
|
|
37
37
|
let i = "";
|
|
38
|
-
const
|
|
38
|
+
const t = typeof e.label == "string" ? e.label : e.name, c = ne(e.labelI18n, t) ?? t;
|
|
39
39
|
if (e.required) {
|
|
40
|
-
const
|
|
41
|
-
(s == null || s === "" || Array.isArray(s) && s.length === 0 ||
|
|
40
|
+
const l = typeof s == "string" && /<\/?[a-z][^>]*>/i.test(s) && s.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim() === "";
|
|
41
|
+
(s == null || s === "" || Array.isArray(s) && s.length === 0 || l) && (i = `${c} is required`);
|
|
42
42
|
}
|
|
43
43
|
if (!i && e.maxFileSize) {
|
|
44
|
-
const
|
|
44
|
+
const l = e.maxFileSize * 1024 * 1024;
|
|
45
45
|
if (s != null && s !== "") {
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
i = `${
|
|
46
|
+
const v = Array.isArray(s) ? s : [s];
|
|
47
|
+
for (const p of v) {
|
|
48
|
+
const y = p instanceof File ? p.size : p?.fileSize || p?.file?.size || p?.size;
|
|
49
|
+
if (y !== void 0 && y > l) {
|
|
50
|
+
i = `${c} size must be less than ${e.maxFileSize}MB`;
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
if (!i && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const l = e.maxFiles || e.props?.maxFiles;
|
|
58
|
+
l && Array.isArray(s) && s.length > l && (i = `Maximum ${l} files allowed`);
|
|
59
59
|
}
|
|
60
60
|
if (!i && e.validation) {
|
|
61
|
-
|
|
61
|
+
b.value[o] = !0;
|
|
62
62
|
try {
|
|
63
63
|
i = await e.validation({
|
|
64
64
|
value: s,
|
|
65
|
-
values:
|
|
66
|
-
globalValues:
|
|
67
|
-
isUpdate:
|
|
65
|
+
values: r.value,
|
|
66
|
+
globalValues: r.value,
|
|
67
|
+
isUpdate: h
|
|
68
68
|
});
|
|
69
|
-
} catch (
|
|
70
|
-
console.error(`[useForm] Validation error in field ${
|
|
69
|
+
} catch (l) {
|
|
70
|
+
console.error(`[useForm] Validation error in field ${o}:`, l), i = "Validation failed";
|
|
71
71
|
} finally {
|
|
72
|
-
|
|
72
|
+
b.value[o] = !1;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
if (i ?
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
for (let
|
|
79
|
-
const
|
|
80
|
-
for (const
|
|
81
|
-
const
|
|
82
|
-
|
|
75
|
+
if (i ? m.value[o] = i : delete m.value[o], e.type === "customFields" && e.props?.schema) {
|
|
76
|
+
const l = e.props.schema, v = Array.isArray(s) ? s : [];
|
|
77
|
+
let p = !1;
|
|
78
|
+
for (let y = 0; y < v.length; y++) {
|
|
79
|
+
const u = { values: v[y] || {}, globalValues: r.value, isUpdate: h };
|
|
80
|
+
for (const n of l) {
|
|
81
|
+
const g = !n.when || $(n.when, u), d = $(n.disabled, u);
|
|
82
|
+
g && !d ? await k(n, `${o}.${y}`) && (p = !0) : delete m.value[`${o}.${y}.${n.name}`];
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
p && !i && (i = "Please fix errors in the list.", m.value[o] = i);
|
|
86
86
|
}
|
|
87
87
|
return i;
|
|
88
88
|
}, H = async () => {
|
|
89
|
-
|
|
89
|
+
P();
|
|
90
90
|
let e = !0;
|
|
91
|
-
for (const a of
|
|
92
|
-
if (!
|
|
93
|
-
await
|
|
91
|
+
for (const a of j.value) {
|
|
92
|
+
if (!S(a) || T(a)) continue;
|
|
93
|
+
await k(a) && (e = !1);
|
|
94
94
|
}
|
|
95
95
|
return e;
|
|
96
|
-
}, X = async (e, a,
|
|
97
|
-
const s =
|
|
98
|
-
let i = s.find((
|
|
99
|
-
if (!i && s.length > 0 && (i = s[0]), i && (!
|
|
96
|
+
}, X = async (e, a, o) => {
|
|
97
|
+
const s = j.value.filter((t) => t.name === e);
|
|
98
|
+
let i = s.find((t) => S(t));
|
|
99
|
+
if (!i && s.length > 0 && (i = s[0]), i && (!S(i) || T(i) || W(i))) {
|
|
100
100
|
console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly/hidden field: ${e}`);
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
103
|
+
if (r.value = E(r.value, e, a), A.value = !0, delete m.value[e], i?.updateValues) {
|
|
104
|
+
b.value[e] = !0;
|
|
105
105
|
try {
|
|
106
|
-
const
|
|
106
|
+
const t = await i.updateValues({
|
|
107
107
|
value: a,
|
|
108
108
|
// Exposing the explicitly requested value
|
|
109
|
-
values:
|
|
110
|
-
globalValues:
|
|
111
|
-
data:
|
|
112
|
-
isUpdate:
|
|
109
|
+
values: r.value,
|
|
110
|
+
globalValues: r.value,
|
|
111
|
+
data: o,
|
|
112
|
+
isUpdate: h,
|
|
113
113
|
updateError: R
|
|
114
114
|
});
|
|
115
|
-
|
|
116
|
-
} catch (
|
|
117
|
-
console.error(`[useForm] Error in updateValues for ${e}:`,
|
|
115
|
+
t && typeof t == "object" && (r.value = { ...r.value, ...t });
|
|
116
|
+
} catch (t) {
|
|
117
|
+
console.error(`[useForm] Error in updateValues for ${e}:`, t);
|
|
118
118
|
} finally {
|
|
119
|
-
|
|
119
|
+
b.value[e] = !1;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}, Y = async () => {
|
|
123
|
-
const e =
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
...typeof
|
|
128
|
-
fileName:
|
|
129
|
-
fileUrl:
|
|
130
|
-
fileType:
|
|
131
|
-
fileSize:
|
|
123
|
+
const e = V(r.value), a = ie(z.value, e, r.value, h), o = (t, c) => {
|
|
124
|
+
let l = null;
|
|
125
|
+
t instanceof File ? l = t : t && typeof t == "object" && t.file instanceof File && (l = t.file);
|
|
126
|
+
const v = {
|
|
127
|
+
...typeof t == "object" ? t : {},
|
|
128
|
+
fileName: t?.fileName || l?.name || c.split("/").pop() || "unknown",
|
|
129
|
+
fileUrl: c,
|
|
130
|
+
fileType: t?.fileType || l?.type || "application/octet-stream",
|
|
131
|
+
fileSize: t?.fileSize || l?.size || 0
|
|
132
132
|
};
|
|
133
|
-
return delete
|
|
134
|
-
}, s = a.map(async (
|
|
135
|
-
const { name:
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
|
|
133
|
+
return delete v.file, delete v.base64, v;
|
|
134
|
+
}, s = a.map(async (t) => {
|
|
135
|
+
const { name: c, value: l, field: v } = t;
|
|
136
|
+
if (t.type === "thumbnailSelector") {
|
|
137
|
+
const f = l, u = Array.isArray(f.images) ? f.images : [], n = f.thumbnail;
|
|
138
|
+
b.value[c] = !0;
|
|
139
139
|
try {
|
|
140
|
-
const
|
|
141
|
-
u.map(async (
|
|
142
|
-
if (
|
|
143
|
-
const B = await (await fetch(
|
|
144
|
-
return await
|
|
140
|
+
const g = await Promise.all(
|
|
141
|
+
u.map(async (w) => {
|
|
142
|
+
if (w.startsWith("data:image/")) {
|
|
143
|
+
const B = await (await fetch(w)).blob(), ee = new File([B], `thumbnail-${Date.now()}.${B.type.split("/")[1] || "jpg"}`, { type: B.type });
|
|
144
|
+
return await I(ee, U) || w;
|
|
145
145
|
}
|
|
146
|
-
return
|
|
146
|
+
return w;
|
|
147
147
|
})
|
|
148
148
|
);
|
|
149
|
-
let
|
|
150
|
-
if (
|
|
151
|
-
const
|
|
152
|
-
|
|
149
|
+
let d = n;
|
|
150
|
+
if (n && n.startsWith("data:image/")) {
|
|
151
|
+
const w = u.indexOf(n);
|
|
152
|
+
w !== -1 && g[w] && (d = g[w]);
|
|
153
153
|
}
|
|
154
|
-
return { name:
|
|
154
|
+
return { name: c, value: { images: g, thumbnail: d } };
|
|
155
155
|
} finally {
|
|
156
|
-
|
|
156
|
+
b.value[c] = !1;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const
|
|
160
|
-
(
|
|
161
|
-
) :
|
|
162
|
-
|
|
159
|
+
const p = v.returnFileObject === !0, y = Array.isArray(l) ? l.some(
|
|
160
|
+
(f) => f instanceof File || f && typeof f == "object" && f.file instanceof File
|
|
161
|
+
) : l instanceof File || l && typeof l == "object" && l.file instanceof File;
|
|
162
|
+
y && (b.value[c] = !0);
|
|
163
163
|
try {
|
|
164
|
-
if (Array.isArray(
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
const
|
|
168
|
-
return
|
|
164
|
+
if (Array.isArray(l)) {
|
|
165
|
+
const f = l.map(async (n) => {
|
|
166
|
+
if (n instanceof File || n && typeof n == "object" && n.file instanceof File) {
|
|
167
|
+
const d = await I(n, U);
|
|
168
|
+
return d ? p ? o(n, d) : d : null;
|
|
169
169
|
}
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
return delete
|
|
170
|
+
if (n && typeof n == "object") {
|
|
171
|
+
const d = { ...n };
|
|
172
|
+
return delete d.file, delete d.base64, d;
|
|
173
173
|
}
|
|
174
|
-
return
|
|
175
|
-
}), u = await Promise.all(
|
|
176
|
-
return { name:
|
|
174
|
+
return n;
|
|
175
|
+
}), u = await Promise.all(f);
|
|
176
|
+
return { name: c, value: u };
|
|
177
177
|
} else {
|
|
178
|
-
if (
|
|
179
|
-
const u = await
|
|
178
|
+
if (l instanceof File || l && typeof l == "object" && l.file instanceof File) {
|
|
179
|
+
const u = await I(l, U);
|
|
180
180
|
if (u)
|
|
181
|
-
return { name:
|
|
182
|
-
} else if (
|
|
183
|
-
const u = { ...
|
|
184
|
-
return delete u.file, delete u.base64, { name:
|
|
181
|
+
return { name: c, value: p ? o(l, u) : u };
|
|
182
|
+
} else if (l && typeof l == "object") {
|
|
183
|
+
const u = { ...l };
|
|
184
|
+
return delete u.file, delete u.base64, { name: c, value: u };
|
|
185
185
|
}
|
|
186
186
|
return null;
|
|
187
187
|
}
|
|
188
188
|
} finally {
|
|
189
|
-
|
|
189
|
+
y && (b.value[c] = !1);
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
-
return (await Promise.all(s)).forEach((
|
|
193
|
-
|
|
192
|
+
return (await Promise.all(s)).forEach((t) => {
|
|
193
|
+
t && (Object.assign(e, E(e, t.name, t.value)), r.value = E(r.value, t.name, t.value));
|
|
194
194
|
}), e;
|
|
195
195
|
}, Z = (e) => {
|
|
196
196
|
const a = { ...e };
|
|
197
|
-
for (const
|
|
198
|
-
if (
|
|
199
|
-
const s = J(a,
|
|
197
|
+
for (const o of j.value)
|
|
198
|
+
if (S(o) && o.type === "customFields" && o.props?.schema) {
|
|
199
|
+
const s = J(a, o.name);
|
|
200
200
|
if (Array.isArray(s)) {
|
|
201
|
-
const i =
|
|
202
|
-
Object.assign(a,
|
|
201
|
+
const i = oe(s, o.props.schema);
|
|
202
|
+
Object.assign(a, E(a, o.name, i));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return a;
|
|
206
206
|
};
|
|
207
207
|
return {
|
|
208
|
-
formValues:
|
|
209
|
-
errors:
|
|
210
|
-
isSubmitting:
|
|
211
|
-
isDirty:
|
|
212
|
-
fieldLoading:
|
|
208
|
+
formValues: r,
|
|
209
|
+
errors: m,
|
|
210
|
+
isSubmitting: C,
|
|
211
|
+
isDirty: A,
|
|
212
|
+
fieldLoading: b,
|
|
213
213
|
handleFieldChange: X,
|
|
214
|
-
validateField:
|
|
214
|
+
validateField: k,
|
|
215
215
|
validateAll: H,
|
|
216
|
-
isFieldVisible:
|
|
217
|
-
isFieldDisabled:
|
|
216
|
+
isFieldVisible: S,
|
|
217
|
+
isFieldDisabled: T,
|
|
218
218
|
isFieldReadonly: W,
|
|
219
219
|
getFieldValue: M,
|
|
220
220
|
getFieldError: Q,
|
|
221
221
|
setFieldError: R,
|
|
222
|
-
clearErrors:
|
|
222
|
+
clearErrors: P,
|
|
223
223
|
resetForm: () => {
|
|
224
|
-
|
|
224
|
+
r.value = V(D.value), P(), A.value = !1;
|
|
225
225
|
},
|
|
226
226
|
handleSubmit: async () => {
|
|
227
227
|
if (await H()) {
|
|
228
|
-
|
|
228
|
+
C.value = !0;
|
|
229
229
|
try {
|
|
230
230
|
let a = await Y();
|
|
231
|
-
a = Z(a), a = await
|
|
231
|
+
a = Z(a), a = await se(
|
|
232
232
|
a,
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
z.value,
|
|
234
|
+
L.emitFields,
|
|
235
235
|
void 0,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
),
|
|
236
|
+
r.value,
|
|
237
|
+
h
|
|
238
|
+
), q && await q({
|
|
239
239
|
values: a,
|
|
240
|
-
isUpdate:
|
|
241
|
-
}),
|
|
240
|
+
isUpdate: h
|
|
241
|
+
}), A.value = !1, D.value = V(a);
|
|
242
242
|
} catch (a) {
|
|
243
243
|
throw console.error("[useForm] Submit error:", a), a;
|
|
244
244
|
} finally {
|
|
245
|
-
|
|
245
|
+
C.value = !1;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
},
|
|
249
|
-
flatSchema:
|
|
249
|
+
flatSchema: j,
|
|
250
250
|
reinitialize: async (e, a) => {
|
|
251
|
-
e !== void 0 && (
|
|
251
|
+
e !== void 0 && (z.value = e), a !== void 0 && (F = a), await N(a !== void 0 ? a : F);
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0138ffcc"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
|
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
3
|
import C from "./AccordionView.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useCustomFieldRows as
|
|
4
|
+
import U from "../Label.vue.js";
|
|
5
|
+
import N from "../Button.vue.js";
|
|
6
|
+
import { useCustomFieldRows as F } from "./composables/useCustomFieldRows.js";
|
|
7
7
|
import { createRowHelpers as T } from "./rowHelpers.js";
|
|
8
|
-
import {
|
|
9
|
-
const V = { class: "custom-fields-wrapper min-w-0 w-full" },
|
|
8
|
+
import { resolveI18nText as s } from "../../utils/i18n.js";
|
|
9
|
+
const V = { class: "custom-fields-wrapper min-w-0 w-full" }, A = { class: "flex justify-between items-center mb-2" }, O = /* @__PURE__ */ b({
|
|
10
10
|
name: "CustomFields",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -34,14 +34,15 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex
|
|
|
34
34
|
accordionTitleKey: { default: void 0 }
|
|
35
35
|
},
|
|
36
36
|
emits: ["update:modelValue", "change"],
|
|
37
|
-
setup(a, { emit:
|
|
38
|
-
const e = a,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
setup(a, { emit: f }) {
|
|
38
|
+
const e = a, h = f, i = d(() => s(e.labelI18n, e.label)), m = d(
|
|
39
|
+
() => s("vlite.customFields.emptyTitle", "No items added") ?? "No items added"
|
|
40
|
+
), u = d(
|
|
41
|
+
() => s(
|
|
42
|
+
"vlite.customFields.emptyDescription",
|
|
43
|
+
"Add a new item to get started"
|
|
44
|
+
) ?? "Add a new item to get started"
|
|
45
|
+
), t = F(
|
|
45
46
|
{
|
|
46
47
|
// Getters (not snapshots) — see the long-form note in the composable
|
|
47
48
|
// file. The `watch(() => options.modelValue, ...)` source must
|
|
@@ -58,20 +59,23 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex
|
|
|
58
59
|
minRows: () => e.minRows,
|
|
59
60
|
maxRows: () => e.maxRows
|
|
60
61
|
},
|
|
61
|
-
|
|
62
|
-
), c = d(() => e.headers && e.headers.length > 0 ? e.headers : e.schema.map((o) => o.labelI18n ? s(
|
|
62
|
+
h
|
|
63
|
+
), c = d(() => e.headers && e.headers.length > 0 ? e.headers : e.schema.map((o) => o.labelI18n ? s(
|
|
64
|
+
o.labelI18n,
|
|
65
|
+
typeof o.label == "string" ? o.label : o.name
|
|
66
|
+
) ?? o.name : typeof o.label == "string" ? o.label : o.name)), p = d(() => e.schema.slice(0, c.value.length)), w = d(
|
|
63
67
|
() => T({
|
|
64
|
-
rows:
|
|
68
|
+
rows: t.rows.value,
|
|
65
69
|
schema: e.schema,
|
|
66
70
|
name: e.name,
|
|
67
71
|
values: e.values,
|
|
68
72
|
isUpdate: e.isUpdate,
|
|
69
73
|
errors: e.errors
|
|
70
74
|
})
|
|
71
|
-
), y = d(() =>
|
|
75
|
+
), y = d(() => s(e.labelI18n, e.label ?? "Item") ?? "Item");
|
|
72
76
|
return (o, z) => (n(), g("div", V, [
|
|
73
|
-
R("div",
|
|
74
|
-
i.value ? (n(), r(
|
|
77
|
+
R("div", A, [
|
|
78
|
+
i.value ? (n(), r(U, {
|
|
75
79
|
key: 0,
|
|
76
80
|
class: "text-sm font-medium text-foreground"
|
|
77
81
|
}, {
|
|
@@ -79,8 +83,8 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex
|
|
|
79
83
|
k(I(i.value), 1)
|
|
80
84
|
]),
|
|
81
85
|
_: 1
|
|
82
|
-
})) :
|
|
83
|
-
a.readonly ?
|
|
86
|
+
})) : v("", !0),
|
|
87
|
+
a.readonly ? v("", !0) : (n(), r(N, {
|
|
84
88
|
key: 1,
|
|
85
89
|
type: "button",
|
|
86
90
|
variant: "outline",
|
|
@@ -88,32 +92,32 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex
|
|
|
88
92
|
rounded: "full",
|
|
89
93
|
"as-icon": "",
|
|
90
94
|
icon: "lucide:plus",
|
|
91
|
-
disabled: !t
|
|
92
|
-
onClick: t
|
|
95
|
+
disabled: !l(t).canAddRow.value,
|
|
96
|
+
onClick: l(t).addRow
|
|
93
97
|
}, null, 8, ["disabled", "onClick"]))
|
|
94
98
|
]),
|
|
95
99
|
a.layout === "table" ? (n(), r(B, {
|
|
96
100
|
key: 0,
|
|
97
|
-
rows: t
|
|
101
|
+
rows: l(t).rows.value,
|
|
98
102
|
schema: e.schema,
|
|
99
103
|
"column-headers": c.value,
|
|
100
|
-
"visible-schema-fields":
|
|
104
|
+
"visible-schema-fields": p.value,
|
|
101
105
|
draggable: a.draggable,
|
|
102
106
|
disabled: a.disabled,
|
|
103
107
|
readonly: a.readonly,
|
|
104
108
|
"is-update": a.isUpdate,
|
|
105
109
|
"show-row-numbers": a.showRowNumbers,
|
|
106
|
-
"can-remove-row": t
|
|
107
|
-
"can-add-row": t
|
|
108
|
-
helpers:
|
|
110
|
+
"can-remove-row": l(t).canRemoveRow.value,
|
|
111
|
+
"can-add-row": l(t).canAddRow.value,
|
|
112
|
+
helpers: w.value,
|
|
109
113
|
"empty-title": m.value,
|
|
110
114
|
"empty-description": u.value,
|
|
111
|
-
"on-field-change": t
|
|
112
|
-
"on-remove-row": t
|
|
113
|
-
"on-drag-update": t
|
|
115
|
+
"on-field-change": l(t).handleFieldChange,
|
|
116
|
+
"on-remove-row": l(t).removeRow,
|
|
117
|
+
"on-drag-update": l(t).handleDragUpdate
|
|
114
118
|
}, null, 8, ["rows", "schema", "column-headers", "visible-schema-fields", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "can-add-row", "helpers", "empty-title", "empty-description", "on-field-change", "on-remove-row", "on-drag-update"])) : (n(), r(C, {
|
|
115
119
|
key: 1,
|
|
116
|
-
rows: t
|
|
120
|
+
rows: l(t).rows.value,
|
|
117
121
|
schema: e.schema,
|
|
118
122
|
draggable: a.draggable,
|
|
119
123
|
disabled: a.disabled,
|
|
@@ -122,16 +126,16 @@ const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex
|
|
|
122
126
|
variant: a.variant,
|
|
123
127
|
size: a.size,
|
|
124
128
|
rounded: a.rounded,
|
|
125
|
-
"can-remove-row": t
|
|
126
|
-
"can-add-row": t
|
|
127
|
-
helpers:
|
|
129
|
+
"can-remove-row": l(t).canRemoveRow.value,
|
|
130
|
+
"can-add-row": l(t).canAddRow.value,
|
|
131
|
+
helpers: w.value,
|
|
128
132
|
"accordion-title-key": a.accordionTitleKey,
|
|
129
133
|
"item-name": y.value,
|
|
130
134
|
"empty-title": m.value,
|
|
131
135
|
"empty-description": u.value,
|
|
132
|
-
"on-field-change": t
|
|
133
|
-
"on-remove-row": t
|
|
134
|
-
"on-drag-update": t
|
|
136
|
+
"on-field-change": l(t).handleFieldChange,
|
|
137
|
+
"on-remove-row": l(t).removeRow,
|
|
138
|
+
"on-drag-update": l(t).handleDragUpdate
|
|
135
139
|
}, null, 8, ["rows", "schema", "draggable", "disabled", "readonly", "is-update", "variant", "size", "rounded", "can-remove-row", "can-add-row", "helpers", "accordion-title-key", "item-name", "empty-title", "empty-description", "on-field-change", "on-remove-row", "on-drag-update"]))
|
|
136
140
|
]));
|
|
137
141
|
}
|
package/components/Input.vue.js
CHANGED
|
@@ -2,7 +2,7 @@ import { defineComponent as Z, computed as d, useSlots as _, ref as v, onMounted
|
|
|
2
2
|
import g from "./Icon.vue.js";
|
|
3
3
|
import le from "./Label.vue.js";
|
|
4
4
|
import ne from "./Textarea.vue.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveI18nText as E } from "../utils/i18n.js";
|
|
6
6
|
const oe = ["for"], ae = ["type", "value", "placeholder", "disabled", "readonly", "min", "max", "data-testid"], de = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, me = /* @__PURE__ */ Z({
|
|
7
7
|
__name: "Input",
|
|
8
8
|
props: {
|
|
@@ -39,8 +39,8 @@ const oe = ["for"], ae = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:modelValue", "focus", "blur", "change", "click:icon", "click:icon-right"],
|
|
41
41
|
setup(t, { emit: D }) {
|
|
42
|
-
const e = t, c = D, a = d(() =>
|
|
43
|
-
() =>
|
|
42
|
+
const e = t, c = D, a = d(() => E(e.labelI18n, e.label)), L = d(
|
|
43
|
+
() => E(e.placeholderI18n, e.placeholder)
|
|
44
44
|
), x = _(), m = v(null), y = v(!1), p = v(!1), H = d(() => e.type === "password" && y.value ? "text" : e.type), k = d(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), $ = d(() => b.value || k.value || p.value), h = d(() => !!e.addonLeft || !!x["addon-left"]), V = d(() => !!e.addonRight || !!x["addon-right"]), U = d(() => [
|
|
45
45
|
"relative w-full",
|
|
46
46
|
e.class,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import se from "./RichTextToolbar.
|
|
4
|
-
/* empty css
|
|
5
|
-
import de from "./RichTextLinkPopover.
|
|
6
|
-
/* empty css
|
|
3
|
+
import se from "./RichTextToolbar.vue2.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import de from "./RichTextLinkPopover.vue2.js";
|
|
6
|
+
/* empty css */
|
|
7
7
|
import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
|
|
8
8
|
import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
|
|
9
9
|
const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
|