vlite3 1.4.4 → 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/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 +225 -249
- 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/Chat/ChatInterface.vue.js +1 -1
- package/components/Comment/CommentEditor.vue.js +1 -1
- package/components/Dropdown/Dropdown.vue.d.ts +1 -0
- package/components/Dropdown/Dropdown.vue.js +31 -29
- 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 +3 -3
- 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} +8 -5
- 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/Form/types.d.ts +3 -0
- package/components/IconPicker.vue.d.ts +2 -2
- 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 +4 -3
- 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/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
- package/components/index.d.ts +2 -1
- package/core/config.d.ts +6 -6
- package/index.d.ts +1 -0
- package/index.js +328 -307
- package/package.json +1 -1
- package/style.css +1 -1
- package/components/FilePicker/FilePicker.vue.js +0 -361
- package/components/FilePicker/FilePicker.vue2.js +0 -4
- package/components/Form/CustomFields.vue.js +0 -7
- package/components/Form/CustomFields.vue2.js +0 -261
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { defineComponent as I, computed as m, shallowRef as ee, watch as te, openBlock as n, createElementBlock as d, createElementVNode as p, createBlock as k, withCtx as N, createTextVNode as ae, toDisplayString as v, createCommentVNode as i, Fragment as V, renderList as C, normalizeClass as F, createVNode as $, unref as le, isMemoSame as re } from "vue";
|
|
2
|
-
import { VueDraggable as se } from "vue-draggable-plus";
|
|
3
|
-
import oe from "./FormField.vue.js";
|
|
4
|
-
import E from "../Button.vue.js";
|
|
5
|
-
import ne from "../Label.vue.js";
|
|
6
|
-
import de from "../Icon.vue.js";
|
|
7
|
-
import { $t as w } from "../../utils/i18n.js";
|
|
8
|
-
import { setNestedValue as T, resolveFieldType as ue, evaluateConditional as U } from "./utils/form.utils.js";
|
|
9
|
-
const ie = { class: "custom-fields-wrapper" }, ce = { class: "flex justify-between items-center mb-2" }, me = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, be = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
12
|
-
}, fe = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "w-10 flex-none p-3 border-r border-border"
|
|
15
|
-
}, ve = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
18
|
-
}, ye = {
|
|
19
|
-
key: 2,
|
|
20
|
-
class: "w-10 flex-none p-3"
|
|
21
|
-
}, ge = {
|
|
22
|
-
key: 1,
|
|
23
|
-
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
24
|
-
}, he = {
|
|
25
|
-
key: 2,
|
|
26
|
-
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
27
|
-
}, pe = {
|
|
28
|
-
key: 1,
|
|
29
|
-
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
30
|
-
}, we = { class: "text-sm font-medium text-foreground" }, xe = { class: "text-xs text-muted-foreground mt-1" }, je = /* @__PURE__ */ I({
|
|
31
|
-
__name: "CustomFields",
|
|
32
|
-
props: {
|
|
33
|
-
name: {},
|
|
34
|
-
modelValue: { default: () => [] },
|
|
35
|
-
schema: {},
|
|
36
|
-
headers: { default: () => [] },
|
|
37
|
-
variant: { default: "outline" },
|
|
38
|
-
size: { default: "md" },
|
|
39
|
-
rounded: { default: "md" },
|
|
40
|
-
disabled: { type: Boolean, default: !1 },
|
|
41
|
-
readonly: { type: Boolean, default: !1 },
|
|
42
|
-
draggable: { type: Boolean, default: !1 },
|
|
43
|
-
minRows: { default: 0 },
|
|
44
|
-
maxRows: {},
|
|
45
|
-
addButtonText: { default: "Add Row" },
|
|
46
|
-
textI18n: {},
|
|
47
|
-
label: {},
|
|
48
|
-
labelI18n: {},
|
|
49
|
-
showRowNumbers: { type: Boolean, default: !1 },
|
|
50
|
-
values: {},
|
|
51
|
-
errors: { default: () => ({}) },
|
|
52
|
-
isUpdate: { type: Boolean, default: !1 }
|
|
53
|
-
},
|
|
54
|
-
emits: ["update:modelValue", "change"],
|
|
55
|
-
setup(r, { emit: S }) {
|
|
56
|
-
const t = r, B = S, j = m(() => t.labelI18n ? w(t.labelI18n) : t.label), z = m(() => {
|
|
57
|
-
const e = w("vlite.customFields.emptyTitle");
|
|
58
|
-
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
59
|
-
}), A = m(() => {
|
|
60
|
-
const e = w("vlite.customFields.emptyDescription");
|
|
61
|
-
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
62
|
-
}), s = ee([]), D = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
63
|
-
te(
|
|
64
|
-
() => t.modelValue,
|
|
65
|
-
(e) => {
|
|
66
|
-
Array.isArray(e) ? s.value = e.map((a, o) => {
|
|
67
|
-
const l = s.value[o];
|
|
68
|
-
return {
|
|
69
|
-
...a,
|
|
70
|
-
_id: l?._id || D()
|
|
71
|
-
};
|
|
72
|
-
}) : s.value = [];
|
|
73
|
-
},
|
|
74
|
-
{ immediate: !0, deep: !0 }
|
|
75
|
-
);
|
|
76
|
-
const H = () => {
|
|
77
|
-
const e = {};
|
|
78
|
-
for (const a of t.schema) {
|
|
79
|
-
const o = typeof a.value == "function" ? a.value() : a.value;
|
|
80
|
-
let l = null;
|
|
81
|
-
(a.props?.multiple || a.type === "multiSelect" || a.type === "tags") && (l = []), e[a.name] = o ?? l;
|
|
82
|
-
}
|
|
83
|
-
return { ...e, _id: D() };
|
|
84
|
-
}, L = () => {
|
|
85
|
-
if (t.disabled || t.readonly || t.maxRows && s.value.length >= t.maxRows) return;
|
|
86
|
-
const e = [...s.value, H()];
|
|
87
|
-
s.value = e, y(e);
|
|
88
|
-
}, M = (e) => {
|
|
89
|
-
if (t.disabled || t.readonly || s.value.length <= t.minRows) return;
|
|
90
|
-
const a = [...s.value];
|
|
91
|
-
a.splice(e, 1), s.value = a, y(a);
|
|
92
|
-
}, G = async (e, a, o) => {
|
|
93
|
-
const l = [...s.value];
|
|
94
|
-
l[e] = {
|
|
95
|
-
...l[e],
|
|
96
|
-
[a]: o.value
|
|
97
|
-
};
|
|
98
|
-
const h = t.schema.find((c) => c.name === a);
|
|
99
|
-
if (h && h.updateValues)
|
|
100
|
-
try {
|
|
101
|
-
const c = l[e];
|
|
102
|
-
let b = { ...t.values || {} };
|
|
103
|
-
t.name && (b = T(b, t.name, l));
|
|
104
|
-
const f = await h.updateValues({
|
|
105
|
-
value: o.value,
|
|
106
|
-
values: c,
|
|
107
|
-
// strictly local row scope
|
|
108
|
-
globalValues: b,
|
|
109
|
-
// strictly global root scope
|
|
110
|
-
data: o.data,
|
|
111
|
-
isUpdate: t.isUpdate
|
|
112
|
-
});
|
|
113
|
-
f && typeof f == "object" && (l[e] = { ...l[e], ...f });
|
|
114
|
-
} catch (c) {
|
|
115
|
-
console.error(`[CustomFields] Error in updateValues for ${a}:`, c);
|
|
116
|
-
}
|
|
117
|
-
s.value = l, y(l);
|
|
118
|
-
}, O = (e) => {
|
|
119
|
-
s.value = e, y(e);
|
|
120
|
-
}, y = (e) => {
|
|
121
|
-
const a = e.map(({ _id: o, ...l }) => l);
|
|
122
|
-
B("update:modelValue", a), B("change", a);
|
|
123
|
-
}, W = (e, a) => s.value[e]?.[a], q = m(() => !(t.disabled || t.readonly || t.maxRows && s.value.length >= t.maxRows)), x = m(() => t.disabled || t.readonly ? !1 : s.value.length > t.minRows), R = m(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? w(e.labelI18n) : e.label || e.name)), J = m(() => t.schema.slice(0, R.value.length)), g = (e) => {
|
|
124
|
-
let a = { ...t.values || {} };
|
|
125
|
-
return t.name && (a = T(a, t.name, s.value)), {
|
|
126
|
-
values: s.value[e] || {},
|
|
127
|
-
globalValues: a,
|
|
128
|
-
isUpdate: t.isUpdate
|
|
129
|
-
};
|
|
130
|
-
}, K = (e, a) => ue(e, g(a)), P = (e, a) => t.disabled ? !0 : U(a.disabled, g(e)), Q = (e, a) => t.readonly ? !0 : U(a.readonly, g(e)), X = (e, a) => a.when ? U(a.when, g(e)) : !0, Y = (e) => {
|
|
131
|
-
if (!t.errors || !t.name) return "";
|
|
132
|
-
const a = `${t.name}.${e}.`;
|
|
133
|
-
return Object.keys(t.errors).filter((o) => o.startsWith(a)).map((o) => t.errors[o]).join(",");
|
|
134
|
-
};
|
|
135
|
-
return (e, a) => (n(), d("div", ie, [
|
|
136
|
-
p("div", ce, [
|
|
137
|
-
j.value ? (n(), k(ne, {
|
|
138
|
-
key: 0,
|
|
139
|
-
class: "text-sm font-medium text-foreground"
|
|
140
|
-
}, {
|
|
141
|
-
default: N(() => [
|
|
142
|
-
ae(v(j.value), 1)
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
})) : i("", !0),
|
|
146
|
-
r.readonly ? i("", !0) : (n(), k(E, {
|
|
147
|
-
key: 1,
|
|
148
|
-
type: "button",
|
|
149
|
-
variant: "outline",
|
|
150
|
-
size: "xs",
|
|
151
|
-
rounded: "full",
|
|
152
|
-
icon: "lucide:plus",
|
|
153
|
-
disabled: !q.value,
|
|
154
|
-
onClick: L
|
|
155
|
-
}, null, 8, ["disabled"]))
|
|
156
|
-
]),
|
|
157
|
-
p("div", me, [
|
|
158
|
-
R.value.length > 1 ? (n(), d("div", be, [
|
|
159
|
-
r.draggable && !r.disabled && !r.readonly ? (n(), d("div", fe)) : i("", !0),
|
|
160
|
-
r.showRowNumbers ? (n(), d("div", ve, " # ")) : i("", !0),
|
|
161
|
-
(n(!0), d(V, null, C(R.value, (o, l) => (n(), d("div", {
|
|
162
|
-
key: l,
|
|
163
|
-
class: F(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": l > 0 }])
|
|
164
|
-
}, v(o), 3))), 128)),
|
|
165
|
-
x.value ? (n(), d("div", ye)) : i("", !0)
|
|
166
|
-
])) : i("", !0),
|
|
167
|
-
$(le(se), {
|
|
168
|
-
"model-value": s.value,
|
|
169
|
-
"onUpdate:modelValue": O,
|
|
170
|
-
disabled: !r.draggable || r.disabled || r.readonly,
|
|
171
|
-
animation: 150,
|
|
172
|
-
handle: ".drag-handle",
|
|
173
|
-
"ghost-class": "opacity-50",
|
|
174
|
-
class: "divide-y divide-border"
|
|
175
|
-
}, {
|
|
176
|
-
default: N(() => [
|
|
177
|
-
(n(!0), d(V, null, C(s.value, (o, l, h, c) => {
|
|
178
|
-
const b = [
|
|
179
|
-
o,
|
|
180
|
-
r.disabled,
|
|
181
|
-
r.readonly,
|
|
182
|
-
r.isUpdate,
|
|
183
|
-
r.showRowNumbers,
|
|
184
|
-
x.value,
|
|
185
|
-
r.draggable,
|
|
186
|
-
l,
|
|
187
|
-
Y(l)
|
|
188
|
-
];
|
|
189
|
-
if (c && c.key === o._id && re(c, b)) return c;
|
|
190
|
-
const f = (n(), d("div", {
|
|
191
|
-
key: o._id,
|
|
192
|
-
class: "flex group bg-white transition-colors"
|
|
193
|
-
}, [
|
|
194
|
-
r.draggable && !r.disabled && !r.readonly ? (n(), d("div", {
|
|
195
|
-
key: 0,
|
|
196
|
-
class: F([
|
|
197
|
-
"w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
198
|
-
r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
199
|
-
])
|
|
200
|
-
}, [
|
|
201
|
-
$(de, {
|
|
202
|
-
icon: "lucide:grip-vertical",
|
|
203
|
-
class: "w-4 h-4"
|
|
204
|
-
})
|
|
205
|
-
], 2)) : i("", !0),
|
|
206
|
-
r.showRowNumbers ? (n(), d("div", ge, v(l + 1), 1)) : i("", !0),
|
|
207
|
-
(n(!0), d(V, null, C(J.value, (u, Z) => (n(), d("div", {
|
|
208
|
-
key: u.name,
|
|
209
|
-
class: F(["flex-1 min-w-0 relative", { "border-l border-border": Z > 0 }])
|
|
210
|
-
}, [
|
|
211
|
-
X(l, u) ? (n(), k(oe, {
|
|
212
|
-
key: 0,
|
|
213
|
-
field: {
|
|
214
|
-
...u,
|
|
215
|
-
props: {
|
|
216
|
-
...K(u, l) === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
217
|
-
...u.props || {}
|
|
218
|
-
},
|
|
219
|
-
label: void 0
|
|
220
|
-
},
|
|
221
|
-
value: W(l, u.name),
|
|
222
|
-
values: s.value[l] || {},
|
|
223
|
-
errors: r.errors,
|
|
224
|
-
error: r.name && r.errors ? r.errors[`${r.name}.${l}.${u.name}`] : "",
|
|
225
|
-
variant: "transparent",
|
|
226
|
-
size: "sm",
|
|
227
|
-
rounded: "none",
|
|
228
|
-
disabled: P(l, u),
|
|
229
|
-
readonly: Q(l, u),
|
|
230
|
-
isUpdate: r.isUpdate,
|
|
231
|
-
class: "w-full h-full min-h-[40px]",
|
|
232
|
-
onChange: (_) => G(l, u.name, _)
|
|
233
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : i("", !0)
|
|
234
|
-
], 2))), 128)),
|
|
235
|
-
x.value ? (n(), d("div", he, [
|
|
236
|
-
$(E, {
|
|
237
|
-
type: "button",
|
|
238
|
-
variant: "ghost",
|
|
239
|
-
size: "xs",
|
|
240
|
-
icon: "lucide:trash-2",
|
|
241
|
-
disabled: r.disabled || r.readonly,
|
|
242
|
-
onClick: (u) => M(l)
|
|
243
|
-
}, null, 8, ["disabled", "onClick"])
|
|
244
|
-
])) : i("", !0)
|
|
245
|
-
]));
|
|
246
|
-
return f.memo = b, f;
|
|
247
|
-
}, a, 0), 128))
|
|
248
|
-
]),
|
|
249
|
-
_: 1
|
|
250
|
-
}, 8, ["model-value", "disabled"]),
|
|
251
|
-
s.value.length === 0 ? (n(), d("div", pe, [
|
|
252
|
-
p("p", we, v(z.value), 1),
|
|
253
|
-
p("p", xe, v(A.value), 1)
|
|
254
|
-
])) : i("", !0)
|
|
255
|
-
])
|
|
256
|
-
]));
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
export {
|
|
260
|
-
je as default
|
|
261
|
-
};
|