@duxweb/dvha-core 1.0.17 → 1.0.19

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,6 +1,6 @@
1
1
  import { json2csv as v } from "json-2-csv";
2
2
  import { computed as u } from "vue";
3
- import { useExport as h } from "./export.js";
3
+ import { useExport as y } from "./export.js";
4
4
  function b(e) {
5
5
  const d = u(() => {
6
6
  const { filename: t, headers: r, csvOptions: s, ...c } = e;
@@ -19,10 +19,10 @@ function b(e) {
19
19
  excelBOM: t.writeBOM || !1
20
20
  };
21
21
  });
22
- return h({
22
+ return y({
23
23
  ...d.value,
24
24
  onSuccess: async (t) => {
25
- var s, c, a, i;
25
+ var s, c, i, a;
26
26
  if (!(t != null && t.pages)) {
27
27
  (s = e.onError) == null || s.call(e, {
28
28
  message: "No data to export",
@@ -30,8 +30,8 @@ function b(e) {
30
30
  });
31
31
  return;
32
32
  }
33
- const r = t.pages.flatMap((n) => (n == null ? void 0 : n.data) || []);
34
- if (r.length === 0) {
33
+ const r = t.pages.flatMap((n) => Array.isArray(n == null ? void 0 : n.data) ? n.data : []);
34
+ if (!r || !(r != null && r.length)) {
35
35
  (c = e.onError) == null || c.call(e, {
36
36
  message: "No data to export",
37
37
  status: 400
@@ -40,9 +40,9 @@ function b(e) {
40
40
  }
41
41
  try {
42
42
  const n = await v(r, m.value), f = new Blob([n], { type: "text/csv;charset=utf-8;" }), l = URL.createObjectURL(f), o = document.createElement("a");
43
- o.href = l, o.download = e.filename || "export.csv", o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(l), (a = e.onSuccess) == null || a.call(e, t);
43
+ o.href = l, o.download = e.filename || "export.csv", o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(l), (i = e.onSuccess) == null || i.call(e, t);
44
44
  } catch (n) {
45
- (i = e.onError) == null || i.call(e, {
45
+ (a = e.onError) == null || a.call(e, {
46
46
  message: `CSV Export Error: ${n}`,
47
47
  status: 500
48
48
  });
@@ -1,44 +1,54 @@
1
- import { cloneDeep as c } from "lodash-es";
2
- import { toRef as N, ref as b, computed as o, watch as E } from "vue";
1
+ import { cloneDeep as v } from "lodash-es";
2
+ import { toRef as m, ref as s, computed as f, watch as E } from "vue";
3
3
  import { useOne as L, useCreate as O, useUpdate as S } from "./data.js";
4
- function w(e) {
5
- const i = N(e, "form", {}), n = b(c(e.form || {})), d = o(() => e.action === "edit" || e.id), { data: v, isLoading: l, refetch: f } = L({
6
- path: e.path || "",
7
- id: e.id,
4
+ function x(e) {
5
+ const n = m(e, "form", {}), i = m(e, "id", void 0), c = s(v(n.value || {})), l = s(v(n.value || {})), u = f(() => e.action === "edit" || !!i.value), { data: g, isLoading: h, refetch: D } = L({
6
+ get path() {
7
+ return e.path || "";
8
+ },
9
+ get id() {
10
+ return i.value;
11
+ },
8
12
  options: {
9
- enabled: !!e.id
13
+ enabled: u.value
10
14
  },
11
15
  providerName: e.providerName
12
- });
13
- E([() => e.action, () => e.id], async () => {
16
+ }), d = () => {
17
+ let a = {};
18
+ u.value ? a = v(c.value) : a = v(l.value), Object.assign(n.value, a);
19
+ };
20
+ E([i, u], async () => {
14
21
  var t;
15
- if (!d.value)
22
+ if (!u.value) {
23
+ d();
16
24
  return;
17
- await f();
18
- const a = c(((t = v.value) == null ? void 0 : t.data) || {});
19
- Object.assign(i.value, a), Object.assign(n.value, a);
25
+ }
26
+ await D();
27
+ const a = v(((t = g.value) == null ? void 0 : t.data) || {});
28
+ Object.assign(n.value, a), Object.assign(c.value, a);
20
29
  }, {
21
30
  immediate: !0
22
31
  });
23
- const r = () => {
24
- const a = c(n.value);
25
- Object.assign(i.value, a);
26
- }, u = O({
32
+ const o = O({
27
33
  path: e.path ?? "",
28
- data: i.value,
34
+ data: n.value,
29
35
  onSuccess: (a) => {
30
36
  var t;
31
- (t = e.onSuccess) == null || t.call(e, a);
37
+ d(), (t = e.onSuccess) == null || t.call(e, a);
32
38
  },
33
39
  onError: (a) => {
34
40
  var t;
35
41
  (t = e.onError) == null || t.call(e, a);
36
42
  },
37
43
  providerName: e.providerName
38
- }), m = S({
39
- path: e.path ?? "",
40
- id: e.id,
41
- data: i.value,
44
+ }), r = S({
45
+ get path() {
46
+ return e.path ?? "";
47
+ },
48
+ get id() {
49
+ return i.value;
50
+ },
51
+ data: n.value,
42
52
  onSuccess: (a) => {
43
53
  var t;
44
54
  (t = e.onSuccess) == null || t.call(e, a);
@@ -48,23 +58,23 @@ function w(e) {
48
58
  (t = e.onError) == null || t.call(e, a);
49
59
  },
50
60
  providerName: e.providerName
51
- }), g = (a) => {
52
- e.action === "create" ? u.mutate({
53
- data: a || i.value
54
- }) : m.mutate({
55
- id: e.id,
56
- data: a || i.value
61
+ }), N = (a) => {
62
+ u.value ? r.mutate({
63
+ id: i.value,
64
+ data: a || n.value
65
+ }) : o.mutate({
66
+ data: a || n.value
57
67
  });
58
- }, h = o(() => l.value || u.isLoading.value || m.isLoading.value);
68
+ }, b = f(() => h.value || o.isLoading.value || r.isLoading.value);
59
69
  return {
60
- form: i,
61
- initData: n,
62
- isLoading: h,
63
- isEdit: d,
64
- onSubmit: g,
65
- onReset: r
70
+ form: n,
71
+ initData: u.value ? c.value : l.value,
72
+ isLoading: b,
73
+ isEdit: u,
74
+ onSubmit: N,
75
+ onReset: d
66
76
  };
67
77
  }
68
78
  export {
69
- w as useForm
79
+ x as useForm
70
80
  };
@@ -1,17 +1,19 @@
1
1
  import { toRef as d, computed as c } from "vue";
2
2
  import { useForm as l } from "./form.js";
3
- import { useValidateForm as E } from "./formValidate.js";
3
+ import { useValidateForm as v } from "./formValidate.js";
4
4
  function F(t) {
5
- const n = d(t, "form", {}), { validate: m, reset: s } = E({
6
- data: n,
5
+ const o = d(t, "form", {}), { validate: m, reset: s } = v({
6
+ data: o,
7
7
  rules: t.rules
8
8
  }), u = c(() => {
9
- const { form: o, ...r } = t;
9
+ const { form: n, ...r } = t;
10
10
  return {
11
- ...r,
12
- form: o
11
+ ...r
13
12
  };
14
- }), e = l(u.value), a = (o) => {
13
+ }), e = l({
14
+ ...u.value,
15
+ form: o.value
16
+ }), a = (n) => {
15
17
  m().then((r) => {
16
18
  var i;
17
19
  if (!r.valid) {
@@ -20,7 +22,7 @@ function F(t) {
20
22
  });
21
23
  return;
22
24
  }
23
- e.onSubmit(o);
25
+ e.onSubmit(n);
24
26
  });
25
27
  }, f = () => {
26
28
  e.onReset(), s();
@@ -28,7 +30,7 @@ function F(t) {
28
30
  return {
29
31
  isLoading: e.isLoading,
30
32
  isEdit: e.isEdit,
31
- form: n,
33
+ form: o,
32
34
  onSubmit: a,
33
35
  onReset: f
34
36
  };
@@ -1,42 +1,36 @@
1
- import { computed as a } from "vue";
1
+ import { toRef as o, computed as a } from "vue";
2
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({
7
- get path() {
8
- return e.path || "";
9
- },
10
- get filters() {
11
- return e.params;
12
- },
13
- get providerName() {
14
- return e.providerName;
15
- }
16
- }), d = a(() => {
17
- var r, n, i, t, l, s;
18
- return e.converTree ? m(((n = o.value) == null ? void 0 : n.data) || [], {
3
+ import { arrayToTree as K, treeToArr as f } from "../utils/tree.js";
4
+ import { useList as O } from "./data.js";
5
+ function D(e) {
6
+ const u = o(e, "path"), m = o(e, "params"), h = o(e, "providerName"), { data: d, isLoading: v } = O({
7
+ path: u.value || "",
8
+ filters: m.value,
9
+ providerName: h.value
10
+ }), s = a(() => {
11
+ var r, n, i, t, l, c;
12
+ return e.converTree ? K(((n = d.value) == null ? void 0 : n.data) || [], {
19
13
  idKey: ((i = e.treeOptions) == null ? void 0 : i.valueKey) || "id",
20
- parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parentId",
14
+ parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parent_id",
21
15
  sortKey: ((l = e.treeOptions) == null ? void 0 : l.sortKey) || "sort",
22
- childrenKey: ((s = e.treeOptions) == null ? void 0 : s.childrenKey) || "children"
23
- }) : ((r = o.value) == null ? void 0 : r.data) || [];
24
- }), u = a(() => {
16
+ childrenKey: ((c = e.treeOptions) == null ? void 0 : c.childrenKey) || "children"
17
+ }) : ((r = d.value) == null ? void 0 : r.data) || [];
18
+ }), p = a(() => {
25
19
  var r, n;
26
- return y(d.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
27
- }), h = a(() => c.value);
20
+ return f(s.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
21
+ }), y = a(() => v.value);
28
22
  return {
29
23
  options: a(() => {
30
24
  const r = (n) => n.map((i) => {
31
25
  const t = { ...i };
32
26
  return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = r(t.children)), t;
33
27
  });
34
- return r(d.value || []);
28
+ return r(s.value || []);
35
29
  }),
36
- loading: h,
37
- expanded: u
30
+ loading: y,
31
+ expanded: p
38
32
  };
39
33
  }
40
34
  export {
41
- T as useTree
35
+ D as useTree
42
36
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as U, inject as V, createVNode as q } from "vue";
2
- import { OverlaysProvider as B } from "@overlastic/vue";
3
- import { useRouter as G } from "vue-router";
4
- import { useCan as H } from "../hooks/auth.js";
5
- import { useConfig as K } from "../hooks/config.js";
1
+ import { defineComponent as T, inject as U, createVNode as V } from "vue";
2
+ import { OverlaysProvider as q } from "@overlastic/vue";
3
+ import { useRouter as B } from "vue-router";
4
+ import { useCan as G } from "../hooks/auth.js";
5
+ import { useConfig as H } from "../hooks/config.js";
6
6
  import "@tanstack/vue-query";
7
- import { useManage as Q } from "../hooks/manage.js";
7
+ import { useManage as K } from "../hooks/manage.js";
8
8
  import "json-2-csv";
9
9
  import "lodash-es";
10
10
  import "@vee-validate/rules";
11
11
  import "vee-validate";
12
- import { useAuthStore as T } from "../stores/auth.js";
12
+ import { useAuthStore as Q } from "../stores/auth.js";
13
13
  import { useI18nStore as W } from "../stores/i18n.js";
14
14
  import "pinia";
15
15
  import { useManageStore as X } from "../stores/manage.js";
@@ -22,49 +22,49 @@ import "colorizr";
22
22
  import "axios";
23
23
  import "clsx";
24
24
  import { DuxError as x } from "../components/status/error.js";
25
- import { DuxNotAuthorized as ee } from "../components/status/notAuthorized.js";
26
- import { DuxNotFound as oe } from "../components/status/notFound.js";
27
- const Ie = /* @__PURE__ */ U({
25
+ import { DuxNotAuthorized as tt } from "../components/status/notAuthorized.js";
26
+ import { DuxNotFound as ot } from "../components/status/notFound.js";
27
+ const Et = /* @__PURE__ */ T({
28
28
  name: "DuxAppProvider",
29
29
  props: {},
30
- setup(te, {
31
- slots: c
30
+ setup(et, {
31
+ slots: h
32
32
  }) {
33
- const f = V("dux.manage"), u = K(), s = G();
34
- return s.beforeEach(async (n, re, a) => {
35
- var P, b, R, A, S, $, k, M, z, D, w, C, I, N;
33
+ const l = U("dux.manage"), f = H(), d = B();
34
+ return d.beforeEach(async (n, rt, i) => {
35
+ var A, S, $, k, M, w, z, D, C, E, I, N, F, L;
36
36
  const o = n.meta.manageName, J = n.meta.authorization === !1;
37
37
  if (!o) {
38
- const e = u.defaultManage || ((b = (P = u.manages) == null ? void 0 : P[0]) == null ? void 0 : b.name) || "";
39
- return a({
40
- path: `/${e}`,
38
+ const t = f.defaultManage || ((S = (A = f.manages) == null ? void 0 : A[0]) == null ? void 0 : S.name) || "";
39
+ return i({
40
+ path: `/${t}`,
41
41
  replace: !0
42
42
  });
43
43
  }
44
- f && (f.value = o);
45
- const h = X(o);
46
- h.isInit() || h.setConfig((R = u.manages) == null ? void 0 : R.find((e) => e.name === o), u);
47
- const i = Y(o), r = Q(o), d = T(o), l = W(o);
48
- if ((A = r.config) != null && A.i18nProvider && !l.isInit()) {
49
- const e = l.getLocale();
50
- e && ((S = r.config) == null || S.i18nProvider.changeLocale(e));
44
+ l && (l.value = o);
45
+ const P = X(o);
46
+ P.isInit() || P.setConfig(($ = f.manages) == null ? void 0 : $.find((t) => t.name === o), f);
47
+ const c = Y(o), e = K(o), g = Q(o), v = W(o);
48
+ if ((k = e.config) != null && k.i18nProvider && !v.isInit()) {
49
+ const t = v.getLocale();
50
+ t && ((M = e.config) == null || M.i18nProvider.changeLocale(t));
51
51
  }
52
- if (Z(u, o), !d.isLogin())
53
- return J ? a() : a({
54
- path: r.getRoutePath("login"),
52
+ if (Z(f, o), !g.isLogin())
53
+ return J ? i() : i({
54
+ path: e.getRoutePath("login"),
55
55
  replace: !0
56
56
  });
57
- const g = (e) => e == null ? void 0 : e.map((p) => ({
57
+ const R = (t) => t == null ? void 0 : t.map((p) => ({
58
58
  ...p,
59
- path: p.path ? r.getRoutePath(p.path) : void 0
59
+ path: p.path ? e.getRoutePath(p.path) : void 0
60
60
  }));
61
- if (!i.getRouteInit()) {
62
- const e = (($ = r.config) == null ? void 0 : $.components) || {}, p = [];
63
- if (p.push({
61
+ if (!c.getRouteInit()) {
62
+ const t = ((w = e.config) == null ? void 0 : w.components) || {}, p = [];
63
+ return p.push({
64
64
  name: `${o}.notFound`,
65
65
  label: "404",
66
66
  path: ":pathMatch(.*)*",
67
- component: e.notFound || oe,
67
+ component: t.notFound || ot,
68
68
  hidden: !0,
69
69
  meta: {
70
70
  can: !1
@@ -73,7 +73,7 @@ const Ie = /* @__PURE__ */ U({
73
73
  name: `${o}.notAuthorized`,
74
74
  label: "403",
75
75
  path: "notAuthorized",
76
- component: e.notAuthorized || ee,
76
+ component: t.notAuthorized || tt,
77
77
  hidden: !0,
78
78
  meta: {
79
79
  can: !1
@@ -82,79 +82,78 @@ const Ie = /* @__PURE__ */ U({
82
82
  name: `${o}.error`,
83
83
  label: "500",
84
84
  path: "error",
85
- component: e.error || x,
85
+ component: t.error || x,
86
86
  hidden: !0,
87
87
  meta: {
88
88
  can: !1
89
89
  }
90
- }), i.setRoutes(g(((k = r.config) == null ? void 0 : k.menus) || [])), (M = r.config) != null && M.apiRoutePath)
91
- try {
92
- await ((w = (D = (z = r.config) == null ? void 0 : z.dataProvider) == null ? void 0 : D.default) == null ? void 0 : w.custom({
93
- path: r.config.apiRoutePath,
94
- meta: {
95
- timeout: 5e3
96
- }
97
- }, r, d.getUser()).then((t) => {
98
- i.appendRoutes(g(t.data || []));
99
- }));
100
- } catch (t) {
101
- console.error(t);
90
+ }), c.setRoutes(R(((z = e.config) == null ? void 0 : z.menus) || [])), (D = e.config) != null && D.apiRoutePath && await ((I = (E = (C = e.config) == null ? void 0 : C.dataProvider) == null ? void 0 : E.default) == null ? void 0 : I.custom({
91
+ path: e.config.apiRoutePath,
92
+ meta: {
93
+ timeout: 5e3
102
94
  }
103
- return i.appendRoutes(p), i.getRoutes().forEach((t) => {
104
- var E, F, y, L;
105
- if (!t.path)
95
+ }, e, g.getUser()).then((r) => {
96
+ c.appendRoutes(R(r.data || []));
97
+ }).catch((r) => {
98
+ var a, m, s;
99
+ throw (s = (m = (a = e.config) == null ? void 0 : a.authProvider) == null ? void 0 : m.onError) == null || s.call(m, r).then((u) => {
100
+ u != null && u.logout && (g.logout(), d.push(e.getRoutePath(u.redirectTo || "/login")));
101
+ }), r;
102
+ })), c.appendRoutes(p), c.getRoutes().forEach((r) => {
103
+ var m, s, u, _;
104
+ if (!r.path)
106
105
  return;
107
- const m = {
108
- name: t.name,
109
- path: t.path,
110
- meta: t.meta
106
+ const a = {
107
+ name: r.name,
108
+ path: r.path,
109
+ meta: r.meta
111
110
  };
112
- switch (t.loader) {
111
+ switch (r.loader) {
113
112
  case "iframe":
114
- m.component = ((F = (E = r.config) == null ? void 0 : E.components) == null ? void 0 : F.iframe) || (() => import("../components/loader/iframe.js"));
113
+ a.component = ((s = (m = e.config) == null ? void 0 : m.components) == null ? void 0 : s.iframe) || (() => import("../components/loader/iframe.js"));
115
114
  break;
116
115
  case "remote":
117
- m.component = ((L = (y = r.config) == null ? void 0 : y.components) == null ? void 0 : L.remote) || (() => import("../components/loader/loader.js"));
116
+ a.component = ((_ = (u = e.config) == null ? void 0 : u.components) == null ? void 0 : _.remote) || (() => import("../components/loader/loader.js"));
118
117
  break;
119
118
  case "link":
120
- m.beforeEnter = () => {
119
+ a.beforeEnter = () => {
121
120
  var j;
122
- const _ = ((j = t.meta) == null ? void 0 : j.url) || t.path;
123
- return _ && window.open(_, "_blank"), !1;
124
- }, m.component = () => Promise.resolve({
121
+ const y = ((j = r.meta) == null ? void 0 : j.url) || r.path;
122
+ return y && window.open(y, "_blank"), !1;
123
+ }, a.component = () => Promise.resolve({
125
124
  template: "<div></div>"
126
125
  });
127
126
  break;
128
127
  default:
129
- t.component && (m.component = t.component);
128
+ r.component && (a.component = r.component);
130
129
  break;
131
130
  }
132
- s.addRoute(`${o}.auth`, m);
133
- }), a({
134
- path: ((C = n.redirectedFrom) == null ? void 0 : C.path) || n.path,
131
+ d.addRoute(`${o}.auth`, a);
132
+ }), i({
133
+ path: ((N = n.redirectedFrom) == null ? void 0 : N.path) || n.path,
135
134
  replace: !0
136
135
  });
137
136
  }
138
- const v = ["", "/", `/${o}`, `/${o}/`];
139
- if (v.includes(n.path)) {
140
- const e = i.getIndexRoute();
141
- return !(e != null && e.path) || v.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"), a()) : a({
142
- path: (e == null ? void 0 : e.path) || "/",
137
+ const b = ["", "/", `/${o}`, `/${o}/`];
138
+ if (b.includes(n.path)) {
139
+ const t = c.getIndexRoute();
140
+ return !(t != null && t.path) || b.includes(t == null ? void 0 : t.path) ? (console.warn("[Dux] index route not found, skip redirect"), i()) : i({
141
+ path: (t == null ? void 0 : t.path) || "/",
143
142
  replace: !0
144
143
  });
145
144
  }
146
- const O = H(o);
147
- return (((I = n.meta) == null ? void 0 : I.can) === void 0 || ((N = n.meta) == null ? void 0 : N.can) === !0) && !O(n.name) ? a({
145
+ const O = G(o);
146
+ return (((F = n.meta) == null ? void 0 : F.can) === void 0 || ((L = n.meta) == null ? void 0 : L.can) === !0) && !O(n.name) ? i({
148
147
  name: `${o}.notAuthorized`
149
- }) : a();
150
- }), () => q(B, null, {
148
+ }) : i();
149
+ }), () => V(q, null, {
151
150
  default: () => {
152
151
  var n;
153
- return [(n = c.default) == null ? void 0 : n.call(c)];
152
+ return [(n = h.default) == null ? void 0 : n.call(h)];
154
153
  }
155
154
  });
156
155
  }
157
156
  });
158
157
  export {
159
- Ie as DuxAppProvider
158
+ Et as DuxAppProvider
160
159
  };
@@ -1,43 +1,39 @@
1
1
  import { defineStore as u } from "pinia";
2
- import { inject as i, ref as a } from "vue";
3
- function h(t, e) {
4
- const o = t.toString ? t.toString() : String(t);
5
- return `${e}-${o.slice(0, 32)}`;
6
- }
7
- function y(t) {
8
- const e = i("dux.manage");
9
- if (t || (t = (e == null ? void 0 : e.value) || ""), !t)
2
+ import { inject as h, ref as a } from "vue";
3
+ function d(o) {
4
+ const e = h("dux.manage");
5
+ if (o || (o = (e == null ? void 0 : e.value) || ""), !o)
10
6
  throw new Error("manage not found");
11
- return l(t)();
7
+ return i(o)();
12
8
  }
13
- function l(t) {
14
- return u(`jsonSchema-${t}`, () => {
15
- const e = a(/* @__PURE__ */ new Map()), o = a(/* @__PURE__ */ new Map());
9
+ function i(o) {
10
+ return u(`jsonSchema-${o}`, () => {
11
+ const e = a(/* @__PURE__ */ new Map()), r = a(/* @__PURE__ */ new Map());
16
12
  return {
17
13
  componentCache: e,
18
- componentsByName: o,
19
- addComponent: (n, r, s) => {
20
- const c = h(n, r);
14
+ componentsByName: r,
15
+ addComponent: (t, n, s) => {
16
+ const c = n;
21
17
  return e.value.has(c) || (e.value.set(c, {
22
- component: n,
23
- name: r,
24
- originalName: s || r,
18
+ component: t,
19
+ name: n,
20
+ originalName: s || n,
25
21
  cacheKey: c
26
- }), o.value.set(r, n)), c;
22
+ }), r.value.set(n, t)), c;
27
23
  },
28
- getComponent: (n) => {
29
- var r;
30
- return (r = e.value.get(n)) == null ? void 0 : r.component;
24
+ getComponent: (t) => {
25
+ var n;
26
+ return (n = e.value.get(t)) == null ? void 0 : n.component;
31
27
  },
32
- getComponentByName: (n) => o.value.get(n),
33
- hasComponent: (n) => e.value.has(n),
28
+ getComponentByName: (t) => r.value.get(t),
29
+ hasComponent: (t) => e.value.has(t),
34
30
  clearCache: () => {
35
- e.value.clear(), o.value.clear();
31
+ e.value.clear(), r.value.clear();
36
32
  },
37
33
  getCacheSize: () => e.value.size
38
34
  };
39
35
  });
40
36
  }
41
37
  export {
42
- y as useJsonSchemaStore
38
+ d as useJsonSchemaStore
43
39
  };
@@ -1,19 +1,19 @@
1
1
  import { defineStore as w } from "pinia";
2
2
  import { inject as j, ref as R } from "vue";
3
- function b(n) {
3
+ function b(u) {
4
4
  const t = j("dux.manage");
5
- if (n || (n = (t == null ? void 0 : t.value) || ""), !n)
5
+ if (u || (u = (t == null ? void 0 : t.value) || ""), !u)
6
6
  throw new Error("manage not found");
7
- return E(n)();
7
+ return E(u)();
8
8
  }
9
- function E(n) {
10
- return w(`routes-${n}`, () => {
11
- const t = R([]), a = (e) => {
9
+ function E(u) {
10
+ return w(`routes-${u}`, () => {
11
+ const t = R([]), l = (e) => {
12
12
  var o;
13
- return (o = t.value) == null ? void 0 : o.find((u) => u.path === e);
13
+ return (o = t.value) == null ? void 0 : o.find((s) => s.path === e);
14
14
  }, p = (e) => {
15
15
  var o;
16
- return (o = t.value) == null ? void 0 : o.find((u) => u.name === e);
16
+ return (o = t.value) == null ? void 0 : o.find((s) => s.name === e);
17
17
  }, h = (e) => {
18
18
  var o;
19
19
  (o = t.value) == null || o.push(e);
@@ -24,27 +24,30 @@ function E(n) {
24
24
  }, x = () => t.value, g = () => {
25
25
  t.value = [];
26
26
  }, m = () => {
27
- var u, f;
28
- const e = (f = (u = t.value) == null ? void 0 : u.filter((r) => !r.parent && !r.name.includes("404") && !r.name.includes("403"))) == null ? void 0 : f.sort((r, s) => (r.sort || 0) - (s.sort || 0)), o = (r) => {
29
- var d, v;
27
+ var s, d;
28
+ const e = (d = (s = t.value) == null ? void 0 : s.filter((r) => {
29
+ var n, c;
30
+ return !r.parent && !((n = r.name) != null && n.includes("404")) && !((c = r.name) != null && c.includes("403"));
31
+ })) == null ? void 0 : d.sort((r, n) => (r.sort || 0) - (n.sort || 0)), o = (r) => {
32
+ var c, v;
30
33
  if (r.path)
31
34
  return r;
32
- const s = (v = (d = t.value) == null ? void 0 : d.filter((c) => c.parent === r.name)) == null ? void 0 : v.sort((c, i) => (c.sort || 0) - (i.sort || 0));
33
- for (const c of s || []) {
34
- const i = o(c);
35
- if (i)
36
- return i;
35
+ const n = (v = (c = t.value) == null ? void 0 : c.filter((i) => i.parent === r.name)) == null ? void 0 : v.sort((i, a) => (i.sort || 0) - (a.sort || 0));
36
+ for (const i of n || []) {
37
+ const a = o(i);
38
+ if (a)
39
+ return a;
37
40
  }
38
41
  };
39
42
  for (const r of e || []) {
40
- const s = o(r);
41
- if (s)
42
- return s;
43
+ const n = o(r);
44
+ if (n)
45
+ return n;
43
46
  }
44
- }, l = R(!1);
47
+ }, f = R(!1);
45
48
  return {
46
49
  routes: t,
47
- searchRoute: a,
50
+ searchRoute: l,
48
51
  searchRouteName: p,
49
52
  appendRoute: h,
50
53
  appendRoutes: S,
@@ -53,8 +56,8 @@ function E(n) {
53
56
  clearRoutes: g,
54
57
  getIndexRoute: m,
55
58
  getRouteInit: () => {
56
- const e = l.value;
57
- return l.value = !0, e;
59
+ const e = f.value;
60
+ return f.value = !0, e;
58
61
  }
59
62
  };
60
63
  });