vlite3 1.4.5 → 1.4.6
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/AppShell/AppShellLayoutStorefront.vue.d.ts +4 -17
- package/components/AppShell/AppShellLayoutStorefront.vue.js +116 -152
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +1 -1
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/Chat/ChatInterface.vue.js +1 -1
- package/components/Comment/CommentEditor.vue.js +1 -1
- package/components/FilePicker/FilePickerDropzone.vue.d.ts +27 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +117 -0
- package/components/FilePicker/FilePickerDropzone.vue2.js +4 -0
- package/components/FilePicker/FilePickerInput.vue.d.ts +22 -0
- package/components/FilePicker/FilePickerInput.vue.js +147 -0
- package/components/FilePicker/FilePickerInput.vue2.js +4 -0
- package/components/FilePicker/FilePreview.vue.d.ts +21 -0
- package/components/FilePicker/FilePreview.vue.js +95 -0
- package/components/FilePicker/FilePreview.vue2.js +4 -0
- package/components/FilePicker/composables/useFileProcessing.d.ts +65 -0
- package/components/FilePicker/composables/useFileProcessing.js +141 -0
- package/components/FilePicker/index.d.ts +2 -2
- package/components/FilePicker/{FilePicker.vue.d.ts → index.vue.d.ts} +11 -18
- package/components/FilePicker/index.vue.js +131 -0
- package/components/FilePicker/index.vue2.js +4 -0
- package/components/FilePicker/types.d.ts +17 -0
- package/components/FilePicker/utils.d.ts +23 -0
- package/components/FilePicker/utils.js +37 -0
- package/components/Form/AccordionView.vue.d.ts +26 -0
- package/components/Form/AccordionView.vue.js +219 -0
- package/components/Form/AccordionView.vue2.js +4 -0
- package/components/Form/FormField.vue.js +2 -2
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/TableRow.vue.d.ts +18 -0
- package/components/Form/TableRow.vue.js +88 -0
- package/components/Form/TableRow.vue2.js +4 -0
- package/components/Form/TableView.vue.d.ts +23 -0
- package/components/Form/TableView.vue.js +88 -0
- package/components/Form/TableView.vue2.js +4 -0
- package/components/Form/composables/useCustomFieldRows.d.ts +52 -0
- package/components/Form/composables/useCustomFieldRows.js +77 -0
- package/components/Form/index.d.ts +1 -1
- package/components/Form/{CustomFields.vue.d.ts → index.vue.d.ts} +5 -6
- package/components/Form/index.vue.js +7 -0
- package/components/Form/index.vue2.js +141 -0
- package/components/Form/rowHelpers.d.ts +45 -0
- package/components/Form/rowHelpers.js +40 -0
- package/components/IconPicker.vue.d.ts +2 -2
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
- package/components/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/components/FilePicker/FilePicker.vue.js +0 -437
- package/components/FilePicker/FilePicker.vue2.js +0 -4
- package/components/Form/CustomFields.vue.js +0 -7
- package/components/Form/CustomFields.vue2.js +0 -465
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
import { defineComponent as he, computed as p, shallowRef as ge, watch as re, ref as le, openBlock as n, createElementBlock as i, createElementVNode as b, createBlock as k, withCtx as R, createTextVNode as K, toDisplayString as v, createCommentVNode as d, Fragment as x, renderList as j, normalizeClass as $, createVNode as g, unref as N, isMemoSame as ne, resolveDynamicComponent as oe, withModifiers as ke, markRaw as xe } from "vue";
|
|
2
|
-
import { VueDraggable as ie } from "vue-draggable-plus";
|
|
3
|
-
import ue from "./FormField.vue.js";
|
|
4
|
-
import L from "../Button.vue.js";
|
|
5
|
-
import O from "../Label.vue.js";
|
|
6
|
-
import z from "../Icon.vue.js";
|
|
7
|
-
import we from "../Accordion/AccordionItem.vue.js";
|
|
8
|
-
import { $t as V } from "../../utils/i18n.js";
|
|
9
|
-
import { isComponent as M, setNestedValue as de, resolveFieldType as pe, evaluateConditional as W } from "./utils/form.utils.js";
|
|
10
|
-
const Re = { class: "custom-fields-wrapper" }, $e = { class: "flex justify-between items-center mb-2" }, Ve = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "custom-fields-table border border-border rounded overflow-hidden bg-background"
|
|
13
|
-
}, Ce = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
16
|
-
}, Ue = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "w-10 flex-none p-3 border-r border-border"
|
|
19
|
-
}, Fe = {
|
|
20
|
-
key: 1,
|
|
21
|
-
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
22
|
-
}, je = {
|
|
23
|
-
key: 2,
|
|
24
|
-
class: "w-10 flex-none p-3"
|
|
25
|
-
}, Te = {
|
|
26
|
-
key: 1,
|
|
27
|
-
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
28
|
-
}, Ae = {
|
|
29
|
-
key: 2,
|
|
30
|
-
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
31
|
-
}, Be = {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
34
|
-
}, Ne = { class: "text-sm font-medium text-foreground" }, ze = { class: "text-xs text-muted-foreground mt-1" }, De = {
|
|
35
|
-
key: 1,
|
|
36
|
-
class: "custom-fields-accordion"
|
|
37
|
-
}, Ee = ["onClick"], Se = { class: "flex items-center flex-1 py-3 px-4 min-w-0" }, Ke = { class: "font-medium flex-1 text-left truncate mr-4" }, Le = { class: "flex items-center gap-2 flex-none" }, Oe = {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "text-destructive flex items-center justify-center rounded-full bg-destructive/10 w-6 h-6"
|
|
40
|
-
}, Me = {
|
|
41
|
-
key: 0,
|
|
42
|
-
class: "grid gap-4"
|
|
43
|
-
}, We = {
|
|
44
|
-
key: 0,
|
|
45
|
-
class: "text-destructive ml-0.5"
|
|
46
|
-
}, qe = {
|
|
47
|
-
key: 0,
|
|
48
|
-
class: "text-destructive ml-0.5"
|
|
49
|
-
}, He = {
|
|
50
|
-
key: 1,
|
|
51
|
-
class: "mt-1 text-xs text-destructive"
|
|
52
|
-
}, Ge = {
|
|
53
|
-
key: 0,
|
|
54
|
-
class: "col-span-1 flex justify-end"
|
|
55
|
-
}, Je = {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: "flex flex-col items-center justify-center py-6 text-center border border-border rounded bg-muted/5 mt-2"
|
|
58
|
-
}, Pe = { class: "text-sm font-medium text-foreground" }, Qe = { class: "text-xs text-muted-foreground mt-1" }, rt = /* @__PURE__ */ he({
|
|
59
|
-
__name: "CustomFields",
|
|
60
|
-
props: {
|
|
61
|
-
name: {},
|
|
62
|
-
modelValue: { default: () => [] },
|
|
63
|
-
schema: {},
|
|
64
|
-
headers: { default: () => [] },
|
|
65
|
-
variant: { default: "outline" },
|
|
66
|
-
size: { default: "md" },
|
|
67
|
-
rounded: { default: "md" },
|
|
68
|
-
disabled: { type: Boolean, default: !1 },
|
|
69
|
-
readonly: { type: Boolean, default: !1 },
|
|
70
|
-
draggable: { type: Boolean, default: !1 },
|
|
71
|
-
minRows: { default: 0 },
|
|
72
|
-
maxRows: {},
|
|
73
|
-
addButtonText: { default: "Add Row" },
|
|
74
|
-
textI18n: {},
|
|
75
|
-
label: {},
|
|
76
|
-
labelI18n: {},
|
|
77
|
-
showRowNumbers: { type: Boolean, default: !1 },
|
|
78
|
-
values: {},
|
|
79
|
-
errors: { default: () => ({}) },
|
|
80
|
-
isUpdate: { type: Boolean, default: !1 },
|
|
81
|
-
layout: { default: "table" },
|
|
82
|
-
accordionTitleKey: { default: void 0 }
|
|
83
|
-
},
|
|
84
|
-
emits: ["update:modelValue", "change"],
|
|
85
|
-
setup(s, { emit: ce }) {
|
|
86
|
-
const a = s, q = ce, H = p(() => a.labelI18n ? V(a.labelI18n) : a.label), G = p(() => {
|
|
87
|
-
const e = V("vlite.customFields.emptyTitle");
|
|
88
|
-
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
89
|
-
}), J = p(() => {
|
|
90
|
-
const e = V("vlite.customFields.emptyDescription");
|
|
91
|
-
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
92
|
-
}), u = ge([]), P = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
93
|
-
re(
|
|
94
|
-
() => a.modelValue,
|
|
95
|
-
(e) => {
|
|
96
|
-
Array.isArray(e) ? u.value = e.map((r, o) => {
|
|
97
|
-
const t = u.value[o];
|
|
98
|
-
return {
|
|
99
|
-
...r,
|
|
100
|
-
_id: t?._id || P()
|
|
101
|
-
};
|
|
102
|
-
}) : u.value = [];
|
|
103
|
-
},
|
|
104
|
-
{ immediate: !0, deep: !0 }
|
|
105
|
-
);
|
|
106
|
-
const me = () => {
|
|
107
|
-
const e = {};
|
|
108
|
-
for (const r of a.schema) {
|
|
109
|
-
const o = typeof r.value == "function" ? r.value() : r.value;
|
|
110
|
-
let t = null;
|
|
111
|
-
(r.props?.multiple || r.type === "multiSelect" || r.type === "tags") && (t = []), e[r.name] = o ?? t;
|
|
112
|
-
}
|
|
113
|
-
return { ...e, _id: P() };
|
|
114
|
-
}, ve = () => {
|
|
115
|
-
if (a.disabled || a.readonly || a.maxRows && u.value.length >= a.maxRows) return;
|
|
116
|
-
const e = [...u.value, me()];
|
|
117
|
-
u.value = e, T(e);
|
|
118
|
-
}, Q = (e) => {
|
|
119
|
-
if (a.disabled || a.readonly || u.value.length <= a.minRows) return;
|
|
120
|
-
const r = [...u.value];
|
|
121
|
-
r.splice(e, 1), u.value = r, T(r);
|
|
122
|
-
}, X = async (e, r, o) => {
|
|
123
|
-
const t = [...u.value];
|
|
124
|
-
t[e] = {
|
|
125
|
-
...t[e],
|
|
126
|
-
[r]: o.value
|
|
127
|
-
};
|
|
128
|
-
const U = a.schema.find((c) => c.name === r);
|
|
129
|
-
if (U && U.updateValues)
|
|
130
|
-
try {
|
|
131
|
-
const c = t[e];
|
|
132
|
-
let y = { ...a.values || {} };
|
|
133
|
-
a.name && (y = de(y, a.name, t));
|
|
134
|
-
const h = await U.updateValues({
|
|
135
|
-
value: o.value,
|
|
136
|
-
values: c,
|
|
137
|
-
// strictly local row scope
|
|
138
|
-
globalValues: y,
|
|
139
|
-
// strictly global root scope
|
|
140
|
-
data: o.data,
|
|
141
|
-
isUpdate: a.isUpdate
|
|
142
|
-
});
|
|
143
|
-
h && typeof h == "object" && (t[e] = { ...t[e], ...h });
|
|
144
|
-
} catch (c) {
|
|
145
|
-
console.error(`[CustomFields] Error in updateValues for ${r}:`, c);
|
|
146
|
-
}
|
|
147
|
-
u.value = t, T(t);
|
|
148
|
-
}, Y = (e) => {
|
|
149
|
-
u.value = e, T(e);
|
|
150
|
-
}, T = (e) => {
|
|
151
|
-
const r = e.map(({ _id: o, ...t }) => t);
|
|
152
|
-
q("update:modelValue", r), q("change", r);
|
|
153
|
-
}, Z = (e, r) => u.value[e]?.[r], be = p(() => !(a.disabled || a.readonly || a.maxRows && u.value.length >= a.maxRows)), A = p(() => a.disabled || a.readonly ? !1 : u.value.length > a.minRows), D = p(() => a.headers && a.headers.length > 0 ? a.headers : a.schema.map((e) => e.labelI18n ? V(e.labelI18n) : e.label || e.name)), fe = p(() => a.schema.slice(0, D.value.length)), B = (e) => {
|
|
154
|
-
let r = { ...a.values || {} };
|
|
155
|
-
return a.name && (r = de(r, a.name, u.value)), {
|
|
156
|
-
values: u.value[e] || {},
|
|
157
|
-
globalValues: r,
|
|
158
|
-
isUpdate: a.isUpdate
|
|
159
|
-
};
|
|
160
|
-
}, m = (e, r) => pe(e, B(r)), _ = (e, r) => a.disabled ? !0 : W(r.disabled, B(e)), I = (e, r) => a.readonly ? !0 : W(r.readonly, B(e)), ee = (e, r) => r.when ? W(r.when, B(e)) : !0, te = (e) => {
|
|
161
|
-
if (!a.errors || !a.name) return "";
|
|
162
|
-
const r = `${a.name}.${e}.`;
|
|
163
|
-
return Object.keys(a.errors).filter((o) => o.startsWith(r)).map((o) => a.errors[o]).join(",");
|
|
164
|
-
}, ae = (e, r) => a.accordionTitleKey && e[a.accordionTitleKey] ? e[a.accordionTitleKey] : `${a.labelI18n ? V(a.labelI18n) : a.label || "Item"} #${r + 1}`, E = (e) => {
|
|
165
|
-
if (!a.errors || !a.name) return !1;
|
|
166
|
-
const r = `${a.name}.${e}.`;
|
|
167
|
-
return Object.keys(a.errors).some((o) => o.startsWith(r));
|
|
168
|
-
}, w = (e) => e.labelI18n ? V(e.labelI18n) : e.label || e.name, se = (e) => {
|
|
169
|
-
if (e)
|
|
170
|
-
return M(e) ? xe(e) : e;
|
|
171
|
-
}, f = le([]), C = le([]), ye = (e) => {
|
|
172
|
-
f.value.includes(e) ? f.value = f.value.filter((o) => o !== e) : (C.value.includes(e) || C.value.push(e), f.value = [...f.value, e]);
|
|
173
|
-
};
|
|
174
|
-
return re(
|
|
175
|
-
() => a.errors,
|
|
176
|
-
(e) => {
|
|
177
|
-
if (a.layout !== "accordion" || !e || !a.name) return;
|
|
178
|
-
const r = u.value.filter((o, t) => E(t)).map((o) => o._id);
|
|
179
|
-
if (r.length > 0) {
|
|
180
|
-
const o = /* @__PURE__ */ new Set([...f.value, ...r]);
|
|
181
|
-
f.value = Array.from(o);
|
|
182
|
-
const t = /* @__PURE__ */ new Set([...C.value, ...r]);
|
|
183
|
-
C.value = Array.from(t);
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{ deep: !0, immediate: !0 }
|
|
187
|
-
), (e, r) => (n(), i("div", Re, [
|
|
188
|
-
b("div", $e, [
|
|
189
|
-
H.value ? (n(), k(O, {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: "text-sm font-medium text-foreground"
|
|
192
|
-
}, {
|
|
193
|
-
default: R(() => [
|
|
194
|
-
K(v(H.value), 1)
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
})) : d("", !0),
|
|
198
|
-
s.readonly ? d("", !0) : (n(), k(L, {
|
|
199
|
-
key: 1,
|
|
200
|
-
type: "button",
|
|
201
|
-
variant: "outline",
|
|
202
|
-
size: "xs",
|
|
203
|
-
rounded: "full",
|
|
204
|
-
"as-icon": "",
|
|
205
|
-
icon: "lucide:plus",
|
|
206
|
-
disabled: !be.value,
|
|
207
|
-
onClick: ve
|
|
208
|
-
}, null, 8, ["disabled"]))
|
|
209
|
-
]),
|
|
210
|
-
a.layout === "table" ? (n(), i("div", Ve, [
|
|
211
|
-
D.value.length > 1 ? (n(), i("div", Ce, [
|
|
212
|
-
s.draggable && !s.disabled && !s.readonly ? (n(), i("div", Ue)) : d("", !0),
|
|
213
|
-
s.showRowNumbers ? (n(), i("div", Fe, " # ")) : d("", !0),
|
|
214
|
-
(n(!0), i(x, null, j(D.value, (o, t) => (n(), i("div", {
|
|
215
|
-
key: t,
|
|
216
|
-
class: $(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": t > 0 }])
|
|
217
|
-
}, v(o), 3))), 128)),
|
|
218
|
-
A.value ? (n(), i("div", je)) : d("", !0)
|
|
219
|
-
])) : d("", !0),
|
|
220
|
-
g(N(ie), {
|
|
221
|
-
"model-value": u.value,
|
|
222
|
-
"onUpdate:modelValue": Y,
|
|
223
|
-
disabled: !s.draggable || s.disabled || s.readonly,
|
|
224
|
-
animation: 150,
|
|
225
|
-
handle: ".drag-handle",
|
|
226
|
-
"ghost-class": "opacity-50",
|
|
227
|
-
class: "divide-y divide-border"
|
|
228
|
-
}, {
|
|
229
|
-
default: R(() => [
|
|
230
|
-
(n(!0), i(x, null, j(u.value, (o, t, U, c) => {
|
|
231
|
-
const y = [
|
|
232
|
-
o,
|
|
233
|
-
s.disabled,
|
|
234
|
-
s.readonly,
|
|
235
|
-
s.isUpdate,
|
|
236
|
-
s.showRowNumbers,
|
|
237
|
-
A.value,
|
|
238
|
-
s.draggable,
|
|
239
|
-
t,
|
|
240
|
-
te(t)
|
|
241
|
-
];
|
|
242
|
-
if (c && c.key === o._id && ne(c, y)) return c;
|
|
243
|
-
const h = (n(), i("div", {
|
|
244
|
-
key: o._id,
|
|
245
|
-
class: "flex group bg-white transition-colors"
|
|
246
|
-
}, [
|
|
247
|
-
s.draggable && !s.disabled && !s.readonly ? (n(), i("div", {
|
|
248
|
-
key: 0,
|
|
249
|
-
class: $([
|
|
250
|
-
"w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
251
|
-
s.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
252
|
-
])
|
|
253
|
-
}, [
|
|
254
|
-
g(z, {
|
|
255
|
-
icon: "lucide:grip-vertical",
|
|
256
|
-
class: "w-4 h-4"
|
|
257
|
-
})
|
|
258
|
-
], 2)) : d("", !0),
|
|
259
|
-
s.showRowNumbers ? (n(), i("div", Te, v(t + 1), 1)) : d("", !0),
|
|
260
|
-
(n(!0), i(x, null, j(fe.value, (l, F) => (n(), i("div", {
|
|
261
|
-
key: l.name,
|
|
262
|
-
class: $(["flex-1 min-w-0 relative", { "border-l border-border": F > 0 }])
|
|
263
|
-
}, [
|
|
264
|
-
ee(t, l) ? (n(), k(ue, {
|
|
265
|
-
key: 0,
|
|
266
|
-
field: {
|
|
267
|
-
...l,
|
|
268
|
-
props: {
|
|
269
|
-
...m(l, t) === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
270
|
-
...l.props || {},
|
|
271
|
-
...m(l, t) === "file" || m(l, t) === "fileUploader" ? { variant: "input" } : {}
|
|
272
|
-
},
|
|
273
|
-
label: void 0
|
|
274
|
-
},
|
|
275
|
-
value: Z(t, l.name),
|
|
276
|
-
values: u.value[t] || {},
|
|
277
|
-
errors: s.errors,
|
|
278
|
-
error: s.name && s.errors ? s.errors[`${s.name}.${t}.${l.name}`] : "",
|
|
279
|
-
variant: "transparent",
|
|
280
|
-
size: "sm",
|
|
281
|
-
rounded: "none",
|
|
282
|
-
disabled: _(t, l),
|
|
283
|
-
readonly: I(t, l),
|
|
284
|
-
isUpdate: s.isUpdate,
|
|
285
|
-
class: "w-full h-full min-h-[40px]",
|
|
286
|
-
onChange: (S) => X(t, l.name, S)
|
|
287
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : d("", !0)
|
|
288
|
-
], 2))), 128)),
|
|
289
|
-
A.value ? (n(), i("div", Ae, [
|
|
290
|
-
g(L, {
|
|
291
|
-
type: "button",
|
|
292
|
-
variant: "ghost",
|
|
293
|
-
size: "xs",
|
|
294
|
-
icon: "lucide:trash-2",
|
|
295
|
-
disabled: s.disabled || s.readonly,
|
|
296
|
-
onClick: (l) => Q(t)
|
|
297
|
-
}, null, 8, ["disabled", "onClick"])
|
|
298
|
-
])) : d("", !0)
|
|
299
|
-
]));
|
|
300
|
-
return h.memo = y, h;
|
|
301
|
-
}, r, 0), 128))
|
|
302
|
-
]),
|
|
303
|
-
_: 1
|
|
304
|
-
}, 8, ["model-value", "disabled"]),
|
|
305
|
-
u.value.length === 0 ? (n(), i("div", Be, [
|
|
306
|
-
b("p", Ne, v(G.value), 1),
|
|
307
|
-
b("p", ze, v(J.value), 1)
|
|
308
|
-
])) : d("", !0)
|
|
309
|
-
])) : a.layout === "accordion" ? (n(), i("div", De, [
|
|
310
|
-
g(N(ie), {
|
|
311
|
-
"model-value": u.value,
|
|
312
|
-
"onUpdate:modelValue": Y,
|
|
313
|
-
disabled: !s.draggable || s.disabled || s.readonly,
|
|
314
|
-
animation: 150,
|
|
315
|
-
handle: ".drag-handle",
|
|
316
|
-
"ghost-class": "opacity-50",
|
|
317
|
-
class: "space-y-2"
|
|
318
|
-
}, {
|
|
319
|
-
default: R(() => [
|
|
320
|
-
(n(!0), i(x, null, j(u.value, (o, t, U, c) => {
|
|
321
|
-
const y = [
|
|
322
|
-
o,
|
|
323
|
-
s.disabled,
|
|
324
|
-
s.readonly,
|
|
325
|
-
s.isUpdate,
|
|
326
|
-
s.draggable,
|
|
327
|
-
t,
|
|
328
|
-
te(t),
|
|
329
|
-
E(t),
|
|
330
|
-
f.value.includes(o._id)
|
|
331
|
-
];
|
|
332
|
-
if (c && c.key === o._id && ne(c, y)) return c;
|
|
333
|
-
const h = (n(), k(we, {
|
|
334
|
-
key: o._id,
|
|
335
|
-
item: { id: o._id, title: ae(o, t) },
|
|
336
|
-
"is-open": f.value.includes(o._id),
|
|
337
|
-
variant: "solid",
|
|
338
|
-
onToggle: ye,
|
|
339
|
-
class: "bg-white"
|
|
340
|
-
}, {
|
|
341
|
-
trigger: R(({ open: l, toggle: F, triggerClass: S }) => [
|
|
342
|
-
b("div", {
|
|
343
|
-
class: $(["flex items-stretch w-full", [S, "!p-0 overflow-hidden"]]),
|
|
344
|
-
onClick: F
|
|
345
|
-
}, [
|
|
346
|
-
s.draggable && !s.disabled && !s.readonly ? (n(), i("div", {
|
|
347
|
-
key: 0,
|
|
348
|
-
class: $([
|
|
349
|
-
"w-12 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
350
|
-
s.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
351
|
-
]),
|
|
352
|
-
onClick: r[2] || (r[2] = ke(() => {
|
|
353
|
-
}, ["stop"]))
|
|
354
|
-
}, [
|
|
355
|
-
g(z, {
|
|
356
|
-
icon: "lucide:grip-vertical",
|
|
357
|
-
class: "w-4 h-4"
|
|
358
|
-
})
|
|
359
|
-
], 2)) : d("", !0),
|
|
360
|
-
b("div", Se, [
|
|
361
|
-
b("span", Ke, v(ae(o, t)), 1),
|
|
362
|
-
b("div", Le, [
|
|
363
|
-
E(t) ? (n(), i("div", Oe, [
|
|
364
|
-
g(z, {
|
|
365
|
-
icon: "lucide:alert-circle",
|
|
366
|
-
class: "w-4 h-4"
|
|
367
|
-
})
|
|
368
|
-
])) : d("", !0),
|
|
369
|
-
g(z, {
|
|
370
|
-
icon: "lucide:chevron-down",
|
|
371
|
-
class: $(["w-4 h-4 transition-transform duration-200", { "rotate-180": l }])
|
|
372
|
-
}, null, 8, ["class"])
|
|
373
|
-
])
|
|
374
|
-
])
|
|
375
|
-
], 10, Ee)
|
|
376
|
-
]),
|
|
377
|
-
content: R(() => [
|
|
378
|
-
C.value.includes(o._id) ? (n(), i("div", Me, [
|
|
379
|
-
(n(!0), i(x, null, j(a.schema, (l) => (n(), i("div", {
|
|
380
|
-
key: l.name,
|
|
381
|
-
class: "col-span-1 flex flex-col"
|
|
382
|
-
}, [
|
|
383
|
-
ee(t, l) ? (n(), i(x, { key: 0 }, [
|
|
384
|
-
w(l) && m(l, t) !== "switch" && m(l, t) !== "check" && m(l, t) !== "customFields" && m(l, t) !== "choiceBox" ? (n(), k(O, {
|
|
385
|
-
key: 0,
|
|
386
|
-
class: "mb-2 block text-sm font-medium"
|
|
387
|
-
}, {
|
|
388
|
-
default: R(() => [
|
|
389
|
-
N(M)(w(l)) ? (n(), k(oe(se(w(l))), { key: 0 })) : (n(), i(x, { key: 1 }, [
|
|
390
|
-
K(v(w(l)) + " ", 1),
|
|
391
|
-
l.required ? (n(), i("span", We, "*")) : d("", !0)
|
|
392
|
-
], 64))
|
|
393
|
-
]),
|
|
394
|
-
_: 2
|
|
395
|
-
}, 1024)) : d("", !0),
|
|
396
|
-
b("div", {
|
|
397
|
-
class: $(["relative", [
|
|
398
|
-
m(l, t) === "check" || m(l, t) === "switch" && l.props?.switchVariant === "basic" ? "w-auto flex items-center" : "w-full"
|
|
399
|
-
]])
|
|
400
|
-
}, [
|
|
401
|
-
g(ue, {
|
|
402
|
-
field: {
|
|
403
|
-
...l,
|
|
404
|
-
props: {
|
|
405
|
-
...l.props || {}
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
value: Z(t, l.name),
|
|
409
|
-
values: u.value[t] || {},
|
|
410
|
-
errors: s.errors,
|
|
411
|
-
error: s.name && s.errors ? s.errors[`${s.name}.${t}.${l.name}`] : "",
|
|
412
|
-
variant: s.variant,
|
|
413
|
-
size: s.size,
|
|
414
|
-
rounded: s.rounded,
|
|
415
|
-
disabled: _(t, l),
|
|
416
|
-
readonly: I(t, l),
|
|
417
|
-
isUpdate: s.isUpdate,
|
|
418
|
-
onChange: (F) => X(t, l.name, F)
|
|
419
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "variant", "size", "rounded", "disabled", "readonly", "isUpdate", "onChange"]),
|
|
420
|
-
m(l, t) === "check" || m(l, t) === "switch" && l.props?.switchVariant === "basic" ? (n(), k(O, {
|
|
421
|
-
key: 0,
|
|
422
|
-
class: "ml-2 text-sm font-medium cursor-pointer"
|
|
423
|
-
}, {
|
|
424
|
-
default: R(() => [
|
|
425
|
-
N(M)(w(l)) ? (n(), k(oe(se(w(l))), { key: 0 })) : (n(), i(x, { key: 1 }, [
|
|
426
|
-
K(v(w(l)) + " ", 1),
|
|
427
|
-
l.required ? (n(), i("span", qe, "*")) : d("", !0)
|
|
428
|
-
], 64))
|
|
429
|
-
]),
|
|
430
|
-
_: 2
|
|
431
|
-
}, 1024)) : d("", !0)
|
|
432
|
-
], 2),
|
|
433
|
-
s.name && s.errors && s.errors[`${s.name}.${t}.${l.name}`] ? (n(), i("p", He, v(s.errors[`${s.name}.${t}.${l.name}`]), 1)) : d("", !0)
|
|
434
|
-
], 64)) : d("", !0)
|
|
435
|
-
]))), 128)),
|
|
436
|
-
A.value ? (n(), i("div", Ge, [
|
|
437
|
-
g(L, {
|
|
438
|
-
type: "button",
|
|
439
|
-
variant: "secondary",
|
|
440
|
-
size: "xs",
|
|
441
|
-
icon: "lucide:trash-2",
|
|
442
|
-
disabled: s.disabled || s.readonly,
|
|
443
|
-
onClick: (l) => Q(t)
|
|
444
|
-
}, null, 8, ["disabled", "onClick"])
|
|
445
|
-
])) : d("", !0)
|
|
446
|
-
])) : d("", !0)
|
|
447
|
-
]),
|
|
448
|
-
_: 2
|
|
449
|
-
}, 1032, ["item", "is-open"]));
|
|
450
|
-
return h.memo = y, h;
|
|
451
|
-
}, r, 3), 128))
|
|
452
|
-
]),
|
|
453
|
-
_: 1
|
|
454
|
-
}, 8, ["model-value", "disabled"]),
|
|
455
|
-
u.value.length === 0 ? (n(), i("div", Je, [
|
|
456
|
-
b("p", Pe, v(G.value), 1),
|
|
457
|
-
b("p", Qe, v(J.value), 1)
|
|
458
|
-
])) : d("", !0)
|
|
459
|
-
])) : d("", !0)
|
|
460
|
-
]));
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
export {
|
|
464
|
-
rt as default
|
|
465
|
-
};
|