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