@duxweb/dvha-core 0.1.20 → 0.1.22
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/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/render.cjs +1 -0
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/components/status/error.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -0
- package/dist/cjs/components/status/notAuthorized.cjs +1 -1
- package/dist/cjs/components/status/notFound.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -0
- package/dist/cjs/hooks/formValidate.cjs +1 -0
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +1 -1
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -0
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +2 -2
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/provider/tab.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/theme.cjs +9 -1
- package/dist/esm/components/auth/can.js +9 -7
- package/dist/esm/components/loader/loader.js +48 -0
- package/dist/esm/components/loader/remote/loader.js +150 -0
- package/dist/esm/components/loader/remote/render.js +19 -0
- package/dist/esm/components/overlay/overlay.js +22 -31
- package/dist/esm/components/status/error.js +3 -3
- package/dist/esm/components/status/exception.js +23 -0
- package/dist/esm/components/status/notAuthorized.js +2 -2
- package/dist/esm/components/status/notFound.js +4 -4
- package/dist/esm/directive/permission.js +5 -3
- package/dist/esm/hooks/auth.js +67 -67
- package/dist/esm/hooks/data.js +164 -160
- package/dist/esm/hooks/export.js +26 -23
- package/dist/esm/hooks/form.js +38 -35
- package/dist/esm/hooks/formExtend.js +38 -0
- package/dist/esm/hooks/formValidate.js +28 -0
- package/dist/esm/hooks/i18n.js +16 -8
- package/dist/esm/hooks/json/utils/expressionParser.js +1 -1
- package/dist/esm/hooks/json.js +57 -57
- package/dist/esm/hooks/list.js +179 -0
- package/dist/esm/hooks/manage.js +18 -13
- package/dist/esm/hooks/overlay.js +6 -4
- package/dist/esm/hooks/theme.js +11 -11
- package/dist/esm/index.js +129 -113
- package/dist/esm/main.js +22 -12
- package/dist/esm/preset/i18nProvider.js +17 -18
- package/dist/esm/provider/app.js +61 -53
- package/dist/esm/provider/tab.js +1 -1
- package/dist/esm/stores/manage.js +34 -24
- package/dist/esm/stores/tab.js +58 -49
- package/dist/esm/stores/theme.js +36 -34
- package/dist/esm/utils/theme.js +89 -76
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/loader/loader.d.ts +2 -0
- package/dist/types/components/loader/remote/index.d.ts +2 -0
- package/dist/types/components/loader/remote/loader.d.ts +1 -0
- package/dist/types/components/loader/remote/render.d.ts +1 -0
- package/dist/types/components/status/error.d.ts +1 -2
- package/dist/types/components/status/exception.d.ts +3 -0
- package/dist/types/components/status/index.d.ts +4 -0
- package/dist/types/components/status/notAuthorized.d.ts +1 -2
- package/dist/types/components/status/notFound.d.ts +1 -2
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/hooks/auth.d.ts +6 -6
- package/dist/types/hooks/data.d.ts +216 -216
- package/dist/types/hooks/form.d.ts +6 -3
- package/dist/types/hooks/formExtend.d.ts +12 -0
- package/dist/types/hooks/formValidate.d.ts +14 -0
- package/dist/types/hooks/i18n.d.ts +2 -0
- package/dist/types/hooks/import.d.ts +1 -2
- package/dist/types/hooks/index.d.ts +4 -1
- package/dist/types/hooks/json.d.ts +1 -1
- package/dist/types/hooks/list.d.ts +66 -0
- package/dist/types/hooks/manage.d.ts +1 -0
- package/dist/types/hooks/menu.d.ts +1 -1
- package/dist/types/hooks/overlay.d.ts +1 -1
- package/dist/types/hooks/theme.d.ts +8 -8
- package/dist/types/index.d.ts +6 -5
- package/dist/types/preset/i18nProvider.d.ts +1 -1
- package/dist/types/stores/auth.d.ts +9 -24
- package/dist/types/stores/i18n.d.ts +7 -16
- package/dist/types/stores/index.d.ts +2 -2
- package/dist/types/stores/manage.d.ts +7 -16
- package/dist/types/stores/route.d.ts +12 -2538
- package/dist/types/stores/tab.d.ts +6 -1030
- package/dist/types/stores/theme.d.ts +14 -96
- package/dist/types/types/config.d.ts +9 -0
- package/dist/types/types/i18n.d.ts +1 -0
- package/dist/types/types/manage.d.ts +6 -0
- package/dist/types/types/theme.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +4 -49
- package/package.json +22 -15
- package/dist/cjs/node_modules/jsep/dist/jsep.cjs +0 -2
- package/dist/esm/node_modules/jsep/dist/jsep.js +0 -737
- /package/dist/cjs/{hooks/themeColor.cjs → config/color.cjs} +0 -0
- /package/dist/esm/{hooks/themeColor.js → config/color.js} +0 -0
- /package/dist/types/{hooks/themeColor.d.ts → config/color.d.ts} +0 -0
package/dist/esm/hooks/auth.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useAuthStore as
|
|
4
|
-
import { useManage as
|
|
5
|
-
function
|
|
6
|
-
const u =
|
|
1
|
+
import { ref as P } from "vue";
|
|
2
|
+
import { useRouter as d } from "vue-router";
|
|
3
|
+
import { useAuthStore as h } from "../stores/auth.js";
|
|
4
|
+
import { useManage as f } from "./manage.js";
|
|
5
|
+
function s(t) {
|
|
6
|
+
const u = f(), o = h(), g = d(), r = P(!1);
|
|
7
7
|
return {
|
|
8
|
-
mutate: async (
|
|
9
|
-
var
|
|
8
|
+
mutate: async (e) => {
|
|
9
|
+
var c, i, m;
|
|
10
10
|
r.value = !0;
|
|
11
|
-
const n = await ((
|
|
11
|
+
const n = await ((c = u.config.authProvider) == null ? void 0 : c.login(e, u));
|
|
12
12
|
if (r.value = !1, n != null && n.success) {
|
|
13
13
|
if (!(n != null && n.data))
|
|
14
14
|
throw new Error("Login response data is undefined");
|
|
15
|
-
|
|
15
|
+
(i = t == null ? void 0 : t.onSuccess) == null || i.call(t, n), o.login(n.data), g.push(u.getRoutePath(n.redirectTo || "/"));
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, n);
|
|
19
19
|
},
|
|
20
20
|
isLoading: r
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function R(
|
|
24
|
-
const u =
|
|
23
|
+
function R(t) {
|
|
24
|
+
const u = f(), o = h(), g = d();
|
|
25
25
|
return {
|
|
26
|
-
mutate: async (
|
|
27
|
-
var n;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
26
|
+
mutate: async (a) => {
|
|
27
|
+
var n, c, i;
|
|
28
|
+
const e = await ((n = u.config.authProvider) == null ? void 0 : n.logout(a, u));
|
|
29
|
+
if (e != null && e.success) {
|
|
30
|
+
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, e), o.logout(), g.push(u.getRoutePath(e.redirectTo || "/login"));
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
(i = t == null ? void 0 : t.onError) == null || i.call(t, e);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function T(
|
|
38
|
-
const u =
|
|
37
|
+
function T(t) {
|
|
38
|
+
const u = f(), o = h(), g = d();
|
|
39
39
|
return {
|
|
40
|
-
mutate: async (
|
|
41
|
-
var n;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
40
|
+
mutate: async (a) => {
|
|
41
|
+
var n, c, i;
|
|
42
|
+
const e = await ((n = u.config.authProvider) == null ? void 0 : n.check(a, u));
|
|
43
|
+
if (e != null && e.success) {
|
|
44
|
+
if ((c = t == null ? void 0 : t.onSuccess) == null || c.call(t, e), !(e != null && e.data))
|
|
45
45
|
throw new Error("Check response data is undefined");
|
|
46
|
-
o.update(
|
|
46
|
+
o.update(e.data);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
(i = t == null ? void 0 : t.onError) == null || i.call(t, e), e != null && e.logout && g.push(u.getRoutePath(e.redirectTo || "/login"));
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function y(
|
|
54
|
-
const u =
|
|
53
|
+
function y(t) {
|
|
54
|
+
const u = f(), o = h(), g = d();
|
|
55
55
|
return {
|
|
56
|
-
mutate: async (
|
|
57
|
-
var n,
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
if (
|
|
56
|
+
mutate: async (a) => {
|
|
57
|
+
var n, c, i, m;
|
|
58
|
+
const e = await ((c = (n = u.config.authProvider) == null ? void 0 : n.register) == null ? void 0 : c.call(n, a, u));
|
|
59
|
+
if (e != null && e.success) {
|
|
60
|
+
if ((i = t == null ? void 0 : t.onSuccess) == null || i.call(t, e), !(e != null && e.data))
|
|
61
61
|
throw new Error("Register response data is undefined");
|
|
62
|
-
o.login(
|
|
62
|
+
o.login(e.data), g.push(u.getRoutePath(e.redirectTo || ""));
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
(m = t == null ? void 0 : t.onError) == null || m.call(t, e);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function L(
|
|
70
|
-
const u =
|
|
69
|
+
function L(t) {
|
|
70
|
+
const u = f(), o = d();
|
|
71
71
|
return {
|
|
72
72
|
mutate: async (r) => {
|
|
73
|
-
var
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
73
|
+
var e, n, c, i;
|
|
74
|
+
const a = await ((n = (e = u.config.authProvider) == null ? void 0 : e.forgotPassword) == null ? void 0 : n.call(e, r, u));
|
|
75
|
+
if (a != null && a.success) {
|
|
76
|
+
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, a), a.redirectTo && o.push(u.getRoutePath(a.redirectTo));
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
(i = t == null ? void 0 : t.onError) == null || i.call(t, a);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function U(
|
|
84
|
-
const u =
|
|
83
|
+
function U(t) {
|
|
84
|
+
const u = f(), o = d();
|
|
85
85
|
return {
|
|
86
86
|
mutate: async (r) => {
|
|
87
|
-
var
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
87
|
+
var e, n, c, i;
|
|
88
|
+
const a = await ((n = (e = u.config.authProvider) == null ? void 0 : e.updatePassword) == null ? void 0 : n.call(e, r, u));
|
|
89
|
+
if (a != null && a.success) {
|
|
90
|
+
(c = t == null ? void 0 : t.onSuccess) == null || c.call(t, a), a.redirectTo && o.push(u.getRoutePath(a.redirectTo));
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
(i = t == null ? void 0 : t.onError) == null || i.call(t, a);
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function A(
|
|
98
|
-
const { config:
|
|
97
|
+
function A(t) {
|
|
98
|
+
const { config: u, getRoutePath: o } = f(), g = d();
|
|
99
99
|
return {
|
|
100
|
-
mutate: async (
|
|
101
|
-
var
|
|
102
|
-
const
|
|
103
|
-
|
|
100
|
+
mutate: async (a) => {
|
|
101
|
+
var n;
|
|
102
|
+
const e = await ((n = u.authProvider) == null ? void 0 : n.onError(a));
|
|
103
|
+
t == null || t(e), e != null && e.logout && g.push(o(e.redirectTo || "/login"));
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function x(
|
|
108
|
-
return
|
|
107
|
+
function x(t) {
|
|
108
|
+
return h(t).getUser();
|
|
109
109
|
}
|
|
110
|
-
function F(
|
|
111
|
-
return
|
|
110
|
+
function F(t) {
|
|
111
|
+
return h(t).isLogin();
|
|
112
112
|
}
|
|
113
|
-
function G(
|
|
114
|
-
const
|
|
115
|
-
return (
|
|
116
|
-
var
|
|
117
|
-
return (
|
|
113
|
+
function G(t) {
|
|
114
|
+
const u = f(t), g = h(t).getUser();
|
|
115
|
+
return (a, e) => {
|
|
116
|
+
var n;
|
|
117
|
+
return (n = u.config.authProvider) != null && n.can ? u.config.authProvider.can(a, e, u, g) : !0;
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
export {
|
|
@@ -124,7 +124,7 @@ export {
|
|
|
124
124
|
L as useForgotPassword,
|
|
125
125
|
x as useGetAuth,
|
|
126
126
|
F as useIsLogin,
|
|
127
|
-
|
|
127
|
+
s as useLogin,
|
|
128
128
|
R as useLogout,
|
|
129
129
|
y as useRegister,
|
|
130
130
|
U as useUpdatePassword
|