@keyblade/pro-components 1.12.17 → 1.13.1
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/es/pro-date-range-picker/index.d.ts +12 -0
- package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +5 -0
- package/es/pro-date-range-picker/pro-date-range-picker.vue.js +2 -2
- package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +54 -53
- package/es/pro-layout/enum.d.ts +16 -0
- package/es/pro-layout/enum.js +5 -0
- package/es/pro-layout/hooks.d.ts +89 -12
- package/es/pro-layout/hooks.js +122 -82
- package/es/pro-layout/index.d.ts +19 -284
- package/es/pro-layout/pro-layout.vue.d.ts +14 -236
- package/es/pro-layout/pro-layout.vue.js +150 -233
- package/es/pro-layout/type.d.ts +83 -0
- package/es/pro-menu/index.d.ts +3 -3
- package/es/pro-menu/interface.d.ts +11 -0
- package/es/pro-menu/pro-menu.vue.d.ts +2 -2
- package/es/pro-menu/pro-menu.vue.js +43 -41
- package/es/style.css +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,9 @@ declare const ProDateRangePicker: {
|
|
|
7
7
|
startPlaceholder?: string;
|
|
8
8
|
endPlaceholder?: string;
|
|
9
9
|
separator?: string;
|
|
10
|
+
hideLabel?: boolean;
|
|
11
|
+
formItemProps?: FormItemProps;
|
|
12
|
+
datePickerProps?: DatePickerProps;
|
|
10
13
|
}> & Readonly<{
|
|
11
14
|
"onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
|
|
12
15
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -17,6 +20,7 @@ declare const ProDateRangePicker: {
|
|
|
17
20
|
startPlaceholder: string;
|
|
18
21
|
endPlaceholder: string;
|
|
19
22
|
separator: string;
|
|
23
|
+
hideLabel: boolean;
|
|
20
24
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
21
25
|
startDatePickerRef: unknown;
|
|
22
26
|
endDatePickerRef: unknown;
|
|
@@ -34,6 +38,9 @@ declare const ProDateRangePicker: {
|
|
|
34
38
|
startPlaceholder?: string;
|
|
35
39
|
endPlaceholder?: string;
|
|
36
40
|
separator?: string;
|
|
41
|
+
hideLabel?: boolean;
|
|
42
|
+
formItemProps?: FormItemProps;
|
|
43
|
+
datePickerProps?: DatePickerProps;
|
|
37
44
|
}> & Readonly<{
|
|
38
45
|
"onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
|
|
39
46
|
}>, {}, {}, {}, {}, {
|
|
@@ -42,6 +49,7 @@ declare const ProDateRangePicker: {
|
|
|
42
49
|
startPlaceholder: string;
|
|
43
50
|
endPlaceholder: string;
|
|
44
51
|
separator: string;
|
|
52
|
+
hideLabel: boolean;
|
|
45
53
|
}>;
|
|
46
54
|
__isFragment?: never;
|
|
47
55
|
__isTeleport?: never;
|
|
@@ -53,6 +61,9 @@ declare const ProDateRangePicker: {
|
|
|
53
61
|
startPlaceholder?: string;
|
|
54
62
|
endPlaceholder?: string;
|
|
55
63
|
separator?: string;
|
|
64
|
+
hideLabel?: boolean;
|
|
65
|
+
formItemProps?: FormItemProps;
|
|
66
|
+
datePickerProps?: DatePickerProps;
|
|
56
67
|
}> & Readonly<{
|
|
57
68
|
"onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
|
|
58
69
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -63,6 +74,7 @@ declare const ProDateRangePicker: {
|
|
|
63
74
|
startPlaceholder: string;
|
|
64
75
|
endPlaceholder: string;
|
|
65
76
|
separator: string;
|
|
77
|
+
hideLabel: boolean;
|
|
66
78
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
67
79
|
install: (app: App) => void;
|
|
68
80
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IModelValue } from './type.ts';
|
|
2
|
+
import { DatePickerProps, FormItemProps } from '@arco-design/web-vue';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
modelValue: IModelValue;
|
|
4
5
|
startField?: string;
|
|
@@ -6,6 +7,9 @@ type __VLS_Props = {
|
|
|
6
7
|
startPlaceholder?: string;
|
|
7
8
|
endPlaceholder?: string;
|
|
8
9
|
separator?: string;
|
|
10
|
+
hideLabel?: boolean;
|
|
11
|
+
formItemProps?: FormItemProps;
|
|
12
|
+
datePickerProps?: DatePickerProps;
|
|
9
13
|
};
|
|
10
14
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
11
15
|
"update:modelValue": (value: IModelValue) => any;
|
|
@@ -17,6 +21,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
17
21
|
startPlaceholder: string;
|
|
18
22
|
endPlaceholder: string;
|
|
19
23
|
separator: string;
|
|
24
|
+
hideLabel: boolean;
|
|
20
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
26
|
startDatePickerRef: unknown;
|
|
22
27
|
endDatePickerRef: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./pro-date-range-picker.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const _ = /* @__PURE__ */
|
|
3
|
+
import a from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const _ = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ae94924a"]]);
|
|
5
5
|
export {
|
|
6
6
|
_ as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, ref as V, computed as k, resolveComponent as h, createElementBlock as _, openBlock as E, normalizeClass as S, createVNode as d, mergeProps as i, withCtx as n, createTextVNode as B, toDisplayString as R, nextTick as P } from "vue";
|
|
2
2
|
import r from "dayjs";
|
|
3
|
-
const
|
|
3
|
+
const T = "keyblade-pro-date-range-picker", I = /* @__PURE__ */ v({
|
|
4
4
|
__name: "pro-date-range-picker",
|
|
5
5
|
props: {
|
|
6
6
|
modelValue: {},
|
|
@@ -8,92 +8,93 @@ const N = "keyblade-pro-date-range-picker", $ = /* @__PURE__ */ C({
|
|
|
8
8
|
endField: { default: "endDate" },
|
|
9
9
|
startPlaceholder: { default: "开始日期" },
|
|
10
10
|
endPlaceholder: { default: "结束日期" },
|
|
11
|
-
separator: { default: "至" }
|
|
11
|
+
separator: { default: "至" },
|
|
12
|
+
hideLabel: { type: Boolean, default: !0 },
|
|
13
|
+
formItemProps: {},
|
|
14
|
+
datePickerProps: {}
|
|
12
15
|
},
|
|
13
16
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const e =
|
|
16
|
-
const { class: t, ...l } = F;
|
|
17
|
-
return l;
|
|
18
|
-
}), i = g, u = V(), m = V(), c = n({
|
|
17
|
+
setup(F, { emit: g }) {
|
|
18
|
+
const e = F, s = g, u = V(), m = V(), p = k({
|
|
19
19
|
get: () => e.modelValue[e.startField],
|
|
20
|
-
set: (
|
|
21
|
-
|
|
20
|
+
set: (l) => {
|
|
21
|
+
s("update:modelValue", {
|
|
22
22
|
...e.modelValue,
|
|
23
|
-
[e.startField]:
|
|
23
|
+
[e.startField]: l
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
26
|
+
}), f = k({
|
|
27
27
|
get: () => e.modelValue[e.endField],
|
|
28
|
-
set: (
|
|
29
|
-
|
|
28
|
+
set: (l) => {
|
|
29
|
+
s("update:modelValue", {
|
|
30
30
|
...e.modelValue,
|
|
31
|
-
[e.endField]:
|
|
31
|
+
[e.endField]: l
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}), b = (
|
|
34
|
+
}), b = (l) => e.modelValue[e.endField] ? r(l).isAfter(r(e.modelValue[e.endField])) : !1, D = (l) => e.modelValue[e.startField] ? r(l).isBefore(r(e.modelValue[e.startField])) : !1, y = () => {
|
|
35
35
|
setTimeout(() => {
|
|
36
|
-
e.modelValue[e.startField] && !e.modelValue[e.endField] &&
|
|
37
|
-
var
|
|
38
|
-
const
|
|
39
|
-
|
|
36
|
+
e.modelValue[e.startField] && !e.modelValue[e.endField] && P(() => {
|
|
37
|
+
var t;
|
|
38
|
+
const l = (t = m.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
|
|
39
|
+
l && l.click();
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
},
|
|
42
|
+
}, C = () => {
|
|
43
43
|
setTimeout(() => {
|
|
44
|
-
e.modelValue[e.endField] && !e.modelValue[e.startField] &&
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
|
|
44
|
+
e.modelValue[e.endField] && !e.modelValue[e.startField] && P(() => {
|
|
45
|
+
var t;
|
|
46
|
+
const l = (t = u.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
|
|
47
|
+
l && l.click();
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
return (
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
class: T
|
|
51
|
+
return (l, t) => {
|
|
52
|
+
const c = h("a-date-picker"), o = h("a-form-item");
|
|
53
|
+
return E(), _("div", {
|
|
54
|
+
class: S(T)
|
|
55
55
|
}, [
|
|
56
|
-
d(o, {
|
|
57
|
-
field:
|
|
56
|
+
d(o, i(l.formItemProps, {
|
|
57
|
+
field: l.startField,
|
|
58
58
|
style: { "margin-right": "8px" },
|
|
59
|
-
"hide-label":
|
|
60
|
-
}, {
|
|
61
|
-
default:
|
|
62
|
-
d(
|
|
59
|
+
"hide-label": l.hideLabel
|
|
60
|
+
}), {
|
|
61
|
+
default: n(() => [
|
|
62
|
+
d(c, i({
|
|
63
63
|
ref_key: "startDatePickerRef",
|
|
64
64
|
ref: u,
|
|
65
|
-
modelValue:
|
|
66
|
-
"onUpdate:modelValue":
|
|
67
|
-
|
|
65
|
+
modelValue: p.value,
|
|
66
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => p.value = a)
|
|
67
|
+
}, l.datePickerProps, {
|
|
68
|
+
placeholder: l.startPlaceholder,
|
|
68
69
|
"disabled-date": (a) => b(a),
|
|
69
|
-
onChange:
|
|
70
|
-
}, null,
|
|
70
|
+
onChange: y
|
|
71
|
+
}), null, 16, ["modelValue", "placeholder", "disabled-date"])
|
|
71
72
|
]),
|
|
72
73
|
_: 1
|
|
73
|
-
},
|
|
74
|
+
}, 16, ["field", "hide-label"]),
|
|
74
75
|
d(o, {
|
|
75
76
|
"hide-label": "",
|
|
76
77
|
style: { "margin-right": "8px" }
|
|
77
78
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
79
|
+
default: n(() => [
|
|
80
|
+
B(R(l.separator), 1)
|
|
80
81
|
]),
|
|
81
82
|
_: 1
|
|
82
83
|
}),
|
|
83
84
|
d(o, {
|
|
84
|
-
field:
|
|
85
|
+
field: l.endField,
|
|
85
86
|
"hide-label": ""
|
|
86
87
|
}, {
|
|
87
|
-
default:
|
|
88
|
-
d(
|
|
88
|
+
default: n(() => [
|
|
89
|
+
d(c, i({
|
|
89
90
|
ref_key: "endDatePickerRef",
|
|
90
91
|
ref: m,
|
|
91
|
-
modelValue:
|
|
92
|
-
"onUpdate:modelValue":
|
|
93
|
-
},
|
|
94
|
-
placeholder:
|
|
95
|
-
"disabled-date": (a) =>
|
|
96
|
-
onChange:
|
|
92
|
+
modelValue: f.value,
|
|
93
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => f.value = a)
|
|
94
|
+
}, l.datePickerProps, {
|
|
95
|
+
placeholder: l.endPlaceholder,
|
|
96
|
+
"disabled-date": (a) => D(a),
|
|
97
|
+
onChange: C
|
|
97
98
|
}), null, 16, ["modelValue", "placeholder", "disabled-date"])
|
|
98
99
|
]),
|
|
99
100
|
_: 1
|
|
@@ -103,5 +104,5 @@ const N = "keyblade-pro-date-range-picker", $ = /* @__PURE__ */ C({
|
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
106
|
export {
|
|
106
|
-
|
|
107
|
+
I as default
|
|
107
108
|
};
|
package/es/pro-layout/hooks.d.ts
CHANGED
|
@@ -1,14 +1,91 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
1
|
import { IProMenuItem } from '../pro-menu';
|
|
3
2
|
import { IProTab } from '../pro-reuse-tabs';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { ProLayoutMenuType } from './enum.ts';
|
|
4
|
+
import { IProLayoutProps } from './type.ts';
|
|
5
|
+
export declare function useHooks(props: IProLayoutProps): {
|
|
6
|
+
topMenuItems: import('vue').Ref<{
|
|
7
|
+
name: string;
|
|
8
|
+
path: string;
|
|
9
|
+
title: string;
|
|
10
|
+
topMenu?: boolean | undefined;
|
|
11
|
+
topChildrenMenu?: boolean | undefined;
|
|
12
|
+
activatedKeys?: string[] | undefined;
|
|
13
|
+
icon?: string | undefined;
|
|
14
|
+
selectedIcon?: string | undefined;
|
|
15
|
+
hideInMenu?: boolean | undefined;
|
|
16
|
+
hideChildrenInMenu?: boolean | undefined;
|
|
17
|
+
noAffix?: boolean | undefined;
|
|
18
|
+
breadcrumbs?: {
|
|
19
|
+
path?: string | undefined;
|
|
20
|
+
label: string;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
ignoreCache?: boolean | undefined;
|
|
23
|
+
componentKey?: "path" | "fullPath" | undefined;
|
|
24
|
+
children?: /*elided*/ any[] | undefined;
|
|
25
|
+
}[], IProMenuItem[] | {
|
|
26
|
+
name: string;
|
|
27
|
+
path: string;
|
|
28
|
+
title: string;
|
|
29
|
+
topMenu?: boolean | undefined;
|
|
30
|
+
topChildrenMenu?: boolean | undefined;
|
|
31
|
+
activatedKeys?: string[] | undefined;
|
|
32
|
+
icon?: string | undefined;
|
|
33
|
+
selectedIcon?: string | undefined;
|
|
34
|
+
hideInMenu?: boolean | undefined;
|
|
35
|
+
hideChildrenInMenu?: boolean | undefined;
|
|
36
|
+
noAffix?: boolean | undefined;
|
|
37
|
+
breadcrumbs?: {
|
|
38
|
+
path?: string | undefined;
|
|
39
|
+
label: string;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
ignoreCache?: boolean | undefined;
|
|
42
|
+
componentKey?: "path" | "fullPath" | undefined;
|
|
43
|
+
children?: /*elided*/ any[] | undefined;
|
|
44
|
+
}[]>;
|
|
45
|
+
siderMenuItems: import('vue').Ref<{
|
|
46
|
+
name: string;
|
|
47
|
+
path: string;
|
|
48
|
+
title: string;
|
|
49
|
+
topMenu?: boolean | undefined;
|
|
50
|
+
topChildrenMenu?: boolean | undefined;
|
|
51
|
+
activatedKeys?: string[] | undefined;
|
|
52
|
+
icon?: string | undefined;
|
|
53
|
+
selectedIcon?: string | undefined;
|
|
54
|
+
hideInMenu?: boolean | undefined;
|
|
55
|
+
hideChildrenInMenu?: boolean | undefined;
|
|
56
|
+
noAffix?: boolean | undefined;
|
|
57
|
+
breadcrumbs?: {
|
|
58
|
+
path?: string | undefined;
|
|
59
|
+
label: string;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
ignoreCache?: boolean | undefined;
|
|
62
|
+
componentKey?: "path" | "fullPath" | undefined;
|
|
63
|
+
children?: /*elided*/ any[] | undefined;
|
|
64
|
+
}[], IProMenuItem[] | {
|
|
65
|
+
name: string;
|
|
66
|
+
path: string;
|
|
67
|
+
title: string;
|
|
68
|
+
topMenu?: boolean | undefined;
|
|
69
|
+
topChildrenMenu?: boolean | undefined;
|
|
70
|
+
activatedKeys?: string[] | undefined;
|
|
71
|
+
icon?: string | undefined;
|
|
72
|
+
selectedIcon?: string | undefined;
|
|
73
|
+
hideInMenu?: boolean | undefined;
|
|
74
|
+
hideChildrenInMenu?: boolean | undefined;
|
|
75
|
+
noAffix?: boolean | undefined;
|
|
76
|
+
breadcrumbs?: {
|
|
77
|
+
path?: string | undefined;
|
|
78
|
+
label: string;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
ignoreCache?: boolean | undefined;
|
|
81
|
+
componentKey?: "path" | "fullPath" | undefined;
|
|
82
|
+
children?: /*elided*/ any[] | undefined;
|
|
83
|
+
}[]>;
|
|
84
|
+
topMenuSelectedKeys: import('vue').Ref<string[], string[]>;
|
|
85
|
+
siderMenuSelectedKeys: import('vue').Ref<string[], string[]>;
|
|
86
|
+
activeMenuItem: import('vue').Ref<IProMenuItem | undefined, IProMenuItem | undefined>;
|
|
87
|
+
menuItemMap: import('vue').Ref<Record<string, IProMenuItem>, Record<string, IProMenuItem>>;
|
|
88
|
+
breadcrumbItems: import('vue').Ref<{
|
|
12
89
|
path?: string | undefined;
|
|
13
90
|
label: string;
|
|
14
91
|
}[], {
|
|
@@ -18,7 +95,7 @@ export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
|
|
|
18
95
|
path?: string | undefined;
|
|
19
96
|
label: string;
|
|
20
97
|
}[]>;
|
|
21
|
-
tabs: Ref<{
|
|
98
|
+
tabs: import('vue').Ref<{
|
|
22
99
|
name: string;
|
|
23
100
|
parentNames: string[];
|
|
24
101
|
title: string;
|
|
@@ -31,8 +108,8 @@ export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
|
|
|
31
108
|
fullPath: string;
|
|
32
109
|
active: boolean;
|
|
33
110
|
}[]>;
|
|
34
|
-
keepAliveInclude: Ref<string[], string[]>;
|
|
35
|
-
|
|
111
|
+
keepAliveInclude: import('vue').Ref<string[], string[]>;
|
|
112
|
+
onProMenuItemClick: (menuType: ProLayoutMenuType, item: IProMenuItem) => Promise<void>;
|
|
36
113
|
onTabClick: (key: string) => void;
|
|
37
114
|
onTabDelete: (key: string) => void;
|
|
38
115
|
};
|
package/es/pro-layout/hooks.js
CHANGED
|
@@ -1,106 +1,146 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ref as r, computed as L, watch as g } from "vue";
|
|
2
|
+
import { useRoute as R, useRouter as W } from "vue-router";
|
|
3
|
+
import { ProLayoutMode as P, ProLayoutMenuType as B } from "./enum.js";
|
|
4
|
+
function z(u) {
|
|
5
|
+
const o = R(), h = W(), y = r([]), T = r([]), i = r(), v = r([]), M = r({}), k = r([]), s = r([]), p = r([]), b = r([]), f = r([]), d = L(() => {
|
|
6
|
+
const a = [...u.menuItems], e = (n) => {
|
|
7
|
+
n.forEach((l) => {
|
|
8
|
+
if (l != null && l.children && l.children.length > 0) {
|
|
9
|
+
if ((l == null ? void 0 : l.topChildrenMenu) !== void 0)
|
|
10
|
+
l.children = l.children.map((t) => ({ ...t, topMenu: l == null ? void 0 : l.topChildrenMenu }));
|
|
11
|
+
else {
|
|
12
|
+
const t = l.children.find((c) => c.topMenu !== void 0);
|
|
13
|
+
t && (l.topChildrenMenu = t.topMenu, l.children = l.children.map((c) => ({ ...c, topMenu: t.topMenu })));
|
|
14
|
+
}
|
|
15
|
+
e(l.children);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return u.layout === P.mix && e(a), a;
|
|
20
|
+
}), C = (a) => {
|
|
21
|
+
var e;
|
|
22
|
+
y.value = [a.name], !(a != null && a.children) || ((e = a == null ? void 0 : a.children) == null ? void 0 : e.length) === 0 ? (f.value = [], h == null || h.push({ path: a.path })) : f.value = a.children;
|
|
23
|
+
}, E = (a) => {
|
|
24
|
+
h == null || h.push({ path: a.path }), T.value = [a.name];
|
|
25
|
+
}, N = async (a, e) => {
|
|
26
|
+
if (e != null && e.path && !(u != null && u.onMenuItemClick && !await u.onMenuItemClick(e))) {
|
|
27
|
+
if (e.path.startsWith("http") || e.path.startsWith("https")) {
|
|
28
|
+
window.open(e.path);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
a === B.top ? C(e) : E(e);
|
|
32
|
+
}
|
|
33
|
+
}, S = () => {
|
|
34
|
+
const a = [], e = (n) => {
|
|
35
|
+
var l;
|
|
36
|
+
for (const t in n) {
|
|
37
|
+
const c = n[t];
|
|
38
|
+
if (c.name === ((l = i == null ? void 0 : i.value) == null ? void 0 : l.name) || c.children && c.children.length > 0 && e(c.children))
|
|
39
|
+
return a.unshift(c), !0;
|
|
13
40
|
}
|
|
14
41
|
return !1;
|
|
15
42
|
};
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
|
|
43
|
+
e(JSON.parse(JSON.stringify(d.value))), v.value = a;
|
|
44
|
+
}, x = () => {
|
|
45
|
+
var e, n, l;
|
|
46
|
+
const a = (e = v.value) == null ? void 0 : e.map((t) => ({ path: t == null ? void 0 : t.path, label: t == null ? void 0 : t.title }));
|
|
47
|
+
k.value = (n = i.value) != null && n.breadcrumbs ? (l = i.value) == null ? void 0 : l.breadcrumbs : a.length !== 0 ? a : [];
|
|
21
48
|
};
|
|
22
|
-
function
|
|
23
|
-
if (!
|
|
24
|
-
|
|
25
|
-
|
|
49
|
+
function A() {
|
|
50
|
+
if (!i.value || i.value.noAffix) {
|
|
51
|
+
s.value.forEach((t) => {
|
|
52
|
+
t.active = !1;
|
|
26
53
|
});
|
|
27
54
|
return;
|
|
28
55
|
}
|
|
29
|
-
const { name:
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
56
|
+
const { name: a, title: e } = i.value;
|
|
57
|
+
let n = -1;
|
|
58
|
+
s.value.forEach((t, c) => {
|
|
59
|
+
t.active = !1, t.name === a && (n = c);
|
|
33
60
|
});
|
|
34
|
-
const
|
|
35
|
-
name:
|
|
36
|
-
parentNames: v.value.map((
|
|
37
|
-
title:
|
|
38
|
-
fullPath:
|
|
61
|
+
const l = {
|
|
62
|
+
name: a,
|
|
63
|
+
parentNames: v.value.map((t) => t.name),
|
|
64
|
+
title: e ?? a,
|
|
65
|
+
fullPath: o.fullPath,
|
|
39
66
|
active: !0
|
|
40
67
|
};
|
|
41
|
-
if (~
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
if (~n) {
|
|
69
|
+
const t = s.value[n];
|
|
70
|
+
t.fullPath === o.fullPath ? (t.active = !0, t.fullPath = o.fullPath) : (s.value.splice(n, 1), setTimeout(() => {
|
|
71
|
+
s.value.push(l);
|
|
45
72
|
}));
|
|
46
73
|
} else
|
|
47
|
-
|
|
74
|
+
s.value.push(l);
|
|
48
75
|
}
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
let
|
|
58
|
-
|
|
76
|
+
const w = (a) => {
|
|
77
|
+
const e = s.value.findIndex((l) => l.name === a), n = s.value[e];
|
|
78
|
+
h.push(n.fullPath);
|
|
79
|
+
}, K = (a) => {
|
|
80
|
+
let e = -1, n = -1;
|
|
81
|
+
if (s.value.forEach((t, c) => {
|
|
82
|
+
t.name === a && (n = c), t.active && (e = c);
|
|
83
|
+
}), e === n) {
|
|
84
|
+
let t;
|
|
85
|
+
n === 0 ? t = s.value[n + 1] : t = s.value[n - 1], t.active = !0, h.push(t.fullPath);
|
|
59
86
|
}
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
var
|
|
64
|
-
if (
|
|
87
|
+
const l = s.value.splice(n, 1);
|
|
88
|
+
O(l[0]);
|
|
89
|
+
}, J = () => {
|
|
90
|
+
var e;
|
|
91
|
+
if (u != null && u.disableKeepAlive || (e = o == null ? void 0 : o.meta) != null && e.ignoreCache)
|
|
65
92
|
return;
|
|
66
|
-
const
|
|
67
|
-
v.value.forEach((
|
|
68
|
-
|
|
69
|
-
}),
|
|
70
|
-
},
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
93
|
+
const a = new Set(p.value);
|
|
94
|
+
v.value.forEach((n) => {
|
|
95
|
+
n.name && a.add(n.name);
|
|
96
|
+
}), p.value = Array.from(a.values());
|
|
97
|
+
}, O = (a) => {
|
|
98
|
+
const e = new Set(p.value);
|
|
99
|
+
a.parentNames.forEach((n) => {
|
|
100
|
+
e.delete(n);
|
|
101
|
+
}), s.value.forEach((n) => {
|
|
102
|
+
n.parentNames.forEach((l) => {
|
|
103
|
+
const t = M.value[l];
|
|
104
|
+
t != null && t.ignoreCache || e.add(t.name);
|
|
78
105
|
});
|
|
79
|
-
}),
|
|
106
|
+
}), p.value = Array.from(e.values());
|
|
80
107
|
};
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
108
|
+
return g(() => d.value, () => {
|
|
109
|
+
const a = {}, e = (n) => {
|
|
110
|
+
n.forEach((l) => {
|
|
111
|
+
l.children && l.children.length > 0 && e(l.children), delete l.children, a[l.name] = l;
|
|
85
112
|
});
|
|
86
113
|
};
|
|
87
|
-
|
|
88
|
-
}, { immediate: !0 }),
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
114
|
+
e(JSON.parse(JSON.stringify(d.value))), M.value = a;
|
|
115
|
+
}, { immediate: !0 }), g(() => [u.layout, d.value], () => {
|
|
116
|
+
var a;
|
|
117
|
+
if (b.value = [], f.value = [], u.layout === P.side)
|
|
118
|
+
f.value = d.value;
|
|
119
|
+
else if (u.layout === P.mix) {
|
|
120
|
+
const e = (a = d.value) == null ? void 0 : a.filter((n) => n.topMenu);
|
|
121
|
+
(e == null ? void 0 : e.length) === 0 ? f.value = d.value : b.value = e;
|
|
122
|
+
}
|
|
123
|
+
}, { immediate: !0 }), g(() => o == null ? void 0 : o.name, () => {
|
|
124
|
+
var n, l, t;
|
|
125
|
+
const a = o == null ? void 0 : o.name;
|
|
126
|
+
i.value = M.value[a], S();
|
|
127
|
+
const e = v.value.filter((c) => c.topMenu);
|
|
128
|
+
e.length > 0 && b.value.length > 0 && (f.value = ((n = e[e.length - 1]) == null ? void 0 : n.children) || []), y.value = i != null && i.value ? [...e.map((c) => c.name), ...((l = i.value) == null ? void 0 : l.activatedKeys) || []] : [], T.value = i != null && i.value ? [i.value.name, ...((t = i.value) == null ? void 0 : t.activatedKeys) || []] : [], x(), u.hideTabs || A(), J();
|
|
92
129
|
}, { immediate: !0 }), {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
130
|
+
topMenuItems: b,
|
|
131
|
+
siderMenuItems: f,
|
|
132
|
+
topMenuSelectedKeys: y,
|
|
133
|
+
siderMenuSelectedKeys: T,
|
|
134
|
+
activeMenuItem: i,
|
|
135
|
+
menuItemMap: M,
|
|
136
|
+
breadcrumbItems: k,
|
|
137
|
+
tabs: s,
|
|
138
|
+
keepAliveInclude: p,
|
|
139
|
+
onProMenuItemClick: N,
|
|
140
|
+
onTabClick: w,
|
|
141
|
+
onTabDelete: K
|
|
102
142
|
};
|
|
103
143
|
}
|
|
104
144
|
export {
|
|
105
|
-
|
|
145
|
+
z as useHooks
|
|
106
146
|
};
|