@duxweb/dvha-core 0.1.23 → 1.0.15

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.
Files changed (45) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/loader.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/directive/permission.cjs +1 -1
  5. package/dist/cjs/hooks/data.cjs +1 -1
  6. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  7. package/dist/cjs/hooks/json.cjs +1 -1
  8. package/dist/cjs/hooks/menu.cjs +1 -1
  9. package/dist/cjs/hooks/overlay.cjs +1 -1
  10. package/dist/cjs/hooks/tree.cjs +1 -1
  11. package/dist/cjs/hooks/upload/local.cjs +1 -1
  12. package/dist/cjs/hooks/upload.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/cjs/main.cjs +1 -1
  15. package/dist/cjs/provider/app.cjs +1 -1
  16. package/dist/cjs/stores/jsonSchema.cjs +1 -0
  17. package/dist/cjs/utils/bus.cjs +1 -0
  18. package/dist/esm/components/auth/can.js +3 -2
  19. package/dist/esm/components/loader/loader.js +3 -2
  20. package/dist/esm/components/loader/remote/loader.js +3 -2
  21. package/dist/esm/directive/permission.js +3 -2
  22. package/dist/esm/hooks/data.js +166 -158
  23. package/dist/esm/hooks/json/vModel.js +67 -36
  24. package/dist/esm/hooks/json.js +109 -57
  25. package/dist/esm/hooks/menu.js +14 -13
  26. package/dist/esm/hooks/overlay.js +3 -2
  27. package/dist/esm/hooks/tree.js +8 -7
  28. package/dist/esm/hooks/upload/local.js +8 -8
  29. package/dist/esm/hooks/upload.js +123 -116
  30. package/dist/esm/index.js +93 -88
  31. package/dist/esm/main.js +7 -6
  32. package/dist/esm/provider/app.js +55 -53
  33. package/dist/esm/stores/jsonSchema.js +43 -0
  34. package/dist/esm/utils/bus.js +5 -0
  35. package/dist/types/hooks/data.d.ts +6 -66
  36. package/dist/types/hooks/json.d.ts +13 -3
  37. package/dist/types/hooks/upload/local.d.ts +1 -1
  38. package/dist/types/hooks/upload.d.ts +1 -1
  39. package/dist/types/stores/index.d.ts +1 -0
  40. package/dist/types/stores/jsonSchema.d.ts +27 -0
  41. package/dist/types/types/config.d.ts +6 -0
  42. package/dist/types/types/manage.d.ts +6 -0
  43. package/dist/types/utils/bus.d.ts +1 -0
  44. package/dist/types/utils/index.d.ts +1 -0
  45. package/package.json +2 -2
