@duxweb/dvha-core 0.0.8 → 0.0.9

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 (44) hide show
  1. package/dist/cjs/components/loader/iframe.cjs +1 -0
  2. package/dist/cjs/hooks/auth.cjs +1 -1
  3. package/dist/cjs/hooks/data.cjs +1 -1
  4. package/dist/cjs/hooks/manage.cjs +1 -1
  5. package/dist/cjs/hooks/menu.cjs +1 -1
  6. package/dist/cjs/hooks/theme.cjs +1 -1
  7. package/dist/cjs/index.cjs +1 -1
  8. package/dist/cjs/provider/app.cjs +1 -1
  9. package/dist/cjs/provider/tab.cjs +1 -1
  10. package/dist/cjs/simple/authProvider.cjs +1 -1
  11. package/dist/cjs/simple/dataProvider.cjs +1 -1
  12. package/dist/cjs/stores/auth.cjs +1 -1
  13. package/dist/cjs/stores/manage.cjs +1 -0
  14. package/dist/cjs/stores/route.cjs +1 -1
  15. package/dist/cjs/stores/tab.cjs +1 -1
  16. package/dist/esm/components/loader/iframe.js +22 -0
  17. package/dist/esm/hooks/auth.js +34 -36
  18. package/dist/esm/hooks/data.js +237 -219
  19. package/dist/esm/hooks/manage.js +16 -18
  20. package/dist/esm/hooks/menu.js +13 -14
  21. package/dist/esm/hooks/theme.js +16 -16
  22. package/dist/esm/index.js +51 -51
  23. package/dist/esm/provider/app.js +58 -55
  24. package/dist/esm/provider/tab.js +11 -10
  25. package/dist/esm/simple/authProvider.js +111 -88
  26. package/dist/esm/simple/dataProvider.js +95 -90
  27. package/dist/esm/stores/auth.js +49 -48
  28. package/dist/esm/stores/manage.js +41 -0
  29. package/dist/esm/stores/route.js +0 -1
  30. package/dist/esm/stores/tab.js +1 -2
  31. package/dist/types/components/loader/index.d.ts +1 -1
  32. package/dist/types/hooks/data.d.ts +17 -2
  33. package/dist/types/hooks/manage.d.ts +1 -1
  34. package/dist/types/simple/authProvider.d.ts +16 -1
  35. package/dist/types/simple/dataProvider.d.ts +4 -1
  36. package/dist/types/stores/auth.d.ts +28 -22
  37. package/dist/types/stores/index.d.ts +1 -0
  38. package/dist/types/stores/manage.d.ts +23 -0
  39. package/dist/types/stores/route.d.ts +0 -2019
  40. package/dist/types/stores/tab.d.ts +1 -830
  41. package/dist/types/types/config.d.ts +1 -2
  42. package/dist/types/types/data.d.ts +1 -0
  43. package/dist/types/types/manage.d.ts +1 -2
  44. package/package.json +2 -2
@@ -2,13 +2,12 @@ import { cloneDeep as S } from "lodash-es";
2
2
  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
- import "../stores/auth.js";
6
5
  import { useRouteStore as B } from "../stores/route.js";
7
6
  import { arrayToTree as A, searchTree as M } from "../utils/tree.js";
