vft 0.0.240 → 0.0.241
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/components/context-menu/useContextMenu.js +1 -1
- package/es/components/focus-trap/focus-trap.vue2.js +60 -61
- package/es/components/multiple-tabs/index.d.ts +1 -33
- package/es/components/multiple-tabs/multiple-tabs.vue.d.ts +1 -11
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +17 -125
- package/es/components/multiple-tabs/tab-content.vue2.js +17 -21
- package/es/components/multiple-tabs/use/use-multiple-tabs.js +4 -4
- package/es/components/tabs/index.d.ts +12 -8
- package/es/components/tabs/tab-bar.vue.d.ts +1 -0
- package/es/components/tabs/tab-bar.vue2.js +42 -32
- package/es/components/tabs/tab-nav.vue.d.ts +6 -1
- package/es/components/tabs/tab-nav.vue2.js +124 -109
- package/es/components/tabs/tab-pane.vue2.js +33 -27
- package/es/components/tabs/tabs.vue.d.ts +14 -9
- package/es/components/tabs/tabs.vue2.js +92 -69
- package/es/components/tabs/types.d.ts +8 -5
- package/es/hooks/use-ordered-children/index.d.ts +8 -4
- package/es/hooks/use-ordered-children/index.js +41 -20
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +18 -18
- package/lib/components/focus-trap/focus-trap.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/index.d.ts +1 -33
- package/lib/components/multiple-tabs/multiple-tabs.vue.d.ts +1 -11
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/tabs/index.d.ts +12 -8
- package/lib/components/tabs/tab-bar.vue.d.ts +1 -0
- package/lib/components/tabs/tab-bar.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue.d.ts +6 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tab-pane.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue.d.ts +14 -9
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/tabs/types.d.ts +8 -5
- package/lib/hooks/use-ordered-children/index.cjs +1 -1
- package/lib/hooks/use-ordered-children/index.d.ts +8 -4
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/utils/vue/vnode.cjs +1 -1
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCurrentInstance as n, onUnmounted as o } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { destroyContextMenu as t, createContextMenu as r } from "./createContextMenu.js";
|
|
3
3
|
function f(e = !0) {
|
|
4
4
|
return n() && e && o(() => {
|
|
5
5
|
t();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EVENT_CODE as
|
|
1
|
+
import { EVENT_CODE as V } from "@vft/constants";
|
|
2
2
|
import { useEscapeKeydown as j } from "@vft/use";
|
|
3
3
|
import { isString as q } from "@vft/utils";
|
|
4
4
|
import { isNil as x } from "lodash-es";
|
|
5
|
-
import { defineComponent as J, ref as M, provide as Y, watch as
|
|
6
|
-
import { ON_TRAP_FOCUS_EVT as
|
|
7
|
-
import { useFocusReason as Q, tryFocus as f, createFocusOutPreventedEvent as m, getEdges as W, focusableStack as
|
|
5
|
+
import { defineComponent as J, ref as M, provide as Y, watch as b, unref as p, onMounted as z, onBeforeUnmount as G, nextTick as U } from "vue";
|
|
6
|
+
import { ON_TRAP_FOCUS_EVT as K, ON_RELEASE_FOCUS_EVT as k, FOCUS_TRAP_INJECTION_KEY as H, FOCUS_AFTER_TRAPPED as y, FOCUS_AFTER_TRAPPED_OPTS as N, FOCUS_AFTER_RELEASED as L } from "./tokens.js";
|
|
7
|
+
import { useFocusReason as Q, tryFocus as f, createFocusOutPreventedEvent as m, getEdges as W, focusableStack as B, focusFirstDescendant as X, obtainAllFocusableElements as Z, isFocusCausedByUserEvent as $ } from "./utils.js";
|
|
8
8
|
const ce = J({
|
|
9
9
|
name: "VftFocusTrap",
|
|
10
10
|
inheritAttrs: !1,
|
|
@@ -18,19 +18,19 @@ const ce = J({
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
emits: [
|
|
21
|
-
U,
|
|
22
21
|
K,
|
|
22
|
+
k,
|
|
23
23
|
"focusin",
|
|
24
24
|
"focusout",
|
|
25
25
|
"focusout-prevented",
|
|
26
26
|
"release-requested"
|
|
27
27
|
],
|
|
28
|
-
setup(n, { emit:
|
|
29
|
-
const
|
|
28
|
+
setup(n, { emit: u }) {
|
|
29
|
+
const s = M();
|
|
30
30
|
let l, T;
|
|
31
31
|
const { focusReason: d } = Q();
|
|
32
32
|
j((e) => {
|
|
33
|
-
n.trapped && !i.paused &&
|
|
33
|
+
n.trapped && !i.paused && u("release-requested", e);
|
|
34
34
|
});
|
|
35
35
|
const i = {
|
|
36
36
|
paused: !1,
|
|
@@ -42,112 +42,111 @@ const ce = J({
|
|
|
42
42
|
}
|
|
43
43
|
}, v = (e) => {
|
|
44
44
|
if (!n.loop && !n.trapped || i.paused) return;
|
|
45
|
-
const {
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
if (!
|
|
50
|
-
const
|
|
45
|
+
const { code: t, altKey: o, ctrlKey: a, metaKey: r, currentTarget: h, shiftKey: D } = e, { loop: I } = n, w = t === V.tab && !o && !a && !r, E = document.activeElement;
|
|
46
|
+
if (w && E) {
|
|
47
|
+
const _ = h, [C, O] = W(_);
|
|
48
|
+
if (C && O) {
|
|
49
|
+
if (!D && E === O) {
|
|
50
|
+
const c = m({
|
|
51
51
|
focusReason: d.value
|
|
52
52
|
});
|
|
53
|
-
|
|
54
|
-
} else if (
|
|
55
|
-
const
|
|
53
|
+
u("focusout-prevented", c), c.defaultPrevented || (e.preventDefault(), I && f(C, !0));
|
|
54
|
+
} else if (D && [C, _].includes(E)) {
|
|
55
|
+
const c = m({
|
|
56
56
|
focusReason: d.value
|
|
57
57
|
});
|
|
58
|
-
|
|
58
|
+
u("focusout-prevented", c), c.defaultPrevented || (e.preventDefault(), I && f(O, !0));
|
|
59
59
|
}
|
|
60
|
-
} else if (
|
|
61
|
-
const
|
|
60
|
+
} else if (E === _) {
|
|
61
|
+
const c = m({
|
|
62
62
|
focusReason: d.value
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
u("focusout-prevented", c), c.defaultPrevented || e.preventDefault();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
Y(H, {
|
|
69
|
-
focusTrapRef:
|
|
69
|
+
focusTrapRef: s,
|
|
70
70
|
onKeydown: v
|
|
71
|
-
}),
|
|
71
|
+
}), b(
|
|
72
72
|
() => n.focusTrapEl,
|
|
73
73
|
(e) => {
|
|
74
|
-
e && (
|
|
74
|
+
e && (s.value = e);
|
|
75
75
|
},
|
|
76
76
|
{ immediate: !0 }
|
|
77
|
-
),
|
|
78
|
-
e && (e.addEventListener("keydown", v), e.addEventListener("focusin",
|
|
77
|
+
), b([s], ([e], [t]) => {
|
|
78
|
+
e && (e.addEventListener("keydown", v), e.addEventListener("focusin", F), e.addEventListener("focusout", P)), t && (t.removeEventListener("keydown", v), t.removeEventListener("focusin", F), t.removeEventListener("focusout", P));
|
|
79
79
|
});
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
const t =
|
|
80
|
+
const g = (e) => {
|
|
81
|
+
u(K, e);
|
|
82
|
+
}, S = (e) => u(k, e), F = (e) => {
|
|
83
|
+
const t = p(s);
|
|
84
84
|
if (!t) return;
|
|
85
|
-
const
|
|
86
|
-
n.trapped ||
|
|
87
|
-
},
|
|
88
|
-
const t =
|
|
85
|
+
const o = e.target, a = e.relatedTarget, r = o && t.contains(o);
|
|
86
|
+
n.trapped || a && t.contains(a) || (l = a), r && u("focusin", e), !i.paused && n.trapped && (r ? T = o : f(T, !0));
|
|
87
|
+
}, P = (e) => {
|
|
88
|
+
const t = p(s);
|
|
89
89
|
if (!(i.paused || !t))
|
|
90
90
|
if (n.trapped) {
|
|
91
|
-
const
|
|
92
|
-
!x(
|
|
91
|
+
const o = e.relatedTarget;
|
|
92
|
+
!x(o) && !t.contains(o) && setTimeout(() => {
|
|
93
93
|
if (!i.paused && n.trapped) {
|
|
94
|
-
const
|
|
94
|
+
const a = m({
|
|
95
95
|
focusReason: d.value
|
|
96
96
|
});
|
|
97
|
-
|
|
97
|
+
u("focusout-prevented", a), a.defaultPrevented || f(T, !0);
|
|
98
98
|
}
|
|
99
99
|
}, 0);
|
|
100
100
|
} else {
|
|
101
|
-
const
|
|
102
|
-
|
|
101
|
+
const o = e.target;
|
|
102
|
+
o && t.contains(o) || u("focusout", e);
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
async function
|
|
106
|
-
await
|
|
107
|
-
const e =
|
|
105
|
+
async function A() {
|
|
106
|
+
await U();
|
|
107
|
+
const e = p(s);
|
|
108
108
|
if (e) {
|
|
109
|
-
|
|
109
|
+
B.push(i);
|
|
110
110
|
const t = e.contains(
|
|
111
111
|
document.activeElement
|
|
112
112
|
) ? l : document.activeElement;
|
|
113
113
|
if (l = t, !e.contains(t)) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
const a = new Event(
|
|
115
|
+
y,
|
|
116
|
+
N
|
|
117
117
|
);
|
|
118
|
-
e.addEventListener(
|
|
119
|
-
let
|
|
120
|
-
q(
|
|
118
|
+
e.addEventListener(y, g), e.dispatchEvent(a), a.defaultPrevented || U(() => {
|
|
119
|
+
let r = n.focusStartEl;
|
|
120
|
+
q(r) || (f(r), document.activeElement !== r && (r = "first")), r === "first" && X(
|
|
121
121
|
Z(e),
|
|
122
122
|
!0
|
|
123
|
-
), (document.activeElement === t ||
|
|
123
|
+
), (document.activeElement === t || r === "container") && f(e);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const e =
|
|
128
|
+
function R() {
|
|
129
|
+
const e = p(s);
|
|
130
130
|
if (e) {
|
|
131
|
-
e.removeEventListener(
|
|
132
|
-
const t = new CustomEvent(
|
|
133
|
-
...
|
|
131
|
+
e.removeEventListener(y, g);
|
|
132
|
+
const t = new CustomEvent(L, {
|
|
133
|
+
...N,
|
|
134
134
|
detail: {
|
|
135
135
|
focusReason: d.value
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
e.addEventListener(
|
|
139
|
-
(d.value == "keyboard" || !$() || e.contains(document.activeElement)) && f(l ?? document.body), e.removeEventListener(y, F), N.remove(i);
|
|
138
|
+
e.addEventListener(L, S), e.dispatchEvent(t), !t.defaultPrevented && (d.value == "keyboard" || !$() || e.contains(document.activeElement)) && f(l ?? document.body), e.removeEventListener(L, S), B.remove(i);
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
141
|
return z(() => {
|
|
143
|
-
n.trapped &&
|
|
142
|
+
n.trapped && A(), b(
|
|
144
143
|
() => n.trapped,
|
|
145
144
|
(e) => {
|
|
146
|
-
e ?
|
|
145
|
+
e ? A() : R();
|
|
147
146
|
}
|
|
148
147
|
);
|
|
149
148
|
}), G(() => {
|
|
150
|
-
n.trapped &&
|
|
149
|
+
n.trapped && R(), s.value && (s.value.removeEventListener("keydown", v), s.value.removeEventListener("focusin", F), s.value.removeEventListener("focusout", P), s.value = void 0);
|
|
151
150
|
}), {
|
|
152
151
|
onKeydown: v
|
|
153
152
|
};
|
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
export declare const VftMultipleTabs: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").
|
|
2
|
-
tabsStyle: {
|
|
3
|
-
type: import("vue").PropType<Record<string, string | number>>;
|
|
4
|
-
};
|
|
5
|
-
contextMenuStyle: {
|
|
6
|
-
type: import("vue").PropType<Record<string, string | number>>;
|
|
7
|
-
};
|
|
8
|
-
canDrag: {
|
|
9
|
-
type: import("vue").PropType<boolean>;
|
|
10
|
-
};
|
|
11
|
-
fixTabCount: {
|
|
12
|
-
type: import("vue").PropType<number>;
|
|
13
|
-
};
|
|
14
|
-
fixExtraScrollWidth: {
|
|
15
|
-
type: import("vue").PropType<number>;
|
|
16
|
-
};
|
|
17
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
-
tabsStyle: {
|
|
19
|
-
type: import("vue").PropType<Record<string, string | number>>;
|
|
20
|
-
};
|
|
21
|
-
contextMenuStyle: {
|
|
22
|
-
type: import("vue").PropType<Record<string, string | number>>;
|
|
23
|
-
};
|
|
24
|
-
canDrag: {
|
|
25
|
-
type: import("vue").PropType<boolean>;
|
|
26
|
-
};
|
|
27
|
-
fixTabCount: {
|
|
28
|
-
type: import("vue").PropType<number>;
|
|
29
|
-
};
|
|
30
|
-
fixExtraScrollWidth: {
|
|
31
|
-
type: import("vue").PropType<number>;
|
|
32
|
-
};
|
|
33
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
1
|
+
export declare const VftMultipleTabs: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
34
2
|
export default VftMultipleTabs;
|
|
35
3
|
export * from './types';
|
|
36
4
|
export * from './use';
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MultipleTabsProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<MultipleTabsProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3
2
|
export default _default;
|
|
4
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
5
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
6
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
7
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
8
|
-
} : {
|
|
9
|
-
type: import('vue').PropType<T[K]>;
|
|
10
|
-
required: true;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as t, getCurrentInstance as i, ref as p, createElementBlock as m, openBlock as e, normalizeClass as n, unref as s } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../backtop/index.js";
|
|
@@ -62,7 +62,7 @@ import "../slider/index.js";
|
|
|
62
62
|
import "../space/index.js";
|
|
63
63
|
import "../switch/index.js";
|
|
64
64
|
import "../table/index.js";
|
|
65
|
-
import
|
|
65
|
+
import "../tabs/index.js";
|
|
66
66
|
import "../tag/index.js";
|
|
67
67
|
import "../time-picker/index.js";
|
|
68
68
|
import "../tooltip/index.js";
|
|
@@ -88,138 +88,30 @@ import "../md-container/index.js";
|
|
|
88
88
|
import "../md-tabs/index.js";
|
|
89
89
|
import "../md-vue-playground/index.js";
|
|
90
90
|
import "@vueuse/core";
|
|
91
|
-
import
|
|
91
|
+
import "../../utils/ns-cover.js";
|
|
92
92
|
import "lodash-es";
|
|
93
|
-
import { useNamespace as
|
|
93
|
+
import { useNamespace as a } from "../../hooks/use-namespace/index.js";
|
|
94
94
|
import "../../hooks/use-model-toggle/index.js";
|
|
95
95
|
import "@popperjs/core";
|
|
96
96
|
import "../../hooks/use-z-index/index.js";
|
|
97
97
|
import "../message/index.js";
|
|
98
98
|
import "../infinite-scroll/index.js";
|
|
99
99
|
import "../progress-i/index.js";
|
|
100
|
-
import
|
|
101
|
-
import { useMultipleTabStore as
|
|
102
|
-
import {
|
|
103
|
-
import
|
|
104
|
-
|
|
105
|
-
import tt from "./tab-content.vue2.js";
|
|
106
|
-
import { initAffixTabs as et, useTabsDrag as ot } from "./use/use-multiple-tabs.js";
|
|
107
|
-
const it = S({
|
|
100
|
+
import "@vft/router";
|
|
101
|
+
import { useMultipleTabStore as c } from "@vft/store";
|
|
102
|
+
import { initAffixTabs as l } from "./use/use-multiple-tabs.js";
|
|
103
|
+
import "vue-router";
|
|
104
|
+
const u = t({
|
|
108
105
|
name: "vft-multiple-tabs"
|
|
109
|
-
}),
|
|
110
|
-
...
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
fixExtraScrollWidth: {}
|
|
117
|
-
},
|
|
118
|
-
setup(c) {
|
|
119
|
-
const _ = q("multiple-tabs"), a = N().appContext.config.globalProperties.$router, p = et(a), l = O(), r = d(""), m = d(0), f = d(), { go: b } = G(a), s = g(() => l.getTabList.filter((t) => !t.meta?.hideTab));
|
|
120
|
-
z(() => {
|
|
121
|
-
if (r.value) {
|
|
122
|
-
const t = s.value.findIndex((o) => u(o) === r.value);
|
|
123
|
-
t === -1 ? m.value = s.value?.length - 1 : m.value = t, m.value = m.value < p?.length ? p?.length - 1 : m.value;
|
|
124
|
-
}
|
|
125
|
-
}), Z(() => {
|
|
126
|
-
f.value = i(a.currentRoute);
|
|
127
|
-
}), J(({ route: t }) => {
|
|
128
|
-
if (!t || t.meta?.hasTokenToRoot)
|
|
129
|
-
return;
|
|
130
|
-
const { meta: o = {} } = t, { currentActivePath: e, hideTab: n } = o, I = n ? e : null, h = u(t);
|
|
131
|
-
if (r.value !== h && (r.value = h), I) {
|
|
132
|
-
let v = a.getRoutes().find((L) => L.path === e);
|
|
133
|
-
v && l.addTab(
|
|
134
|
-
v,
|
|
135
|
-
i(f),
|
|
136
|
-
m.value,
|
|
137
|
-
t
|
|
138
|
-
);
|
|
139
|
-
} else
|
|
140
|
-
l.addTab(i(t), i(f), m.value);
|
|
141
|
-
});
|
|
142
|
-
function P(t) {
|
|
143
|
-
if (r.value === t.paneName)
|
|
144
|
-
return;
|
|
145
|
-
const o = s.value[t.attrs.index];
|
|
146
|
-
r.value = t.paneName;
|
|
147
|
-
const e = o?.meta?.hideActiveRoute?.fullPath;
|
|
148
|
-
b(e || o.fullPath || o.path);
|
|
149
|
-
}
|
|
150
|
-
function k(t) {
|
|
151
|
-
l.closeTabByKey(t, a);
|
|
152
|
-
}
|
|
153
|
-
const { refs: w, setRefs: M } = X();
|
|
154
|
-
function V(t) {
|
|
155
|
-
const o = t.pane.attrs.index, e = t.event;
|
|
156
|
-
w.value[o].handleContext(e);
|
|
157
|
-
}
|
|
158
|
-
const B = g(() => ({ ...C({
|
|
159
|
-
padding: "4px 0 0",
|
|
160
|
-
"border-bottom": "none",
|
|
161
|
-
"header-height": "26px",
|
|
162
|
-
"font-size": "13px",
|
|
163
|
-
"item-padding": "0 10px",
|
|
164
|
-
"close-icon-left": "8px",
|
|
165
|
-
"item-distance": "1px",
|
|
166
|
-
"item-max-width": "180px",
|
|
167
|
-
"scroll-padding": "0 20px",
|
|
168
|
-
"header-margin": "0 0 0 8px",
|
|
169
|
-
"item-border-radius": "5px 5px 0 0",
|
|
170
|
-
"item-border": "none"
|
|
171
|
-
}, "tabs"), ...c.tabsStyle })), { closeCurrent: A } = Q(), E = {
|
|
172
|
-
...C(
|
|
173
|
-
{
|
|
174
|
-
"sub-item-height": "40px",
|
|
175
|
-
"item-min-width": "150px"
|
|
176
|
-
},
|
|
177
|
-
"menu"
|
|
178
|
-
),
|
|
179
|
-
...c.contextMenuStyle
|
|
180
|
-
};
|
|
181
|
-
return D(() => {
|
|
182
|
-
c.canDrag && ot(p), Y("command+e, ctrl+e", function() {
|
|
183
|
-
return A(), !1;
|
|
184
|
-
});
|
|
185
|
-
}), (t, o) => (x(), T("div", {
|
|
186
|
-
class: K(i(_).b()),
|
|
187
|
-
style: H(B.value)
|
|
188
|
-
}, [
|
|
189
|
-
y(i(U), {
|
|
190
|
-
"show-bar": !1,
|
|
191
|
-
"fix-tab-count": t.fixTabCount,
|
|
192
|
-
"fix-extra-scroll-width": t.fixExtraScrollWidth,
|
|
193
|
-
modelValue: r.value,
|
|
194
|
-
"onUpdate:modelValue": o[0] || (o[0] = (e) => r.value = e),
|
|
195
|
-
onTabClick: P,
|
|
196
|
-
onTabRemove: k,
|
|
197
|
-
onTabContextMenu: V
|
|
198
|
-
}, {
|
|
199
|
-
default: R(() => [
|
|
200
|
-
(x(!0), T(W, null, $(s.value, (e, n) => (x(), F(i(j), {
|
|
201
|
-
key: i(u)(e) + n,
|
|
202
|
-
closable: !e.meta?.affix,
|
|
203
|
-
index: n,
|
|
204
|
-
name: i(u)(e)
|
|
205
|
-
}, {
|
|
206
|
-
label: R(() => [
|
|
207
|
-
y(tt, {
|
|
208
|
-
"context-menu-style": E,
|
|
209
|
-
"affix-num": i(p)?.length,
|
|
210
|
-
ref_for: !0,
|
|
211
|
-
ref: i(M)(n),
|
|
212
|
-
"tab-item": e
|
|
213
|
-
}, null, 8, ["affix-num", "tab-item"])
|
|
214
|
-
]),
|
|
215
|
-
_: 2
|
|
216
|
-
}, 1032, ["closable", "index", "name"]))), 128))
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
}, 8, ["fix-tab-count", "fix-extra-scroll-width", "modelValue"])
|
|
220
|
-
], 6));
|
|
106
|
+
}), uo = /* @__PURE__ */ t({
|
|
107
|
+
...u,
|
|
108
|
+
setup(f) {
|
|
109
|
+
const o = a("multiple-tabs"), r = i().appContext.config.globalProperties.$router;
|
|
110
|
+
return l(r), c(), p(""), (b, d) => (e(), m("div", {
|
|
111
|
+
class: n(s(o).b())
|
|
112
|
+
}, null, 2));
|
|
221
113
|
}
|
|
222
114
|
});
|
|
223
115
|
export {
|
|
224
|
-
|
|
116
|
+
uo as default
|
|
225
117
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { singleAttrToObj as
|
|
1
|
+
import { defineComponent as u, computed as m, createElementBlock as c, openBlock as l, toDisplayString as f } from "vue";
|
|
2
|
+
import { singleAttrToObj as s } from "@vft/utils";
|
|
3
3
|
import "../context-menu/context-menu.vue2.js";
|
|
4
4
|
import "../alert/index.js";
|
|
5
5
|
import "../avatar/index.js";
|
|
@@ -31,7 +31,7 @@ import "../full-screen/index.js";
|
|
|
31
31
|
import "../header-layout/index.js";
|
|
32
32
|
import "../horizontal-menu/index.js";
|
|
33
33
|
import "../icon/index.js";
|
|
34
|
-
import
|
|
34
|
+
import "../icon-text/index.js";
|
|
35
35
|
import "../iframe-layout/index.js";
|
|
36
36
|
import "../image/index.js";
|
|
37
37
|
import "../image-viewer/index.js";
|
|
@@ -97,12 +97,12 @@ import "../../hooks/use-z-index/index.js";
|
|
|
97
97
|
import "../message/index.js";
|
|
98
98
|
import "../infinite-scroll/index.js";
|
|
99
99
|
import "../progress-i/index.js";
|
|
100
|
-
import { useContextMenu as
|
|
100
|
+
import { useContextMenu as x } from "../context-menu/useContextMenu.js";
|
|
101
101
|
import "vue-router";
|
|
102
102
|
import "@vft/store";
|
|
103
103
|
import "@vft/use";
|
|
104
|
-
import { useTabDropdown as
|
|
105
|
-
const
|
|
104
|
+
import { useTabDropdown as b } from "./use/use-tab-dropdown.js";
|
|
105
|
+
const so = /* @__PURE__ */ u({
|
|
106
106
|
__name: "tab-content",
|
|
107
107
|
props: {
|
|
108
108
|
tabItem: {},
|
|
@@ -110,29 +110,25 @@ const Io = /* @__PURE__ */ c({
|
|
|
110
110
|
contextMenuStyle: {},
|
|
111
111
|
visible: { type: Boolean }
|
|
112
112
|
},
|
|
113
|
-
setup(t, { expose:
|
|
114
|
-
const [
|
|
113
|
+
setup(t, { expose: i }) {
|
|
114
|
+
const [r] = x(), p = m(() => t.tabItem.meta && t.tabItem.meta.title);
|
|
115
|
+
m(() => s(t.tabItem.meta?.icon, "icon"));
|
|
116
|
+
const { getDropMenuList: e, handleContextMenu: n } = b(
|
|
115
117
|
t.tabItem,
|
|
116
118
|
t.affixNum
|
|
117
119
|
);
|
|
118
|
-
function
|
|
119
|
-
|
|
120
|
+
function a(o) {
|
|
121
|
+
n(t.tabItem)(o), r({
|
|
120
122
|
event: o,
|
|
121
123
|
styles: t.contextMenuStyle,
|
|
122
|
-
items:
|
|
124
|
+
items: e.value
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
|
-
return
|
|
126
|
-
handleContext:
|
|
127
|
-
}), (o,
|
|
128
|
-
class: "vft-multiple-tabs__title",
|
|
129
|
-
title: i.value,
|
|
130
|
-
icon: n.value,
|
|
131
|
-
text: i.value,
|
|
132
|
-
onContextmenu: x(m, ["stop"])
|
|
133
|
-
}, null, 8, ["title", "icon", "text"]));
|
|
127
|
+
return i({
|
|
128
|
+
handleContext: a
|
|
129
|
+
}), (o, d) => (l(), c("div", null, f(p.value), 1));
|
|
134
130
|
}
|
|
135
131
|
});
|
|
136
132
|
export {
|
|
137
|
-
|
|
133
|
+
so as default
|
|
138
134
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useMultipleTabStore as c } from "@vft/store";
|
|
2
2
|
import { useSortable as u } from "@vft/use";
|
|
3
|
-
import {
|
|
4
|
-
import { ref as m,
|
|
3
|
+
import { arrSort as b, isNullOrUndefined as l } from "@vft/utils";
|
|
4
|
+
import { ref as m, toRaw as d, nextTick as x } from "vue";
|
|
5
5
|
function g(o) {
|
|
6
6
|
const n = m([]), f = c();
|
|
7
7
|
function i(t) {
|
|
8
8
|
const a = [];
|
|
9
9
|
return t && t.forEach((s) => {
|
|
10
|
-
s.meta?.affix && a.push(
|
|
10
|
+
s.meta?.affix && a.push(d(s));
|
|
11
11
|
}), a;
|
|
12
12
|
}
|
|
13
13
|
function r() {
|
|
@@ -25,7 +25,7 @@ function g(o) {
|
|
|
25
25
|
}
|
|
26
26
|
function h(o) {
|
|
27
27
|
const n = c();
|
|
28
|
-
|
|
28
|
+
x(() => {
|
|
29
29
|
const f = document.querySelectorAll(".vft-tabs__nav")?.[0], { initSortable: i } = u(f, {
|
|
30
30
|
draggable: ".is-closable",
|
|
31
31
|
// forceFallback: true,
|
|
@@ -51,6 +51,7 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
51
51
|
"update:modelValue": (name: string | number) => void;
|
|
52
52
|
tabClick: (pane: {
|
|
53
53
|
uid: number;
|
|
54
|
+
getVnode: () => import("vue").VNode;
|
|
54
55
|
slots: import("vue").Slots;
|
|
55
56
|
props: {
|
|
56
57
|
label: string;
|
|
@@ -59,14 +60,15 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
59
60
|
disabled: boolean;
|
|
60
61
|
lazy: boolean;
|
|
61
62
|
};
|
|
62
|
-
paneName:
|
|
63
|
+
paneName: import("./types").TabPaneName | undefined;
|
|
63
64
|
active: boolean;
|
|
64
65
|
index: string | undefined;
|
|
65
66
|
isClosable: boolean;
|
|
66
|
-
|
|
67
|
+
isFocusInsidePane: () => boolean | undefined;
|
|
67
68
|
}, ev: Event) => void;
|
|
68
69
|
tabContextMenu: (pane: {
|
|
69
70
|
uid: number;
|
|
71
|
+
getVnode: () => import("vue").VNode;
|
|
70
72
|
slots: import("vue").Slots;
|
|
71
73
|
props: {
|
|
72
74
|
label: string;
|
|
@@ -75,11 +77,11 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
75
77
|
disabled: boolean;
|
|
76
78
|
lazy: boolean;
|
|
77
79
|
};
|
|
78
|
-
paneName:
|
|
80
|
+
paneName: import("./types").TabPaneName | undefined;
|
|
79
81
|
active: boolean;
|
|
80
82
|
index: string | undefined;
|
|
81
83
|
isClosable: boolean;
|
|
82
|
-
|
|
84
|
+
isFocusInsidePane: () => boolean | undefined;
|
|
83
85
|
}, index: number, ev: Event) => void;
|
|
84
86
|
tabChange: (name: string | number) => void;
|
|
85
87
|
tabRemove: (name: string | number) => void;
|
|
@@ -135,6 +137,7 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
135
137
|
"onUpdate:modelValue"?: ((name: string | number) => any) | undefined;
|
|
136
138
|
onTabClick?: ((pane: {
|
|
137
139
|
uid: number;
|
|
140
|
+
getVnode: () => import("vue").VNode;
|
|
138
141
|
slots: import("vue").Slots;
|
|
139
142
|
props: {
|
|
140
143
|
label: string;
|
|
@@ -143,16 +146,17 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
143
146
|
disabled: boolean;
|
|
144
147
|
lazy: boolean;
|
|
145
148
|
};
|
|
146
|
-
paneName:
|
|
149
|
+
paneName: import("./types").TabPaneName | undefined;
|
|
147
150
|
active: boolean;
|
|
148
151
|
index: string | undefined;
|
|
149
152
|
isClosable: boolean;
|
|
150
|
-
|
|
153
|
+
isFocusInsidePane: () => boolean | undefined;
|
|
151
154
|
}, ev: Event) => any) | undefined;
|
|
152
155
|
onTabRemove?: ((name: string | number) => any) | undefined;
|
|
153
156
|
onTabAdd?: (() => any) | undefined;
|
|
154
157
|
onTabContextMenu?: ((pane: {
|
|
155
158
|
uid: number;
|
|
159
|
+
getVnode: () => import("vue").VNode;
|
|
156
160
|
slots: import("vue").Slots;
|
|
157
161
|
props: {
|
|
158
162
|
label: string;
|
|
@@ -161,11 +165,11 @@ export declare const VftTabs: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
161
165
|
disabled: boolean;
|
|
162
166
|
lazy: boolean;
|
|
163
167
|
};
|
|
164
|
-
paneName:
|
|
168
|
+
paneName: import("./types").TabPaneName | undefined;
|
|
165
169
|
active: boolean;
|
|
166
170
|
index: string | undefined;
|
|
167
171
|
isClosable: boolean;
|
|
168
|
-
|
|
172
|
+
isFocusInsidePane: () => boolean | undefined;
|
|
169
173
|
}, index: number, ev: Event) => any) | undefined;
|
|
170
174
|
onTabChange?: ((name: string | number) => any) | undefined;
|
|
171
175
|
onEdit?: ((paneName: string | number | undefined, action: "remove" | "add") => any) | undefined;
|
|
@@ -3,6 +3,7 @@ import type { CSSProperties } from 'vue';
|
|
|
3
3
|
interface Props {
|
|
4
4
|
/** tabs 集合 */
|
|
5
5
|
tabs: TabsPaneContext[];
|
|
6
|
+
tabRefs?: Record<string, any>;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
8
9
|
ref: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|