@duxweb/dvha-core 0.0.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/loader/iframe.cjs +1 -0
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/provider/tab.cjs +1 -1
- package/dist/cjs/simple/authProvider.cjs +1 -1
- package/dist/cjs/simple/dataProvider.cjs +1 -1
- package/dist/cjs/stores/auth.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -0
- package/dist/cjs/stores/route.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/esm/components/loader/iframe.js +22 -0
- package/dist/esm/hooks/auth.js +34 -36
- package/dist/esm/hooks/data.js +237 -219
- package/dist/esm/hooks/manage.js +16 -18
- package/dist/esm/hooks/menu.js +13 -14
- package/dist/esm/hooks/theme.js +16 -16
- package/dist/esm/index.js +51 -51
- package/dist/esm/provider/app.js +58 -55
- package/dist/esm/provider/tab.js +11 -10
- package/dist/esm/simple/authProvider.js +111 -88
- package/dist/esm/simple/dataProvider.js +95 -90
- package/dist/esm/stores/auth.js +49 -48
- package/dist/esm/stores/manage.js +41 -0
- package/dist/esm/stores/route.js +0 -1
- package/dist/esm/stores/tab.js +1 -2
- package/dist/types/components/loader/index.d.ts +1 -1
- package/dist/types/hooks/data.d.ts +17 -2
- package/dist/types/hooks/manage.d.ts +1 -1
- package/dist/types/simple/authProvider.d.ts +16 -1
- package/dist/types/simple/dataProvider.d.ts +4 -1
- package/dist/types/stores/auth.d.ts +28 -22
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/manage.d.ts +23 -0
- package/dist/types/stores/route.d.ts +0 -2019
- package/dist/types/stores/tab.d.ts +1 -830
- package/dist/types/types/config.d.ts +1 -2
- package/dist/types/types/data.d.ts +1 -0
- package/dist/types/types/manage.d.ts +1 -2
- package/package.json +2 -2
package/dist/esm/hooks/menu.js
CHANGED
|
@@ -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
|
|
7
|
+
function N(n) {
|
|
9
8
|
const D = B(), { routes: L } = q(D), y = (e = !0) => {
|
|
10
|
-
var
|
|
11
|
-
return (
|
|
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((
|
|
31
|
+
return e == null ? void 0 : e.map((a) => (delete a.children, a));
|
|
33
32
|
}), x = v(() => {
|
|
34
|
-
var
|
|
35
|
-
return n != null && n.doubleMenu ? [] : ((
|
|
36
|
-
}), w = v(() => M(b.value, (
|
|
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,
|
|
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 = (
|
|
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 = (
|
|
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),
|
|
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[
|
|
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
|
-
|
|
73
|
+
N as useMenu
|
|
75
74
|
};
|
package/dist/esm/hooks/theme.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { useColorMode as
|
|
2
|
-
import { watchEffect as
|
|
3
|
-
import { useManage as
|
|
4
|
-
function
|
|
5
|
-
const r =
|
|
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
|
-
|
|
9
|
-
const a =
|
|
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
|
-
}),
|
|
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 :
|
|
16
|
-
banner: (
|
|
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: (
|
|
19
|
-
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:
|
|
23
|
+
toggle: d,
|
|
24
24
|
mode: n,
|
|
25
25
|
isDark: a,
|
|
26
|
-
theme:
|
|
26
|
+
theme: h
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
C as useTheme
|
|
31
31
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { createDux as
|
|
2
|
-
import { useCheck as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useClient as
|
|
5
|
-
import { useManage as
|
|
6
|
-
import { useMenu as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import { useOverlay as
|
|
9
|
-
import { initRouter as
|
|
10
|
-
import { useAuthStore as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
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
|
|
24
|
+
Z as DuxLoaderIframe,
|
|
25
|
+
X as DuxLogo,
|
|
25
26
|
$ as DuxOverlay,
|
|
26
27
|
pe as DuxTabRouterView,
|
|
27
28
|
re as arrayToTree,
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
b as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
};
|
package/dist/esm/provider/app.js
CHANGED
|
@@ -1,127 +1,130 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { OverlaysProvider as
|
|
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
|
|
6
|
-
import { useManage as
|
|
7
|
-
import { useConfig as
|
|
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
|
|
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
|
|
14
|
+
const oe = /* @__PURE__ */ E({
|
|
14
15
|
name: "DuxAppProvider",
|
|
15
16
|
props: {},
|
|
16
|
-
setup(
|
|
17
|
-
slots:
|
|
17
|
+
setup(q, {
|
|
18
|
+
slots: m
|
|
18
19
|
}) {
|
|
19
|
-
const
|
|
20
|
-
return s.beforeEach(async (a,
|
|
21
|
-
var
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
const e =
|
|
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
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!
|
|
35
|
-
return
|
|
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
|
|
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 = ((
|
|
45
|
+
const e = ((v = r.config) == null ? void 0 : v.components) || {}, p = [];
|
|
45
46
|
if (e.notFound && p.push({
|
|
46
|
-
name: `${
|
|
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: `${
|
|
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: `${
|
|
59
|
+
name: `${t}.error`,
|
|
59
60
|
label: "500",
|
|
60
61
|
path: "error",
|
|
61
62
|
component: e.error,
|
|
62
63
|
hidden: !0
|
|
63
|
-
}), u.setRoutes(
|
|
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 ((
|
|
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,
|
|
71
|
-
u.appendRoutes(
|
|
72
|
+
}, r, d.getUser()).then((o) => {
|
|
73
|
+
u.appendRoutes(l(o.data || []));
|
|
72
74
|
}));
|
|
73
|
-
} catch (
|
|
74
|
-
console.error(
|
|
75
|
+
} catch (o) {
|
|
76
|
+
console.error(o);
|
|
75
77
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
}
|
|
79
|
+
return u.appendRoutes(p), u.getRoutes().forEach((o) => {
|
|
80
|
+
var w, z;
|
|
81
|
+
if (!o.path)
|
|
79
82
|
return;
|
|
80
|
-
const
|
|
81
|
-
name:
|
|
82
|
-
path:
|
|
83
|
-
meta:
|
|
83
|
+
const i = {
|
|
84
|
+
name: o.name,
|
|
85
|
+
path: o.path,
|
|
86
|
+
meta: o.meta
|
|
84
87
|
};
|
|
85
|
-
switch (
|
|
88
|
+
switch (o.loader) {
|
|
86
89
|
case "iframe":
|
|
87
|
-
|
|
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
|
-
|
|
91
|
-
var
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
},
|
|
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
|
-
|
|
102
|
+
o.component && (i.component = o.component);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
|
-
s.addRoute(`${
|
|
105
|
+
s.addRoute(`${t}.auth`, i);
|
|
103
106
|
}), n({
|
|
104
107
|
path: a.fullPath,
|
|
105
108
|
replace: !0
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
111
|
+
const g = ["", "/", `/${t}`, `/${t}/`];
|
|
112
|
+
if (g.includes(a.path)) {
|
|
110
113
|
const e = u.getIndexRoute();
|
|
111
|
-
return !(e != null && e.path) ||
|
|
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
|
-
}), () =>
|
|
120
|
+
}), () => I(N, null, {
|
|
118
121
|
default: () => {
|
|
119
122
|
var a;
|
|
120
|
-
return [(a =
|
|
123
|
+
return [(a = m.default) == null ? void 0 : a.call(m)];
|
|
121
124
|
}
|
|
122
125
|
});
|
|
123
126
|
}
|
|
124
127
|
});
|
|
125
128
|
export {
|
|
126
|
-
|
|
129
|
+
oe as DuxAppProvider
|
|
127
130
|
};
|
package/dist/esm/provider/tab.js
CHANGED
|
@@ -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 "
|
|
3
|
+
import "pinia";
|
|
4
4
|
import { useRouteStore as R } from "../stores/route.js";
|
|
5
5
|
import { useTabStore as w } from "../stores/tab.js";
|
|
6
|
-
|
|
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(),
|
|
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
|
|
26
|
-
return
|
|
27
|
-
...
|
|
26
|
+
const s = i.getIndexRoute();
|
|
27
|
+
return s && u.addTab({
|
|
28
|
+
...s,
|
|
28
29
|
meta: {
|
|
29
|
-
...
|
|
30
|
+
...s.meta,
|
|
30
31
|
lock: !0
|
|
31
32
|
}
|
|
32
|
-
}), d([r, () =>
|
|
33
|
-
const e =
|
|
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
|
-
|
|
64
|
+
k as DuxTabRouterView
|
|
64
65
|
};
|