@duxweb/dvha-core 1.0.23 → 1.0.24

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 (85) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/iframe.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  5. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  6. package/dist/cjs/components/status/exception.cjs +1 -1
  7. package/dist/cjs/directive/permission.cjs +1 -1
  8. package/dist/cjs/hooks/auth.cjs +1 -1
  9. package/dist/cjs/hooks/data.cjs +1 -1
  10. package/dist/cjs/hooks/export.cjs +1 -1
  11. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  12. package/dist/cjs/hooks/form.cjs +1 -1
  13. package/dist/cjs/hooks/formExtend.cjs +1 -1
  14. package/dist/cjs/hooks/i18n.cjs +1 -1
  15. package/dist/cjs/hooks/import.cjs +1 -1
  16. package/dist/cjs/hooks/importCsv.cjs +2 -2
  17. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  18. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  19. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  20. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  21. package/dist/cjs/hooks/json.cjs +1 -1
  22. package/dist/cjs/hooks/list.cjs +1 -1
  23. package/dist/cjs/hooks/manage.cjs +1 -1
  24. package/dist/cjs/hooks/menu.cjs +1 -1
  25. package/dist/cjs/hooks/select.cjs +1 -1
  26. package/dist/cjs/hooks/theme.cjs +3 -3
  27. package/dist/cjs/hooks/tree.cjs +1 -1
  28. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  29. package/dist/cjs/hooks/upload.cjs +1 -1
  30. package/dist/cjs/preset/authProvider.cjs +1 -1
  31. package/dist/cjs/preset/dataProvider.cjs +1 -1
  32. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  33. package/dist/cjs/provider/app.cjs +1 -1
  34. package/dist/cjs/router/route.cjs +1 -1
  35. package/dist/cjs/stores/auth.cjs +1 -1
  36. package/dist/cjs/stores/i18n.cjs +1 -1
  37. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  38. package/dist/cjs/stores/manage.cjs +1 -1
  39. package/dist/cjs/stores/route.cjs +1 -1
  40. package/dist/cjs/stores/tab.cjs +1 -1
  41. package/dist/cjs/stores/theme.cjs +1 -1
  42. package/dist/cjs/utils/tree.cjs +1 -1
  43. package/dist/esm/components/auth/can.js +8 -11
  44. package/dist/esm/components/loader/iframe.js +14 -17
  45. package/dist/esm/components/loader/remote/loader.js +103 -105
  46. package/dist/esm/components/loader/remote/render.js +10 -11
  47. package/dist/esm/components/overlay/overlay.js +7 -7
  48. package/dist/esm/components/status/exception.js +10 -13
  49. package/dist/esm/directive/permission.js +6 -7
  50. package/dist/esm/hooks/auth.js +73 -83
  51. package/dist/esm/hooks/data.js +290 -345
  52. package/dist/esm/hooks/export.js +16 -17
  53. package/dist/esm/hooks/exportCsv.js +26 -27
  54. package/dist/esm/hooks/form.js +49 -54
  55. package/dist/esm/hooks/formExtend.js +24 -25
  56. package/dist/esm/hooks/i18n.js +11 -29
  57. package/dist/esm/hooks/import.js +31 -32
  58. package/dist/esm/hooks/importCsv.js +24 -25
  59. package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
  60. package/dist/esm/hooks/json/vFor.js +15 -16
  61. package/dist/esm/hooks/json/vOn.js +17 -18
  62. package/dist/esm/hooks/json/vShow.js +9 -10
  63. package/dist/esm/hooks/json.js +88 -94
  64. package/dist/esm/hooks/list.js +100 -127
  65. package/dist/esm/hooks/manage.js +13 -17
  66. package/dist/esm/hooks/menu.js +39 -52
  67. package/dist/esm/hooks/select.js +35 -40
  68. package/dist/esm/hooks/theme.js +127 -141
  69. package/dist/esm/hooks/tree.js +22 -28
  70. package/dist/esm/hooks/upload/s3.js +22 -23
  71. package/dist/esm/hooks/upload.js +152 -159
  72. package/dist/esm/preset/authProvider.js +63 -117
  73. package/dist/esm/preset/dataProvider.js +69 -76
  74. package/dist/esm/preset/i18nProvider.js +18 -18
  75. package/dist/esm/provider/app.js +74 -81
  76. package/dist/esm/router/route.js +16 -24
  77. package/dist/esm/stores/auth.js +17 -20
  78. package/dist/esm/stores/i18n.js +10 -10
  79. package/dist/esm/stores/jsonSchema.js +20 -23
  80. package/dist/esm/stores/manage.js +33 -33
  81. package/dist/esm/stores/route.js +38 -50
  82. package/dist/esm/stores/tab.js +38 -54
  83. package/dist/esm/stores/theme.js +28 -29
  84. package/dist/esm/utils/tree.js +23 -24
  85. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { useCan as m } from "../hooks/auth.js";
