vft 0.0.473 → 0.0.475
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/iframe-layout/iframe-layout.vue.d.ts +9 -2
- package/es/components/iframe-layout/iframe-layout.vue2.js +24 -21
- package/es/components/iframe-layout/iframe-page.vue.d.ts +7 -1
- package/es/components/iframe-layout/iframe-page.vue2.js +32 -35
- package/es/components/iframe-layout/index.d.ts +13 -6
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +93 -96
- 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/iframe-layout/iframe-layout.vue.d.ts +9 -2
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue.d.ts +7 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/iframe-layout/index.d.ts +13 -6
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
interface Props {
|
|
3
3
|
iframePages: RouteLocationNormalized[];
|
|
4
|
-
|
|
4
|
+
currentPath?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
6
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
7
|
+
iframePageRef: import("vue").Ref<any, any>;
|
|
8
|
+
iframeIsLoaded: import("vue").ComputedRef<boolean>;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
12
|
+
"onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
14
|
export default _default;
|
|
8
15
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
16
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
import "../config-provider/hooks/use-global-config.js";
|
|
5
|
-
import "lodash-es";
|
|
6
|
-
import "../form/index.js";
|
|
7
|
-
import "../../hooks/use-model-toggle/index.js";
|
|
8
|
-
import "@popperjs/core";
|
|
9
|
-
import "../../hooks/use-z-index/index.js";
|
|
10
|
-
import i from "./iframe-page.vue2.js";
|
|
11
|
-
const s = o({
|
|
1
|
+
import { defineComponent as c, ref as p, computed as P, createElementBlock as n, openBlock as t, Fragment as m, renderList as _, withDirectives as g, createCommentVNode as k, createBlock as v, vShow as L } from "vue";
|
|
2
|
+
import y from "./iframe-page.vue2.js";
|
|
3
|
+
const B = c({
|
|
12
4
|
name: "vft-iframe-layout"
|
|
13
|
-
}),
|
|
14
|
-
...
|
|
5
|
+
}), x = /* @__PURE__ */ c({
|
|
6
|
+
...B,
|
|
15
7
|
props: {
|
|
16
8
|
iframePages: {},
|
|
17
|
-
|
|
9
|
+
currentPath: {}
|
|
18
10
|
},
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
emits: ["iframe-loaded"],
|
|
12
|
+
setup(o, { expose: l, emit: u }) {
|
|
13
|
+
const d = u, r = p(), s = (a, f) => {
|
|
14
|
+
d("iframe-loaded", a, f);
|
|
15
|
+
}, i = P(() => !r?.value?.[r?.value?.length - 1]?.isLoading);
|
|
16
|
+
return l({
|
|
17
|
+
iframePageRef: r,
|
|
18
|
+
iframeIsLoaded: i
|
|
19
|
+
}), (a, f) => (t(!0), n(m, null, _(o.iframePages, (e, h) => (t(), n(m, {
|
|
21
20
|
key: e.query ? e.fullPath : e.path
|
|
22
21
|
}, [
|
|
23
|
-
e.meta.frameSrc && e.meta.loaded ?
|
|
22
|
+
e.meta.frameSrc && e.meta.loaded ? g((t(), v(y, {
|
|
24
23
|
key: 0,
|
|
24
|
+
ref_for: !0,
|
|
25
|
+
ref_key: "iframePageRef",
|
|
26
|
+
ref: r,
|
|
27
|
+
onLoaded: (S) => s(e, h),
|
|
25
28
|
"frame-src": e.meta.frameSrc
|
|
26
|
-
}, null, 8, ["frame-src"])), [
|
|
27
|
-
[
|
|
28
|
-
]) :
|
|
29
|
+
}, null, 8, ["onLoaded", "frame-src"])), [
|
|
30
|
+
[L, e.fullPath === (o.currentPath || a.$route.fullPath)]
|
|
31
|
+
]) : k("", !0)
|
|
29
32
|
], 64))), 128));
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
35
|
export {
|
|
33
|
-
|
|
36
|
+
x as default
|
|
34
37
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
interface IframePageProps {
|
|
2
2
|
frameSrc: string;
|
|
3
3
|
}
|
|
4
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
loaded: () => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{
|
|
9
|
+
onLoaded?: (() => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
11
|
export default _default;
|
|
6
12
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
13
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,57 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as n, ref as t, onMounted as u, nextTick as a, createElementBlock as _, openBlock as v, normalizeClass as w, unref as g } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as h } 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
|
-
|
|
12
|
-
import "../icon/index.js";
|
|
13
|
-
const b = ["src"], k = m({
|
|
11
|
+
const b = ["src"], k = n({
|
|
14
12
|
name: "vft-iframe-page"
|
|
15
|
-
}),
|
|
13
|
+
}), I = /* @__PURE__ */ n({
|
|
16
14
|
...k,
|
|
17
15
|
props: {
|
|
18
16
|
frameSrc: {}
|
|
19
17
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
emits: ["loaded"],
|
|
19
|
+
setup(i, { expose: m, emit: s }) {
|
|
20
|
+
const l = s, c = h("iframe-page"), e = t(), o = t(!0), r = () => {
|
|
21
|
+
a(() => {
|
|
22
|
+
o.value = !1, l("loaded");
|
|
23
|
+
});
|
|
24
|
+
}, f = () => {
|
|
25
|
+
r();
|
|
26
|
+
}, p = () => {
|
|
26
27
|
if (!e.value) return;
|
|
27
28
|
e.value?.contentDocument?.readyState === "complete" && setTimeout(() => {
|
|
28
|
-
|
|
29
|
+
r();
|
|
29
30
|
}, 1e3);
|
|
30
31
|
};
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
return u(() => {
|
|
33
|
+
o.value = !0, a(() => {
|
|
34
|
+
p();
|
|
34
35
|
});
|
|
35
|
-
}), (
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, null, 42, b)
|
|
50
|
-
], 2)), [
|
|
51
|
-
[r(h), o.value]
|
|
52
|
-
]);
|
|
36
|
+
}), m({
|
|
37
|
+
isLoading: o
|
|
38
|
+
}), (d, x) => (v(), _("iframe", {
|
|
39
|
+
ref_key: "iframeRef",
|
|
40
|
+
ref: e,
|
|
41
|
+
sandbox: "allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",
|
|
42
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
43
|
+
frameborder: "0",
|
|
44
|
+
style: { border: "none", outline: "none" },
|
|
45
|
+
class: w(g(c).b()),
|
|
46
|
+
src: i.frameSrc,
|
|
47
|
+
onLoad: r,
|
|
48
|
+
onError: f
|
|
49
|
+
}, null, 42, b));
|
|
53
50
|
}
|
|
54
51
|
});
|
|
55
52
|
export {
|
|
56
|
-
|
|
53
|
+
I as default
|
|
57
54
|
};
|
|
@@ -3,16 +3,23 @@ export declare const VftIframeLayout: import("vft/es/utils").SFCWithInstall<impo
|
|
|
3
3
|
type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
|
|
4
4
|
required: true;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
type: import("vue").PropType<
|
|
6
|
+
currentPath: {
|
|
7
|
+
type: import("vue").PropType<string>;
|
|
8
8
|
};
|
|
9
|
-
}>, {
|
|
9
|
+
}>, {
|
|
10
|
+
iframePageRef: import("vue").Ref<any, any>;
|
|
11
|
+
iframeIsLoaded: import("vue").ComputedRef<boolean>;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
15
|
iframePages: {
|
|
11
16
|
type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
|
|
12
17
|
required: true;
|
|
13
18
|
};
|
|
14
|
-
|
|
15
|
-
type: import("vue").PropType<
|
|
19
|
+
currentPath: {
|
|
20
|
+
type: import("vue").PropType<string>;
|
|
16
21
|
};
|
|
17
|
-
}>> & Readonly<{
|
|
22
|
+
}>> & Readonly<{
|
|
23
|
+
"onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
18
25
|
export default VftIframeLayout;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftTabs as
|
|
1
|
+
import { defineComponent as w, getCurrentInstance as z, ref as v, computed as S, watchEffect as D, unref as n, onMounted as H, createElementBlock as C, openBlock as b, normalizeStyle as K, normalizeClass as k, createVNode as p, createSlots as U, withCtx as x, Fragment as W, renderList as j, createBlock as q, renderSlot as G, createElementVNode as J } from "vue";
|
|
2
|
+
import { VftTabs as O, VftTabPane as Q } from "../tabs/index.js";
|
|
3
|
+
import { VftIcon as X } from "../icon/index.js";
|
|
3
4
|
import { isClient as Y } from "@vueuse/core";
|
|
4
5
|
import "@vft/utils";
|
|
5
6
|
import { addUnit as o } from "../../utils/helper.js";
|
|
6
|
-
import { generateCssVars as
|
|
7
|
+
import { generateCssVars as P } from "../../utils/ns-cover.js";
|
|
7
8
|
import "lodash-es";
|
|
8
9
|
import "../form/index.js";
|
|
9
10
|
import { useNamespace as Z } from "../../hooks/use-namespace/index.js";
|
|
10
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
12
|
import "@popperjs/core";
|
|
12
13
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import { useRouterHelper as ee, getRouterKeyPath as
|
|
14
|
-
import { useMultipleTabStore as ne, useTabs as
|
|
15
|
-
import { useRefs as
|
|
14
|
+
import { useRouterHelper as ee, getRouterKeyPath as d, listenerRouteChange as te } from "@vft/router";
|
|
15
|
+
import { useMultipleTabStore as ne, useTabs as ae } from "@vft/store";
|
|
16
|
+
import { useRefs as oe } from "@vft/use";
|
|
16
17
|
import ie from "hotkeys-js";
|
|
17
18
|
import { onBeforeRouteLeave as le } from "vue-router";
|
|
18
19
|
import re from "./tab-content.vue2.js";
|
|
19
20
|
import { initAffixTabs as se, useTabsDrag as ce } from "./use/use-multiple-tabs.js";
|
|
20
21
|
import "../context-menu/context-menu.vue2.js";
|
|
21
|
-
|
|
22
|
-
const ue = _({
|
|
22
|
+
const ue = w({
|
|
23
23
|
name: "vft-multiple-tabs"
|
|
24
|
-
}),
|
|
24
|
+
}), _e = /* @__PURE__ */ w({
|
|
25
25
|
...ue,
|
|
26
26
|
props: {
|
|
27
27
|
tabsStyle: {},
|
|
@@ -31,46 +31,46 @@ const ue = _({
|
|
|
31
31
|
fixTabCount: {},
|
|
32
32
|
fixExtraScrollWidth: {}
|
|
33
33
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
34
|
+
setup(s) {
|
|
35
|
+
const g = Z("multiple-tabs"), c = z().appContext.config.globalProperties.$router, f = se(c), r = ne(), i = v(""), l = v(0), h = v(), { go: T } = ee(c), m = S(() => r.getTabList.filter((e) => !e.meta?.hideTab));
|
|
36
36
|
D(() => {
|
|
37
|
-
if (
|
|
38
|
-
const e =
|
|
39
|
-
e === -1 ?
|
|
37
|
+
if (i.value) {
|
|
38
|
+
const e = m.value.findIndex((a) => d(a) === i.value);
|
|
39
|
+
e === -1 ? l.value = m.value?.length - 1 : l.value = e, l.value = l.value < f?.length ? f?.length - 1 : l.value;
|
|
40
40
|
}
|
|
41
41
|
}), Y && le(() => {
|
|
42
|
-
h.value =
|
|
42
|
+
h.value = n(c.currentRoute);
|
|
43
43
|
}), te(({ route: e }) => {
|
|
44
44
|
if (!e || e.meta?.hasTokenToRoot)
|
|
45
45
|
return;
|
|
46
|
-
const { meta:
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
const { meta: a = {} } = e, { currentActivePath: t, hideTab: u } = a, A = u ? t : null, R = d(e);
|
|
47
|
+
if (i.value !== R && (i.value = R), A) {
|
|
48
|
+
const y = c.getRoutes().find((F) => F.path === t);
|
|
49
|
+
y && r.addTab(
|
|
50
|
+
y,
|
|
51
|
+
n(h),
|
|
52
|
+
l.value,
|
|
53
53
|
e
|
|
54
54
|
);
|
|
55
|
-
} else
|
|
55
|
+
} else u || r.addTab(n(e), n(h), l.value);
|
|
56
56
|
});
|
|
57
57
|
function V(e) {
|
|
58
|
-
if (
|
|
58
|
+
if (i.value === e.paneName)
|
|
59
59
|
return;
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
60
|
+
const a = m.value[e.attrs.index];
|
|
61
|
+
i.value = e.paneName;
|
|
62
|
+
const t = a?.meta?.hideActiveRoute?.fullPath;
|
|
63
|
+
T(t || a.fullPath || a.path);
|
|
64
64
|
}
|
|
65
65
|
function $(e) {
|
|
66
|
-
|
|
66
|
+
r.closeTabByKey(e, c);
|
|
67
67
|
}
|
|
68
|
-
const { refs: B, setRefs: M } =
|
|
68
|
+
const { refs: B, setRefs: M } = oe();
|
|
69
69
|
function N(e) {
|
|
70
|
-
const
|
|
71
|
-
B.value[
|
|
70
|
+
const a = e.pane.attrs.index, t = e.event;
|
|
71
|
+
B.value[a].handleContext(t);
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const _ = S(() => {
|
|
74
74
|
const e = {
|
|
75
75
|
padding: "4px 0 0",
|
|
76
76
|
"border-bottom": "none",
|
|
@@ -85,80 +85,77 @@ const ue = _({
|
|
|
85
85
|
"item-border-radius": `${o(5)} ${o(5)} 0 0`,
|
|
86
86
|
"item-border": "none"
|
|
87
87
|
};
|
|
88
|
-
return { ...
|
|
89
|
-
}), { closeCurrent:
|
|
90
|
-
...
|
|
88
|
+
return { ...P(e, "tabs"), ...s.tabsStyle };
|
|
89
|
+
}), { closeCurrent: E } = ae(), I = {
|
|
90
|
+
...P(
|
|
91
91
|
{
|
|
92
92
|
"sub-item-height": o(40),
|
|
93
93
|
"item-min-width": o(150)
|
|
94
94
|
},
|
|
95
95
|
"menu"
|
|
96
96
|
),
|
|
97
|
-
...
|
|
98
|
-
},
|
|
99
|
-
|
|
97
|
+
...s.contextMenuStyle
|
|
98
|
+
}, L = () => {
|
|
99
|
+
r.toggleFullScreen(r.getTabList[l.value], c);
|
|
100
100
|
};
|
|
101
101
|
return H(() => {
|
|
102
|
-
|
|
103
|
-
}), (e,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
s.canDrag && ce(f), ie("command+e, ctrl+e", () => (E(), !1));
|
|
103
|
+
}), (e, a) => (b(), C("div", {
|
|
104
|
+
class: k(n(g).b()),
|
|
105
|
+
style: K(_.value)
|
|
106
|
+
}, [
|
|
107
|
+
p(n(O), {
|
|
108
|
+
"show-bar": !1,
|
|
109
|
+
"fix-tab-count": s.fixTabCount,
|
|
110
|
+
"fix-extra-scroll-width": s.fixExtraScrollWidth,
|
|
111
|
+
modelValue: i.value,
|
|
112
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => i.value = t),
|
|
113
|
+
onTabClick: V,
|
|
114
|
+
onTabRemove: $,
|
|
115
|
+
onTabContextMenu: N
|
|
116
|
+
}, U({
|
|
117
|
+
default: x(() => [
|
|
118
|
+
(b(!0), C(W, null, j(m.value, (t, u) => (b(), q(n(Q), {
|
|
119
|
+
key: n(d)(t) + u,
|
|
120
|
+
closable: !t.meta?.affix,
|
|
121
|
+
index: u,
|
|
122
|
+
name: n(d)(t)
|
|
123
|
+
}, {
|
|
124
|
+
label: x(() => [
|
|
125
|
+
p(re, {
|
|
126
|
+
"context-menu-style": I,
|
|
127
|
+
"affix-num": n(f)?.length,
|
|
128
|
+
ref_for: !0,
|
|
129
|
+
ref: n(M)(u),
|
|
130
|
+
"tab-item": t
|
|
131
|
+
}, null, 8, ["affix-num", "tab-item"])
|
|
132
|
+
]),
|
|
133
|
+
_: 2
|
|
134
|
+
}, 1032, ["closable", "index", "name"]))), 128))
|
|
135
|
+
]),
|
|
136
|
+
_: 2
|
|
108
137
|
}, [
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
index: f,
|
|
124
|
-
name: t(v)(i)
|
|
125
|
-
}, {
|
|
126
|
-
label: g(() => [
|
|
127
|
-
x(re, {
|
|
128
|
-
"context-menu-style": A,
|
|
129
|
-
"affix-num": t(m)?.length,
|
|
130
|
-
ref_for: !0,
|
|
131
|
-
ref: t(M)(f),
|
|
132
|
-
"tab-item": i
|
|
133
|
-
}, null, 8, ["affix-num", "tab-item"])
|
|
134
|
-
]),
|
|
135
|
-
_: 2
|
|
136
|
-
}, 1032, ["closable", "index", "name"]))), 128))
|
|
138
|
+
s.showNavRight ? {
|
|
139
|
+
name: "navRight",
|
|
140
|
+
fn: x(() => [
|
|
141
|
+
G(e.$slots, "nav-right", {}, () => [
|
|
142
|
+
J("div", {
|
|
143
|
+
class: k(n(g).e("nav-right"))
|
|
144
|
+
}, [
|
|
145
|
+
p(n(X), {
|
|
146
|
+
onClick: L,
|
|
147
|
+
icon: n(r).isFullScreen ? "icon-collapse" : "icon-expand",
|
|
148
|
+
pointer: ""
|
|
149
|
+
}, null, 8, ["icon"])
|
|
150
|
+
], 2)
|
|
151
|
+
])
|
|
137
152
|
]),
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
fn: g(() => [
|
|
143
|
-
J(e.$slots, "nav-right", {}, () => [
|
|
144
|
-
O("div", {
|
|
145
|
-
class: P(t(T).e("nav-right"))
|
|
146
|
-
}, [
|
|
147
|
-
x(a, {
|
|
148
|
-
onClick: F,
|
|
149
|
-
icon: t(s).isFullScreen ? "icon-collapse" : "icon-expand",
|
|
150
|
-
pointer: ""
|
|
151
|
-
}, null, 8, ["icon"])
|
|
152
|
-
], 2)
|
|
153
|
-
])
|
|
154
|
-
]),
|
|
155
|
-
key: "0"
|
|
156
|
-
} : void 0
|
|
157
|
-
]), 1032, ["fix-tab-count", "fix-extra-scroll-width", "modelValue"])
|
|
158
|
-
], 6);
|
|
159
|
-
};
|
|
153
|
+
key: "0"
|
|
154
|
+
} : void 0
|
|
155
|
+
]), 1032, ["fix-tab-count", "fix-extra-scroll-width", "modelValue"])
|
|
156
|
+
], 6));
|
|
160
157
|
}
|
|
161
158
|
});
|
|
162
159
|
export {
|
|
163
|
-
|
|
160
|
+
_e as default
|
|
164
161
|
};
|
|
@@ -2,14 +2,14 @@ import "@vueuse/core";
|
|
|
2
2
|
import { isNumber as m, isClient as p } from "@vft/utils";
|
|
3
3
|
import { debugWarn as l } from "../../utils/error.js";
|
|
4
4
|
import "../../components/config-provider/hooks/use-global-config.js";
|
|
5
|
-
import { getCurrentInstance as i, inject as e, computed as c, unref as
|
|
5
|
+
import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../../components/form/index.js";
|
|
8
8
|
const s = {
|
|
9
9
|
current: 0
|
|
10
|
-
}, u =
|
|
10
|
+
}, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
|
|
11
11
|
const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
|
|
12
|
-
const r =
|
|
12
|
+
const r = Z(x);
|
|
13
13
|
return m(r) ? r : f;
|
|
14
14
|
}), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
|
|
15
15
|
return !p && !e(d) && l(
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { RouteLocationNormalized } from 'vue-router';
|
|
2
2
|
interface Props {
|
|
3
3
|
iframePages: RouteLocationNormalized[];
|
|
4
|
-
|
|
4
|
+
currentPath?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
6
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {
|
|
7
|
+
iframePageRef: import("vue").Ref<any, any>;
|
|
8
|
+
iframeIsLoaded: import("vue").ComputedRef<boolean>;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
12
|
+
"onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
14
|
export default _default;
|
|
8
15
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
16
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./iframe-page.vue2.cjs"),i=e.defineComponent({name:"vft-iframe-layout"}),_=e.defineComponent({...i,props:{iframePages:{},currentPath:{}},emits:["iframe-loaded"],setup(o,{expose:u,emit:l}){const c=l,t=e.ref(),f=(a,n)=>{c("iframe-loaded",a,n)},d=e.computed(()=>!t?.value?.[t?.value?.length-1]?.isLoading);return u({iframePageRef:t,iframeIsLoaded:d}),(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.iframePages,(r,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.query?r.fullPath:r.path},[r.meta.frameSrc&&r.meta.loaded?e.withDirectives((e.openBlock(),e.createBlock(m.default,{key:0,ref_for:!0,ref_key:"iframePageRef",ref:t,onLoaded:p=>f(r,s),"frame-src":r.meta.frameSrc},null,8,["onLoaded","frame-src"])),[[e.vShow,r.fullPath===(o.currentPath||a.$route.fullPath)]]):e.createCommentVNode("",!0)],64))),128))}});exports.default=_;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
interface IframePageProps {
|
|
2
2
|
frameSrc: string;
|
|
3
3
|
}
|
|
4
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>, {
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
loaded: () => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{
|
|
9
|
+
onLoaded?: (() => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
11
|
export default _default;
|
|
6
12
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
13
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const d=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const m=["src"],p=e.defineComponent({name:"vft-iframe-page"}),_=e.defineComponent({...p,props:{frameSrc:{}},emits:["loaded"],setup(a,{expose:t,emit:i}){const s=i,l=d.useNamespace("iframe-page"),r=e.ref(),o=e.ref(!0),n=()=>{e.nextTick(()=>{o.value=!1,s("loaded")})},c=()=>{n()},u=()=>{if(!r.value)return;r.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{n()},1e3)};return e.onMounted(()=>{o.value=!0,e.nextTick(()=>{u()})}),t({isLoading:o}),(f,v)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:r,sandbox:"allow-scripts allow-same-origin allow-top-navigation allow-modals allow-forms allow-top-navigation-by-user-activation",referrerPolicy:"no-referrer-when-downgrade",frameborder:"0",style:{border:"none",outline:"none"},class:e.normalizeClass(e.unref(l).b()),src:a.frameSrc,onLoad:n,onError:c},null,42,m))}});exports.default=_;
|
|
@@ -3,16 +3,23 @@ export declare const VftIframeLayout: import("vft/es/utils").SFCWithInstall<impo
|
|
|
3
3
|
type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
|
|
4
4
|
required: true;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
type: import("vue").PropType<
|
|
6
|
+
currentPath: {
|
|
7
|
+
type: import("vue").PropType<string>;
|
|
8
8
|
};
|
|
9
|
-
}>, {
|
|
9
|
+
}>, {
|
|
10
|
+
iframePageRef: import("vue").Ref<any, any>;
|
|
11
|
+
iframeIsLoaded: import("vue").ComputedRef<boolean>;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"iframe-loaded": (item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
15
|
iframePages: {
|
|
11
16
|
type: import("vue").PropType<import("vue-router").RouteLocationNormalizedGeneric[]>;
|
|
12
17
|
required: true;
|
|
13
18
|
};
|
|
14
|
-
|
|
15
|
-
type: import("vue").PropType<
|
|
19
|
+
currentPath: {
|
|
20
|
+
type: import("vue").PropType<string>;
|
|
16
21
|
};
|
|
17
|
-
}>> & Readonly<{
|
|
22
|
+
}>> & Readonly<{
|
|
23
|
+
"onIframe-loaded"?: ((item: import("vue-router").RouteLocationNormalizedGeneric, index: number) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
|
|
18
25
|
export default VftIframeLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../tabs/index.cjs"),N=require("../icon/index.cjs"),$=require("@vueuse/core");require("@vft/utils");const r=require("../../utils/helper.cjs"),T=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const E=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const d=require("@vft/router"),C=require("@vft/store"),I=require("@vft/use"),K=require("hotkeys-js"),L=require("vue-router"),z=require("./tab-content.vue2.cjs"),y=require("./use/use-multiple-tabs.cjs");require("../context-menu/context-menu.vue2.cjs");const A=e.defineComponent({name:"vft-multiple-tabs"}),F=e.defineComponent({...A,props:{tabsStyle:{},contextMenuStyle:{},canDrag:{type:Boolean},showNavRight:{type:Boolean,default:!0},fixTabCount:{},fixExtraScrollWidth:{}},setup(l){const m=E.useNamespace("multiple-tabs"),s=e.getCurrentInstance().appContext.config.globalProperties.$router,f=y.initAffixTabs(s),u=C.useMultipleTabStore(),o=e.ref(""),i=e.ref(0),v=e.ref(),{go:b}=d.useRouterHelper(s),h=e.computed(()=>u.getTabList.filter(t=>!t.meta?.hideTab));e.watchEffect(()=>{if(o.value){const t=h.value.findIndex(a=>d.getRouterKeyPath(a)===o.value);t===-1?i.value=h.value?.length-1:i.value=t,i.value=i.value<f?.length?f?.length-1:i.value}}),$.isClient&&L.onBeforeRouteLeave(()=>{v.value=e.unref(s.currentRoute)}),d.listenerRouteChange(({route:t})=>{if(!t||t.meta?.hasTokenToRoot)return;const{meta:a={}}=t,{currentActivePath:n,hideTab:c}=a,B=c?n:null,x=d.getRouterKeyPath(t);if(o.value!==x&&(o.value=x),B){const g=s.getRoutes().find(M=>M.path===n);g&&u.addTab(g,e.unref(v),i.value,t)}else c||u.addTab(e.unref(t),e.unref(v),i.value)});function R(t){if(o.value===t.paneName)return;const a=h.value[t.attrs.index];o.value=t.paneName;const n=a?.meta?.hideActiveRoute?.fullPath;b(n||a.fullPath||a.path)}function q(t){u.closeTabByKey(t,s)}const{refs:S,setRefs:k}=I.useRefs();function P(t){const a=t.pane.attrs.index,n=t.event;S.value[a].handleContext(n)}const _=e.computed(()=>{const t={padding:"4px 0 0","border-bottom":"none","header-height":r.addUnit(26),"font-size":r.addUnit(13),"item-padding":`0 ${r.addUnit(10)}`,"close-icon-left":r.addUnit(8),"item-distance":"1px","item-max-width":r.addUnit(180),"scroll-padding":`0 ${r.addUnit(20)}`,"header-margin":`0 0 0 ${r.addUnit(10)}`,"item-border-radius":`${r.addUnit(5)} ${r.addUnit(5)} 0 0`,"item-border":"none"};return{...T.generateCssVars(t,"tabs"),...l.tabsStyle}}),{closeCurrent:U}=C.useTabs(),V={...T.generateCssVars({"sub-item-height":r.addUnit(40),"item-min-width":r.addUnit(150)},"menu"),...l.contextMenuStyle},w=()=>{u.toggleFullScreen(u.getTabList[i.value],s)};return e.onMounted(()=>{l.canDrag&&y.useTabsDrag(f),K("command+e, ctrl+e",()=>(U(),!1))}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m).b()),style:e.normalizeStyle(_.value)},[e.createVNode(e.unref(p.VftTabs),{"show-bar":!1,"fix-tab-count":l.fixTabCount,"fix-extra-scroll-width":l.fixExtraScrollWidth,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=n=>o.value=n),onTabClick:R,onTabRemove:q,onTabContextMenu:P},e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(n,c)=>(e.openBlock(),e.createBlock(e.unref(p.VftTabPane),{key:e.unref(d.getRouterKeyPath)(n)+c,closable:!n.meta?.affix,index:c,name:e.unref(d.getRouterKeyPath)(n)},{label:e.withCtx(()=>[e.createVNode(z.default,{"context-menu-style":V,"affix-num":e.unref(f)?.length,ref_for:!0,ref:e.unref(k)(c),"tab-item":n},null,8,["affix-num","tab-item"])]),_:2},1032,["closable","index","name"]))),128))]),_:2},[l.showNavRight?{name:"navRight",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"nav-right",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(m).e("nav-right"))},[e.createVNode(e.unref(N.VftIcon),{onClick:w,icon:e.unref(u).isFullScreen?"icon-collapse":"icon-expand",pointer:""},null,8,["icon"])],2)])]),key:"0"}:void 0]),1032,["fix-tab-count","fix-extra-scroll-width","modelValue"])],6))}});exports.default=F;
|