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.
@@ -1,11 +1,11 @@
1
- import { defineComponent as ne, ref as v, watch as R, computed as D, provide as oe, openBlock as x, createElementBlock as V, createElementVNode as f, renderSlot as re, createBlock as $, withCtx as _, createTextVNode as F, createCommentVNode as A, createVNode as g, toDisplayString as J, withDirectives as le, withKeys as B, vModelText as ie, unref as de } from "vue";
2
- import ae from "./CategoryNode.vue.js";
3
- import se from "../Modal.vue.js";
4
- import ue from "../Form/Form.vue.js";
5
- import ce from "../Icon.vue.js";
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 E from "../Button.vue.js";
8
- import "../../core/config.js";
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 me from "../IconPicker.vue.js";
20
+ import Ae from "../IconPicker.vue.js";
21
21
  /* empty css */
22
22
  /* empty css */
23
- import { getUniqueId as N } from "../../utils/functions.js";
24
- const fe = { class: "category-manager-container w-full bg-muted/10 rounded-xl border border-border p-4 lg:p-6" }, pe = { class: "flex items-center justify-between mb-6" }, ve = {
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
- }, he = { class: "w-12 h-12 bg-muted rounded-full flex items-center justify-center mb-4" }, ge = { class: "text-base font-medium text-foreground" }, ye = { class: "text-sm text-muted-foreground mt-1 max-w-sm" }, xe = {
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
- }, be = {
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
- }, we = {
35
+ }, Oe = ["placeholder"], $e = {
35
36
  class: "modal-body",
36
37
  style: { "will-change": "transform", contain: "layout style" }
37
- }, Pe = /* @__PURE__ */ ne({
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(b, { emit: j }) {
50
- const w = b, c = j, d = v([]), I = v(/* @__PURE__ */ new Set()), s = (t) => JSON.parse(JSON.stringify(t)), p = (t, e = null) => {
51
- t.forEach((n, l) => {
52
- n.parentId = e, n.position = l, n.children || (n.children = []), p(n.children, n.id);
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
- }, q = (t) => {
55
- const e = /* @__PURE__ */ new Map(), n = [];
56
- t.forEach((o) => {
57
- e.set(o.id, {
58
- ...o,
59
- id: o.id,
60
- title: o.name || o.title || "Untitled",
61
- icon: o.icon,
62
- parentId: o.parentId || null,
63
- position: o.position ?? 0,
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((o) => {
67
- const r = e.get(o.id);
68
- r && (o.parentId && e.has(o.parentId) ? e.get(o.parentId).children.push(r) : n.push(r));
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 l = (o) => {
71
- o.sort((r, a) => (r.position ?? 0) - (a.position ?? 0)), o.forEach((r) => {
72
- r.children && l(r.children);
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 l(n), n;
110
+ return i(r), r;
76
111
  };
77
- R(
78
- () => w.rawData,
112
+ F(
113
+ () => e.rawData,
79
114
  (t) => {
80
115
  if (t && t.length > 0) {
81
- const e = q(t);
82
- p(e);
83
- const n = JSON.stringify(e), l = JSON.stringify(d.value);
84
- if (n !== l) {
85
- const o = s(e);
86
- d.value = o, c("update:modelValue", o);
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
- ), R(
92
- () => w.modelValue,
126
+ ), F(
127
+ () => e.modelValue,
93
128
  (t) => {
94
- const e = JSON.stringify(t), n = JSON.stringify(d.value);
95
- if (e !== n && t.length > 0) {
96
- const l = s(t);
97
- p(l), d.value = l;
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 y = () => {
103
- p(d.value);
104
- const t = s(d.value);
105
- c("update:modelValue", t);
137
+ const x = () => {
138
+ v(s.value);
139
+ const t = p(s.value);
140
+ m("update:modelValue", t);
106
141
  }, K = (t) => {
107
- const e = new Set(I.value);
108
- e.has(t) ? e.delete(t) : e.add(t), I.value = e;
109
- }, u = v({
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
- }), M = (t, e) => {
115
- u.value = {
149
+ }), E = (t, o) => {
150
+ g.value = {
116
151
  mode: t,
117
- targetId: t === "add-child" && e || null,
152
+ targetId: t === "add-child" && o || null,
118
153
  title: "",
119
154
  icon: "lucide:folder"
120
- }, t === "add-child" && e && I.value.add(e);
121
- }, S = () => {
122
- u.value = { mode: null, targetId: null, title: "", icon: "lucide:folder" };
123
- }, T = () => {
124
- const { mode: t, targetId: e, title: n, icon: l } = u.value;
125
- if (!n.trim()) return;
126
- const o = [...d.value];
127
- let r = null;
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
- r = { id: N(), title: n, icon: l, children: [] }, o.push(r);
164
+ n = { id: k(), title: r, icon: i, children: [] }, a.push(n);
130
165
  else if (t === "add-child") {
131
- r = { id: N(), title: n, icon: l, children: [] };
132
- const a = (m) => {
133
- for (const i of m) {
134
- if (i.id === e)
135
- return i.children || (i.children = []), i.children.push(r), !0;
136
- if (i.children && a(i.children)) return !0;
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(o);
175
+ u(a);
141
176
  }
142
- r && (p(o), c("onAdd", s(r))), d.value = o, y(), S();
143
- }, k = v(!1), h = v("add"), U = v(null), z = v(null), O = v({}), P = [
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
- ], G = D(() => w.formSchema || P), H = D(() => h.value === "add" ? "Add Category" : h.value === "add-child" ? "Add Sub-category" : "Edit Category"), L = (t, e, n) => {
148
- h.value = t, U.value = e || null, z.value = n || null, O.value = e ? s(e) : {}, k.value = !0;
149
- }, Q = async (t) => {
150
- const e = t?.values || t, n = [...d.value];
151
- let l = null, o = null;
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 r = { id: N(), children: [], ...e };
154
- n.push(r), l = r, o = "onAdd";
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 r = { id: N(), children: [], ...e }, a = (m) => {
157
- for (const i of m) {
158
- if (i.id === z.value)
159
- return i.children || (i.children = []), i.children.push(r), I.value.add(i.id), !0;
160
- if (i.children && a(i.children)) return !0;
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
- a(n), l = r, o = "onAdd";
165
- } else if (h.value === "edit" && U.value) {
166
- const r = U.value.id, a = (m) => {
167
- const i = m.findIndex((C) => C.id === r);
168
- if (i > -1)
169
- return m[i] = { ...m[i], ...e }, l = m[i], !0;
170
- for (const C of m)
171
- if (C.children && a(C.children)) return !0;
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
- a(n), o = "onEdit";
209
+ u(r), a = "onEdit";
175
210
  }
176
- p(n), l && (o === "onAdd" ? c("onAdd", s(l)) : o === "onEdit" && c("onEdit", s(l))), d.value = n, y(), t && typeof t.setSubmitting == "function" && t.setSubmitting(!1), k.value = !1;
177
- }, W = (t) => {
178
- const e = t.id, n = (o) => {
179
- const r = o.findIndex((a) => a.id === e);
180
- if (r > -1)
181
- return o.splice(r, 1), !0;
182
- for (const a of o)
183
- if (a.children && n(a.children)) return !0;
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
- }, l = [...d.value];
186
- n(l), p(l), d.value = l, c("onDelete", s(t)), y();
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(d.value);
195
- const e = s(d.value);
196
- c("update:modelValue", e);
197
- let n = null;
198
- const l = (o) => {
199
- for (const r of o) {
200
- if (String(r.id) === String(t))
201
- return n = r, !0;
202
- if (r.children && l(r.children)) return !0;
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
- l(e), n && c("onReorder", {
207
- id: n.id,
208
- parentId: n.parentId ?? null,
209
- position: n.position ?? 0
241
+ i(o), r && m("onReorder", {
242
+ id: r.id,
243
+ parentId: r.parentId ?? null,
244
+ position: r.position ?? 0
210
245
  });
211
- };
212
- oe("categoryManager", {
213
- expandedIds: I,
214
- inlineState: u,
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: M,
217
- saveInline: T,
218
- cancelInline: S,
219
- saveItem: X,
220
- openModalForm: L,
221
- deleteItem: W,
222
- readonly: D(() => w.readonly),
223
- size: D(() => w.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 te = {
347
+ const ve = {
226
348
  mounted: (t) => {
227
349
  setTimeout(() => t.focus(), 10);
228
350
  }
229
351
  };
230
- return (t, e) => (x(), V("div", fe, [
231
- f("div", pe, [
232
- re(t.$slots, "header", {}, () => [
233
- e[6] || (e[6] = f("div", null, [
234
- f("h3", { class: "text-lg font-bold text-foreground" }, "Categories"),
235
- f("p", { class: "text-sm text-muted-foreground mt-0.5" }, "Manage your hierarchical structure.")
236
- ], -1)),
237
- b.readonly ? A("", !0) : (x(), $(E, {
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: e[0] || (e[0] = (n) => M("add-root"))
364
+ onClick: o[0] || (o[0] = (r) => E("add-root"))
243
365
  }, {
244
- default: _(() => [...e[5] || (e[5] = [
245
- F(" Add Category ", -1)
246
- ])]),
366
+ default: V(() => [
367
+ B(M(de.value), 1)
368
+ ]),
247
369
  _: 1
248
370
  }))
249
371
  ])
250
372
  ]),
251
- d.value.length === 0 && u.value.mode !== "add-root" ? (x(), V("div", ve, [
252
- f("div", he, [
253
- g(ce, {
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
- f("h4", ge, J(b.emptyTitle), 1),
259
- f("p", ye, J(b.emptyDescription), 1),
260
- b.readonly ? A("", !0) : (x(), $(E, {
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: e[1] || (e[1] = (n) => M("add-root"))
388
+ onClick: o[1] || (o[1] = (r) => E("add-root"))
267
389
  }, {
268
- default: _(() => [...e[7] || (e[7] = [
269
- F(" Create Category ", -1)
270
- ])]),
390
+ default: V(() => [
391
+ B(M(ce.value), 1)
392
+ ]),
271
393
  _: 1
272
394
  }))
273
- ])) : (x(), V("div", xe, [
274
- g(ae, {
275
- modelValue: d.value,
276
- "onUpdate:modelValue": Y,
277
- onChange: Z,
278
- onDragEnd: ee
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
- u.value.mode === "add-root" ? (x(), V("div", be, [
281
- g(me, {
282
- modelValue: u.value.icon,
283
- "onUpdate:modelValue": e[2] || (e[2] = (n) => u.value.icon = n),
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
- le(f("input", {
288
- "onUpdate:modelValue": e[3] || (e[3] = (n) => u.value.title = n),
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: "New root category...",
412
+ placeholder: se.value,
291
413
  onKeyup: [
292
- B(T, ["enter"]),
293
- B(S, ["esc"])
414
+ j(_, ["enter"]),
415
+ j(C, ["esc"])
294
416
  ]
295
- }, null, 544), [
296
- [te],
297
- [ie, u.value.title]
417
+ }, null, 40, Oe), [
418
+ [ve],
419
+ [be, g.value.title]
298
420
  ]),
299
- g(E, {
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: "Save",
305
- onClick: T
306
- }),
307
- g(E, {
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: "Cancel",
313
- onClick: S
314
- })
315
- ])) : A("", !0)
434
+ title: $.value,
435
+ onClick: C
436
+ }, null, 8, ["title"])
437
+ ])) : q("", !0)
316
438
  ])),
317
- g(se, {
318
- show: k.value,
319
- "onUpdate:show": e[4] || (e[4] = (n) => k.value = n),
320
- title: H.value,
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
- f("div", we, [
325
- g(de(ue), {
326
- schema: G.value,
327
- values: O.value,
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: "Save Details",
330
- onOnSubmit: Q
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
- Pe as default
462
+ ut as default
341
463
  };