vlite3 1.4.4 → 1.4.5
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.js +2 -2
- package/components/Cart/Cart.vue.js +242 -0
- package/components/Cart/Cart.vue2.js +4 -0
- package/components/Cart/CartCouponInput.vue.js +176 -0
- package/components/Cart/CartCouponInput.vue2.js +4 -0
- package/components/Cart/CartEmptyState.vue.js +48 -0
- package/components/Cart/CartEmptyState.vue2.js +4 -0
- package/components/Cart/CartLineItem.vue.js +341 -0
- package/components/Cart/CartLineItem.vue2.js +4 -0
- package/components/Cart/CartSummary.vue.js +157 -0
- package/components/Cart/CartSummary.vue2.js +4 -0
- package/components/Cart/CartVariant1.vue.js +156 -0
- package/components/Cart/CartVariant1.vue2.js +4 -0
- package/components/Cart/CartVariant2.vue.js +154 -0
- package/components/Cart/CartVariant2.vue2.js +4 -0
- package/components/Cart/CartVariant3.vue.js +192 -0
- package/components/Cart/CartVariant3.vue2.js +4 -0
- package/components/Cart/CartVariant4.vue.js +145 -0
- package/components/Cart/CartVariant4.vue2.js +4 -0
- package/components/Cart/composables/useCart.d.ts +46 -0
- package/components/Cart/composables/useCart.js +110 -0
- package/components/Cart/composables/useCartCalculation.js +145 -0
- package/components/Cart/index.d.ts +2 -0
- package/components/CategoryManager/CategoryManager.vue.js +3 -3
- package/components/CategoryManager/CategoryManager.vue2.js +224 -248
- package/components/CategoryManager/utils.d.ts +3 -0
- package/components/CategoryManager/utils.js +31 -0
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +2 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +46 -40
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +5 -1
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +5 -144
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +220 -2
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +5 -1
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +5 -160
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +235 -2
- package/components/CategoryMenu/types.d.ts +5 -2
- package/components/Dropdown/Dropdown.vue.d.ts +1 -0
- package/components/Dropdown/Dropdown.vue.js +31 -29
- package/components/FilePicker/FilePicker.vue.js +278 -202
- package/components/Form/CustomFields.vue.d.ts +4 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +349 -145
- package/components/Form/FormField.vue.js +1 -1
- package/components/Form/types.d.ts +3 -0
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +30 -28
- package/components/Screen/ScreenFilter.vue.js +3 -2
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +1 -1
- package/components/SidePanel.vue2.js +25 -23
- package/components/SidebarMenu/SidebarMenu.vue.js +145 -128
- package/components/index.d.ts +1 -0
- package/core/config.d.ts +6 -6
- package/index.d.ts +1 -0
- package/index.js +327 -306
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -23,6 +23,8 @@ interface Props {
|
|
|
23
23
|
/** Form Validation errors passed down */
|
|
24
24
|
errors?: Record<string, string>;
|
|
25
25
|
isUpdate?: boolean;
|
|
26
|
+
layout?: 'table' | 'accordion';
|
|
27
|
+
accordionTitleKey?: string;
|
|
26
28
|
}
|
|
27
29
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
28
30
|
change: (value: Record<string, any>[]) => any;
|
|
@@ -36,6 +38,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
36
38
|
rounded: InputRounded;
|
|
37
39
|
readonly: boolean;
|
|
38
40
|
disabled: boolean;
|
|
41
|
+
layout: "table" | "accordion";
|
|
39
42
|
isUpdate: boolean;
|
|
40
43
|
modelValue: Record<string, any>[];
|
|
41
44
|
draggable: boolean;
|
|
@@ -44,5 +47,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
44
47
|
addButtonText: string;
|
|
45
48
|
showRowNumbers: boolean;
|
|
46
49
|
errors: Record<string, string>;
|
|
50
|
+
accordionTitleKey: string;
|
|
47
51
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
48
52
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CustomFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ffa944de"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VueDraggable as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
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 = {
|
|
10
14
|
key: 0,
|
|
11
15
|
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
12
|
-
},
|
|
16
|
+
}, Ue = {
|
|
13
17
|
key: 0,
|
|
14
18
|
class: "w-10 flex-none p-3 border-r border-border"
|
|
15
|
-
},
|
|
19
|
+
}, Fe = {
|
|
16
20
|
key: 1,
|
|
17
21
|
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
18
|
-
},
|
|
22
|
+
}, je = {
|
|
19
23
|
key: 2,
|
|
20
24
|
class: "w-10 flex-none p-3"
|
|
21
|
-
},
|
|
25
|
+
}, Te = {
|
|
22
26
|
key: 1,
|
|
23
27
|
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
24
|
-
},
|
|
28
|
+
}, Ae = {
|
|
25
29
|
key: 2,
|
|
26
30
|
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
27
|
-
},
|
|
31
|
+
}, Be = {
|
|
28
32
|
key: 1,
|
|
29
33
|
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
30
|
-
},
|
|
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({
|
|
31
59
|
__name: "CustomFields",
|
|
32
60
|
props: {
|
|
33
61
|
name: {},
|
|
@@ -49,213 +77,389 @@ const ie = { class: "custom-fields-wrapper" }, ce = { class: "flex justify-betwe
|
|
|
49
77
|
showRowNumbers: { type: Boolean, default: !1 },
|
|
50
78
|
values: {},
|
|
51
79
|
errors: { default: () => ({}) },
|
|
52
|
-
isUpdate: { type: Boolean, default: !1 }
|
|
80
|
+
isUpdate: { type: Boolean, default: !1 },
|
|
81
|
+
layout: { default: "table" },
|
|
82
|
+
accordionTitleKey: { default: void 0 }
|
|
53
83
|
},
|
|
54
84
|
emits: ["update:modelValue", "change"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
57
|
-
const e =
|
|
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");
|
|
58
88
|
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
59
|
-
}),
|
|
60
|
-
const e =
|
|
89
|
+
}), J = p(() => {
|
|
90
|
+
const e = V("vlite.customFields.emptyDescription");
|
|
61
91
|
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
62
|
-
}),
|
|
63
|
-
|
|
64
|
-
() =>
|
|
92
|
+
}), u = ge([]), P = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
93
|
+
re(
|
|
94
|
+
() => a.modelValue,
|
|
65
95
|
(e) => {
|
|
66
|
-
Array.isArray(e) ?
|
|
67
|
-
const
|
|
96
|
+
Array.isArray(e) ? u.value = e.map((r, o) => {
|
|
97
|
+
const t = u.value[o];
|
|
68
98
|
return {
|
|
69
|
-
...
|
|
70
|
-
_id:
|
|
99
|
+
...r,
|
|
100
|
+
_id: t?._id || P()
|
|
71
101
|
};
|
|
72
|
-
}) :
|
|
102
|
+
}) : u.value = [];
|
|
73
103
|
},
|
|
74
104
|
{ immediate: !0, deep: !0 }
|
|
75
105
|
);
|
|
76
|
-
const
|
|
106
|
+
const me = () => {
|
|
77
107
|
const e = {};
|
|
78
|
-
for (const
|
|
79
|
-
const o = typeof
|
|
80
|
-
let
|
|
81
|
-
(
|
|
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;
|
|
82
112
|
}
|
|
83
|
-
return { ...e, _id:
|
|
84
|
-
},
|
|
85
|
-
if (
|
|
86
|
-
const e = [...
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
...
|
|
96
|
-
[
|
|
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
|
|
97
127
|
};
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
128
|
+
const U = a.schema.find((c) => c.name === r);
|
|
129
|
+
if (U && U.updateValues)
|
|
100
130
|
try {
|
|
101
|
-
const c =
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
const
|
|
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({
|
|
105
135
|
value: o.value,
|
|
106
136
|
values: c,
|
|
107
137
|
// strictly local row scope
|
|
108
|
-
globalValues:
|
|
138
|
+
globalValues: y,
|
|
109
139
|
// strictly global root scope
|
|
110
140
|
data: o.data,
|
|
111
|
-
isUpdate:
|
|
141
|
+
isUpdate: a.isUpdate
|
|
112
142
|
});
|
|
113
|
-
|
|
143
|
+
h && typeof h == "object" && (t[e] = { ...t[e], ...h });
|
|
114
144
|
} catch (c) {
|
|
115
|
-
console.error(`[CustomFields] Error in updateValues for ${
|
|
145
|
+
console.error(`[CustomFields] Error in updateValues for ${r}:`, c);
|
|
116
146
|
}
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
let
|
|
125
|
-
return
|
|
126
|
-
values:
|
|
127
|
-
globalValues:
|
|
128
|
-
isUpdate:
|
|
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
|
|
129
159
|
};
|
|
130
|
-
},
|
|
131
|
-
if (!
|
|
132
|
-
const
|
|
133
|
-
return Object.keys(
|
|
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]);
|
|
134
173
|
};
|
|
135
|
-
return (
|
|
136
|
-
|
|
137
|
-
|
|
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, {
|
|
138
190
|
key: 0,
|
|
139
191
|
class: "text-sm font-medium text-foreground"
|
|
140
192
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
193
|
+
default: R(() => [
|
|
194
|
+
K(v(H.value), 1)
|
|
143
195
|
]),
|
|
144
196
|
_: 1
|
|
145
|
-
})) :
|
|
146
|
-
|
|
197
|
+
})) : d("", !0),
|
|
198
|
+
s.readonly ? d("", !0) : (n(), k(L, {
|
|
147
199
|
key: 1,
|
|
148
200
|
type: "button",
|
|
149
201
|
variant: "outline",
|
|
150
202
|
size: "xs",
|
|
151
203
|
rounded: "full",
|
|
204
|
+
"as-icon": "",
|
|
152
205
|
icon: "lucide:plus",
|
|
153
|
-
disabled: !
|
|
154
|
-
onClick:
|
|
206
|
+
disabled: !be.value,
|
|
207
|
+
onClick: ve
|
|
155
208
|
}, null, 8, ["disabled"]))
|
|
156
209
|
]),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
(n(!0),
|
|
162
|
-
key:
|
|
163
|
-
class:
|
|
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 }])
|
|
164
217
|
}, v(o), 3))), 128)),
|
|
165
|
-
|
|
166
|
-
])) :
|
|
167
|
-
|
|
168
|
-
"model-value":
|
|
169
|
-
"onUpdate:modelValue":
|
|
170
|
-
disabled: !
|
|
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,
|
|
171
224
|
animation: 150,
|
|
172
225
|
handle: ".drag-handle",
|
|
173
226
|
"ghost-class": "opacity-50",
|
|
174
227
|
class: "divide-y divide-border"
|
|
175
228
|
}, {
|
|
176
|
-
default:
|
|
177
|
-
(n(!0),
|
|
178
|
-
const
|
|
229
|
+
default: R(() => [
|
|
230
|
+
(n(!0), i(x, null, j(u.value, (o, t, U, c) => {
|
|
231
|
+
const y = [
|
|
179
232
|
o,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
233
|
+
s.disabled,
|
|
234
|
+
s.readonly,
|
|
235
|
+
s.isUpdate,
|
|
236
|
+
s.showRowNumbers,
|
|
237
|
+
A.value,
|
|
238
|
+
s.draggable,
|
|
239
|
+
t,
|
|
240
|
+
te(t)
|
|
188
241
|
];
|
|
189
|
-
if (c && c.key === o._id &&
|
|
190
|
-
const
|
|
242
|
+
if (c && c.key === o._id && ne(c, y)) return c;
|
|
243
|
+
const h = (n(), i("div", {
|
|
191
244
|
key: o._id,
|
|
192
245
|
class: "flex group bg-white transition-colors"
|
|
193
246
|
}, [
|
|
194
|
-
|
|
247
|
+
s.draggable && !s.disabled && !s.readonly ? (n(), i("div", {
|
|
195
248
|
key: 0,
|
|
196
|
-
class:
|
|
249
|
+
class: $([
|
|
197
250
|
"w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
198
|
-
|
|
251
|
+
s.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
199
252
|
])
|
|
200
253
|
}, [
|
|
201
|
-
|
|
254
|
+
g(z, {
|
|
202
255
|
icon: "lucide:grip-vertical",
|
|
203
256
|
class: "w-4 h-4"
|
|
204
257
|
})
|
|
205
|
-
], 2)) :
|
|
206
|
-
|
|
207
|
-
(n(!0),
|
|
208
|
-
key:
|
|
209
|
-
class:
|
|
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 }])
|
|
210
263
|
}, [
|
|
211
|
-
|
|
264
|
+
ee(t, l) ? (n(), k(ue, {
|
|
212
265
|
key: 0,
|
|
213
266
|
field: {
|
|
214
|
-
...
|
|
267
|
+
...l,
|
|
215
268
|
props: {
|
|
216
|
-
...
|
|
217
|
-
...
|
|
269
|
+
...m(l, t) === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
270
|
+
...l.props || {},
|
|
271
|
+
...m(l, t) === "file" || m(l, t) === "fileUploader" ? { variant: "input" } : {}
|
|
218
272
|
},
|
|
219
273
|
label: void 0
|
|
220
274
|
},
|
|
221
|
-
value:
|
|
222
|
-
values:
|
|
223
|
-
errors:
|
|
224
|
-
error:
|
|
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}`] : "",
|
|
225
279
|
variant: "transparent",
|
|
226
280
|
size: "sm",
|
|
227
281
|
rounded: "none",
|
|
228
|
-
disabled:
|
|
229
|
-
readonly:
|
|
230
|
-
isUpdate:
|
|
282
|
+
disabled: _(t, l),
|
|
283
|
+
readonly: I(t, l),
|
|
284
|
+
isUpdate: s.isUpdate,
|
|
231
285
|
class: "w-full h-full min-h-[40px]",
|
|
232
|
-
onChange: (
|
|
233
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) :
|
|
286
|
+
onChange: (S) => X(t, l.name, S)
|
|
287
|
+
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : d("", !0)
|
|
234
288
|
], 2))), 128)),
|
|
235
|
-
|
|
236
|
-
|
|
289
|
+
A.value ? (n(), i("div", Ae, [
|
|
290
|
+
g(L, {
|
|
237
291
|
type: "button",
|
|
238
292
|
variant: "ghost",
|
|
239
293
|
size: "xs",
|
|
240
294
|
icon: "lucide:trash-2",
|
|
241
|
-
disabled:
|
|
242
|
-
onClick: (
|
|
295
|
+
disabled: s.disabled || s.readonly,
|
|
296
|
+
onClick: (l) => Q(t)
|
|
243
297
|
}, null, 8, ["disabled", "onClick"])
|
|
244
|
-
])) :
|
|
298
|
+
])) : d("", !0)
|
|
245
299
|
]));
|
|
246
|
-
return
|
|
247
|
-
},
|
|
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))
|
|
248
452
|
]),
|
|
249
453
|
_: 1
|
|
250
454
|
}, 8, ["model-value", "disabled"]),
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
])) :
|
|
255
|
-
])
|
|
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)
|
|
256
460
|
]));
|
|
257
461
|
}
|
|
258
462
|
});
|
|
259
463
|
export {
|
|
260
|
-
|
|
464
|
+
rt as default
|
|
261
465
|
};
|
|
@@ -266,7 +266,7 @@ const Be = /* @__PURE__ */ E({
|
|
|
266
266
|
maxFiles: e.field.maxFiles || e.field.props?.maxFiles,
|
|
267
267
|
fileTypes: e.field.props?.accept ? e.field.props.accept.split(",") : [],
|
|
268
268
|
returnFormat: "base64",
|
|
269
|
-
variant: a === "file" ? "input" : "dropzone",
|
|
269
|
+
variant: e.field.props?.variant ?? (a === "file" ? "input" : "dropzone"),
|
|
270
270
|
placeholder: o,
|
|
271
271
|
size: e.size,
|
|
272
272
|
rounded: e.rounded,
|