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,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as Me, ref as h, watch as j, computed as s, provide as Ce, onMounted as De, openBlock as I, createElementBlock as C, normalizeClass as Ae, createElementVNode as m, renderSlot as ke, toDisplayString as b, createBlock as G, withCtx as P, createTextVNode as H, createCommentVNode as E, createVNode as T, withDirectives as Pe, withKeys as K, vModelText as Ee, unref as z, Transition as Re } from "vue";
|
|
2
|
+
import _e from "./CategoryNode.vue.js";
|
|
3
|
+
import Ne from "../Modal.vue.js";
|
|
4
|
+
import Ve from "../Form/Form.vue.js";
|
|
5
5
|
import Q from "../Icon.vue.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import R from "../Button.vue.js";
|
|
8
|
-
import { $t as
|
|
8
|
+
import { $t as a } from "../../utils/i18n.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import "vue-draggable-plus";
|
|
11
11
|
/* empty css */
|
|
@@ -18,8 +18,9 @@ import "v-datepicker-lite/style.css";
|
|
|
18
18
|
import "@jaames/iro";
|
|
19
19
|
import "@vueuse/core";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import
|
|
22
|
-
/* empty css
|
|
21
|
+
import qe from "../IconPicker.vue.js";
|
|
22
|
+
/* empty css */
|
|
23
|
+
/* empty css */
|
|
23
24
|
/* empty css */
|
|
24
25
|
/* empty css */
|
|
25
26
|
/* empty css */
|
|
@@ -27,7 +28,8 @@ import "../../core/config.js";
|
|
|
27
28
|
/* empty css */
|
|
28
29
|
/* empty css */
|
|
29
30
|
import { getUniqueId as _ } from "../../utils/functions.js";
|
|
30
|
-
|
|
31
|
+
import { buildTreeFromRaw as ze, ensureMeta as w } from "./utils.js";
|
|
32
|
+
const Ue = { class: "flex items-center justify-between mb-6" }, Oe = { class: "text-lg font-bold text-foreground" }, $e = { class: "text-sm text-muted-foreground mt-0.5" }, Fe = {
|
|
31
33
|
key: 0,
|
|
32
34
|
class: "flex flex-col items-center justify-center py-10 px-4 text-center border border-dashed border-border rounded-xl bg-background"
|
|
33
35
|
}, Je = { class: "w-12 h-12 bg-muted rounded-full flex items-center justify-center mb-4" }, Be = { class: "text-base font-medium text-foreground" }, je = { class: "text-sm text-muted-foreground mt-1 max-w-sm" }, Ge = {
|
|
@@ -43,7 +45,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
43
45
|
}, Le = {
|
|
44
46
|
key: 0,
|
|
45
47
|
class: "absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-background/60 backdrop-blur-[1px] transition-opacity"
|
|
46
|
-
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" },
|
|
48
|
+
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" }, At = /* @__PURE__ */ Me({
|
|
47
49
|
__name: "CategoryManager",
|
|
48
50
|
props: {
|
|
49
51
|
modelValue: { default: () => [] },
|
|
@@ -91,379 +93,353 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
91
93
|
cancelTooltipI18n: {}
|
|
92
94
|
},
|
|
93
95
|
emits: ["update:modelValue", "onAdd", "onEdit", "onDelete", "onReorder"],
|
|
94
|
-
setup(
|
|
95
|
-
const e =
|
|
96
|
-
o
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, X = (o) => {
|
|
100
|
-
const t = /* @__PURE__ */ new Map(), a = [];
|
|
101
|
-
o.forEach((r) => {
|
|
102
|
-
t.set(r.id, {
|
|
103
|
-
...r,
|
|
104
|
-
id: r.id,
|
|
105
|
-
title: r.name || r.title || "Untitled",
|
|
106
|
-
icon: r.icon,
|
|
107
|
-
parentId: r.parentId || null,
|
|
108
|
-
position: r.position ?? 0,
|
|
109
|
-
children: []
|
|
110
|
-
});
|
|
111
|
-
}), o.forEach((r) => {
|
|
112
|
-
const n = t.get(r.id);
|
|
113
|
-
n && (r.parentId && t.has(r.parentId) ? t.get(r.parentId).children.push(n) : a.push(n));
|
|
114
|
-
});
|
|
115
|
-
const i = (r) => {
|
|
116
|
-
r.sort((n, u) => (n.position ?? 0) - (u.position ?? 0)), r.forEach((n) => {
|
|
117
|
-
n.children && i(n.children);
|
|
118
|
-
});
|
|
96
|
+
setup(M, { expose: L, emit: W }) {
|
|
97
|
+
const e = M, v = W, d = h([]), g = h(/* @__PURE__ */ new Set()), f = (t) => JSON.parse(JSON.stringify(t)), U = (t) => {
|
|
98
|
+
const o = /* @__PURE__ */ new Set(), l = (n) => {
|
|
99
|
+
for (const i of n)
|
|
100
|
+
o.add(i.id), i.children && l(i.children);
|
|
119
101
|
};
|
|
120
|
-
return
|
|
121
|
-
}, z = (o) => {
|
|
122
|
-
const t = /* @__PURE__ */ new Set(), a = (i) => {
|
|
123
|
-
for (const r of i)
|
|
124
|
-
t.add(r.id), r.children && a(r.children);
|
|
125
|
-
};
|
|
126
|
-
return a(o), t;
|
|
102
|
+
return l(t), o;
|
|
127
103
|
};
|
|
128
104
|
j(
|
|
129
105
|
() => e.rawData,
|
|
130
|
-
(
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
d.value = [],
|
|
106
|
+
(t) => {
|
|
107
|
+
if (t) {
|
|
108
|
+
if (t.length === 0) {
|
|
109
|
+
d.value = [], g.value = /* @__PURE__ */ new Set(), v("update:modelValue", []);
|
|
134
110
|
return;
|
|
135
111
|
}
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
[...
|
|
112
|
+
const o = ze(t);
|
|
113
|
+
w(o);
|
|
114
|
+
const l = JSON.stringify(o), n = JSON.stringify(d.value);
|
|
115
|
+
if (l !== n) {
|
|
116
|
+
const i = U(o), r = new Set(
|
|
117
|
+
[...g.value].filter((p) => i.has(p))
|
|
142
118
|
);
|
|
143
|
-
|
|
144
|
-
const u =
|
|
145
|
-
d.value = u,
|
|
119
|
+
g.value = r;
|
|
120
|
+
const u = f(o);
|
|
121
|
+
d.value = u, v("update:modelValue", u);
|
|
146
122
|
}
|
|
147
123
|
}
|
|
148
124
|
},
|
|
149
125
|
{ immediate: !0, deep: !0 }
|
|
150
126
|
), j(
|
|
151
127
|
() => e.modelValue,
|
|
152
|
-
(
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
128
|
+
(t) => {
|
|
129
|
+
const o = JSON.stringify(t), l = JSON.stringify(d.value);
|
|
130
|
+
if (o !== l && t.length > 0) {
|
|
131
|
+
const n = f(t);
|
|
132
|
+
w(n), d.value = n;
|
|
157
133
|
}
|
|
158
134
|
},
|
|
159
135
|
{ immediate: !0, deep: !0 }
|
|
160
136
|
);
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
}, y =
|
|
137
|
+
const S = () => {
|
|
138
|
+
w(d.value);
|
|
139
|
+
const t = f(d.value);
|
|
140
|
+
v("update:modelValue", t);
|
|
141
|
+
}, X = (t) => {
|
|
142
|
+
const o = new Set(g.value);
|
|
143
|
+
o.has(t) ? o.delete(t) : o.add(t), g.value = o;
|
|
144
|
+
}, y = h({
|
|
169
145
|
mode: null,
|
|
170
146
|
targetId: null,
|
|
171
147
|
title: "",
|
|
172
148
|
icon: "lucide:folder"
|
|
173
|
-
}), N = (
|
|
149
|
+
}), N = (t, o) => {
|
|
174
150
|
y.value = {
|
|
175
|
-
mode:
|
|
176
|
-
targetId:
|
|
151
|
+
mode: t,
|
|
152
|
+
targetId: t === "add-child" && o || null,
|
|
177
153
|
title: "",
|
|
178
154
|
icon: "lucide:folder"
|
|
179
|
-
},
|
|
155
|
+
}, t === "add-child" && o && g.value.add(o);
|
|
180
156
|
}, D = () => {
|
|
181
157
|
y.value = { mode: null, targetId: null, title: "", icon: "lucide:folder" };
|
|
182
158
|
}, V = () => {
|
|
183
|
-
const { mode:
|
|
184
|
-
if (!
|
|
185
|
-
const
|
|
186
|
-
let
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
else if (
|
|
190
|
-
|
|
191
|
-
const u = (
|
|
192
|
-
for (const c of
|
|
193
|
-
if (c.id ===
|
|
194
|
-
return c.children || (c.children = []), c.children.push(
|
|
159
|
+
const { mode: t, targetId: o, title: l, icon: n } = y.value;
|
|
160
|
+
if (!l.trim()) return;
|
|
161
|
+
const i = [...d.value];
|
|
162
|
+
let r = null;
|
|
163
|
+
if (t === "add-root")
|
|
164
|
+
r = { id: _(), title: l, icon: n, children: [] }, i.push(r);
|
|
165
|
+
else if (t === "add-child") {
|
|
166
|
+
r = { id: _(), title: l, icon: n, children: [] };
|
|
167
|
+
const u = (p) => {
|
|
168
|
+
for (const c of p) {
|
|
169
|
+
if (c.id === o)
|
|
170
|
+
return c.children || (c.children = []), c.children.push(r), !0;
|
|
195
171
|
if (c.children && u(c.children)) return !0;
|
|
196
172
|
}
|
|
197
173
|
return !1;
|
|
198
174
|
};
|
|
199
|
-
u(
|
|
175
|
+
u(i);
|
|
200
176
|
}
|
|
201
|
-
|
|
202
|
-
}, A =
|
|
177
|
+
r && (w(i), v("onAdd", f(r))), d.value = i, S(), D();
|
|
178
|
+
}, A = h(!1), x = h("add"), q = h(null), O = h(null), $ = h({}), Y = [
|
|
203
179
|
{ name: "icon", label: "Category Icon", type: "iconPicker" },
|
|
204
180
|
{ name: "title", label: "Title", type: "text", required: !0 },
|
|
205
181
|
{ name: "description", label: "Description", type: "textarea", props: { rows: 3 } }
|
|
206
|
-
],
|
|
207
|
-
x.value =
|
|
208
|
-
},
|
|
209
|
-
const
|
|
210
|
-
let
|
|
182
|
+
], Z = s(() => e.formSchema || Y), ee = s(() => x.value === "add" ? e.modalTitleAddI18n ? a(e.modalTitleAddI18n) : e.modalTitleAdd ? e.modalTitleAdd : a("vlite.categoryManager.modalTitleAdd") !== "vlite.categoryManager.modalTitleAdd" ? a("vlite.categoryManager.modalTitleAdd") : "Add Category" : x.value === "add-child" ? e.modalTitleAddChildI18n ? a(e.modalTitleAddChildI18n) : e.modalTitleAddChild ? e.modalTitleAddChild : a("vlite.categoryManager.modalTitleAddChild") !== "vlite.categoryManager.modalTitleAddChild" ? a("vlite.categoryManager.modalTitleAddChild") : "Add Sub-category" : e.modalTitleEditI18n ? a(e.modalTitleEditI18n) : e.modalTitleEdit ? e.modalTitleEdit : a("vlite.categoryManager.modalTitleEdit") !== "vlite.categoryManager.modalTitleEdit" ? a("vlite.categoryManager.modalTitleEdit") : "Edit Category"), te = (t, o, l) => {
|
|
183
|
+
x.value = t, q.value = o || null, O.value = l || null, $.value = o ? f(o) : {}, A.value = !0;
|
|
184
|
+
}, oe = async (t) => {
|
|
185
|
+
const o = t?.values || t, l = [...d.value];
|
|
186
|
+
let n = null, i = null;
|
|
211
187
|
if (x.value === "add") {
|
|
212
|
-
const
|
|
213
|
-
|
|
188
|
+
const r = { id: _(), children: [], ...o };
|
|
189
|
+
l.push(r), n = r, i = "onAdd";
|
|
214
190
|
} else if (x.value === "add-child") {
|
|
215
|
-
const
|
|
216
|
-
for (const c of
|
|
191
|
+
const r = { id: _(), children: [], ...o }, u = (p) => {
|
|
192
|
+
for (const c of p) {
|
|
217
193
|
if (c.id === O.value)
|
|
218
|
-
return c.children || (c.children = []), c.children.push(
|
|
194
|
+
return c.children || (c.children = []), c.children.push(r), g.value.add(c.id), !0;
|
|
219
195
|
if (c.children && u(c.children)) return !0;
|
|
220
196
|
}
|
|
221
197
|
return !1;
|
|
222
198
|
};
|
|
223
|
-
u(
|
|
199
|
+
u(l), n = r, i = "onAdd";
|
|
224
200
|
} else if (x.value === "edit" && q.value) {
|
|
225
|
-
const
|
|
226
|
-
const c =
|
|
201
|
+
const r = q.value.id, u = (p) => {
|
|
202
|
+
const c = p.findIndex((k) => k.id === r);
|
|
227
203
|
if (c > -1)
|
|
228
|
-
return
|
|
229
|
-
for (const k of
|
|
204
|
+
return p[c] = { ...p[c], ...o }, n = p[c], !0;
|
|
205
|
+
for (const k of p)
|
|
230
206
|
if (k.children && u(k.children)) return !0;
|
|
231
207
|
return !1;
|
|
232
208
|
};
|
|
233
|
-
u(
|
|
209
|
+
u(l), i = "onEdit";
|
|
234
210
|
}
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
241
|
-
for (const u of
|
|
242
|
-
if (u.children &&
|
|
211
|
+
w(l), n && (i === "onAdd" ? v("onAdd", f(n)) : i === "onEdit" && v("onEdit", f(n))), d.value = l, S(), t && typeof t.setSubmitting == "function" && t.setSubmitting(!1), A.value = !1;
|
|
212
|
+
}, ae = (t) => {
|
|
213
|
+
const o = t.id, l = (i) => {
|
|
214
|
+
const r = i.findIndex((u) => u.id === o);
|
|
215
|
+
if (r > -1)
|
|
216
|
+
return i.splice(r, 1), !0;
|
|
217
|
+
for (const u of i)
|
|
218
|
+
if (u.children && l(u.children)) return !0;
|
|
243
219
|
return !1;
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
d.value = [...
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
const
|
|
258
|
-
for (const
|
|
259
|
-
if (String(
|
|
260
|
-
return
|
|
261
|
-
if (
|
|
220
|
+
}, n = [...d.value];
|
|
221
|
+
l(n), w(n), d.value = n, v("onDelete", f(t)), S();
|
|
222
|
+
}, le = (t) => {
|
|
223
|
+
v("onEdit", f(t)), S();
|
|
224
|
+
}, re = (t) => {
|
|
225
|
+
d.value = [...t], S();
|
|
226
|
+
}, ne = () => {
|
|
227
|
+
S();
|
|
228
|
+
}, ie = (t) => {
|
|
229
|
+
w(d.value);
|
|
230
|
+
const o = f(d.value);
|
|
231
|
+
v("update:modelValue", o);
|
|
232
|
+
let l = null;
|
|
233
|
+
const n = (i) => {
|
|
234
|
+
for (const r of i) {
|
|
235
|
+
if (String(r.id) === String(t))
|
|
236
|
+
return l = r, !0;
|
|
237
|
+
if (r.children && n(r.children)) return !0;
|
|
262
238
|
}
|
|
263
239
|
return !1;
|
|
264
240
|
};
|
|
265
|
-
|
|
266
|
-
id:
|
|
267
|
-
parentId:
|
|
268
|
-
position:
|
|
241
|
+
n(o), l && v("onReorder", {
|
|
242
|
+
id: l.id,
|
|
243
|
+
parentId: l.parentId ?? null,
|
|
244
|
+
position: l.position ?? 0
|
|
269
245
|
});
|
|
270
|
-
},
|
|
246
|
+
}, de = s(() => {
|
|
271
247
|
if (e.emptyTitleI18n) {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
248
|
+
const o = a(e.emptyTitleI18n);
|
|
249
|
+
if (o !== e.emptyTitleI18n) return o;
|
|
274
250
|
}
|
|
275
251
|
if (e.emptyTitle !== "No Categories Found") return e.emptyTitle;
|
|
276
|
-
const
|
|
277
|
-
return
|
|
278
|
-
}),
|
|
252
|
+
const t = a("vlite.categoryManager.emptyTitle");
|
|
253
|
+
return t !== "vlite.categoryManager.emptyTitle" ? t : e.emptyTitle;
|
|
254
|
+
}), ce = s(() => {
|
|
279
255
|
if (e.emptyDescriptionI18n) {
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
256
|
+
const o = a(e.emptyDescriptionI18n);
|
|
257
|
+
if (o !== e.emptyDescriptionI18n) return o;
|
|
282
258
|
}
|
|
283
259
|
if (e.emptyDescription !== "Get started by creating your first category.") return e.emptyDescription;
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
}),
|
|
260
|
+
const t = a("vlite.categoryManager.emptyDescription");
|
|
261
|
+
return t !== "vlite.categoryManager.emptyDescription" ? t : e.emptyDescription;
|
|
262
|
+
}), se = s(() => {
|
|
287
263
|
if (e.headerTitleI18n) {
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
264
|
+
const o = a(e.headerTitleI18n);
|
|
265
|
+
if (o !== e.headerTitleI18n) return o;
|
|
290
266
|
}
|
|
291
267
|
if (e.headerTitle) return e.headerTitle;
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
}),
|
|
268
|
+
const t = a("vlite.categoryManager.headerTitle");
|
|
269
|
+
return t !== "vlite.categoryManager.headerTitle" ? t : "Categories";
|
|
270
|
+
}), ue = s(() => {
|
|
295
271
|
if (e.headerDescriptionI18n) {
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
272
|
+
const o = a(e.headerDescriptionI18n);
|
|
273
|
+
if (o !== e.headerDescriptionI18n) return o;
|
|
298
274
|
}
|
|
299
275
|
if (e.headerDescription) return e.headerDescription;
|
|
300
|
-
const
|
|
301
|
-
return
|
|
276
|
+
const t = a("vlite.categoryManager.headerDescription");
|
|
277
|
+
return t !== "vlite.categoryManager.headerDescription" ? t : "Manage your hierarchical structure.";
|
|
302
278
|
}), ge = s(() => {
|
|
303
279
|
if (e.addCategoryTextI18n) {
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
280
|
+
const o = a(e.addCategoryTextI18n);
|
|
281
|
+
if (o !== e.addCategoryTextI18n) return o;
|
|
306
282
|
}
|
|
307
283
|
if (e.addCategoryText) return e.addCategoryText;
|
|
308
|
-
const
|
|
309
|
-
return
|
|
310
|
-
}),
|
|
284
|
+
const t = a("vlite.categoryManager.addCategory");
|
|
285
|
+
return t !== "vlite.categoryManager.addCategory" ? t : "Add Category";
|
|
286
|
+
}), pe = s(() => {
|
|
311
287
|
if (e.createCategoryTextI18n) {
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
288
|
+
const o = a(e.createCategoryTextI18n);
|
|
289
|
+
if (o !== e.createCategoryTextI18n) return o;
|
|
314
290
|
}
|
|
315
291
|
if (e.createCategoryText) return e.createCategoryText;
|
|
316
|
-
const
|
|
317
|
-
return
|
|
318
|
-
}),
|
|
292
|
+
const t = a("vlite.categoryManager.createCategory");
|
|
293
|
+
return t !== "vlite.categoryManager.createCategory" ? t : "Create Category";
|
|
294
|
+
}), me = s(() => {
|
|
319
295
|
if (e.newRootPlaceholderI18n) {
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
296
|
+
const o = a(e.newRootPlaceholderI18n);
|
|
297
|
+
if (o !== e.newRootPlaceholderI18n) return o;
|
|
322
298
|
}
|
|
323
299
|
if (e.newRootPlaceholder) return e.newRootPlaceholder;
|
|
324
|
-
const
|
|
325
|
-
return
|
|
300
|
+
const t = a("vlite.categoryManager.newRootPlaceholder");
|
|
301
|
+
return t !== "vlite.categoryManager.newRootPlaceholder" ? t : "New root category...";
|
|
326
302
|
}), ve = s(() => {
|
|
327
303
|
if (e.modalSaveTextI18n) {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
304
|
+
const o = a(e.modalSaveTextI18n);
|
|
305
|
+
if (o !== e.modalSaveTextI18n) return o;
|
|
330
306
|
}
|
|
331
307
|
if (e.modalSaveText) return e.modalSaveText;
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
-
}),
|
|
308
|
+
const t = a("vlite.categoryManager.modalSaveText");
|
|
309
|
+
return t !== "vlite.categoryManager.modalSaveText" ? t : "Save Details";
|
|
310
|
+
}), fe = s(() => {
|
|
335
311
|
if (e.newSubcategoryPlaceholderI18n) {
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
312
|
+
const o = a(e.newSubcategoryPlaceholderI18n);
|
|
313
|
+
if (o !== e.newSubcategoryPlaceholderI18n) return o;
|
|
338
314
|
}
|
|
339
315
|
if (e.newSubcategoryPlaceholder) return e.newSubcategoryPlaceholder;
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
}),
|
|
316
|
+
const t = a("vlite.categoryManager.newSubcategoryPlaceholder");
|
|
317
|
+
return t !== "vlite.categoryManager.newSubcategoryPlaceholder" ? t : "New subcategory title...";
|
|
318
|
+
}), ye = s(() => {
|
|
343
319
|
if (e.categoryTitlePlaceholderI18n) {
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
320
|
+
const o = a(e.categoryTitlePlaceholderI18n);
|
|
321
|
+
if (o !== e.categoryTitlePlaceholderI18n) return o;
|
|
346
322
|
}
|
|
347
323
|
if (e.categoryTitlePlaceholder) return e.categoryTitlePlaceholder;
|
|
348
|
-
const
|
|
349
|
-
return
|
|
350
|
-
}), Te = s(() => e.quickAddTooltipI18n ?
|
|
351
|
-
|
|
352
|
-
expandedIds:
|
|
324
|
+
const t = a("vlite.categoryManager.categoryTitlePlaceholder");
|
|
325
|
+
return t !== "vlite.categoryManager.categoryTitlePlaceholder" ? t : "Category title...";
|
|
326
|
+
}), Te = s(() => e.quickAddTooltipI18n ? a(e.quickAddTooltipI18n) : e.quickAddTooltip ? e.quickAddTooltip : a("vlite.categoryManager.quickAddTooltip") !== "vlite.categoryManager.quickAddTooltip" ? a("vlite.categoryManager.quickAddTooltip") : "Quick Add Subcategory"), he = s(() => e.advancedDetailsTooltipI18n ? a(e.advancedDetailsTooltipI18n) : e.advancedDetailsTooltip ? e.advancedDetailsTooltip : a("vlite.categoryManager.advancedDetailsTooltip") !== "vlite.categoryManager.advancedDetailsTooltip" ? a("vlite.categoryManager.advancedDetailsTooltip") : "Advanced Details"), xe = s(() => e.deleteTooltipI18n ? a(e.deleteTooltipI18n) : e.deleteTooltip ? e.deleteTooltip : a("vlite.categoryManager.deleteTooltip") !== "vlite.categoryManager.deleteTooltip" ? a("vlite.categoryManager.deleteTooltip") : "Delete"), F = s(() => e.saveTooltipI18n ? a(e.saveTooltipI18n) : e.saveTooltip ? e.saveTooltip : a("vlite.categoryManager.saveTooltip") !== "vlite.categoryManager.saveTooltip" ? a("vlite.categoryManager.saveTooltip") : "Save"), J = s(() => e.cancelTooltipI18n ? a(e.cancelTooltipI18n) : e.cancelTooltip ? e.cancelTooltip : a("vlite.categoryManager.cancelTooltip") !== "vlite.categoryManager.cancelTooltip" ? a("vlite.categoryManager.cancelTooltip") : "Cancel");
|
|
327
|
+
Ce("categoryManager", {
|
|
328
|
+
expandedIds: g,
|
|
353
329
|
inlineState: y,
|
|
354
|
-
toggleExpand:
|
|
330
|
+
toggleExpand: X,
|
|
355
331
|
startInline: N,
|
|
356
332
|
saveInline: V,
|
|
357
333
|
cancelInline: D,
|
|
358
|
-
saveItem:
|
|
359
|
-
openModalForm:
|
|
360
|
-
deleteItem:
|
|
334
|
+
saveItem: le,
|
|
335
|
+
openModalForm: te,
|
|
336
|
+
deleteItem: ae,
|
|
361
337
|
readonly: s(() => e.readonly),
|
|
362
338
|
size: s(() => e.size),
|
|
363
|
-
newSubcategoryPlaceholderText:
|
|
364
|
-
categoryTitlePlaceholderText:
|
|
339
|
+
newSubcategoryPlaceholderText: fe,
|
|
340
|
+
categoryTitlePlaceholderText: ye,
|
|
365
341
|
quickAddTooltipText: Te,
|
|
366
|
-
advancedDetailsTooltipText:
|
|
342
|
+
advancedDetailsTooltipText: he,
|
|
367
343
|
deleteTooltipText: xe,
|
|
368
344
|
saveTooltipText: F,
|
|
369
345
|
cancelTooltipText: J
|
|
370
346
|
});
|
|
371
|
-
const
|
|
372
|
-
mounted: (
|
|
373
|
-
setTimeout(() =>
|
|
347
|
+
const Ie = {
|
|
348
|
+
mounted: (t) => {
|
|
349
|
+
setTimeout(() => t.focus(), 10);
|
|
374
350
|
}
|
|
351
|
+
}, be = () => {
|
|
352
|
+
const t = U(d.value);
|
|
353
|
+
g.value = t;
|
|
375
354
|
}, we = () => {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
}, Se = (...o) => {
|
|
384
|
-
const t = new Set(p.value);
|
|
385
|
-
o.forEach((a) => t.delete(a)), p.value = t;
|
|
355
|
+
g.value = /* @__PURE__ */ new Set();
|
|
356
|
+
}, B = (...t) => {
|
|
357
|
+
const o = new Set(g.value);
|
|
358
|
+
t.forEach((l) => o.add(l)), g.value = o;
|
|
359
|
+
}, Se = (...t) => {
|
|
360
|
+
const o = new Set(g.value);
|
|
361
|
+
t.forEach((l) => o.delete(l)), g.value = o;
|
|
386
362
|
};
|
|
387
|
-
return
|
|
363
|
+
return De(() => {
|
|
388
364
|
e.defaultExpanded && e.defaultExpanded.length > 0 && B(...e.defaultExpanded);
|
|
389
365
|
}), L({
|
|
390
|
-
expandedIds:
|
|
391
|
-
expandAll:
|
|
392
|
-
collapseAll:
|
|
366
|
+
expandedIds: g,
|
|
367
|
+
expandAll: be,
|
|
368
|
+
collapseAll: we,
|
|
393
369
|
expand: B,
|
|
394
370
|
collapse: Se
|
|
395
|
-
}), (
|
|
396
|
-
class:
|
|
371
|
+
}), (t, o) => (I(), C("div", {
|
|
372
|
+
class: Ae(["category-manager-container w-full bg-muted/10 rounded-xl border border-border p-4 lg:p-6 relative", { "category-manager--loading": M.loading }])
|
|
397
373
|
}, [
|
|
398
|
-
m("div",
|
|
399
|
-
|
|
374
|
+
m("div", Ue, [
|
|
375
|
+
ke(t.$slots, "header", {}, () => [
|
|
400
376
|
m("div", null, [
|
|
401
|
-
m("h3", Oe,
|
|
402
|
-
m("p", $e,
|
|
377
|
+
m("h3", Oe, b(se.value), 1),
|
|
378
|
+
m("p", $e, b(ue.value), 1)
|
|
403
379
|
]),
|
|
404
|
-
|
|
380
|
+
M.readonly ? E("", !0) : (I(), G(R, {
|
|
405
381
|
key: 0,
|
|
406
382
|
variant: "primary",
|
|
407
383
|
icon: "lucide:plus",
|
|
408
384
|
size: "sm",
|
|
409
|
-
onClick:
|
|
385
|
+
onClick: o[0] || (o[0] = (l) => N("add-root"))
|
|
410
386
|
}, {
|
|
411
387
|
default: P(() => [
|
|
412
|
-
H(
|
|
388
|
+
H(b(ge.value), 1)
|
|
413
389
|
]),
|
|
414
390
|
_: 1
|
|
415
391
|
}))
|
|
416
392
|
], !0)
|
|
417
393
|
]),
|
|
418
|
-
d.value.length === 0 && y.value.mode !== "add-root" ? (
|
|
394
|
+
d.value.length === 0 && y.value.mode !== "add-root" ? (I(), C("div", Fe, [
|
|
419
395
|
m("div", Je, [
|
|
420
|
-
|
|
396
|
+
T(Q, {
|
|
421
397
|
icon: "lucide:folder-tree",
|
|
422
398
|
class: "w-6 h-6 text-muted-foreground"
|
|
423
399
|
})
|
|
424
400
|
]),
|
|
425
|
-
m("h4", Be,
|
|
426
|
-
m("p", je,
|
|
427
|
-
|
|
401
|
+
m("h4", Be, b(de.value), 1),
|
|
402
|
+
m("p", je, b(ce.value), 1),
|
|
403
|
+
M.readonly ? E("", !0) : (I(), G(R, {
|
|
428
404
|
key: 0,
|
|
429
405
|
variant: "outline",
|
|
430
406
|
size: "sm",
|
|
431
407
|
class: "mt-5",
|
|
432
408
|
icon: "lucide:plus",
|
|
433
|
-
onClick:
|
|
409
|
+
onClick: o[1] || (o[1] = (l) => N("add-root"))
|
|
434
410
|
}, {
|
|
435
411
|
default: P(() => [
|
|
436
|
-
H(
|
|
412
|
+
H(b(pe.value), 1)
|
|
437
413
|
]),
|
|
438
414
|
_: 1
|
|
439
415
|
}))
|
|
440
|
-
])) : (
|
|
441
|
-
|
|
416
|
+
])) : (I(), C("div", Ge, [
|
|
417
|
+
T(_e, {
|
|
442
418
|
modelValue: d.value,
|
|
443
|
-
"onUpdate:modelValue":
|
|
444
|
-
onChange:
|
|
445
|
-
onDragEnd:
|
|
419
|
+
"onUpdate:modelValue": re,
|
|
420
|
+
onChange: ne,
|
|
421
|
+
onDragEnd: ie
|
|
446
422
|
}, null, 8, ["modelValue"]),
|
|
447
|
-
y.value.mode === "add-root" ? (
|
|
448
|
-
|
|
423
|
+
y.value.mode === "add-root" ? (I(), C("div", He, [
|
|
424
|
+
T(qe, {
|
|
449
425
|
modelValue: y.value.icon,
|
|
450
|
-
"onUpdate:modelValue":
|
|
426
|
+
"onUpdate:modelValue": o[2] || (o[2] = (l) => y.value.icon = l),
|
|
451
427
|
"btn-props": { variant: "ghost", size: "xs", class: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground shrink-0 rounded-md" },
|
|
452
428
|
position: "bottom-start"
|
|
453
429
|
}, null, 8, ["modelValue"]),
|
|
454
|
-
|
|
455
|
-
"onUpdate:modelValue":
|
|
430
|
+
Pe(m("input", {
|
|
431
|
+
"onUpdate:modelValue": o[3] || (o[3] = (l) => y.value.title = l),
|
|
456
432
|
class: "flex-1 bg-transparent border-0 outline-none focus:ring-0 px-1 py-1 text-sm transition-colors w-full shadow-none caret-primary text-foreground placeholder:text-muted-foreground",
|
|
457
|
-
placeholder:
|
|
433
|
+
placeholder: me.value,
|
|
458
434
|
onKeyup: [
|
|
459
435
|
K(V, ["enter"]),
|
|
460
436
|
K(D, ["esc"])
|
|
461
437
|
]
|
|
462
438
|
}, null, 40, Ke), [
|
|
463
|
-
[
|
|
464
|
-
[
|
|
439
|
+
[Ie],
|
|
440
|
+
[Ee, y.value.title]
|
|
465
441
|
]),
|
|
466
|
-
|
|
442
|
+
T(R, {
|
|
467
443
|
variant: "primary",
|
|
468
444
|
size: "xs",
|
|
469
445
|
icon: "lucide:check",
|
|
@@ -471,7 +447,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
471
447
|
title: F.value,
|
|
472
448
|
onClick: V
|
|
473
449
|
}, null, 8, ["title"]),
|
|
474
|
-
|
|
450
|
+
T(R, {
|
|
475
451
|
variant: "ghost",
|
|
476
452
|
size: "xs",
|
|
477
453
|
icon: "lucide:x",
|
|
@@ -481,34 +457,34 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
481
457
|
}, null, 8, ["title"])
|
|
482
458
|
])) : E("", !0)
|
|
483
459
|
])),
|
|
484
|
-
|
|
460
|
+
T(Ne, {
|
|
485
461
|
show: A.value,
|
|
486
|
-
"onUpdate:show":
|
|
487
|
-
title:
|
|
462
|
+
"onUpdate:show": o[4] || (o[4] = (l) => A.value = l),
|
|
463
|
+
title: ee.value,
|
|
488
464
|
"max-width": "max-w-md"
|
|
489
465
|
}, {
|
|
490
466
|
default: P(() => [
|
|
491
467
|
m("div", Qe, [
|
|
492
|
-
|
|
493
|
-
schema:
|
|
468
|
+
T(z(Ve), {
|
|
469
|
+
schema: Z.value,
|
|
494
470
|
values: $.value,
|
|
495
471
|
isUpdate: x.value === "edit",
|
|
496
472
|
submitText: ve.value,
|
|
497
|
-
onOnSubmit:
|
|
473
|
+
onOnSubmit: oe
|
|
498
474
|
}, null, 8, ["schema", "values", "isUpdate", "submitText"])
|
|
499
475
|
])
|
|
500
476
|
]),
|
|
501
477
|
_: 1
|
|
502
478
|
}, 8, ["show", "title"]),
|
|
503
|
-
|
|
479
|
+
T(Re, { name: "cm-fade" }, {
|
|
504
480
|
default: P(() => [
|
|
505
|
-
|
|
481
|
+
M.loading ? (I(), C("div", Le, [
|
|
506
482
|
m("div", We, [
|
|
507
|
-
|
|
483
|
+
T(Q, {
|
|
508
484
|
icon: "lucide:loader-2",
|
|
509
485
|
class: "w-4 h-4 animate-spin"
|
|
510
486
|
}),
|
|
511
|
-
m("span", null,
|
|
487
|
+
m("span", null, b(z(a)("vlite.categoryManager.loading") !== "vlite.categoryManager.loading" ? z(a)("vlite.categoryManager.loading") : "Updating..."), 1)
|
|
512
488
|
])
|
|
513
489
|
])) : E("", !0)
|
|
514
490
|
]),
|
|
@@ -518,5 +494,5 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
518
494
|
}
|
|
519
495
|
});
|
|
520
496
|
export {
|
|
521
|
-
|
|
497
|
+
At as default
|
|
522
498
|
};
|