vft 0.0.470 → 0.0.471
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/index.css +1 -1
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/horizontal-menu/horizontal-menu.vue.d.ts +3 -0
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +93 -73
- package/es/components/horizontal-menu/index.d.ts +18 -0
- package/es/components/menu/menu-item-group.vue2.js +16 -15
- package/es/components/multiple-tabs/style/css.d.ts +1 -0
- package/es/components/multiple-tabs/style/css.js +1 -0
- package/es/components/multiple-tabs/style/index.d.ts +1 -0
- package/es/components/multiple-tabs/style/index.js +1 -0
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +25 -19
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/horizontal-menu/horizontal-menu.vue.d.ts +3 -0
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/index.d.ts +18 -0
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/style/css.cjs +1 -1
- package/lib/components/multiple-tabs/style/css.d.ts +1 -0
- package/lib/components/multiple-tabs/style/index.cjs +1 -1
- package/lib/components/multiple-tabs/style/index.d.ts +1 -0
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/common/icon.scss +1 -0
- package/theme-style/src/menu.scss +0 -5
- package/theme-style/src/multiple-tabs.scss +4 -0
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-multiple-tabs.css +1 -1
- package/web-types.json +1 -1
|
@@ -62,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
62
62
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
63
63
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
64
64
|
readonly effect?: "light" | "dark" | undefined;
|
|
65
|
+
readonly visible?: boolean | null | undefined;
|
|
65
66
|
readonly teleported?: boolean | undefined;
|
|
66
67
|
readonly open?: boolean | undefined;
|
|
67
|
-
readonly visible?: boolean | null | undefined;
|
|
68
68
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
69
69
|
readonly arrowOffset?: number | undefined;
|
|
70
70
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -480,9 +480,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
480
480
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
481
481
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
482
482
|
readonly effect?: "light" | "dark" | undefined;
|
|
483
|
+
readonly visible?: boolean | null | undefined;
|
|
483
484
|
readonly teleported?: boolean | undefined;
|
|
484
485
|
readonly open?: boolean | undefined;
|
|
485
|
-
readonly visible?: boolean | null | undefined;
|
|
486
486
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
487
487
|
readonly arrowOffset?: number | undefined;
|
|
488
488
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -85,9 +85,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
85
85
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
86
86
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
87
87
|
readonly effect?: "light" | "dark" | undefined;
|
|
88
|
+
readonly visible?: boolean | null | undefined;
|
|
88
89
|
readonly teleported?: boolean | undefined;
|
|
89
90
|
readonly open?: boolean | undefined;
|
|
90
|
-
readonly visible?: boolean | null | undefined;
|
|
91
91
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
92
92
|
readonly arrowOffset?: number | undefined;
|
|
93
93
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -503,9 +503,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
503
503
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
504
504
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
505
505
|
readonly effect?: "light" | "dark" | undefined;
|
|
506
|
+
readonly visible?: boolean | null | undefined;
|
|
506
507
|
readonly teleported?: boolean | undefined;
|
|
507
508
|
readonly open?: boolean | undefined;
|
|
508
|
-
readonly visible?: boolean | null | undefined;
|
|
509
509
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
510
510
|
readonly arrowOffset?: number | undefined;
|
|
511
511
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1006,9 +1006,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1006
1006
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1007
1007
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1008
1008
|
readonly effect?: "light" | "dark" | undefined;
|
|
1009
|
+
readonly visible?: boolean | null | undefined;
|
|
1009
1010
|
readonly teleported?: boolean | undefined;
|
|
1010
1011
|
readonly open?: boolean | undefined;
|
|
1011
|
-
readonly visible?: boolean | null | undefined;
|
|
1012
1012
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1013
1013
|
readonly arrowOffset?: number | undefined;
|
|
1014
1014
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1424,9 +1424,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1424
1424
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1425
1425
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1426
1426
|
readonly effect?: "light" | "dark" | undefined;
|
|
1427
|
+
readonly visible?: boolean | null | undefined;
|
|
1427
1428
|
readonly teleported?: boolean | undefined;
|
|
1428
1429
|
readonly open?: boolean | undefined;
|
|
1429
|
-
readonly visible?: boolean | null | undefined;
|
|
1430
1430
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1431
1431
|
readonly arrowOffset?: number | undefined;
|
|
1432
1432
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1916,9 +1916,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1916
1916
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1917
1917
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1918
1918
|
readonly effect?: "light" | "dark" | undefined;
|
|
1919
|
+
readonly visible?: boolean | null | undefined;
|
|
1919
1920
|
readonly teleported?: boolean | undefined;
|
|
1920
1921
|
readonly open?: boolean | undefined;
|
|
1921
|
-
readonly visible?: boolean | null | undefined;
|
|
1922
1922
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1923
1923
|
readonly arrowOffset?: number | undefined;
|
|
1924
1924
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -2334,9 +2334,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
2334
2334
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
2335
2335
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
2336
2336
|
readonly effect?: "light" | "dark" | undefined;
|
|
2337
|
+
readonly visible?: boolean | null | undefined;
|
|
2337
2338
|
readonly teleported?: boolean | undefined;
|
|
2338
2339
|
readonly open?: boolean | undefined;
|
|
2339
|
-
readonly visible?: boolean | null | undefined;
|
|
2340
2340
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
2341
2341
|
readonly arrowOffset?: number | undefined;
|
|
2342
2342
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -24,12 +24,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
24
24
|
autofocus: {
|
|
25
25
|
type: import("vue").PropType<boolean>;
|
|
26
26
|
};
|
|
27
|
-
dark: {
|
|
28
|
-
type: import("vue").PropType<boolean>;
|
|
29
|
-
};
|
|
30
27
|
icon: {
|
|
31
28
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
32
29
|
};
|
|
30
|
+
dark: {
|
|
31
|
+
type: import("vue").PropType<boolean>;
|
|
32
|
+
};
|
|
33
33
|
loading: {
|
|
34
34
|
type: import("vue").PropType<boolean>;
|
|
35
35
|
};
|
|
@@ -114,12 +114,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
114
114
|
autofocus: {
|
|
115
115
|
type: import("vue").PropType<boolean>;
|
|
116
116
|
};
|
|
117
|
-
dark: {
|
|
118
|
-
type: import("vue").PropType<boolean>;
|
|
119
|
-
};
|
|
120
117
|
icon: {
|
|
121
118
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
122
119
|
};
|
|
120
|
+
dark: {
|
|
121
|
+
type: import("vue").PropType<boolean>;
|
|
122
|
+
};
|
|
123
123
|
loading: {
|
|
124
124
|
type: import("vue").PropType<boolean>;
|
|
125
125
|
};
|
|
@@ -199,12 +199,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
199
199
|
autofocus: {
|
|
200
200
|
type: import("vue").PropType<boolean>;
|
|
201
201
|
};
|
|
202
|
-
dark: {
|
|
203
|
-
type: import("vue").PropType<boolean>;
|
|
204
|
-
};
|
|
205
202
|
icon: {
|
|
206
203
|
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
207
204
|
};
|
|
205
|
+
dark: {
|
|
206
|
+
type: import("vue").PropType<boolean>;
|
|
207
|
+
};
|
|
208
208
|
loading: {
|
|
209
209
|
type: import("vue").PropType<boolean>;
|
|
210
210
|
};
|
|
@@ -14,6 +14,9 @@ export interface HorizontalMenuProps {
|
|
|
14
14
|
defaultActive?: string;
|
|
15
15
|
defaultOpeneds?: Array<string | number>;
|
|
16
16
|
menuOptions?: Partial<MenuProps>;
|
|
17
|
+
enableScroll?: boolean;
|
|
18
|
+
scrollThreshold?: number;
|
|
19
|
+
scrollMaxHeight?: string;
|
|
17
20
|
}
|
|
18
21
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<HorizontalMenuProps>>, {
|
|
19
22
|
isInSubMenu: import("vue").ComputedRef<any>;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { defineComponent as I, computed as
|
|
2
|
-
import { useRouterHelper as
|
|
3
|
-
import { isUrl as
|
|
4
|
-
import { VftMenu as
|
|
1
|
+
import { defineComponent as I, computed as S, getCurrentInstance as Y, useSlots as q, ref as F, createVNode as c, mergeProps as w, createTextVNode as K, isVNode as Q } from "vue";
|
|
2
|
+
import { useRouterHelper as X } from "@vft/router";
|
|
3
|
+
import { isUrl as Z } from "@vft/utils";
|
|
4
|
+
import { VftMenu as _, VftSubMenu as ee, VftMenuItem as te, VftMenuItemGroup as ne } from "../menu/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../form/index.js";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import { MenuTypeEnum as
|
|
14
|
-
|
|
13
|
+
import { MenuTypeEnum as oe } from "./constants.js";
|
|
14
|
+
function ue(t) {
|
|
15
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Q(t);
|
|
16
|
+
}
|
|
17
|
+
const ae = I({
|
|
15
18
|
name: "vft-horizontal-menu"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
19
|
+
}), xe = /* @__PURE__ */ I({
|
|
20
|
+
...ae,
|
|
18
21
|
props: {
|
|
19
22
|
menus: {},
|
|
20
23
|
attrMapping: {},
|
|
@@ -39,100 +42,117 @@ const ne = I({
|
|
|
39
42
|
},
|
|
40
43
|
defaultActive: {},
|
|
41
44
|
defaultOpeneds: {},
|
|
42
|
-
menuOptions: {}
|
|
45
|
+
menuOptions: {},
|
|
46
|
+
enableScroll: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !0
|
|
49
|
+
},
|
|
50
|
+
scrollThreshold: {
|
|
51
|
+
default: 10
|
|
52
|
+
},
|
|
53
|
+
scrollMaxHeight: {
|
|
54
|
+
default: "400px"
|
|
55
|
+
}
|
|
43
56
|
},
|
|
44
57
|
emits: ["open", "close", "select", "sub-menu-click"],
|
|
45
|
-
setup(
|
|
46
|
-
expose:
|
|
47
|
-
emit:
|
|
58
|
+
setup(t, {
|
|
59
|
+
expose: N,
|
|
60
|
+
emit: A
|
|
48
61
|
}) {
|
|
49
|
-
const
|
|
50
|
-
"grid-template-rows": `repeat(${Math.min(e?.[o]?.[
|
|
51
|
-
})),
|
|
62
|
+
const p = A, b = le("horizontal-menu"), L = S(() => (e, o, a) => ({
|
|
63
|
+
"grid-template-rows": `repeat(${Math.min(e?.[o]?.[l.value.children]?.length || 0, Number(a || t.maxRowLength ? a || t.maxRowLength : e?.[o]?.[l.value.children]?.length))}, auto)`
|
|
64
|
+
})), l = S(() => ({
|
|
52
65
|
path: "path",
|
|
53
66
|
children: "children",
|
|
54
67
|
title: "title",
|
|
55
68
|
index: "path",
|
|
56
69
|
icon: "icon",
|
|
57
70
|
disabled: "disabled",
|
|
58
|
-
...
|
|
59
|
-
})),
|
|
60
|
-
const
|
|
61
|
-
return
|
|
71
|
+
...t.attrMapping
|
|
72
|
+
})), B = Y(), h = q(), O = F(), T = B.appContext.config.globalProperties.$router, v = (e, o, a) => {
|
|
73
|
+
const i = e[l.value.path], r = e[l.value.title], n = e?.[l.value.index], M = e?.[l.value.icon], m = !!e?.[l.value.disabled], d = t.disabledJudgeTurnOver ? !m : m, g = n || i || o + r;
|
|
74
|
+
return c(te, w(e, {
|
|
62
75
|
key: g,
|
|
63
76
|
index: String(g),
|
|
64
77
|
icon: M,
|
|
65
|
-
route:
|
|
78
|
+
route: i,
|
|
66
79
|
title: r,
|
|
67
|
-
disabled:
|
|
80
|
+
disabled: t.openDisabled && d,
|
|
68
81
|
className: a ? "vft-menu-popup-item" : "vft-menu-no-popup-item"
|
|
69
82
|
}), {
|
|
70
|
-
default: a ?
|
|
83
|
+
default: a ? h.menuItem ? () => h.menuItem?.({
|
|
71
84
|
item: e
|
|
72
|
-
}) : null :
|
|
85
|
+
}) : null : h.menuTopItem ? () => h.menuTopItem?.({
|
|
73
86
|
item: e
|
|
74
87
|
}) : null
|
|
75
88
|
});
|
|
89
|
+
}, J = (e) => {
|
|
90
|
+
p("open", e);
|
|
91
|
+
}, j = (e) => {
|
|
92
|
+
p("close", e);
|
|
76
93
|
}, z = (e) => {
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
p("sub-menu-click", e);
|
|
95
|
+
}, H = (e, o) => !t.enableScroll || !e ? e : o > t.scrollThreshold ? c(ne, {
|
|
96
|
+
style: {
|
|
97
|
+
maxHeight: t.scrollMaxHeight,
|
|
98
|
+
overflowY: "auto"
|
|
99
|
+
}
|
|
100
|
+
}, ue(e) ? e : {
|
|
101
|
+
default: () => [e]
|
|
102
|
+
}) : e, k = (e, o, a) => {
|
|
103
|
+
const i = e[l.value.path], r = e[l.value.title], n = e?.[l.value.children], M = e?.[l.value.index], m = e?.[l.value.icon], d = e?.menuOrder, g = e?.maxRowLength, R = !!e?.[l.value.disabled], E = t.disabledJudgeTurnOver ? !R : R, V = M || i || o + r, x = e.type === oe.TILE;
|
|
84
104
|
let y = [];
|
|
85
105
|
if (x)
|
|
86
106
|
if (d) {
|
|
87
107
|
const u = d.flat();
|
|
88
|
-
if (u?.length <
|
|
89
|
-
const
|
|
90
|
-
for (let s =
|
|
108
|
+
if (u?.length < n.length) {
|
|
109
|
+
const f = Math.max.apply(null, u);
|
|
110
|
+
for (let s = f + 1; s < n.length; s++)
|
|
91
111
|
d.push([s]);
|
|
92
112
|
}
|
|
93
113
|
y = d;
|
|
94
114
|
} else
|
|
95
|
-
for (let u = 0; u <
|
|
115
|
+
for (let u = 0; u < n.length; u++)
|
|
96
116
|
y.push([u]);
|
|
97
|
-
return
|
|
98
|
-
index: String(
|
|
99
|
-
key:
|
|
100
|
-
icon:
|
|
101
|
-
showArrow: e.showArrow ??
|
|
102
|
-
disabled:
|
|
117
|
+
return n?.length || e?.render ? c(ee, w(t.subMenuCfg, e, {
|
|
118
|
+
index: String(V),
|
|
119
|
+
key: V,
|
|
120
|
+
icon: m,
|
|
121
|
+
showArrow: e.showArrow ?? t.subMenuCfg.showArrow,
|
|
122
|
+
disabled: t.openDisabled && E,
|
|
103
123
|
toolTipCfg: {
|
|
104
|
-
...
|
|
124
|
+
...t.subMenuCfg.toolTipCfg || {},
|
|
105
125
|
...e.subMenuCfg?.toolTipCfg || {}
|
|
106
126
|
},
|
|
107
127
|
teleported: !1,
|
|
108
128
|
"popper-class": [x ? b.e("tile") : "", b.e("normal")]
|
|
109
129
|
}), {
|
|
110
|
-
default: () => [e?.render ? e?.render : x ? y.map((u,
|
|
130
|
+
default: () => [H(e?.render ? e?.render : x ? y.map((u, f) => c("div", {
|
|
111
131
|
class: "content-main",
|
|
112
|
-
key:
|
|
113
|
-
}, [u.map((s,
|
|
114
|
-
const C =
|
|
115
|
-
return
|
|
132
|
+
key: f
|
|
133
|
+
}, [u.map((s, $) => {
|
|
134
|
+
const C = n?.[s]?.[l.value.children], G = n?.[s]?.maxRowLength;
|
|
135
|
+
return n?.length ? c("div", {
|
|
116
136
|
class: "content-col",
|
|
117
|
-
key:
|
|
118
|
-
}, [
|
|
137
|
+
key: $
|
|
138
|
+
}, [c("span", {
|
|
119
139
|
class: C?.length ? "title" : ""
|
|
120
|
-
}, [
|
|
140
|
+
}, [n?.[s]?.[l.value.title]]), C?.length ? c("div", {
|
|
121
141
|
class: "content",
|
|
122
|
-
style:
|
|
123
|
-
}, [C.map((U,
|
|
124
|
-
})])) :
|
|
142
|
+
style: L.value(n, s, G || g)
|
|
143
|
+
}, [C.map((U, W) => v(U, W, !0))]) : null]) : null;
|
|
144
|
+
})])) : n.map((u, f) => u[l.value.children]?.length ? k(u, f, !0) : v(u, f, !0)), n?.length || 0)],
|
|
125
145
|
title: () => r
|
|
126
146
|
}) : v(e, o, a);
|
|
127
147
|
};
|
|
128
|
-
async function
|
|
129
|
-
if (
|
|
148
|
+
async function D(e) {
|
|
149
|
+
if (t.useRouterJump) {
|
|
130
150
|
const {
|
|
131
151
|
go: o
|
|
132
|
-
} =
|
|
133
|
-
let
|
|
134
|
-
e.indexPath.some((
|
|
135
|
-
const r =
|
|
152
|
+
} = X(T), a = e.route;
|
|
153
|
+
let i = e.route;
|
|
154
|
+
e.indexPath.some((n) => Z(n)) && (i = e.indexPath.slice(-2).join("/"));
|
|
155
|
+
const r = T.getRoutes().filter((n) => n.path === i)?.[0]?.meta?.linkTarget;
|
|
136
156
|
o(r ? {
|
|
137
157
|
url: a,
|
|
138
158
|
winOpenOpt: {
|
|
@@ -140,26 +160,26 @@ const ne = I({
|
|
|
140
160
|
}
|
|
141
161
|
} : a);
|
|
142
162
|
}
|
|
143
|
-
|
|
163
|
+
p("select", e);
|
|
144
164
|
}
|
|
145
|
-
const
|
|
146
|
-
return
|
|
147
|
-
isInSubMenu:
|
|
148
|
-
}), () =>
|
|
149
|
-
ref:
|
|
150
|
-
onSelect:
|
|
151
|
-
onOpen:
|
|
152
|
-
onClose:
|
|
153
|
-
onSubMenuClick:
|
|
165
|
+
const P = S(() => O.value?.inSubMenu);
|
|
166
|
+
return N({
|
|
167
|
+
isInSubMenu: P
|
|
168
|
+
}), () => c(_, w(t.menuOptions, {
|
|
169
|
+
ref: O,
|
|
170
|
+
onSelect: D,
|
|
171
|
+
onOpen: J,
|
|
172
|
+
onClose: j,
|
|
173
|
+
onSubMenuClick: z,
|
|
154
174
|
mode: "horizontal",
|
|
155
175
|
class: b.b(),
|
|
156
|
-
defaultActive:
|
|
157
|
-
defaultOpeneds:
|
|
176
|
+
defaultActive: t.defaultActive,
|
|
177
|
+
defaultOpeneds: t.defaultOpeneds
|
|
158
178
|
}), {
|
|
159
|
-
default: () => [
|
|
179
|
+
default: () => [t.menus?.length ? t.menus.map((e, o) => k(e, o, !1)) : null, K("·")]
|
|
160
180
|
});
|
|
161
181
|
}
|
|
162
182
|
});
|
|
163
183
|
export {
|
|
164
|
-
|
|
184
|
+
xe as default
|
|
165
185
|
};
|
|
@@ -32,6 +32,15 @@ export declare const VftHorizontalMenu: import("vft/es/utils").SFCWithInstall<im
|
|
|
32
32
|
menuOptions: {
|
|
33
33
|
type: import("vue").PropType<Partial<import("vft/es/vft").MenuProps>>;
|
|
34
34
|
};
|
|
35
|
+
enableScroll: {
|
|
36
|
+
type: import("vue").PropType<boolean>;
|
|
37
|
+
};
|
|
38
|
+
scrollThreshold: {
|
|
39
|
+
type: import("vue").PropType<number>;
|
|
40
|
+
};
|
|
41
|
+
scrollMaxHeight: {
|
|
42
|
+
type: import("vue").PropType<string>;
|
|
43
|
+
};
|
|
35
44
|
}>, {
|
|
36
45
|
isInSubMenu: import("vue").ComputedRef<any>;
|
|
37
46
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -76,6 +85,15 @@ export declare const VftHorizontalMenu: import("vft/es/utils").SFCWithInstall<im
|
|
|
76
85
|
menuOptions: {
|
|
77
86
|
type: import("vue").PropType<Partial<import("vft/es/vft").MenuProps>>;
|
|
78
87
|
};
|
|
88
|
+
enableScroll: {
|
|
89
|
+
type: import("vue").PropType<boolean>;
|
|
90
|
+
};
|
|
91
|
+
scrollThreshold: {
|
|
92
|
+
type: import("vue").PropType<number>;
|
|
93
|
+
};
|
|
94
|
+
scrollMaxHeight: {
|
|
95
|
+
type: import("vue").PropType<string>;
|
|
96
|
+
};
|
|
79
97
|
}>> & Readonly<{
|
|
80
98
|
onSelect?: ((val: {
|
|
81
99
|
route: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as n, createElementBlock as
|
|
1
|
+
import { defineComponent as n, createElementBlock as t, openBlock as o, normalizeClass as i, unref as m, createCommentVNode as a, createElementVNode as p, renderSlot as s, Fragment as u, createTextVNode as c, toDisplayString as d } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -8,31 +8,32 @@ import { useNamespace as f } from "../../hooks/use-namespace/index.js";
|
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
const
|
|
11
|
+
const k = n({
|
|
12
12
|
name: "vft-menu-item-group"
|
|
13
|
-
}),
|
|
14
|
-
...
|
|
13
|
+
}), b = /* @__PURE__ */ n({
|
|
14
|
+
...k,
|
|
15
15
|
props: {
|
|
16
16
|
title: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
return (e,
|
|
21
|
-
class:
|
|
18
|
+
setup(r) {
|
|
19
|
+
const l = f("menu-item-group");
|
|
20
|
+
return (e, g) => (o(), t("li", {
|
|
21
|
+
class: i(m(l).b())
|
|
22
22
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
r.title || e.$slots.title ? (o(), t("div", {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: i(m(l).e("title"))
|
|
25
26
|
}, [
|
|
26
|
-
e.$slots.title ? s(e.$slots, "title", { key: 1 }) : (
|
|
27
|
-
|
|
27
|
+
e.$slots.title ? s(e.$slots, "title", { key: 1 }) : (o(), t(u, { key: 0 }, [
|
|
28
|
+
c(d(r.title), 1)
|
|
28
29
|
], 64))
|
|
29
|
-
], 2),
|
|
30
|
-
|
|
30
|
+
], 2)) : a("", !0),
|
|
31
|
+
p("ul", null, [
|
|
31
32
|
s(e.$slots, "default")
|
|
32
33
|
])
|
|
33
34
|
], 2));
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
b as default
|
|
38
39
|
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { getRouterKeyPath as d } from "@vft/router";
|
|
2
|
-
import { useMultipleTabStore as
|
|
2
|
+
import { useMultipleTabStore as v, useTabs as w } from "@vft/store";
|
|
3
3
|
import "@vft/utils";
|
|
4
|
-
import { reactive as
|
|
4
|
+
import { reactive as M, computed as P } from "vue";
|
|
5
5
|
import "../../context-menu/context-menu.vue2.js";
|
|
6
6
|
import "../../icon/index.js";
|
|
7
7
|
import "vue-router";
|
|
8
|
-
function
|
|
9
|
-
const i =
|
|
8
|
+
function W(e, t) {
|
|
9
|
+
const i = M({
|
|
10
10
|
current: null,
|
|
11
11
|
currentIndex: 0
|
|
12
|
-
}), n =
|
|
13
|
-
refreshPage:
|
|
14
|
-
closeAll:
|
|
12
|
+
}), n = v(), {
|
|
13
|
+
refreshPage: a,
|
|
14
|
+
closeAll: g,
|
|
15
15
|
close: u,
|
|
16
16
|
closeLeft: h,
|
|
17
17
|
closeOther: f,
|
|
18
18
|
closeRight: p,
|
|
19
19
|
newWinTab: x,
|
|
20
|
-
fullScreen:
|
|
21
|
-
|
|
20
|
+
fullScreen: L,
|
|
21
|
+
alonePage: b
|
|
22
|
+
} = w(), C = P(() => {
|
|
22
23
|
if (!e)
|
|
23
24
|
return;
|
|
24
|
-
const { meta: r } = e, o = i.currentIndex, c = o === 0 || o <= t,
|
|
25
|
+
const { meta: r } = e, o = i.currentIndex, c = o === 0 || o <= t, l = n.getTabList.length <= t || o === n.getTabList.length - 1 && n.getLastDragEndIndex >= 0, D = n.getTabList.length === t || n.getTabList.length === t + 1 && o === t, s = n.getTabList.length === t;
|
|
25
26
|
return [
|
|
26
27
|
{
|
|
27
28
|
iconCfg: { icon: "icon-refresh-right" },
|
|
28
29
|
text: "刷新",
|
|
29
|
-
handler: () =>
|
|
30
|
+
handler: () => a(e)
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
iconCfg: { icon: "icon-new-tab" },
|
|
@@ -37,7 +38,7 @@ function K(e, t) {
|
|
|
37
38
|
{
|
|
38
39
|
iconCfg: { icon: "icon-close-tab" },
|
|
39
40
|
text: "关闭标签页",
|
|
40
|
-
disabled: !!r?.affix ||
|
|
41
|
+
disabled: !!r?.affix || s,
|
|
41
42
|
handler: () => u(e)
|
|
42
43
|
},
|
|
43
44
|
{
|
|
@@ -49,26 +50,31 @@ function K(e, t) {
|
|
|
49
50
|
{
|
|
50
51
|
iconCfg: { icon: "icon-arrow-close-right" },
|
|
51
52
|
text: "关闭右侧标签页",
|
|
52
|
-
disabled:
|
|
53
|
+
disabled: l,
|
|
53
54
|
divider: !0,
|
|
54
55
|
handler: () => p(e)
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
iconCfg: { icon: "icon-close-box-multiple-outline" },
|
|
58
59
|
text: "关闭其它标签页",
|
|
59
|
-
disabled:
|
|
60
|
+
disabled: D,
|
|
60
61
|
handler: () => f(e)
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
iconCfg: { icon: "icon-vector-square-delete" },
|
|
64
65
|
text: "关闭所有标签页",
|
|
65
|
-
disabled:
|
|
66
|
+
disabled: s,
|
|
66
67
|
divider: !0,
|
|
67
|
-
handler: () =>
|
|
68
|
+
handler: () => g()
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
iconCfg: { icon: "icon-full-screen" },
|
|
71
72
|
text: "全屏",
|
|
73
|
+
handler: () => L(e)
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
iconCfg: { icon: "icon-separate" },
|
|
77
|
+
text: "独立页面",
|
|
72
78
|
handler: () => b(e)
|
|
73
79
|
}
|
|
74
80
|
];
|
|
@@ -79,13 +85,13 @@ function K(e, t) {
|
|
|
79
85
|
return;
|
|
80
86
|
o?.preventDefault();
|
|
81
87
|
const c = n.getTabList.findIndex(
|
|
82
|
-
(
|
|
88
|
+
(l) => d(l) === d(r)
|
|
83
89
|
);
|
|
84
90
|
i.current = r, i.currentIndex = c;
|
|
85
91
|
};
|
|
86
92
|
}
|
|
87
|
-
return { getDropMenuList:
|
|
93
|
+
return { getDropMenuList: C, handleContextMenu: T };
|
|
88
94
|
}
|
|
89
95
|
export {
|
|
90
|
-
|
|
96
|
+
W as useTabDropdown
|
|
91
97
|
};
|