@duxweb/dvha-core 1.0.47 → 1.0.49
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/status/exception.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/esm/components/status/exception.js +28 -10
- package/dist/esm/hooks/menu.js +18 -18
- package/dist/types/components/status/exception.d.ts +3 -1
- package/dist/types/hooks/menu.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("vue-router");require("pinia");require("lodash-es");const c=require("../../hooks/manage.cjs");require("@tanstack/vue-query");require("json-2-csv");require("@vee-validate/rules");require("vee-validate");require("@vueuse/core");require("../../hooks/json/index.cjs");require("../../utils/bus.cjs");require("@overlastic/vue");require("clsx");require("colorizr");require("axios");const a=e.defineComponent({name:"DuxException",setup(l,{slots:o}){const r=e.ref(null),u=i.useRoute(),{config:n}=c.useManage();return e.onErrorCaptured(t=>(console.error(t),u.name?r.value={title:"500",desc:t?.message||"Internal Server Error"}:r.value={title:"404",desc:"Page not found"},!1)),()=>r.value?n.components?.exception?e.h(n.components.exception,{data:r.value}):e.createVNode("div",null,[e.createVNode("h1",null,[r.value?.title||"Unknown"]),e.createVNode("p",null,[r.value?.desc||"Unknown Description"]),e.createVNode("p",null,[e.createTextVNode("Use config.components.exception to configure the exception layout")])]):o.default?.()}});exports.DuxException=a;
|
package/dist/cjs/hooks/menu.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),q=require("pinia"),t=require("vue"),L=require("vue-router"),S=require("../stores/route.cjs");require("../utils/bus.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),q=require("pinia"),t=require("vue"),L=require("vue-router"),S=require("../stores/route.cjs");require("../utils/bus.cjs");const c=require("../utils/tree.cjs");function x(u){const p=S.useRouteStore(),{routes:M}=q.storeToRefs(p),v=(e=!0)=>y.cloneDeep(M.value)?.filter(n=>!!n?.name).filter(n=>!e||n.hidden===void 0||n.hidden===!1),d=t.computed(()=>{const e=v(!1);return c.arrayToTree(e,{idKey:"name",parentKey:"parent",childrenKey:"children",sortKey:"sort"},void 0)}),a=t.computed(()=>{const e=v();return c.arrayToTree(e,{idKey:"name",parentKey:"parent",childrenKey:"children",sortKey:"sort"},void 0)}),o=L.useRoute(),h=t.ref(o.name),r=t.ref(o.name),s=t.ref(o.name),K=t.computed(()=>u?.doubleMenu?y.cloneDeep(a.value)?.map(n=>(delete n.children,n)):a.value),f=t.computed(()=>u?.doubleMenu?a.value?.find(n=>n.name===r.value)?.children||[]:[]),g=t.computed(()=>c.searchTree(d.value,n=>n?.name===o.name));t.watch(()=>u?.doubleMenu,()=>{if(u?.doubleMenu){const e=c.searchTree(a.value,n=>n?.name===r.value);r.value=e?.[0]?.name,s.value=e?.[e.length-1]?.name}else{const e=c.searchTree(a.value,n=>n?.name===s.value);r.value=e?.[e.length-1]?.name,s.value=e?.[e.length-1]?.name}},{immediate:!0});const T=t.computed(()=>u?.doubleMenu?f.value.length>0:!0);return t.watch([o,d,()=>u?.doubleMenu],()=>{const e=c.searchTree(d.value,i=>i.name===o.name),m=(i=>{let b=-1;for(let l=i.length-1;l>=0;l--)if(i[l].hidden===!1||i[l].hidden===void 0){b=l;break}return b})(e);h.value=e?.[m]?.name,u?.doubleMenu?(r.value=e?.[0]?.name,s.value=e?.[m]?.name):(r.value=e?.[m]?.name,s.value=e?.[m]?.name)},{immediate:!0}),{data:a,originalData:d,getMenu:v,mainMenu:K,subMenu:f,isSubMenu:T,crumbs:g,active:h,appActive:r,subActive:s}}exports.useMenu=x;
|
|
@@ -1,20 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
|
|
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({
|
|
4
18
|
name: "DuxException",
|
|
5
|
-
setup(
|
|
6
|
-
slots:
|
|
19
|
+
setup(d, {
|
|
20
|
+
slots: r
|
|
7
21
|
}) {
|
|
8
|
-
const e =
|
|
9
|
-
|
|
22
|
+
const e = m(null), p = c(), {
|
|
23
|
+
config: t
|
|
24
|
+
} = s();
|
|
25
|
+
return l((n) => (console.error(n), p.name ? e.value = {
|
|
10
26
|
title: "500",
|
|
11
|
-
desc:
|
|
27
|
+
desc: n?.message || "Internal Server Error"
|
|
12
28
|
} : e.value = {
|
|
13
29
|
title: "404",
|
|
14
30
|
desc: "Page not found"
|
|
15
|
-
}, !1)), () => e.value ?
|
|
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?.();
|
|
16
34
|
}
|
|
17
35
|
});
|
|
18
36
|
export {
|
|
19
|
-
|
|
37
|
+
P as DuxException
|
|
20
38
|
};
|
package/dist/esm/hooks/menu.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { cloneDeep as
|
|
1
|
+
import { cloneDeep as y } from "lodash-es";
|
|
2
2
|
import { storeToRefs as R } from "pinia";
|
|
3
|
-
import { computed as l, ref as f, watch as
|
|
3
|
+
import { computed as l, ref as f, watch as M } from "vue";
|
|
4
4
|
import { useRoute as S } from "vue-router";
|
|
5
5
|
import { useRouteStore as A } from "../stores/route.js";
|
|
6
6
|
import "../utils/bus.js";
|
|
7
7
|
import { arrayToTree as K, searchTree as c } from "../utils/tree.js";
|
|
8
8
|
function C(t) {
|
|
9
|
-
const g = A(), { routes: x } = R(g), v = (e = !0) =>
|
|
9
|
+
const g = A(), { routes: x } = R(g), v = (e = !0) => y(x.value)?.filter((n) => !!n?.name).filter((n) => !e || n.hidden === void 0 || n.hidden === !1), d = l(() => {
|
|
10
10
|
const e = v(!1);
|
|
11
11
|
return K(e, {
|
|
12
12
|
idKey: "name",
|
|
@@ -14,7 +14,7 @@ function C(t) {
|
|
|
14
14
|
childrenKey: "children",
|
|
15
15
|
sortKey: "sort"
|
|
16
16
|
}, void 0);
|
|
17
|
-
}),
|
|
17
|
+
}), u = l(() => {
|
|
18
18
|
const e = v();
|
|
19
19
|
return K(e, {
|
|
20
20
|
idKey: "name",
|
|
@@ -22,30 +22,30 @@ function C(t) {
|
|
|
22
22
|
childrenKey: "children",
|
|
23
23
|
sortKey: "sort"
|
|
24
24
|
}, void 0);
|
|
25
|
-
}), r = S(), h = f(r.name),
|
|
26
|
-
|
|
25
|
+
}), r = S(), h = f(r.name), a = f(r.name), o = f(r.name), L = l(() => t?.doubleMenu ? y(u.value)?.map((n) => (delete n.children, n)) : u.value), b = l(() => t?.doubleMenu ? u.value?.find((n) => n.name === a.value)?.children || [] : []), T = l(() => c(d.value, (n) => n?.name === r.name));
|
|
26
|
+
M(() => t?.doubleMenu, () => {
|
|
27
27
|
if (t?.doubleMenu) {
|
|
28
|
-
const e = c(
|
|
29
|
-
|
|
28
|
+
const e = c(u.value, (n) => n?.name === a.value);
|
|
29
|
+
a.value = e?.[0]?.name, o.value = e?.[e.length - 1]?.name;
|
|
30
30
|
} else {
|
|
31
|
-
const e = c(
|
|
32
|
-
|
|
31
|
+
const e = c(u.value, (n) => n?.name === o.value);
|
|
32
|
+
a.value = e?.[e.length - 1]?.name, o.value = e?.[e.length - 1]?.name;
|
|
33
33
|
}
|
|
34
34
|
}, { immediate: !0 });
|
|
35
|
-
const I = l(() => t?.doubleMenu ?
|
|
36
|
-
return
|
|
35
|
+
const I = l(() => t?.doubleMenu ? b.value.length > 0 : !0);
|
|
36
|
+
return M([r, d, () => t?.doubleMenu], () => {
|
|
37
37
|
const e = c(d.value, (i) => i.name === r.name), m = ((i) => {
|
|
38
|
-
let
|
|
38
|
+
let p = -1;
|
|
39
39
|
for (let s = i.length - 1; s >= 0; s--)
|
|
40
40
|
if (i[s].hidden === !1 || i[s].hidden === void 0) {
|
|
41
|
-
|
|
41
|
+
p = s;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return p;
|
|
45
45
|
})(e);
|
|
46
|
-
h.value = e?.[m]?.name, t?.doubleMenu ? (
|
|
46
|
+
h.value = e?.[m]?.name, t?.doubleMenu ? (a.value = e?.[0]?.name, o.value = e?.[m]?.name) : (a.value = e?.[m]?.name, o.value = e?.[m]?.name);
|
|
47
47
|
}, { immediate: !0 }), {
|
|
48
|
-
data:
|
|
48
|
+
data: u,
|
|
49
49
|
originalData: d,
|
|
50
50
|
getMenu: v,
|
|
51
51
|
mainMenu: L,
|
|
@@ -53,7 +53,7 @@ function C(t) {
|
|
|
53
53
|
isSubMenu: I,
|
|
54
54
|
crumbs: T,
|
|
55
55
|
active: h,
|
|
56
|
-
appActive:
|
|
56
|
+
appActive: a,
|
|
57
57
|
subActive: o
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const DuxException: import("vue").DefineComponent<{}, () => import("vue
|
|
1
|
+
export declare const DuxException: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
4
|
[key: string]: any;
|
|
3
5
|
}>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -8,7 +8,7 @@ export declare function useMenu(props?: UseMenuProps): {
|
|
|
8
8
|
getMenu: (hidden?: boolean) => IMenu[];
|
|
9
9
|
mainMenu: import("vue").ComputedRef<any>;
|
|
10
10
|
subMenu: import("vue").ComputedRef<any>;
|
|
11
|
-
isSubMenu: import("vue").ComputedRef<
|
|
11
|
+
isSubMenu: import("vue").ComputedRef<boolean>;
|
|
12
12
|
crumbs: import("vue").ComputedRef<any>;
|
|
13
13
|
active: import("vue").Ref<import("vue-router").RouteRecordNameGeneric, import("vue-router").RouteRecordNameGeneric>;
|
|
14
14
|
appActive: import("vue").Ref<import("vue-router").RouteRecordNameGeneric, import("vue-router").RouteRecordNameGeneric>;
|