@duxweb/dvha-core 1.1.30 → 1.1.31

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 (159) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/components/auth/can.cjs +1 -1
  3. package/dist/cjs/components/auth/index.cjs +1 -0
  4. package/dist/cjs/components/common/icon.cjs +1 -1
  5. package/dist/cjs/components/common/index.cjs +1 -0
  6. package/dist/cjs/components/common/logo.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -0
  8. package/dist/cjs/components/loader/iframe.cjs +1 -1
  9. package/dist/cjs/components/loader/index.cjs +1 -0
  10. package/dist/cjs/components/loader/loader.cjs +1 -1
  11. package/dist/cjs/components/loader/remote/index.cjs +1 -0
  12. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  13. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  14. package/dist/cjs/components/overlay/index.cjs +1 -0
  15. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  16. package/dist/cjs/components/status/error.cjs +1 -1
  17. package/dist/cjs/components/status/exception.cjs +1 -1
  18. package/dist/cjs/components/status/index.cjs +1 -0
  19. package/dist/cjs/components/status/notAuthorized.cjs +1 -1
  20. package/dist/cjs/components/status/notFound.cjs +1 -1
  21. package/dist/cjs/config/color.cjs +1 -1
  22. package/dist/cjs/directive/index.cjs +1 -0
  23. package/dist/cjs/directive/permission.cjs +1 -1
  24. package/dist/cjs/hooks/auth.cjs +1 -1
  25. package/dist/cjs/hooks/config.cjs +1 -1
  26. package/dist/cjs/hooks/data.cjs +1 -1
  27. package/dist/cjs/hooks/export.cjs +1 -1
  28. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  29. package/dist/cjs/hooks/form.cjs +1 -1
  30. package/dist/cjs/hooks/formExtend.cjs +1 -1
  31. package/dist/cjs/hooks/formValidate.cjs +1 -1
  32. package/dist/cjs/hooks/i18n.cjs +1 -1
  33. package/dist/cjs/hooks/import.cjs +1 -1
  34. package/dist/cjs/hooks/importCsv.cjs +2 -2
  35. package/dist/cjs/hooks/index.cjs +1 -0
  36. package/dist/cjs/hooks/json/index.cjs +1 -1
  37. package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -1
  38. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  39. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  40. package/dist/cjs/hooks/json/vIf.cjs +1 -1
  41. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  42. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  43. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  44. package/dist/cjs/hooks/json/vText.cjs +1 -1
  45. package/dist/cjs/hooks/json.cjs +1 -1
  46. package/dist/cjs/hooks/list.cjs +1 -1
  47. package/dist/cjs/hooks/manage.cjs +1 -1
  48. package/dist/cjs/hooks/menu.cjs +1 -1
  49. package/dist/cjs/hooks/overlay.cjs +1 -1
  50. package/dist/cjs/hooks/select.cjs +1 -1
  51. package/dist/cjs/hooks/theme.cjs +4 -8
  52. package/dist/cjs/hooks/tree.cjs +1 -1
  53. package/dist/cjs/hooks/upload/index.cjs +1 -0
  54. package/dist/cjs/hooks/upload/local.cjs +1 -1
  55. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  56. package/dist/cjs/hooks/upload.cjs +1 -1
  57. package/dist/cjs/index.cjs +1 -1
  58. package/dist/cjs/main.cjs +1 -1
  59. package/dist/cjs/preset/authProvider.cjs +1 -1
  60. package/dist/cjs/preset/dataProvider.cjs +1 -1
  61. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  62. package/dist/cjs/preset/index.cjs +1 -0
  63. package/dist/cjs/provider/app.cjs +1 -1
  64. package/dist/cjs/provider/index.cjs +1 -0
  65. package/dist/cjs/provider/tab.cjs +1 -1
  66. package/dist/cjs/router/index.cjs +1 -0
  67. package/dist/cjs/router/route.cjs +1 -1
  68. package/dist/cjs/stores/auth.cjs +1 -1
  69. package/dist/cjs/stores/i18n.cjs +1 -1
  70. package/dist/cjs/stores/index.cjs +1 -0
  71. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  72. package/dist/cjs/stores/manage.cjs +1 -1
  73. package/dist/cjs/stores/route.cjs +1 -1
  74. package/dist/cjs/stores/tab.cjs +1 -1
  75. package/dist/cjs/stores/theme.cjs +1 -1
  76. package/dist/cjs/utils/bus.cjs +1 -1
  77. package/dist/cjs/utils/index.cjs +1 -0
  78. package/dist/cjs/utils/theme.cjs +8 -8
  79. package/dist/cjs/utils/tree.cjs +1 -1
  80. package/dist/esm/_virtual/_rolldown/runtime.js +9 -0
  81. package/dist/esm/components/auth/can.js +17 -36
  82. package/dist/esm/components/auth/index.js +1 -0
  83. package/dist/esm/components/common/icon.js +16 -24
  84. package/dist/esm/components/common/index.js +2 -0
  85. package/dist/esm/components/common/logo.js +50 -49
  86. package/dist/esm/components/index.js +14 -0
  87. package/dist/esm/components/loader/iframe.js +16 -18
  88. package/dist/esm/components/loader/index.js +1 -0
  89. package/dist/esm/components/loader/loader.js +11 -40
  90. package/dist/esm/components/loader/remote/index.js +2 -0
  91. package/dist/esm/components/loader/remote/loader.js +118 -156
  92. package/dist/esm/components/loader/remote/render.js +12 -17
  93. package/dist/esm/components/overlay/index.js +1 -0
  94. package/dist/esm/components/overlay/overlay.js +54 -70
  95. package/dist/esm/components/status/error.js +7 -9
  96. package/dist/esm/components/status/exception.js +21 -37
  97. package/dist/esm/components/status/index.js +4 -0
  98. package/dist/esm/components/status/notAuthorized.js +7 -9
  99. package/dist/esm/components/status/notFound.js +7 -9
  100. package/dist/esm/config/color.js +288 -290
  101. package/dist/esm/directive/index.js +1 -0
  102. package/dist/esm/directive/permission.js +7 -27
  103. package/dist/esm/hooks/auth.js +154 -120
  104. package/dist/esm/hooks/config.js +11 -9
  105. package/dist/esm/hooks/data.js +416 -415
  106. package/dist/esm/hooks/export.js +32 -36
  107. package/dist/esm/hooks/exportCsv.js +42 -46
  108. package/dist/esm/hooks/form.js +86 -95
  109. package/dist/esm/hooks/formExtend.js +36 -40
  110. package/dist/esm/hooks/formValidate.js +22 -25
  111. package/dist/esm/hooks/i18n.js +14 -18
  112. package/dist/esm/hooks/import.js +45 -54
  113. package/dist/esm/hooks/importCsv.js +90 -83
  114. package/dist/esm/hooks/index.js +31 -0
  115. package/dist/esm/hooks/json/index.js +14 -22
  116. package/dist/esm/hooks/json/utils/contextManager.js +35 -26
  117. package/dist/esm/hooks/json/utils/expressionParser.js +100 -123
  118. package/dist/esm/hooks/json/vFor.js +50 -55
  119. package/dist/esm/hooks/json/vIf.js +17 -16
  120. package/dist/esm/hooks/json/vModel.js +96 -106
  121. package/dist/esm/hooks/json/vOn.js +30 -32
  122. package/dist/esm/hooks/json/vShow.js +20 -22
  123. package/dist/esm/hooks/json/vText.js +44 -51
  124. package/dist/esm/hooks/json.js +131 -132
  125. package/dist/esm/hooks/list.js +150 -184
  126. package/dist/esm/hooks/manage.js +25 -22
  127. package/dist/esm/hooks/menu.js +57 -61
  128. package/dist/esm/hooks/overlay.js +6 -23
  129. package/dist/esm/hooks/select.js +84 -94
  130. package/dist/esm/hooks/theme.js +289 -219
  131. package/dist/esm/hooks/tree.js +43 -47
  132. package/dist/esm/hooks/upload/index.js +2 -0
  133. package/dist/esm/hooks/upload/local.js +24 -30
  134. package/dist/esm/hooks/upload/s3.js +70 -80
  135. package/dist/esm/hooks/upload.js +256 -272
  136. package/dist/esm/index.js +150 -141
  137. package/dist/esm/main.js +24 -45
  138. package/dist/esm/preset/authProvider.js +62 -68
  139. package/dist/esm/preset/dataProvider.js +154 -180
  140. package/dist/esm/preset/i18nProvider.js +28 -30
  141. package/dist/esm/preset/index.js +3 -0
  142. package/dist/esm/provider/app.js +124 -151
  143. package/dist/esm/provider/index.js +2 -0
  144. package/dist/esm/provider/tab.js +49 -66
  145. package/dist/esm/router/index.js +1 -0
  146. package/dist/esm/router/route.js +39 -46
  147. package/dist/esm/stores/auth.js +51 -46
  148. package/dist/esm/stores/i18n.js +32 -29
  149. package/dist/esm/stores/index.js +7 -0
  150. package/dist/esm/stores/jsonSchema.js +47 -34
  151. package/dist/esm/stores/manage.js +63 -48
  152. package/dist/esm/stores/route.js +60 -56
  153. package/dist/esm/stores/tab.js +55 -60
  154. package/dist/esm/stores/theme.js +48 -55
  155. package/dist/esm/utils/bus.js +3 -5
  156. package/dist/esm/utils/index.js +3 -0
  157. package/dist/esm/utils/theme.js +110 -93
  158. package/dist/esm/utils/tree.js +28 -37
  159. package/package.json +1 -1