8
- function O(n) {
7
+ function N(n) {
9
8
  const D = B(), { routes: L } = q(D), y = (e = !0) => {
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);
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);
12
11
  }, b = v(() => {
13
12
  const e = y(!1);
14
13
  return A(e, {
@@ -29,25 +28,25 @@ function O(n) {
29
28
  if (n != null && n.doubleMenu)
30
29
  return c.value;
31
30
  const e = S(c.value);
32
- return e == null ? void 0 : e.map((t) => (delete t.children, t));
31
+ return e == null ? void 0 : e.map((a) => (delete a.children, a));
33
32
  }), x = v(() => {
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));
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));
37
36
  h(() => n == null ? void 0 : n.doubleMenu, () => {
38
- var e, t, a, d;
37
+ var e, a, t, d;
39
38
  if (n != null && n.doubleMenu) {
40
39
  const u = M(c.value, (l) => (l == null ? void 0 : l.name) === r.value);
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;
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;
42
41
  } else {
43
42
  const u = M(c.value, (l) => (l == null ? void 0 : l.name) === o.value);
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;
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;
45
44
  }
46
45
  }, { immediate: !0 });
47
46
  const j = v(() => n != null && n.doubleMenu ? (n == null ? void 0 : n.doubleMenu) || x.value.length > 0 : !0);
48
47
  return h([i, b, () => n == null ? void 0 : n.doubleMenu], () => {
49
48
  var d, u, l, T, I;
50
- const e = M(b.value, (m) => m.name === i.name), a = ((m) => {
49
+ const e = M(b.value, (m) => m.name === i.name), t = ((m) => {
51
50
  let R = -1;
52
51
  for (let f = m.length - 1; f >= 0; f--)
53
52
  if (m[f].hidden === !1 || m[f].hidden === void 0) {
@@ -56,7 +55,7 @@ function O(n) {
56
55
  }
57
56
  return R;
58
57
  })(e);
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);
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);
60
59
  }, { immediate: !0 }), {
61
60
  data: c,
62
61
  originalData: b,
@@ -71,5 +70,5 @@ function O(n) {
71
70
  };
72
71
  }
73
72
  export {
74
- O as useMenu
73
+ N as useMenu
75
74
  };
@@ -1,31 +1,31 @@
1
- import { useColorMode as g, useCycleList as f } from "@vueuse/core";
2
- import { watchEffect as d, computed as i } from "vue";
3
- import { useManage as h } from "./manage.js";
4
- function b(l) {
5
- const r = g(l), e = h(), { state: n, next: m } = f(["dark", "light", "auto"], {
1
+ import { useColorMode as k, useCycleList as v } from "@vueuse/core";
2
+ import { watchEffect as p, computed as g } from "vue";
3
+ import { useManage as b } from "./manage.js";
4
+ function C(f) {
5
+ const r = k(f), e = b(), { state: n, next: d } = v(["dark", "light", "auto"], {
6
6
  initialValue: r
7
7
  });
8
- d(() => r.value = n.value);
9
- const a = i(() => {
8
+ p(() => r.value = n.value);
9
+ const a = g(() => {
10
10
  const { system: o, store: t } = r;
11
11
  return n.value === "auto" ? o.value === "dark" : t.value === "dark";
12
- }), s = i(() => {
13
- var o, t, u, c;
12
+ }), h = g(() => {
13
+ var o, t, u, c, i, l, m, s;
14
14
  return a.value ? {
15
- logo: (o = e.config.theme) == null ? void 0 : o.darkLogo,
16
- banner: (t = e.config.theme) == null ? void 0 : t.darkBanner
15
+ logo: (t = (o = e.config) == null ? void 0 : o.theme) == null ? void 0 : t.darkLogo,
16
+ banner: (c = (u = e.config) == null ? void 0 : u.theme) == null ? void 0 : c.darkBanner
17
17
  } : {
18
- logo: (u = e.config.theme) == null ? void 0 : u.logo,
19
- banner: (c = e.config.theme) == null ? void 0 : c.banner
18
+ logo: (l = (i = e.config) == null ? void 0 : i.theme) == null ? void 0 : l.logo,
19
+ banner: (s = (m = e.config) == null ? void 0 : m.theme) == null ? void 0 : s.banner
20
20
  };
21
21
  });
22
22
  return {
23
- toggle: m,
23
+ toggle: d,
24
24
  mode: n,
25
25
  isDark: a,
26
- theme: s
26
+ theme: h
27
27
  };
28
28
  }
29
29
  export {
30
- b as useTheme
30
+ C as useTheme
31
31
  };
package/dist/esm/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { createDux as u } from "./main.js";
2
- import { useCheck as a, useError as p, useForgotPassword as m, useGetAuth as x, useIsLogin as f, useLogin as i, useLogout as n, useRegister as d, useUpdatePassword as g } from "./hooks/auth.js";
3
- import { useConfig as D } from "./hooks/config.js";
4
- import { useClient as y, useCreate as C, useCreateMany as M, useCustom as h, useCustomMutation as v, useDelete as L, useDeleteMany as c, useInfiniteList as A, useInvalidate as P, useList as R, useMany as S, useOne as b, useUpdate as w, useUpdateMany as I } from "./hooks/data.js";
5
- import { useManage as U } from "./hooks/manage.js";
6
- import { useMenu as E } from "./hooks/menu.js";
7
- import { useTheme as G } from "./hooks/theme.js";
8
- import { useOverlay as j } from "./hooks/overlay.js";
9
- import { initRouter as z } from "./router/route.js";
10
- import { useAuthStore as H } from "./stores/auth.js";
11
- import { createRouteStore as K, useRouteStore as N } from "./stores/route.js";
12
- import { createTabStore as W, useTabStore as X } from "./stores/tab.js";
13
- import { DuxLogo as Z } from "./components/common/logo.js";
14
- import "vue";
15
- import "vue-router";
1
+ import { createDux as o } from "./main.js";
2
+ import { useCheck as u, useError as s, useForgotPassword as a, useGetAuth as p, useIsLogin as m, useLogin as x, useLogout as f, useRegister as i, useUpdatePassword as n } from "./hooks/auth.js";
3
+ import { useConfig as g } from "./hooks/config.js";
4
+ import { useClient as D, useCreate as M, useCreateMany as y, useCustom as C, useCustomMutation as L, useDelete as T, useDeleteMany as h, useInfiniteList as v, useInvalidate as A, useList as P, useMany as I, useOne as R, useUpdate as S, useUpdateMany as c } from "./hooks/data.js";
5
+ import { useManage as O } from "./hooks/manage.js";
6
+ import { useMenu as b } from "./hooks/menu.js";
7
+ import { useTheme as E } from "./hooks/theme.js";
8
+ import { useOverlay as G } from "./hooks/overlay.js";
9
+ import { initRouter as j } from "./router/route.js";
10
+ import { useAuthStore as z } from "./stores/auth.js";
11
+ import { useRouteStore as H } from "./stores/route.js";
12
+ import { useTabStore as K } from "./stores/tab.js";
13
+ import { useManageStore as Q } from "./stores/manage.js";
14
+ import { DuxLogo as X } from "./components/common/logo.js";
15
+ import { default as Z } from "./components/loader/iframe.js";
16
16
  import { DuxOverlay as $ } from "./components/overlay/overlay.js";
17
17
  import { arrayToTree as re, searchTree as oe, treeToArr as te } from "./utils/tree.js";
18
18
  import { DuxAppProvider as se } from "./provider/app.js";
@@ -21,47 +21,47 @@ import { simpleAuthProvider as xe } from "./simple/authProvider.js";
21
21
  import { simpleDataProvider as ie } from "./simple/dataProvider.js";
22
22
  export {
23
23
  se as DuxAppProvider,
24
- Z as DuxLogo,
24
+ Z as DuxLoaderIframe,
25
+ X as DuxLogo,
25
26
  $ as DuxOverlay,
26
27
  pe as DuxTabRouterView,
27
28
  re as arrayToTree,
28
- u as createDux,
29
- K as createRouteStore,
30
- W as createTabStore,
31
- z as initRouter,
29
+ o as createDux,
30
+ j as initRouter,
32
31
  oe as searchTree,
33
32
  xe as simpleAuthProvider,
34
33
  ie as simpleDataProvider,
35
34
  te as treeToArr,
36
- H as useAuthStore,
37
- a as useCheck,
38
- y as useClient,
39
- D as useConfig,
40
- C as useCreate,
41
- M as useCreateMany,
42
- h as useCustom,
43
- v as useCustomMutation,
44
- L as useDelete,
45
- c as useDeleteMany,
46
- p as useError,
47
- m as useForgotPassword,
48
- x as useGetAuth,
49
- A as useInfiniteList,
50
- P as useInvalidate,
51
- f as useIsLogin,
52
- R as useList,
53
- i as useLogin,
54
- n as useLogout,
55
- U as useManage,
56
- S as useMany,
57
- E as useMenu,
58
- b as useOne,
59
- j as useOverlay,
60
- d as useRegister,
61
- N as useRouteStore,
62
- X as useTabStore,
63
- G as useTheme,
64
- w as useUpdate,
65
- I as useUpdateMany,
66
- g as useUpdatePassword
35
+ z as useAuthStore,
36
+ u as useCheck,
37
+ D as useClient,
38
+ g as useConfig,
39
+ M as useCreate,
40
+ y as useCreateMany,
41
+ C as useCustom,
42
+ L as useCustomMutation,
43
+ T as useDelete,
44
+ h as useDeleteMany,
45
+ s as useError,
46
+ a as useForgotPassword,
47
+ p as useGetAuth,
48
+ v as useInfiniteList,
49
+ A as useInvalidate,
50
+ m as useIsLogin,
51
+ P as useList,
52
+ x as useLogin,
53
+ f as useLogout,
54
+ O as useManage,
55
+ Q as useManageStore,
56
+ I as useMany,
57
+ b as useMenu,
58
+ R as useOne,
59
+ G as useOverlay,
60
+ i as useRegister,
61
+ H as useRouteStore,
62
+ K as useTabStore,
63
+ E as useTheme,
64
+ S as useUpdate,
65
+ c as useUpdateMany,
66
+ n as useUpdatePassword
67
67
  };
@@ -1,127 +1,130 @@
1
- import { defineComponent as y, inject as D, createVNode as E } from "vue";
2
- import { OverlaysProvider as F } from "@overlastic/vue";
3
- import { storeToRefs as N } from "pinia";
1
+ import { defineComponent as E, inject as F, createVNode as I } from "vue";
2
+ import { OverlaysProvider as N } from "@overlastic/vue";
4
3
  import { useRouter as _ } from "vue-router";
5
- import { useAuthStore as C } from "../stores/auth.js";
6
- import { useManage as I } from "../hooks/manage.js";
7
- import { useConfig as j } from "../hooks/config.js";
4
+ import { useAuthStore as j } from "../stores/auth.js";
5
+ import { useManage as L } from "../hooks/manage.js";
6
+ import { useConfig as O } from "../hooks/config.js";
8
7
  import "@tanstack/vue-query";
9
8
  import "lodash-es";
10
- import { useRouteStore as L } from "../stores/route.js";
9
+ import "pinia";
10
+ import { useRouteStore as U } from "../stores/route.js";
11
+ import { useManageStore as V } from "../stores/manage.js";
11
12
  import "@vueuse/core";
12
13
  import "clsx";
13
- const Z = /* @__PURE__ */ y({
14
+ const oe = /* @__PURE__ */ E({
14
15
  name: "DuxAppProvider",
15
16
  props: {},
16
- setup(O, {
17
- slots: i
17
+ setup(q, {
18
+ slots: m
18
19
  }) {
19
- const m = D("dux.manage"), f = j(), s = _(), h = C();
20
- return s.beforeEach(async (a, T, n) => {
21
- var g, v, P, R, b, A;
22
- const o = a.meta.manageName, z = a.meta.authorization === !1;
23
- if (!o) {
24
- const e = f.defaultManage || ((v = (g = f.manages) == null ? void 0 : g[0]) == null ? void 0 : v.name) || "";
20
+ const f = F("dux.manage"), c = O(), s = _();
21
+ return s.beforeEach(async (a, B, n) => {
22
+ var P, R, b, v, A, M, $, k, S;
23
+ const t = a.meta.manageName, D = a.meta.authorization === !1;
24
+ if (!t) {
25
+ const e = c.defaultManage || ((R = (P = c.manages) == null ? void 0 : P[0]) == null ? void 0 : R.name) || "";
25
26
  return n({
26
27
  path: `/${e}`,
27
28
  replace: !0
28
29
  });
29
30
  }
30
- m && (m.value = o);
31
- const u = L(o), {
32
- routes: S
33
- } = N(u), r = I(o);
34
- if (!h.isLogin(o))
35
- return z ? n() : n({
31
+ f && (f.value = t);
32
+ const h = V(t);
33
+ h.isInit() || h.setConfig((b = c.manages) == null ? void 0 : b.find((e) => e.name === t), c);
34
+ const u = U(t), r = L(t), d = j(t);
35
+ if (!d.isLogin())
36
+ return D ? n() : n({
36
37
  path: r.getRoutePath("login"),
37
38
  replace: !0
38
39
  });
39
- const d = (e) => e == null ? void 0 : e.map((p) => ({
40
+ const l = (e) => e == null ? void 0 : e.map((p) => ({
40
41
  ...p,
41
42
  path: r.getRoutePath(p.path || "")
42
43
  }));
43
44
  if (!u.getRouteInit()) {
44
- const e = ((P = r.config) == null ? void 0 : P.components) || {}, p = [];
45
+ const e = ((v = r.config) == null ? void 0 : v.components) || {}, p = [];
45
46
  if (e.notFound && p.push({
46
- name: `${o}.notFound`,
47
+ name: `${t}.notFound`,
47
48
  label: "404",
48
49
  path: ":pathMatch(.*)*",
49
50
  component: e.notFound,
50
51
  hidden: !0
51
52
  }), e.notAuthorized && p.push({
52
- name: `${o}.notAuthorized`,
53
+ name: `${t}.notAuthorized`,
53
54
  label: "403",
54
55
  path: "notAuthorized",
55
56
  component: e.notAuthorized,
56
57
  hidden: !0
57
58
  }), e.error && p.push({
58
- name: `${o}.error`,
59
+ name: `${t}.error`,
59
60
  label: "500",
60
61
  path: "error",
61
62
  component: e.error,
62
63
  hidden: !0
63
- }), u.setRoutes(d(((R = r.config) == null ? void 0 : R.menus) || [])), (b = r.config) != null && b.apiRoutePath)
64
+ }), u.setRoutes(l(((A = r.config) == null ? void 0 : A.menus) || [])), (M = r.config) != null && M.apiRoutePath) {
65
+ console.log("config", r.config.default);
64
66
  try {
65
- await ((A = r.config.dataProvider) == null ? void 0 : A.custom({
67
+ await ((S = (k = ($ = r.config) == null ? void 0 : $.dataProvider) == null ? void 0 : k.default) == null ? void 0 : S.custom({
66
68
  path: r.config.apiRoutePath,
67
69
  meta: {
68
70
  timeout: 5e3
69
71
  }
70
- }, r, h.getUser(o)).then((t) => {
71
- u.appendRoutes(d(t.data || []));
72
+ }, r, d.getUser()).then((o) => {
73
+ u.appendRoutes(l(o.data || []));
72
74
  }));
73
- } catch (t) {
74
- console.error(t);
75
+ } catch (o) {
76
+ console.error(o);
75
77
  }
76
- return u.appendRoutes(p), S.value.forEach((t) => {
77
- var $, k;
78
- if (!t.path)
78
+ }
79
+ return u.appendRoutes(p), u.getRoutes().forEach((o) => {
80
+ var w, z;
81
+ if (!o.path)
79
82
  return;
80
- const c = {
81
- name: t.name,
82
- path: t.path,
83
- meta: t.meta
83
+ const i = {
84
+ name: o.name,
85
+ path: o.path,
86
+ meta: o.meta
84
87
  };
85
- switch (t.loader) {
88
+ switch (o.loader) {
86
89
  case "iframe":
87
- c.component = (k = ($ = r.config) == null ? void 0 : $.components) == null ? void 0 : k.iframe;
90
+ i.component = ((z = (w = r.config) == null ? void 0 : w.components) == null ? void 0 : z.iframe) || (() => import("../components/loader/iframe.js"));
88
91
  break;
89
92
  case "link":
90
- c.beforeEnter = () => {
91
- var w;
92
- const M = ((w = t.meta) == null ? void 0 : w.url) || t.path;
93
- return M && window.open(M, "_blank"), !1;
94
- }, c.component = () => Promise.resolve({
93
+ i.beforeEnter = () => {
94
+ var C;
95
+ const y = ((C = o.meta) == null ? void 0 : C.url) || o.path;
96
+ return y && window.open(y, "_blank"), !1;
97
+ }, i.component = () => Promise.resolve({
95
98
  template: "<div></div>"
96
99
  });
97
100
  break;
98
101
  default:
99
- t.component && (c.component = t.component);
102
+ o.component && (i.component = o.component);
100
103
  break;
101
104
  }
102
- s.addRoute(`${o}.auth`, c);
105
+ s.addRoute(`${t}.auth`, i);
103
106
  }), n({
104
107
  path: a.fullPath,
105
108
  replace: !0
106
109
  });
107
110
  }
108
- const l = ["", "/", `/${o}`, `/${o}/`];
109
- if (l.includes(a.path)) {
111
+ const g = ["", "/", `/${t}`, `/${t}/`];
112
+ if (g.includes(a.path)) {
110
113
  const e = u.getIndexRoute();
111
- return !(e != null && e.path) || l.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"), n()) : n({
114
+ return !(e != null && e.path) || g.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"), n()) : n({
112
115
  path: (e == null ? void 0 : e.path) || "/",
113
116
  replace: !0
114
117
  });
115
118
  }
116
119
  return n();
117
- }), () => E(F, null, {
120
+ }), () => I(N, null, {
118
121
  default: () => {
119
122
  var a;
120
- return [(a = i.default) == null ? void 0 : a.call(i)];
123
+ return [(a = m.default) == null ? void 0 : a.call(m)];
121
124
  }
122
125
  });
123
126
  }
124
127
  });
125
128
  export {
126
- Z as DuxAppProvider
129
+ oe as DuxAppProvider
127
130
  };
@@ -1,13 +1,14 @@
1
1
  import { defineComponent as c, watch as d, createVNode as m, Transition as l, KeepAlive as f } from "vue";
2
2
  import { useRoute as b, RouterView as h } from "vue-router";
3
- import "../stores/auth.js";
3
+ import "pinia";
4
4
  import { useRouteStore as R } from "../stores/route.js";
5
5
  import { useTabStore as w } from "../stores/tab.js";
6
- const g = /* @__PURE__ */ c({
6
+ import "lodash-es";
7
+ const k = /* @__PURE__ */ c({
7
8
  name: "DuxTabRouterView",
8
9
  props: {},
9
10
  setup() {
10
- const r = b(), u = w(), s = R(), n = /* @__PURE__ */ new Map(), p = (e, t) => {
11
+ const r = b(), u = w(), i = R(), n = /* @__PURE__ */ new Map(), p = (e, t) => {
11
12
  let a;
12
13
  const o = e;
13
14
  return n.has(o) ? a = n.get(o) : (a = {
@@ -22,15 +23,15 @@ const g = /* @__PURE__ */ c({
22
23
  t.tabs.some((o) => o.path === a.name) || n.delete(a.name);
23
24
  });
24
25
  });
25
- const i = s.getIndexRoute();
26
- return i && u.addTab({
27
- ...i,
26
+ const s = i.getIndexRoute();
27
+ return s && u.addTab({
28
+ ...s,
28
29
  meta: {
29
- ...i.meta,
30
+ ...s.meta,
30
31
  lock: !0
31
32
  }
32
- }), d([r, () => s.routes], () => {
33
- const e = s.searchRouteName(r.name);
33
+ }), d([r, () => i.routes], () => {
34
+ const e = i.searchRouteName(r.name);
34
35
  if (!e)
35
36
  return;
36
37
  const t = {
@@ -60,5 +61,5 @@ const g = /* @__PURE__ */ c({
60
61
  }
61
62
  });
62
63
  export {
63
- g as DuxTabRouterView
64
+ k as DuxTabRouterView
64
65
  };