@@ -1,65 +1,96 @@
1
- import { toRef as p } from "vue";
2
- const b = {
1
+ import { toRef as m } from "vue";
2
+ import { extractContext as b } from "./utils/contextManager.js";
3
+ import { evaluateExpression as f } from "./utils/expressionParser.js";
4
+ const w = {
3
5
  name: "v-model",
4
6
  priority: 70,
5
- process(e, s) {
6
- const t = {}, r = {};
7
+ process(e, l) {
8
+ const t = {}, i = {};
7
9
  let o = !1;
8
- return Object.entries(s).forEach(([n, i]) => {
9
- if (n.startsWith("v-model") || n.startsWith("vModel")) {
10
+ const a = b(l);
11
+ return Object.entries(l).forEach(([r, n]) => {
12
+ if (r.startsWith("v-model") || r.startsWith("vModel")) {
10
13
  o = !0;
11
- const [d, ...u] = n.split(".");
12
- let l;
13
- d === "v-model" || d === "vModel" ? l = "modelValue" : d.startsWith("v-model:") ? l = d.slice(8) : d.startsWith("vModel:") ? l = d.slice(7) : l = "modelValue";
14
+ const [c, ...p] = r.split(".");
15
+ let s;
16
+ c === "v-model" || c === "vModel" ? s = "modelValue" : c.startsWith("v-model:") ? s = c.slice(8) : c.startsWith("vModel:") ? s = c.slice(7) : s = "modelValue";
14
17
  try {
15
- const { modelValue: a, updateFn: m } = f(i, u);
16
- t[l] = a, t[`onUpdate:${l}`] = m;
17
- } catch (a) {
18
- console.error(`v-model binding error (${l}):`, a);
18
+ const { modelValue: u, updateFn: h } = g(n, p, a);
19
+ t[s] = u, t[`onUpdate:${s}`] = h;
20
+ } catch (u) {
21
+ console.error(`v-model binding error (${s}):`, u);
19
22
  }
20
23
  } else
21
- r[n] = i;
22
- }), o ? { props: { ...r, ...t } } : null;
24
+ i[r] = n;
25
+ }), o ? { props: { ...i, ...t } } : null;
23
26
  }
24
27
  };
25
- function f(e, s) {
28
+ function g(e, l, t) {
29
+ if (typeof e == "string") {
30
+ const o = () => {
31
+ try {
32
+ return f(e, t);
33
+ } catch (r) {
34
+ console.warn(`v-model: Failed to evaluate expression "${e}"`, r);
35
+ return;
36
+ }
37
+ }, a = (r) => {
38
+ try {
39
+ const n = e.split(".");
40
+ if (n.length >= 2) {
41
+ const c = n.slice(0, -1).join("."), p = n[n.length - 1], s = f(c, t);
42
+ if (s && typeof s == "object") {
43
+ s[p] = d(r, l);
44
+ return;
45
+ }
46
+ }
47
+ console.warn(`v-model: Cannot update expression "${e}". Target object not found.`);
48
+ } catch (n) {
49
+ console.warn(`v-model: Failed to update expression "${e}"`, n);
50
+ }
51
+ };
52
+ return {
53
+ modelValue: o(),
54
+ updateFn: a
55
+ };
56
+ }
26
57
  if (Array.isArray(e) && e.length === 2 && typeof e[0] == "function" && typeof e[1] == "function") {
27
- const [r, o] = e;
58
+ const [o, a] = e;
28
59
  return {
29
- modelValue: r(),
30
- updateFn: (n) => {
31
- o(c(n, s));
60
+ modelValue: o(),
61
+ updateFn: (r) => {
62
+ a(d(r, l));
32
63
  }
33
64
  };
34
65
  }
35
66
  if (Array.isArray(e) && e.length === 2) {
36
- const [r, o] = e;
37
- if (!r || typeof o != "string")
67
+ const [o, a] = e;
68
+ if (!o || typeof a != "string")
38
69
  throw new Error("Invalid v-model binding format: [obj, prop] expected");
39
- const n = p(r, o);
70
+ const r = m(o, a);
40
71
  return {
41
- modelValue: n.value,
42
- updateFn: (i) => {
43
- n.value = c(i, s);
72
+ modelValue: r.value,
73
+ updateFn: (n) => {
74
+ r.value = d(n, l);
44
75
  }
45
76
  };
46
77
  }
47
- const t = p(e);
48
- return t === e && typeof e != "object" ? {
78
+ const i = m(e);
79
+ return i === e && typeof e != "object" ? {
49
80
  modelValue: e,
50
81
  updateFn: () => {
51
82
  console.warn("v-model: Cannot update non-reactive value. Please use ref, [obj, prop], or [getter, setter] format.");
52
83
  }
53
84
  } : {
54
- modelValue: t.value,
55
- updateFn: (r) => {
56
- t.value = c(r, s);
85
+ modelValue: i.value,
86
+ updateFn: (o) => {
87
+ i.value = d(o, l);
57
88
  }
58
89
  };
59
90
  }
60
- function c(e, s) {
61
- return s.reduce((t, r) => {
62
- switch (r) {
91
+ function d(e, l) {
92
+ return l.reduce((t, i) => {
93
+ switch (i) {
63
94
  case "trim":
64
95
  return typeof t == "string" ? t.trim() : t;
65
96
  case "number": {
@@ -69,10 +100,10 @@ function c(e, s) {
69
100
  case "lazy":
70
101
  return t;
71
102
  default:
72
- return console.warn(`Unknown v-model modifier: ${r}`), t;
103
+ return console.warn(`Unknown v-model modifier: ${i}`), t;
73
104
  }
74
105
  }, e);
75
106
  }
76
107
  export {
77
- b as vModelAdaptor
108
+ w as vModelAdaptor
78
109
  };
@@ -1,80 +1,132 @@
1
- import { computed as R, isRef as A, defineComponent as _, h as b, unref as F } from "vue";
1
+ import { computed as U, isRef as _, defineComponent as R, markRaw as E, h as v, unref as D } from "vue";
2
+ import { useJsonSchemaStore as z } from "../stores/jsonSchema.js";
3
+ import { useConfig as F } from "./config.js";
2
4
  import { defaultAdaptors as G } from "./json/index.js";
3
- import { injectContext as N } from "./json/utils/contextManager.js";
4
- function z(t) {
5
- const O = (t == null ? void 0 : t.adaptors) || G, j = (t == null ? void 0 : t.components) || {}, P = R(() => A(t == null ? void 0 : t.data) ? t == null ? void 0 : t.data.value : t == null ? void 0 : t.data);
6
- function V() {
7
- return (A(t == null ? void 0 : t.context) ? t == null ? void 0 : t.context.value : t == null ? void 0 : t.context) || {};
5
+ import { injectContext as L } from "./json/utils/contextManager.js";
6
+ function W(e) {
7
+ return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
8
+ }
9
+ function J(e, s) {
10
+ Array.isArray(e) ? e.forEach((c) => {
11
+ const f = c;
12
+ let i = f.name;
13
+ !i && f.__name && (i = f.__name.replace(/\.(vue|ts|tsx|js|jsx)$/, "").split("/").pop()), i && s.addComponent(E(c), i);
14
+ }) : typeof e == "object" && e !== null && Object.entries(e).forEach(([c, f]) => {
15
+ s.addComponent(E(f), c);
16
+ });
17
+ }
18
+ function X(e, s) {
19
+ var f, i;
20
+ const c = z(s);
21
+ (f = e.jsonSchema) != null && f.components && J(e.jsonSchema.components, c), (i = e.manages) == null || i.forEach((y) => {
22
+ var S;
23
+ (S = y.jsonSchema) != null && S.components && J(y.jsonSchema.components, c);
24
+ });
25
+ }
26
+ function Y(e) {
27
+ var M;
28
+ const s = F(), c = z(), f = [...G, ...((M = s.jsonSchema) == null ? void 0 : M.adaptors) || [], ...(e == null ? void 0 : e.adaptors) || []];
29
+ e != null && e.components && J(e.components, c);
30
+ const i = U(() => _(e == null ? void 0 : e.data) ? e == null ? void 0 : e.data.value : e == null ? void 0 : e.data);
31
+ function y() {
32
+ return (_(e == null ? void 0 : e.context) ? e == null ? void 0 : e.context.value : e == null ? void 0 : e.context) || {};
8
33
  }
9
- function h(e) {
34
+ function S(n) {
10
35
  const r = {};
11
- return Object.entries(e).forEach(([n, f]) => {
12
- if (n === "_context") return;
13
- const l = n === "modelValue" || n.startsWith("modelValue") || n !== "value" && (n.includes("model") || n.includes("Model"));
14
- r[n] = l && A(f) ? F(f) : f;
36
+ return Object.entries(n).forEach(([t, a]) => {
37
+ if (t === "_context") return;
38
+ const A = t === "modelValue" || t.startsWith("modelValue") || t !== "value" && (t.includes("model") || t.includes("Model"));
39
+ r[t] = A && _(a) ? D(a) : a;
15
40
  }), r;
16
41
  }
17
- function s(e, r, n) {
18
- return typeof e == "string" ? e : typeof e == "function" ? s(e(r), r, n) : Array.isArray(e) ? e.flatMap((f) => s(f, r, n)).filter(Boolean) : e != null && e.tag ? a(e, !0, n) : e;
42
+ function b(n, r, t) {
43
+ return typeof n == "string" ? n : typeof n == "function" ? b(n(r), r, t) : Array.isArray(n) ? n.flatMap((a) => b(a, r, t)).filter(Boolean) : n != null && n.tag ? d(n, !0, t) : n;
19
44
  }
20
- function E(e, r, n) {
21
- if (e)
22
- return typeof e == "string" ? e : Array.isArray(e) ? e.flatMap((f) => typeof f == "string" ? f : a(f, r, n)).filter(Boolean) : a(e, r, n);
45
+ function P(n, r, t) {
46
+ if (n)
47
+ return typeof n == "string" ? n : Array.isArray(n) ? n.flatMap((a) => typeof a == "string" ? a : d(a, r, t)).filter(Boolean) : d(n, r, t);
23
48
  }
24
- function a(e, r = !1, n = {}) {
49
+ function d(n, r = !1, t = {}) {
25
50
  const {
26
- tag: f,
27
- attrs: l = {},
28
- children: J,
29
- slots: B
30
- } = e, c = {
31
- ...V(),
32
- ...n
51
+ tag: a,
52
+ attrs: A = {},
53
+ children: w,
54
+ slots: N
55
+ } = n, g = {
56
+ ...y(),
57
+ ...t
33
58
  };
34
- let i = {
35
- ...l
59
+ let j = {
60
+ ...A
36
61
  };
37
- Object.keys(c).length > 0 && (i = {
38
- ...i,
39
- ...N({}, c)
62
+ Object.keys(g).length > 0 && (j = {
63
+ ...j,
64
+ ...L({}, g)
40
65
  });
41
- for (const o of O) {
42
- const u = o.process(e, i);
43
- if (u) {
44
- if (i = u.props, u.skip) return null;
45
- if (u.nodes)
46
- return u.nodes.map((m) => {
47
- var v;
48
- const y = ((v = m.attrs) == null ? void 0 : v._context) || {};
49
- return a(m, r, {
50
- ...c,
51
- ...y
66
+ for (const m of f) {
67
+ const o = m.process(n, j);
68
+ if (o) {
69
+ if (j = o.props, o.skip) return null;
70
+ if (o.nodes)
71
+ return o.nodes.map((l) => {
72
+ var x;
73
+ const h = ((x = l.attrs) == null ? void 0 : x._context) || {};
74
+ return d(l, r, {
75
+ ...g,
76
+ ...h
52
77
  });
53
78
  }).filter(Boolean);
54
79
  }
55
80
  }
56
- const d = typeof f == "string" && j[f] ? j[f] : f, M = typeof d != "string", g = h(i);
57
- if (B && M && !r) {
58
- const o = {};
59
- return Object.entries(B).forEach(([u, m]) => {
60
- o[u] = (y = {}) => s(m, y, c);
61
- }), b(d, g, o);
81
+ let u = typeof a == "string" && ((m) => {
82
+ let o = c.getComponentByName(m);
83
+ if (o)
84
+ return o;
85
+ const l = W(m);
86
+ if (o = c.getComponentByName(l), o)
87
+ return o;
88
+ const h = m.replace(/-([a-z])/g, (x, T) => T.toUpperCase()).replace(/^[a-z]/, (x) => x.toUpperCase());
89
+ return o = c.getComponentByName(h), o || null;
90
+ })(a) || a;
91
+ typeof u != "string" && typeof u == "object" && (u = E(u));
92
+ const O = typeof u != "string", C = S(j);
93
+ if (N && O && !r) {
94
+ const m = {};
95
+ return Object.entries(N).forEach(([o, l]) => {
96
+ m[o] = (h = {}) => b(l, h, g);
97
+ }), v(u, C, m);
62
98
  }
63
- const x = E(J, r, c);
64
- return M && x !== void 0 ? b(d, g, {
65
- default: () => x
66
- }) : b(d, g, x);
99
+ const B = P(w, r, g);
100
+ return O && B !== void 0 ? v(u, C, {
101
+ default: () => B
102
+ }) : v(u, C, B);
67
103
  }
68
- return {
69
- render: /* @__PURE__ */ _({
70
- name: "JsonSchemaRenderer",
104
+ const V = /* @__PURE__ */ R({
105
+ name: "JsonSchemaRenderer",
106
+ render() {
107
+ var n;
108
+ return ((n = i.value) == null ? void 0 : n.map((r) => d(r)).filter(Boolean)) || [];
109
+ }
110
+ });
111
+ function $(n) {
112
+ return /* @__PURE__ */ R({
113
+ name: "DynamicJsonSchemaRenderer",
71
114
  render() {
72
- var e;
73
- return (e = P.value) == null ? void 0 : e.map((r) => a(r)).filter(Boolean);
115
+ var t;
116
+ const r = {
117
+ ...y(),
118
+ ...n.context
119
+ };
120
+ return (t = n.data) == null ? void 0 : t.map((a) => d(a, !1, r)).filter(Boolean);
74
121
  }
75
- })
122
+ });
123
+ }
124
+ return {
125
+ render: V,
126
+ renderAsync: $
76
127
  };
77
128
  }
78
129
  export {
79
- z as useJsonSchema
130
+ X as initJsonSchemaComponents,
131
+ Y as useJsonSchema
80
132
  };
@@ -3,11 +3,12 @@ import { storeToRefs as q } from "pinia";
3
3
  import { computed as v, ref as K, watch as h } from "vue";
4
4
  import { useRoute as z } from "vue-router";
5
5
  import { useRouteStore as B } from "../stores/route.js";
6
+ import "../utils/bus.js";
6
7
  import { arrayToTree as A, searchTree as M } from "../utils/tree.js";
7
- function N(n) {
8
+ function O(n) {
8
9
  const D = B(), { routes: L } = q(D), y = (e = !0) => {
9
- var a;
10
- return (a = S(L.value)) == null ? void 0 : a.filter((t) => !!(t != null && t.name)).filter((t) => !e || t.hidden === void 0 || t.hidden === !1);
10
+ var t;
11
+ return (t = S(L.value)) == null ? void 0 : t.filter((a) => !!(a != null && a.name)).filter((a) => !e || a.hidden === void 0 || a.hidden === !1);
11
12
  }, b = v(() => {
12
13
  const e = y(!1);
13
14
  return A(e, {
@@ -28,25 +29,25 @@ function N(n) {
28
29
  if (n != null && n.doubleMenu)
29
30
  return c.value;
30
31
  const e = S(c.value);
31
- return e == null ? void 0 : e.map((a) => (delete a.children, a));
32
+ return e == null ? void 0 : e.map((t) => (delete t.children, t));
32
33
  }), x = v(() => {
33
- var a, t;
34
- return n != null && n.doubleMenu ? [] : ((t = (a = c.value) == null ? void 0 : a.find((d) => d.name === r.value)) == null ? void 0 : t.children) || [];
35
- }), w = v(() => M(b.value, (a) => (a == null ? void 0 : a.name) === i.name));
34
+ var t, a;
35
+ return n != null && n.doubleMenu ? [] : ((a = (t = c.value) == null ? void 0 : t.find((d) => d.name === r.value)) == null ? void 0 : a.children) || [];
36
+ }), w = v(() => M(b.value, (t) => (t == null ? void 0 : t.name) === i.name));
36
37
  h(() => n == null ? void 0 : n.doubleMenu, () => {
37
- var e, a, t, d;
38
+ var e, t, a, d;
38
39
  if (n != null && n.doubleMenu) {
39
40
  const u = M(c.value, (l) => (l == null ? void 0 : l.name) === r.value);
40
- r.value = (t = u == null ? void 0 : u[0]) == null ? void 0 : t.name, o.value = (d = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : d.name;
41
+ r.value = (a = u == null ? void 0 : u[0]) == null ? void 0 : a.name, o.value = (d = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : d.name;
41
42
  } else {
42
43
  const u = M(c.value, (l) => (l == null ? void 0 : l.name) === o.value);
43
- r.value = (e = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : e.name, o.value = (a = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : a.name;
44
+ r.value = (e = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : e.name, o.value = (t = u == null ? void 0 : u[u.length - 1]) == null ? void 0 : t.name;
44
45
  }
45
46
  }, { immediate: !0 });
46
47
  const j = v(() => n != null && n.doubleMenu ? (n == null ? void 0 : n.doubleMenu) || x.value.length > 0 : !0);
47
48
  return h([i, b, () => n == null ? void 0 : n.doubleMenu], () => {
48
49
  var d, u, l, T, I;
49
- const e = M(b.value, (m) => m.name === i.name), t = ((m) => {
50
+ const e = M(b.value, (m) => m.name === i.name), a = ((m) => {
50
51
  let R = -1;
51
52
  for (let f = m.length - 1; f >= 0; f--)
52
53
  if (m[f].hidden === !1 || m[f].hidden === void 0) {
@@ -55,7 +56,7 @@ function N(n) {
55
56
  }
56
57
  return R;
57
58
  })(e);
58
- g.value = (d = e == null ? void 0 : e[t]) == null ? void 0 : d.name, n != null && n.doubleMenu ? (r.value = (u = e == null ? void 0 : e[t]) == null ? void 0 : u.name, o.value = (l = e == null ? void 0 : e[t]) == null ? void 0 : l.name) : (r.value = (T = e == null ? void 0 : e[0]) == null ? void 0 : T.name, o.value = (I = e == null ? void 0 : e[t]) == null ? void 0 : I.name);
59
+ g.value = (d = e == null ? void 0 : e[a]) == null ? void 0 : d.name, n != null && n.doubleMenu ? (r.value = (u = e == null ? void 0 : e[a]) == null ? void 0 : u.name, o.value = (l = e == null ? void 0 : e[a]) == null ? void 0 : l.name) : (r.value = (T = e == null ? void 0 : e[0]) == null ? void 0 : T.name, o.value = (I = e == null ? void 0 : e[a]) == null ? void 0 : I.name);
59
60
  }, { immediate: !0 }), {
60
61
  data: c,
61
62
  originalData: b,
@@ -70,5 +71,5 @@ function N(n) {
70
71
  };
71
72
  }
72
73
  export {
73
- N as useMenu
74
+ O as useMenu
74
75
  };
@@ -9,16 +9,17 @@ import "@vee-validate/rules";
9
9
  import "vee-validate";
10
10
  import "@vueuse/core";
11
11
  import "./json/index.js";
12
+ import "../utils/bus.js";
12
13
  import "colorizr";
13
14
  import "axios";
14
15
  import "clsx";
15
16
  import { DuxOverlay as m } from "../components/overlay/overlay.js";
16
- function j() {
17
+ function D() {
17
18
  const r = t(m);
18
19
  return {
19
20
  show: (o) => r(o)
20
21
  };
21
22
  }
22
23
  export {
23
- j as useOverlay
24
+ D as useOverlay
24
25
  };
@@ -1,8 +1,9 @@
1
1
  import { computed as a } from "vue";
2
- import { arrayToTree as y, treeToArr as m } from "../utils/tree.js";
3
- import { useList as v } from "./data.js";
4
- function g(e) {
5
- const { data: o, isLoading: c } = v({
2
+ import "../utils/bus.js";
3
+ import { arrayToTree as m, treeToArr as y } from "../utils/tree.js";
4
+ import { useList as p } from "./data.js";
5
+ function T(e) {
6
+ const { data: o, isLoading: c } = p({
6
7
  get path() {
7
8
  return e.path || "";
8
9
  },
@@ -14,7 +15,7 @@ function g(e) {
14
15
  }
15
16
  }), d = a(() => {
16
17
  var r, n, i, t, l, s;
17
- return e.converTree ? y(((n = o.value) == null ? void 0 : n.data) || [], {
18
+ return e.converTree ? m(((n = o.value) == null ? void 0 : n.data) || [], {
18
19
  idKey: ((i = e.treeOptions) == null ? void 0 : i.valueKey) || "id",
19
20
  parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parentId",
20
21
  sortKey: ((l = e.treeOptions) == null ? void 0 : l.sortKey) || "sort",
@@ -22,7 +23,7 @@ function g(e) {
22
23
  }) : ((r = o.value) == null ? void 0 : r.data) || [];
23
24
  }), u = a(() => {
24
25
  var r, n;
25
- return m(d.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
26
+ return y(d.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
26
27
  }), h = a(() => c.value);
27
28
  return {
28
29
  options: a(() => {
@@ -37,5 +38,5 @@ function g(e) {
37
38
  };
38
39
  }
39
40
  export {
40
- g as useTree
41
+ T as useTree
41
42
  };
@@ -1,13 +1,13 @@
1
1
  import { useClient as o } from "../data.js";
2
- const m = () => {
3
- const n = o();
2
+ function s() {
3
+ const c = o();
4
4
  return {
5
5
  upload(l, e) {
6
- const c = e.query || {};
6
+ const n = e.query || {};
7
7
  let a = null;
8
8
  if (e.method === "PUT")
9
9
  Object.entries(e.params || {}).forEach(([r, t]) => {
10
- c[r] = t;
10
+ n[r] = t;
11
11
  }), a = l;
12
12
  else {
13
13
  const r = new FormData();
@@ -15,9 +15,9 @@ const m = () => {
15
15
  r.append(t, d);
16
16
  }), a = r;
17
17
  }
18
- return n.request({
18
+ return c.request({
19
19
  ...e,
20
- query: c,
20
+ query: n,
21
21
  method: e.method || "POST",
22
22
  payload: a,
23
23
  signal: e.signal,
@@ -25,7 +25,7 @@ const m = () => {
25
25
  });
26
26
  }
27
27
  };
28
- };
28
+ }
29
29
  export {
30
- m as createLocalUploadDriver
30
+ s as createLocalUploadDriver
31
31
  };