@@ -1,160 +1,122 @@
1
- import * as k from "vue";
2
- import { createVNode as E } from "vue";
3
- import * as M from "@microsoft/fetch-event-source";
4
- import * as b from "@tanstack/vue-query";
5
- import * as J from "@vueuse/core";
6
- import T from "axios";
1
+ import { useManage as e } from "../../../hooks/manage.js";
2
+ import { useError as t } from "../../../hooks/auth.js";
3
+ import { useClient as n } from "../../../hooks/data.js";
4
+ import { useI18n as r } from "../../../hooks/i18n.js";
5
+ import { useJsonSchema as i } from "../../../hooks/json.js";
6
+ import "../../../hooks/index.js";
7
+ import { src_exports as a } from "../../../index.js";
8
+ import * as o from "vue";
9
+ import { createVNode as s } from "vue";
10
+ import * as c from "vue-router";
11
+ import * as l from "pinia";
12
+ import * as u from "lodash-es";
13
+ import * as d from "@tanstack/vue-query";
14
+ import * as f from "@vueuse/core";
15
+ import p from "mitt";
16
+ import m from "axios";
17
+ import * as h from "@microsoft/fetch-event-source";
7
18
  import g from "crypto-js";
8
- import L from "dayjs";
9
- import * as N from "lodash-es";
10
- import * as O from "marked";
11
- import * as _ from "mathjs";
12
- import h from "mime";
13
- import q from "mitt";
14
- import * as B from "pinia";
15
- import D from "print-js";
16
- import { loadModule as F } from "vue3-sfc-loader";
17
- import * as V from "vue-router";
18
- import { useError as A } from "../../../hooks/auth.js";
19
- import { useClient as H } from "../../../hooks/data.js";
20
- import "json-2-csv";
21
- import "@vee-validate/rules";
22
- import "vee-validate";
23
- import { useI18n as I } from "../../../hooks/i18n.js";
24
- import { useJsonSchema as Q } from "../../../hooks/json.js";
25
- import "../../../hooks/json/index.js";
26
- import { useManage as U } from "../../../hooks/manage.js";
27
- import "../../../utils/bus.js";
28
- import "@overlastic/vue";
29
- import "clsx";
30
- import "colorizr";
31
- import * as z from "../../../index.js";
32
- const l = /* @__PURE__ */ new Map();
33
- function G(a) {
34
- return g.MD5(a).toString().substring(0, 10);
19
+ import _ from "dayjs";
20
+ import * as v from "marked";
21
+ import * as y from "mathjs";
22
+ import b from "mime";
23
+ import x from "print-js";
24
+ import { loadModule as S } from "vue3-sfc-loader";
25
+ var C = /* @__PURE__ */ new Map();
26
+ function w(e) {
27
+ return g.MD5(e).toString().substring(0, 10);
35
28
  }
36
- function gt(a) {
37
- const c = H(), {
38
- mutate: u
39
- } = A(), {
40
- mergeLocale: v
41
- } = I(), {
42
- config: i
43
- } = U(), j = {
44
- moduleCache: {
45
- vue: k,
46
- "@duxweb/dvha-core": z,
47
- "@vueuse/core": J,
48
- "@tanstack/vue-query": b,
49
- axios: T,
50
- "crypto-js": g,
51
- mime: h,
52
- math: _,
53
- mitt: q,
54
- "lodash-es": N,
55
- pinia: B,
56
- dayjs: L,
57
- "vue-router": V,
58
- marked: O,
59
- "@microsoft/fetch-event-source": M,
60
- "print-js": D,
61
- ...i?.remote?.packages,
62
- "static!": function(t, e, r) {
63
- const o = h.getType(r);
64
- if (o?.startsWith("image"))
65
- return `data:${o};charset=utf-8;base64,${btoa(t)}`;
66
- if (r === ".json")
67
- return JSON.parse(t);
68
- throw new Error(`${r} unable to parse`);
69
- }
70
- },
71
- async handleModule(t, e) {
72
- if (t !== ".vue") {
73
- if (t === ".json") {
74
- const r = await e(), {
75
- render: o
76
- } = Q({
77
- data: r?.nodes || {},
78
- context: r?.data || {}
79
- });
80
- return () => E(o, null, null);
81
- }
82
- if (t !== ".mjs")
83
- return e();
84
- }
85
- },
86
- customBlockHandler(t) {
87
- if (t.type === "i18n") {
88
- const e = JSON.parse(t.content);
89
- for (const r in e)
90
- v(r, e[r]);
91
- }
92
- },
93
- getFile: async (t) => {
94
- t = y(t, ".vue"), t = y(t, ".json");
95
- const e = await c.request({
96
- path: typeof i?.remote?.apiRoutePath == "function" ? i?.remote?.apiRoutePath(t) : i?.remote?.apiRoutePath || "static",
97
- payload: {
98
- path: t
99
- },
100
- method: i?.remote?.apiMethod || "POST"
101
- }).then((o) => o?.data).catch((o) => {
102
- u(o);
103
- });
104
- if (!e)
105
- return;
106
- let r = e?.type || ".vue";
107
- return (e?.type?.endsWith("js") || e?.type?.endsWith("ts") || e?.type?.endsWith("jsx") || e?.type?.endsWith("tsx")) && (r = ".mjs"), {
108
- content: e?.content,
109
- type: r
110
- };
111
- },
112
- getResource({
113
- refPath: t,
114
- relPath: e
115
- }, r) {
116
- const {
117
- moduleCache: o,
118
- pathResolve: x,
119
- getFile: w
120
- } = r, [R, ...f] = e.match(/([^!]+!)|[^!]+$/g).reverse(), S = (n, p, m, d) => f.reduce((C, W) => o[W](C, p, m, d), n), s = x({
121
- refPath: t,
122
- relPath: R
123
- }, r), P = f.join("") + s, $ = (n) => n.startsWith("@") ? !0 : !n.includes("/") && !n.startsWith(".");
124
- return {
125
- id: P,
126
- path: s,
127
- async getContent() {
128
- if ($(s))
129
- throw new Error(`Package ${s} not imported`);
130
- const n = await w(s), {
131
- content: p,
132
- type: m
133
- } = n || {};
134
- return {
135
- getContentData: async (d) => S(p, s, m, r),
136
- type: m
137
- };
138
- }
139
- };
140
- },
141
- addStyle(t) {
142
- const e = G(t);
143
- if (l.has(e))
144
- return;
145
- l.set(e, !0);
146
- const r = document.createElement("style");
147
- r.textContent = t, r.setAttribute("data-hash", e), document.head.appendChild(r);
148
- }
149
- };
150
- return () => F(`${a}`, {
151
- ...j
152
- });
29
+ function T(T) {
30
+ let D = n(), { mutate: O } = t(), { mergeLocale: k } = r(), { config: A } = e(), j = {
31
+ moduleCache: {
32
+ vue: o,
33
+ "@duxweb/dvha-core": a,
34
+ "@vueuse/core": f,
35
+ "@tanstack/vue-query": d,
36
+ axios: m,
37
+ "crypto-js": g,
38
+ mime: b,
39
+ math: y,
40
+ mitt: p,
41
+ "lodash-es": u,
42
+ pinia: l,
43
+ dayjs: _,
44
+ "vue-router": c,
45
+ marked: v,
46
+ "@microsoft/fetch-event-source": h,
47
+ "print-js": x,
48
+ ...A?.remote?.packages,
49
+ "static!": function(e, t, n) {
50
+ let r = b.getType(n);
51
+ if (r?.startsWith("image")) return `data:${r};charset=utf-8;base64,${btoa(e)}`;
52
+ if (n === ".json") return JSON.parse(e);
53
+ throw Error(`${n} unable to parse`);
54
+ }
55
+ },
56
+ async handleModule(e, t) {
57
+ if (e !== ".vue") {
58
+ if (e === ".json") {
59
+ let e = await t(), { render: n } = i({
60
+ data: e?.nodes || {},
61
+ context: e?.data || {}
62
+ });
63
+ return () => s(n, null, null);
64
+ }
65
+ if (e !== ".mjs") return t();
66
+ }
67
+ },
68
+ customBlockHandler(e) {
69
+ if (e.type === "i18n") {
70
+ let t = JSON.parse(e.content);
71
+ for (let e in t) k(e, t[e]);
72
+ }
73
+ },
74
+ getFile: async (e) => {
75
+ e = E(e, ".vue"), e = E(e, ".json");
76
+ let t = await D.request({
77
+ path: typeof A?.remote?.apiRoutePath == "function" ? A?.remote?.apiRoutePath(e) : A?.remote?.apiRoutePath || "static",
78
+ payload: { path: e },
79
+ method: A?.remote?.apiMethod || "POST"
80
+ }).then((e) => e?.data).catch((e) => {
81
+ O(e);
82
+ });
83
+ if (!t) return;
84
+ let n = t?.type || ".vue";
85
+ return (t?.type?.endsWith("js") || t?.type?.endsWith("ts") || t?.type?.endsWith("jsx") || t?.type?.endsWith("tsx")) && (n = ".mjs"), {
86
+ content: t?.content,
87
+ type: n
88
+ };
89
+ },
90
+ getResource({ refPath: e, relPath: t }, n) {
91
+ let { moduleCache: r, pathResolve: i, getFile: a } = n, [o, ...s] = t.match(/([^!]+!)|[^!]+$/g).reverse(), c = (e, t, n, i) => s.reduce((e, a) => r[a](e, t, n, i), e), l = i({
92
+ refPath: e,
93
+ relPath: o
94
+ }, n), u = s.join("") + l, d = (e) => e.startsWith("@") ? !0 : !e.includes("/") && !e.startsWith(".");
95
+ return {
96
+ id: u,
97
+ path: l,
98
+ async getContent() {
99
+ if (d(l)) throw Error(`Package ${l} not imported`);
100
+ let { content: e, type: t } = await a(l) || {};
101
+ return {
102
+ getContentData: async (r) => c(e, l, t, n),
103
+ type: t
104
+ };
105
+ }
106
+ };
107
+ },
108
+ addStyle(e) {
109
+ let t = w(e);
110
+ if (C.has(t)) return;
111
+ C.set(t, !0);
112
+ let n = document.createElement("style");
113
+ n.textContent = e, n.setAttribute("data-hash", t), document.head.appendChild(n);
114
+ }
115
+ };
116
+ return () => S(`${T}`, { ...j });
153
117
  }
154
- function y(a, c) {
155
- const u = new RegExp(`${c}$`);
156
- return a.replace(u, "");
118
+ function E(e, t) {
119
+ let n = RegExp(`${t}$`);
120
+ return e.replace(n, "");
157
121
  }
158
- export {
159
- gt as sfcLoader
160
- };
122
+ export { T as sfcLoader };
@@ -1,18 +1,13 @@
1
- import { defineComponent as r, defineAsyncComponent as n, createVNode as m } from "vue";
2
- import { useRoute as p } from "vue-router";
3
- import "pinia";
4
- import "lodash-es";
5
- import { useRouteStore as u } from "../../../stores/route.js";
6
- import { sfcLoader as s } from "./loader.js";
7
- const C = /* @__PURE__ */ r({
8
- name: "DuxRemoteRender",
9
- setup(c) {
10
- const e = p(), o = u().searchRouteName(e.name), t = n({
11
- loader: s(o?.meta?.path)
12
- });
13
- return () => m(t, null, null);
14
- }
1
+ import { useRouteStore as e } from "../../../stores/route.js";
2
+ import "../../../stores/index.js";
3
+ import { sfcLoader as t } from "./loader.js";
4
+ import { createVNode as n, defineAsyncComponent as r, defineComponent as i } from "vue";
5
+ import { useRoute as a } from "vue-router";
6
+ const o = /* @__PURE__ */ i({
7
+ name: "DuxRemoteRender",
8
+ setup(i) {
9
+ let o = a(), s = r({ loader: t(e().searchRouteName(o.name)?.meta?.path) });
10
+ return () => n(s, null, null);
11
+ }
15
12
  });
16
- export {
17
- C as DuxRemoteRender
18
- };
13
+ export { o as DuxRemoteRender };
@@ -0,0 +1 @@
1
+ import "./overlay.js";
@@ -1,71 +1,55 @@
1
- import { defineComponent as r, defineAsyncComponent as u, createVNode as t, Transition as s } from "vue";
2
- import { useDisclosure as m } from "@overlastic/vue";
3
- const C = /* @__PURE__ */ r({
4
- name: "DuxOverlay",
5
- props: {
6
- component: Function,
7
- componentProps: Object,
8
- mask: {
9
- type: Boolean,
10
- default: !0
11
- },
12
- maskClosable: {
13
- type: Boolean,
14
- default: !0
15
- },
16
- duration: {
17
- type: Number,
18
- default: 300
19
- },
20
- zIndex: {
21
- type: Number,
22
- default: 1e3
23
- }
24
- },
25
- setup(e) {
26
- const {
27
- visible: o,
28
- confirm: l,
29
- cancel: n
30
- } = m({
31
- duration: e.duration
32
- }), a = e?.componentProps || {};
33
- a.onConfirm = l, a.onClose = n;
34
- const i = u(e.component), c = () => {
35
- e.maskClosable && n();
36
- };
37
- return () => t("div", {
38
- class: "fixed inset-0 flex items-center justify-center overflow-auto",
39
- style: {
40
- zIndex: e.zIndex
41
- }
42
- }, [t(s, {
43
- enterActiveClass: "transition-opacity",
44
- enterFromClass: "opacity-0",
45
- enterToClass: "opacity-100",
46
- leaveActiveClass: "transition-opacity",
47
- leaveFromClass: "opacity-100",
48
- leaveToClass: "opacity-0"
49
- }, {
50
- default: () => [o.value && e.mask && t("div", {
51
- class: "fixed inset-0 bg-black bg-opacity-30",
52
- style: {
53
- transitionDuration: `${e.duration}ms`
54
- },
55
- onClick: c
56
- }, null)]
57
- }), t(s, {
58
- enterActiveClass: "transition-all",
59
- enterFromClass: "opacity-0 scale-95",
60
- enterToClass: "opacity-100 scale-100",
61
- leaveActiveClass: "transition-all",
62
- leaveFromClass: "opacity-100 scale-100",
63
- leaveToClass: "opacity-0 scale-95"
64
- }, {
65
- default: () => [o.value && t(i, a, null)]
66
- })]);
67
- }
1
+ import { Transition as e, createVNode as t, defineAsyncComponent as n, defineComponent as r } from "vue";
2
+ import { useDisclosure as i } from "@overlastic/vue";
3
+ const a = /* @__PURE__ */ r({
4
+ name: "DuxOverlay",
5
+ props: {
6
+ component: Function,
7
+ componentProps: Object,
8
+ mask: {
9
+ type: Boolean,
10
+ default: !0
11
+ },
12
+ maskClosable: {
13
+ type: Boolean,
14
+ default: !0
15
+ },
16
+ duration: {
17
+ type: Number,
18
+ default: 300
19
+ },
20
+ zIndex: {
21
+ type: Number,
22
+ default: 1e3
23
+ }
24
+ },
25
+ setup(r) {
26
+ let { visible: a, confirm: o, cancel: s } = i({ duration: r.duration }), c = r?.componentProps || {};
27
+ c.onConfirm = o, c.onClose = s;
28
+ let l = n(r.component), u = () => {
29
+ r.maskClosable && s();
30
+ };
31
+ return () => t("div", {
32
+ class: "fixed inset-0 flex items-center justify-center overflow-auto",
33
+ style: { zIndex: r.zIndex }
34
+ }, [t(e, {
35
+ enterActiveClass: "transition-opacity",
36
+ enterFromClass: "opacity-0",
37
+ enterToClass: "opacity-100",
38
+ leaveActiveClass: "transition-opacity",
39
+ leaveFromClass: "opacity-100",
40
+ leaveToClass: "opacity-0"
41
+ }, { default: () => [a.value && r.mask && t("div", {
42
+ class: "fixed inset-0 bg-black bg-opacity-30",
43
+ style: { transitionDuration: `${r.duration}ms` },
44
+ onClick: u
45
+ }, null)] }), t(e, {
46
+ enterActiveClass: "transition-all",
47
+ enterFromClass: "opacity-0 scale-95",
48
+ enterToClass: "opacity-100 scale-100",
49
+ leaveActiveClass: "transition-all",
50
+ leaveFromClass: "opacity-100 scale-100",
51
+ leaveToClass: "opacity-0 scale-95"
52
+ }, { default: () => [a.value && t(l, c, null)] })]);
53
+ }
68
54
  });
69
- export {
70
- C as DuxOverlay
71
- };
55
+ export { a as DuxOverlay };
@@ -1,10 +1,8 @@
1
- import { defineComponent as n, createVNode as r, createTextVNode as e } from "vue";
2
- const t = /* @__PURE__ */ n({
3
- name: "DuxError",
4
- setup() {
5
- return () => r("div", null, [r("h1", null, [e("500")]), r("p", null, [e("Internal Server Error")])]);
6
- }
1
+ import { createTextVNode as e, createVNode as t, defineComponent as n } from "vue";
2
+ const r = /* @__PURE__ */ n({
3
+ name: "DuxError",
4
+ setup() {
5
+ return () => t("div", null, [t("h1", null, [e("500")]), t("p", null, [e("Internal Server Error")])]);
6
+ }
7
7
  });
8
- export {
9
- t as DuxError
10
- };
8
+ export { r as DuxError };
@@ -1,38 +1,22 @@
1
- import { defineComponent as i, ref as m, onErrorCaptured as l, h as u, createVNode as o, createTextVNode as a } from "vue";
2
- import { useRoute as c } from "vue-router";
3
- import "pinia";
4
- import "lodash-es";
5
- import { useManage as s } from "../../hooks/manage.js";
6
- import "@tanstack/vue-query";
7
- import "json-2-csv";
8
- import "@vee-validate/rules";
9
- import "vee-validate";
10
- import "@vueuse/core";
11
- import "../../hooks/json/index.js";
12
- import "../../utils/bus.js";
13
- import "@overlastic/vue";
14
- import "clsx";
15
- import "colorizr";
16
- import "axios";
17
- const P = /* @__PURE__ */ i({
18
- name: "DuxException",
19
- setup(d, {
20
- slots: r
21
- }) {
22
- const e = m(null), p = c(), {
23
- config: t
24
- } = s();
25
- return l((n) => (console.error(n), p.name ? e.value = {
26
- title: "500",
27
- desc: n?.message || "Internal Server Error"
28
- } : e.value = {
29
- title: "404",
30
- desc: "Page not found"
31
- }, !1)), () => e.value ? t.components?.exception ? u(t.components.exception, {
32
- data: e.value
33
- }) : o("div", null, [o("h1", null, [e.value?.title || "Unknown"]), o("p", null, [e.value?.desc || "Unknown Description"]), o("p", null, [a("Use config.components.exception to configure the exception layout")])]) : r.default?.();
34
- }
1
+ import { useManage as e } from "../../hooks/manage.js";
2
+ import "../../hooks/index.js";
3
+ import { createTextVNode as t, createVNode as n, defineComponent as r, h as i, onErrorCaptured as a, ref as o } from "vue";
4
+ import { useRoute as s } from "vue-router";
5
+ const c = /* @__PURE__ */ r({
6
+ name: "DuxException",
7
+ setup(r, { slots: c }) {
8
+ let l = o(null), u = s(), { config: d } = e();
9
+ return a((e) => (console.error(e), u.name ? l.value = {
10
+ title: "500",
11
+ desc: e?.message || "Internal Server Error"
12
+ } : l.value = {
13
+ title: "404",
14
+ desc: "Page not found"
15
+ }, !1)), () => l.value ? d.components?.exception ? i(d.components.exception, { data: l.value }) : n("div", null, [
16
+ n("h1", null, [l.value?.title || "Unknown"]),
17
+ n("p", null, [l.value?.desc || "Unknown Description"]),
18
+ n("p", null, [t("Use config.components.exception to configure the exception layout")])
19
+ ]) : c.default?.();
20
+ }
35
21
  });
36
- export {
37
- P as DuxException
38
- };
22
+ export { c as DuxException };
@@ -0,0 +1,4 @@
1
+ import "./error.js";
2
+ import "./exception.js";
3
+ import "./notAuthorized.js";
4
+ import "./notFound.js";
@@ -1,10 +1,8 @@
1
- import { defineComponent as o, createVNode as e, createTextVNode as t } from "vue";
2
- const u = /* @__PURE__ */ o({
3
- name: "DuxNotAuthorized",
4
- setup() {
5
- return () => e("div", null, [e("h1", null, [t("403")]), e("p", null, [t("You are not authorized to access this page")])]);
6
- }
1
+ import { createTextVNode as e, createVNode as t, defineComponent as n } from "vue";
2
+ const r = /* @__PURE__ */ n({
3
+ name: "DuxNotAuthorized",
4
+ setup() {
5
+ return () => t("div", null, [t("h1", null, [e("403")]), t("p", null, [e("You are not authorized to access this page")])]);
6
+ }
7
7
  });
8
- export {
9
- u as DuxNotAuthorized
10
- };
8
+ export { r as DuxNotAuthorized };
@@ -1,10 +1,8 @@
1
- import { defineComponent as n, createVNode as e, createTextVNode as o } from "vue";
2
- const u = /* @__PURE__ */ n({
3
- name: "DuxNotFound",
4
- setup() {
5
- return () => e("div", null, [e("h1", null, [o("404")]), e("p", null, [o("Page not found")])]);
6
- }
1
+ import { createTextVNode as e, createVNode as t, defineComponent as n } from "vue";
2
+ const r = /* @__PURE__ */ n({
3
+ name: "DuxNotFound",
4
+ setup() {
5
+ return () => t("div", null, [t("h1", null, [e("404")]), t("p", null, [e("Page not found")])]);
6
+ }
7
7
  });
8
- export {
9
- u as DuxNotFound
10
- };
8
+ export { r as DuxNotFound };