1
+ import { useCan as i } from "../hooks/auth.js";
2
2
  import "vue";
3
3
  import "@tanstack/vue-query";
4
4
  import "lodash-es";
@@ -14,15 +14,14 @@ import "@overlastic/vue";
14
14
  import "clsx";
15
15
  import "colorizr";
16
16
  import "axios";
17
- const g = {
18
- mounted(t, i) {
19
- var r;
20
- const { value: o } = i;
17
+ const b = {
18
+ mounted(t, r) {
19
+ const { value: o } = r;
21
20
  if (!o)
22
21
  return;
23
- m()(o) || (r = t.parentElement) == null || r.removeChild(t);
22
+ i()(o) || t.parentElement?.removeChild(t);
24
23
  }
25
24
  };
26
25
  export {
27
- g as permissionDirective
26
+ b as permissionDirective
28
27
  };
@@ -1,137 +1,127 @@
1
- import { ref as w } from "vue";
2
- import { useRouter as m } from "vue-router";
3
- import { useAuthStore as f } from "../stores/auth.js";
4
- import { useManage as h } from "./manage.js";
5
- function v(t) {
6
- const a = h(), o = f(), r = m(), g = w(!1);
1
+ import { ref as d } from "vue";
2
+ import { useRouter as g } from "vue-router";
3
+ import { useAuthStore as c } from "../stores/auth.js";
4
+ import { useManage as i } from "./manage.js";
5
+ function w(e) {
6
+ const t = i(), n = c(), u = g(), s = d(!1);
7
7
  return {
8
- mutate: async (e) => {
9
- var c, i, d;
10
- g.value = !0;
11
- const n = await ((c = a.config.authProvider) == null ? void 0 : c.login(e, a));
12
- if (g.value = !1, n != null && n.success) {
13
- if (!(n != null && n.data))
8
+ mutate: async (o) => {
9
+ s.value = !0;
10
+ const a = await t.config.authProvider?.login(o, t);
11
+ if (s.value = !1, a?.success) {
12
+ if (!a?.data)
14
13
  throw new Error("Login response data is undefined");
15
- (i = t == null ? void 0 : t.onSuccess) == null || i.call(t, n), o.login(n.data), r.push(a.getRoutePath(n.redirectTo || "/"));
14
+ e?.onSuccess?.(a), n.login(a.data), u.push(t.getRoutePath(a.redirectTo || "/"));
16
15
  return;
17
16
  }
18
- (d = t == null ? void 0 : t.onError) == null || d.call(t, n);
17
+ e?.onError?.(a);
19
18
  },
20
- isLoading: g
19
+ isLoading: s
21
20
  };
22
21
  }
23
- function E(t) {
24
- const a = h(), o = f(), r = m();
22
+ function P(e) {
23
+ const t = i(), n = c(), u = g();
25
24
  return {
26
- mutate: async (u) => {
27
- var n, c, i;
28
- const e = await ((n = a.config.authProvider) == null ? void 0 : n.logout(u, a));
29
- if (e != null && e.success) {
30
- (c = t == null ? void 0 : t.onSuccess) == null || c.call(t, e), o.logout(), await r.replace(a.getRoutePath(e.redirectTo || "/login")), setTimeout(() => {
25
+ mutate: async (r) => {
26
+ const o = await t.config.authProvider?.logout(r, t);
27
+ if (o?.success) {
28
+ e?.onSuccess?.(o), n.logout(), await u.replace(t.getRoutePath(o.redirectTo || "/login")), setTimeout(() => {
31
29
  window.location.reload();
32
30
  }, 100);
33
31
  return;
34
32
  }
35
- (i = t == null ? void 0 : t.onError) == null || i.call(t, e);
33
+ e?.onError?.(o);
36
34
  }
37
35
  };
38
36
  }
39
- function R(t) {
40
- const a = h(), o = f(), r = m();
37
+ function S(e) {
38
+ const t = i(), n = c(), u = g();
41
39
  return {
42
- mutate: async (u) => {
43
- var n, c, i, d;
44
- const e = await ((c = (n = a.config.authProvider) == null ? void 0 : n.check) == null ? void 0 : c.call(n, u, a, o.getUser()));
45
- if (e != null && e.success) {
46
- if ((i = t == null ? void 0 : t.onSuccess) == null || i.call(t, e), !(e != null && e.data))
40
+ mutate: async (r) => {
41
+ const o = await t.config.authProvider?.check?.(r, t, n.getUser());
42
+ if (o?.success) {
43
+ if (e?.onSuccess?.(o), !o?.data)
47
44
  throw new Error("Check response data is undefined");
48
- o.update(e.data);
45
+ n.update(o.data);
49
46
  return;
50
47
  }
51
- (d = t == null ? void 0 : t.onError) == null || d.call(t, e), e != null && e.logout && (await r.replace(a.getRoutePath(e.redirectTo || "/login")), setTimeout(() => {
48
+ e?.onError?.(o), o?.logout && (await u.replace(t.getRoutePath(o.redirectTo || "/login")), setTimeout(() => {
52
49
  window.location.reload();
53
50
  }, 100));
54
51
  }
55
52
  };
56
53
  }
57
- function y(t) {
58
- const a = h(), o = f(), r = m();
54
+ function T(e) {
55
+ const t = i(), n = c(), u = g();
59
56
  return {
60
- mutate: async (u) => {
61
- var n, c, i, d;
62
- const e = await ((c = (n = a.config.authProvider) == null ? void 0 : n.register) == null ? void 0 : c.call(n, u, a));
63
- if (e != null && e.success) {
64
- if ((i = t == null ? void 0 : t.onSuccess) == null || i.call(t, e), !(e != null && e.data))
57
+ mutate: async (r) => {
58
+ const o = await t.config.authProvider?.register?.(r, t);
59
+ if (o?.success) {
60
+ if (e?.onSuccess?.(o), !o?.data)
65
61
  throw new Error("Register response data is undefined");
66
- o.login(e.data), r.push(a.getRoutePath(e.redirectTo || "/"));
62
+ n.login(o.data), u.push(t.getRoutePath(o.redirectTo || "/"));
67
63
  return;
68
64
  }
69
- (d = t == null ? void 0 : t.onError) == null || d.call(t, e);
65
+ e?.onError?.(o);
70
66
  }
71
67
  };
72
68
  }
73
- function L(t) {
74
- const a = h(), o = m();
69
+ function v(e) {
70
+ const t = i(), n = g();
75
71
  return {
76
- mutate: async (g) => {
77
- var e, n, c, i;
78
- const u = await ((n = (e = a.config.authProvider) == null ? void 0 : e.forgotPassword) == null ? void 0 : n.call(e, g, a));
79
- if (u != null && u.success) {
80
- (c = t == null ? void 0 : t.onSuccess) == null || c.call(t, u), u.redirectTo && o.push(a.getRoutePath(u.redirectTo || "/"));
72
+ mutate: async (s) => {
73
+ const r = await t.config.authProvider?.forgotPassword?.(s, t);
74
+ if (r?.success) {
75
+ e?.onSuccess?.(r), r.redirectTo && n.push(t.getRoutePath(r.redirectTo || "/"));
81
76
  return;
82
77
  }
83
- (i = t == null ? void 0 : t.onError) == null || i.call(t, u);
78
+ e?.onError?.(r);
84
79
  }
85
80
  };
86
81
  }
87
- function U(t) {
88
- const a = h(), o = m();
82
+ function E(e) {
83
+ const t = i(), n = g();
89
84
  return {
90
- mutate: async (g) => {
91
- var e, n, c, i;
92
- const u = await ((n = (e = a.config.authProvider) == null ? void 0 : e.updatePassword) == null ? void 0 : n.call(e, g, a));
93
- if (u != null && u.success) {
94
- (c = t == null ? void 0 : t.onSuccess) == null || c.call(t, u), u.redirectTo && o.push(a.getRoutePath(u.redirectTo || "/"));
85
+ mutate: async (s) => {
86
+ const r = await t.config.authProvider?.updatePassword?.(s, t);
87
+ if (r?.success) {
88
+ e?.onSuccess?.(r), r.redirectTo && n.push(t.getRoutePath(r.redirectTo || "/"));
95
89
  return;
96
90
  }
97
- (i = t == null ? void 0 : t.onError) == null || i.call(t, u);
91
+ e?.onError?.(r);
98
92
  }
99
93
  };
100
94
  }
101
- function l(t) {
102
- const { config: a, getRoutePath: o } = h(), r = m(), g = f();
95
+ function R(e) {
96
+ const { config: t, getRoutePath: n } = i(), u = g(), s = c();
103
97
  return {
104
- mutate: async (e) => {
105
- var c;
106
- const n = await ((c = a.authProvider) == null ? void 0 : c.onError(e));
107
- t == null || t(n), n != null && n.logout && (g.logout(), await r.replace(o(n.redirectTo || "/login")), setTimeout(() => {
98
+ mutate: async (o) => {
99
+ const a = await t.authProvider?.onError(o);
100
+ e?.(a), a?.logout && (s.logout(), await u.replace(n(a.redirectTo || "/login")), setTimeout(() => {
108
101
  window.location.reload();
109
102
  }, 100));
110
103
  }
111
104
  };
112
105
  }
113
- function A(t) {
114
- return f(t).getUser();
106
+ function y(e) {
107
+ return c(e).getUser();
115
108
  }
116
- function x(t) {
117
- return f(t).isLogin();
109
+ function p(e) {
110
+ return c(e).isLogin();
118
111
  }
119
- function F(t) {
120
- const a = h(t), r = f(t).getUser();
121
- return (u, e) => {
122
- var n;
123
- return (n = a.config.authProvider) != null && n.can ? a.config.authProvider.can(u, e, a, r) : !0;
124
- };
112
+ function L(e) {
113
+ const t = i(e), u = c(e).getUser();
114
+ return (r, o) => t.config.authProvider?.can ? t.config.authProvider.can(r, o, t, u) : !0;
125
115
  }
126
116
  export {
127
- F as useCan,
128
- R as useCheck,
129
- l as useError,
130
- L as useForgotPassword,
131
- A as useGetAuth,
132
- x as useIsLogin,
133
- v as useLogin,
134
- E as useLogout,
135
- y as useRegister,
136
- U as useUpdatePassword
117
+ L as useCan,
118
+ S as useCheck,
119
+ R as useError,
120
+ v as useForgotPassword,
121
+ y as useGetAuth,
122
+ p as useIsLogin,
123
+ w as useLogin,
124
+ P as useLogout,
125
+ T as useRegister,
126
+ E as useUpdatePassword
137
127
  };