vlite3 1.4.21 → 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.
Files changed (31) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +3 -3
  2. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  3. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  4. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  5. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  6. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  7. package/components/Form/AccordionView.vue.js +80 -77
  8. package/components/Form/Form.vue.js +2 -2
  9. package/components/Form/Form.vue2.js +164 -162
  10. package/components/Form/FormField.vue.js +26 -28
  11. package/components/Form/FormFields.vue.js +2 -2
  12. package/components/Form/FormFields.vue2.js +21 -18
  13. package/components/Form/composables/useForm.js +150 -150
  14. package/components/Form/index.vue.js +1 -1
  15. package/components/Form/index.vue2.js +43 -39
  16. package/components/Input.vue.js +3 -3
  17. package/components/NavbarCommandPalette.vue.js +1 -1
  18. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  19. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  20. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  21. package/components/Screen/ScreenFilter.vue.js +3 -3
  22. package/components/Textarea.vue.js +14 -14
  23. package/index.js +389 -388
  24. package/package.json +1 -1
  25. package/style.css +1 -1
  26. package/utils/i18n.d.ts +10 -4
  27. package/utils/i18n.js +14 -3
  28. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
  29. /package/components/Dropdown/{DropdownMenu.vue3.js → DropdownMenu.vue2.js} +0 -0
  30. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -1,254 +1,254 @@
