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