1
- import { ref as S, shallowRef as G, computed as ee, watch as ae } from "vue";
2
- import { deepClone as g, initializeFormValues as le, cleanSubmitValues as te, getNestedValue as J, evaluateConditional as $, setNestedValue as j, collectFileFields as se, filterNullCustomFields as ie } from "../utils/form.utils.js";
3
- import { useFileUpload as oe } from "./useFileUpload.js";
4
- import { $t as re } from "../../../utils/i18n.js";
5
- function Fe(q) {
6
- let { schema: K, values: b, isUpdate: F = !1, folderId: E, onSubmit: L } = q;
7
- const { handleUploadFile: U } = oe(), n = S(b ? g(b) : {}), y = S({}), I = S(!1), V = S(!1), m = S({}), A = G(K), C = G(
8
- b ? g(b) : {}
9
- ), x = ee(() => {
10
- const e = A.value;
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
- }), D = async (e) => {
12
+ }), N = async (e) => {
13
13
  try {
14
- const a = await le(A.value, e, n.value, F);
15
- n.value = a, C.value = g(a), V.value = !1;
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
- D(b), ae(
21
- () => b,
20
+ N(F), le(
21
+ () => F,
22
22
  (e) => {
23
- e && D(e);
23
+ e && N(e);
24
24
  },
25
25
  { deep: !0 }
26
26
  );
27
- const N = () => ({
28
- values: n.value,
29
- globalValues: n.value,
30
- isUpdate: F
31
- }), M = (e) => J(n.value, e), Q = (e) => y.value[e] || "", R = (e, a) => {
32
- a ? y.value[e] = a : delete y.value[e];
33
- }, O = () => {
34
- y.value = {};
35
- }, z = (e) => e.when ? $(e.when, N()) : !0, P = (e) => $(e.disabled, N()), W = (e) => $(e.readonly, N()), T = async (e, a = "") => {
36
- const r = a ? `${a}.${e.name}` : e.name, s = M(r);
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 l = e.labelI18n ? re(e.labelI18n) : typeof e.label == "string" ? e.label : e.name;
38
+ const t = typeof e.label == "string" ? e.label : e.name, c = ne(e.labelI18n, t) ?? t;
39
39
  if (e.required) {
40
- const o = typeof s == "string" && /<\/?[a-z][^>]*>/i.test(s) && s.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim() === "";
41
- (s == null || s === "" || Array.isArray(s) && s.length === 0 || o) && (i = `${l} is required`);
40
+ const l = typeof s == "string" && /<\/?[a-z][^>]*>/i.test(s) && s.replace(/<[^>]*>/g, "").replace(/&nbsp;/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 o = e.maxFileSize * 1024 * 1024;
44
+ const l = e.maxFileSize * 1024 * 1024;
45
45
  if (s != null && s !== "") {
46
- const t = Array.isArray(s) ? s : [s];
47
- for (const f of t) {
48
- const v = f instanceof File ? f.size : f?.fileSize || f?.file?.size || f?.size;
49
- if (v !== void 0 && v > o) {
50
- i = `${l} size must be less than ${e.maxFileSize}MB`;
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 o = e.maxFiles || e.props?.maxFiles;
58
- o && Array.isArray(s) && s.length > o && (i = `Maximum ${o} files allowed`);
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
- m.value[r] = !0;
61
+ b.value[o] = !0;
62
62
  try {
63
63
  i = await e.validation({
64
64
  value: s,
65
- values: n.value,
66
- globalValues: n.value,
67
- isUpdate: F
65
+ values: r.value,
66
+ globalValues: r.value,
67
+ isUpdate: h
68
68
  });
69
- } catch (o) {
70
- console.error(`[useForm] Validation error in field ${r}:`, o), i = "Validation failed";
69
+ } catch (l) {
70
+ console.error(`[useForm] Validation error in field ${o}:`, l), i = "Validation failed";
71
71
  } finally {
72
- m.value[r] = !1;
72
+ b.value[o] = !1;
73
73
  }
74
74
  }
75
- if (i ? y.value[r] = i : delete y.value[r], e.type === "customFields" && e.props?.schema) {
76
- const o = e.props.schema, t = Array.isArray(s) ? s : [];
77
- let f = !1;
78
- for (let v = 0; v < t.length; v++) {
79
- const d = { values: t[v] || {}, globalValues: n.value, isUpdate: F };
80
- for (const u of o) {
81
- const c = !u.when || $(u.when, d), w = $(u.disabled, d);
82
- c && !w ? await T(u, `${r}.${v}`) && (f = !0) : delete y.value[`${r}.${v}.${u.name}`];
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
- f && !i && (i = "Please fix errors in the list.", y.value[r] = i);
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
- O();
89
+ P();
90
90
  let e = !0;
91
- for (const a of x.value) {
92
- if (!z(a) || P(a)) continue;
93
- await T(a) && (e = !1);
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, r) => {
97
- const s = x.value.filter((l) => l.name === e);
98
- let i = s.find((l) => z(l));
99
- if (!i && s.length > 0 && (i = s[0]), i && (!z(i) || P(i) || W(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 (n.value = j(n.value, e, a), V.value = !0, delete y.value[e], i?.updateValues) {
104
- m.value[e] = !0;
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 l = await i.updateValues({
106
+ const t = await i.updateValues({
107
107
  value: a,
108
108
  // Exposing the explicitly requested value
109
- values: n.value,
110
- globalValues: n.value,
111
- data: r,
112
- isUpdate: F,
109
+ values: r.value,
110
+ globalValues: r.value,
111
+ data: o,
112
+ isUpdate: h,
113
113
  updateError: R
114
114
  });
115
- l && typeof l == "object" && (n.value = { ...n.value, ...l });
116
- } catch (l) {
117
- console.error(`[useForm] Error in updateValues for ${e}:`, l);
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
- m.value[e] = !1;
119
+ b.value[e] = !1;
120
120
  }
121
121
  }
122
122
  }, Y = async () => {
123
- const e = g(n.value), a = se(A.value, e, n.value, F), r = (l, o) => {
124
- let t = null;
125
- l instanceof File ? t = l : l && typeof l == "object" && l.file instanceof File && (t = l.file);
126
- const f = {
127
- ...typeof l == "object" ? l : {},
128
- fileName: l?.fileName || t?.name || o.split("/").pop() || "unknown",
129
- fileUrl: o,
130
- fileType: l?.fileType || t?.type || "application/octet-stream",
131
- fileSize: l?.fileSize || t?.size || 0
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 f.file, delete f.base64, f;
134
- }, s = a.map(async (l) => {
135
- const { name: o, value: t, field: f } = l;
136
- if (l.type === "thumbnailSelector") {
137
- const d = t, u = Array.isArray(d.images) ? d.images : [], c = d.thumbnail;
138
- m.value[o] = !0;
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 w = await Promise.all(
141
- u.map(async (h) => {
142
- if (h.startsWith("data:image/")) {
143
- const B = await (await fetch(h)).blob(), _ = new File([B], `thumbnail-${Date.now()}.${B.type.split("/")[1] || "jpg"}`, { type: B.type });
144
- return await U(_, E) || h;
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 h;
146
+ return w;
147
147
  })
148
148
  );
149
- let p = c;
150
- if (c && c.startsWith("data:image/")) {
151
- const h = u.indexOf(c);
152
- h !== -1 && w[h] && (p = w[h]);
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: o, value: { images: w, thumbnail: p } };
154
+ return { name: c, value: { images: g, thumbnail: d } };
155
155
  } finally {
156
- m.value[o] = !1;
156
+ b.value[c] = !1;
157
157
  }
158
158
  }
159
- const v = f.returnFileObject === !0, k = Array.isArray(t) ? t.some(
160
- (d) => d instanceof File || d && typeof d == "object" && d.file instanceof File
161
- ) : t instanceof File || t && typeof t == "object" && t.file instanceof File;
162
- k && (m.value[o] = !0);
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(t)) {
165
- const d = t.map(async (c) => {
166
- if (c instanceof File || c && typeof c == "object" && c.file instanceof File) {
167
- const p = await U(c, E);
168
- return p ? v ? r(c, p) : p : null;
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 (c && typeof c == "object") {
171
- const p = { ...c };
172
- return delete p.file, delete p.base64, p;
170
+ if (n && typeof n == "object") {
171
+ const d = { ...n };
172
+ return delete d.file, delete d.base64, d;
173
173
  }
174
- return c;
175
- }), u = await Promise.all(d);
176
- return { name: o, value: u };
174
+ return n;
175
+ }), u = await Promise.all(f);
176
+ return { name: c, value: u };
177
177
  } else {
178
- if (t instanceof File || t && typeof t == "object" && t.file instanceof File) {
179
- const u = await U(t, E);
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: o, value: v ? r(t, u) : u };
182
- } else if (t && typeof t == "object") {
183
- const u = { ...t };
184
- return delete u.file, delete u.base64, { name: o, value: u };
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
- k && (m.value[o] = !1);
189
+ y && (b.value[c] = !1);
190
190
  }
191
191
  });
192
- return (await Promise.all(s)).forEach((l) => {
193
- l && (Object.assign(e, j(e, l.name, l.value)), n.value = j(n.value, l.name, l.value));
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 r of x.value)
198
- if (z(r) && r.type === "customFields" && r.props?.schema) {
199
- const s = J(a, r.name);
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 = ie(s, r.props.schema);
202
- Object.assign(a, j(a, r.name, i));
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: n,
209
- errors: y,
210
- isSubmitting: I,
211
- isDirty: V,
212
- fieldLoading: m,
208
+ formValues: r,
209
+ errors: m,
210
+ isSubmitting: C,
211
+ isDirty: A,
212
+ fieldLoading: b,
213
213
  handleFieldChange: X,
214
- validateField: T,
214
+ validateField: k,
215
215
  validateAll: H,
216
- isFieldVisible: z,
217
- isFieldDisabled: P,
216
+ isFieldVisible: S,
217
+ isFieldDisabled: T,
218
218
  isFieldReadonly: W,
219
219
  getFieldValue: M,
220
220
  getFieldError: Q,
221
221
  setFieldError: R,
222
- clearErrors: O,
222
+ clearErrors: P,
223
223
  resetForm: () => {
224
- n.value = g(C.value), O(), V.value = !1;
224
+ r.value = V(D.value), P(), A.value = !1;
225
225
  },
226
226
  handleSubmit: async () => {
227
227
  if (await H()) {
228
- I.value = !0;
228
+ C.value = !0;
229
229
  try {
230
230
  let a = await Y();
231
- a = Z(a), a = await te(
231
+ a = Z(a), a = await se(
232
232
  a,
233
- A.value,
234
- q.emitFields,
233
+ z.value,
234
+ L.emitFields,
235
235
  void 0,
236
- n.value,
237
- F
238
- ), L && await L({
236
+ r.value,
237
+ h
238
+ ), q && await q({
239
239
  values: a,
240
- isUpdate: F
241
- }), V.value = !1, C.value = g(a);
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
- I.value = !1;
245
+ C.value = !1;
246
246
  }
247
247
  }
248
248
  },
249
- flatSchema: x,
249
+ flatSchema: j,
250
250
  reinitialize: async (e, a) => {
251
- e !== void 0 && (A.value = e), a !== void 0 && (b = a), await D(a !== void 0 ? a : b);
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-27f884e3"]]);
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 w, unref as t } from "vue";
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 F from "../Label.vue.js";
5
- import U from "../Button.vue.js";
6
- import { useCustomFieldRows as N } from "./composables/useCustomFieldRows.js";
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 { $t as s } from "../../utils/i18n.js";
9
- const V = { class: "custom-fields-wrapper min-w-0 w-full" }, D = { class: "flex justify-between items-center mb-2" }, O = /* @__PURE__ */ b({
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: v }) {
38
- const e = a, p = v, i = d(() => e.labelI18n ? s(e.labelI18n) : e.label), m = d(() => {
39
- const o = s("vlite.customFields.emptyTitle");
40
- return o !== "vlite.customFields.emptyTitle" ? o : "No items added";
41
- }), u = d(() => {
42
- const o = s("vlite.customFields.emptyDescription");
43
- return o !== "vlite.customFields.emptyDescription" ? o : "Add a new item to get started";
44
- }), l = N(
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
- p
62
- ), c = d(() => e.headers && e.headers.length > 0 ? e.headers : e.schema.map((o) => o.labelI18n ? s(o.labelI18n) : typeof o.label == "string" ? o.label : o.name)), h = d(() => e.schema.slice(0, c.value.length)), f = d(
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: l.rows.value,
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(() => e.labelI18n ? s(e.labelI18n) : e.label ? e.label : "Item");
75
+ ), y = d(() => s(e.labelI18n, e.label ?? "Item") ?? "Item");
72
76
  return (o, z) => (n(), g("div", V, [
73
- R("div", D, [
74
- i.value ? (n(), r(F, {
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
- })) : w("", !0),
83
- a.readonly ? w("", !0) : (n(), r(U, {
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(l).canAddRow.value,
92
- onClick: t(l).addRow
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(l).rows.value,
101
+ rows: l(t).rows.value,
98
102
  schema: e.schema,
99
103
  "column-headers": c.value,
100
- "visible-schema-fields": h.value,
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(l).canRemoveRow.value,
107
- "can-add-row": t(l).canAddRow.value,
108
- helpers: f.value,
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(l).handleFieldChange,
112
- "on-remove-row": t(l).removeRow,
113
- "on-drag-update": t(l).handleDragUpdate
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(l).rows.value,
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(l).canRemoveRow.value,
126
- "can-add-row": t(l).canAddRow.value,
127
- helpers: f.value,
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(l).handleFieldChange,
133
- "on-remove-row": t(l).removeRow,
134
- "on-drag-update": t(l).handleDragUpdate
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
  }
@@ -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 { $t as E } from "../utils/i18n.js";
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(() => e.labelI18n ? E(e.labelI18n) : e.label), L = d(
43
- () => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
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,
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as U } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {
@@ -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.vue.js";
4
- /* empty css */
5
- import de from "./RichTextLinkPopover.vue.js";
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({
@@ -1,5 +1,5 @@
1
- import o from "./RichTextLinkPopover.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextLinkPopover.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
- import o from "./RichTextToolbar.vue.js";
2
- /* empty css */
1
+ import o from "./RichTextToolbar.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };