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.
@@ -1,9 +1,16 @@
1
1
  import type { RouteLocationNormalized } from 'vue-router';
2
2
  interface Props {
3
3
  iframePages: RouteLocationNormalized[];
4
- preloadPage?: boolean;
4
+ currentPath?: string;
5
5
  }
6
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
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 o, createElementBlock as t, openBlock as r, Fragment as a, renderList as n, withDirectives as p, createCommentVNode as f, createBlock as c, vShow as u } from "vue";
2
- import "@vueuse/core";
3
- import "@vft/utils";
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
- }), C = /* @__PURE__ */ o({
14
- ...s,
5
+ }), x = /* @__PURE__ */ c({
6
+ ...B,
15
7
  props: {
16
8
  iframePages: {},
17
- preloadPage: { type: Boolean }
9
+ currentPath: {}
18
10
  },
19
- setup(m) {
20
- return (l, _) => (r(!0), t(a, null, n(m.iframePages, (e) => (r(), t(a, {
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 ? p((r(), c(i, {
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
- [u, e.fullPath === l.$route.fullPath]
28
- ]) : f("", !0)
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
- C as default
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>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
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 m, ref as n, onMounted as p, nextTick as d, withDirectives as u, createElementBlock as v, openBlock as _, normalizeClass as i, unref as r, createElementVNode as w } from "vue";
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 g } from "../../hooks/use-namespace/index.js";
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
- import { vLoading as h } from "../loading/directive.js";
12
- import "../icon/index.js";
13
- const b = ["src"], k = m({
11
+ const b = ["src"], k = n({
14
12
  name: "vft-iframe-page"
15
- }), M = /* @__PURE__ */ m({
13
+ }), I = /* @__PURE__ */ n({
16
14
  ...k,
17
15
  props: {
18
16
  frameSrc: {}
19
17
  },
20
- setup(s) {
21
- const a = g("iframe-page"), e = n(), o = n(!0), t = () => {
22
- o.value = !1;
23
- }, l = () => {
24
- o.value = !1;
25
- }, c = () => {
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
- t();
29
+ r();
29
30
  }, 1e3);
30
31
  };
31
- return p(() => {
32
- d(() => {
33
- c();
32
+ return u(() => {
33
+ o.value = !0, a(() => {
34
+ p();
34
35
  });
35
- }), (f, y) => u((_(), v("div", {
36
- class: i(r(a).b())
37
- }, [
38
- w("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: i(r(a).b()),
46
- src: s.frameSrc,
47
- onLoad: t,
48
- onError: l
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
- M as default
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
- preloadPage: {
7
- type: import("vue").PropType<boolean>;
6
+ currentPath: {
7
+ type: import("vue").PropType<string>;
8
8
  };
9
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
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
- preloadPage: {
15
- type: import("vue").PropType<boolean>;
19
+ currentPath: {
20
+ type: import("vue").PropType<string>;
16
21
  };
17
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
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 _, getCurrentInstance as z, ref as b, computed as S, watchEffect as D, unref as t, onMounted as H, resolveComponent as K, createElementBlock as k, openBlock as p, normalizeStyle as U, normalizeClass as P, createVNode as x, createSlots as W, withCtx as g, Fragment as j, renderList as q, createBlock as G, renderSlot as J, createElementVNode as O } from "vue";
2
- import { VftTabs as Q, VftTabPane as X } from "../tabs/index.js";
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 w } from "../../utils/ns-cover.js";
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 v, listenerRouteChange as te } from "@vft/router";
14
- import { useMultipleTabStore as ne, useTabs as oe } from "@vft/store";
15
- import { useRefs as ae } from "@vft/use";
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
- import "../icon/index.js";
22
- const ue = _({
22
+ const ue = w({
23
23
  name: "vft-multiple-tabs"
24
- }), Ne = /* @__PURE__ */ _({
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(c) {
35
- const T = Z("multiple-tabs"), u = z().appContext.config.globalProperties.$router, m = se(u), s = ne(), l = b(""), r = b(0), h = b(), { go: R } = ee(u), d = S(() => s.getTabList.filter((e) => !e.meta?.hideTab));
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 (l.value) {
38
- const e = d.value.findIndex((n) => v(n) === l.value);
39
- e === -1 ? r.value = d.value?.length - 1 : r.value = e, r.value = r.value < m?.length ? m?.length - 1 : r.value;
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 = t(u.currentRoute);
42
+ h.value = n(c.currentRoute);
43
43
  }), te(({ route: e }) => {
44
44
  if (!e || e.meta?.hasTokenToRoot)
45
45
  return;
46
- const { meta: n = {} } = e, { currentActivePath: a, hideTab: i } = n, f = i ? a : null, y = v(e);
47
- if (l.value !== y && (l.value = y), f) {
48
- const C = u.getRoutes().find((I) => I.path === a);
49
- C && s.addTab(
50
- C,
51
- t(h),
52
- r.value,
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 i || s.addTab(t(e), t(h), r.value);
55
+ } else u || r.addTab(n(e), n(h), l.value);
56
56
  });
57
57
  function V(e) {
58
- if (l.value === e.paneName)
58
+ if (i.value === e.paneName)
59
59
  return;
60
- const n = d.value[e.attrs.index];
61
- l.value = e.paneName;
62
- const a = n?.meta?.hideActiveRoute?.fullPath;
63
- R(a || n.fullPath || n.path);
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
- s.closeTabByKey(e, u);
66
+ r.closeTabByKey(e, c);
67
67
  }
68
- const { refs: B, setRefs: M } = ae();
68
+ const { refs: B, setRefs: M } = oe();
69
69
  function N(e) {
70
- const n = e.pane.attrs.index, a = e.event;
71
- B.value[n].handleContext(a);
70
+ const a = e.pane.attrs.index, t = e.event;
71
+ B.value[a].handleContext(t);
72
72
  }
73
- const E = S(() => {
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 { ...w(e, "tabs"), ...c.tabsStyle };
89
- }), { closeCurrent: L } = oe(), A = {
90
- ...w(
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
- ...c.contextMenuStyle
98
- }, F = () => {
99
- s.toggleFullScreen(s.getTabList[r.value], u);
97
+ ...s.contextMenuStyle
98
+ }, L = () => {
99
+ r.toggleFullScreen(r.getTabList[l.value], c);
100
100
  };
101
101
  return H(() => {
102
- c.canDrag && ce(m), ie("command+e, ctrl+e", () => (L(), !1));
103
- }), (e, n) => {
104
- const a = K("vft-icon");
105
- return p(), k("div", {
106
- class: P(t(T).b()),
107
- style: U(E.value)
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
- x(t(Q), {
110
- "show-bar": !1,
111
- "fix-tab-count": c.fixTabCount,
112
- "fix-extra-scroll-width": c.fixExtraScrollWidth,
113
- modelValue: l.value,
114
- "onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i),
115
- onTabClick: V,
116
- onTabRemove: $,
117
- onTabContextMenu: N
118
- }, W({
119
- default: g(() => [
120
- (p(!0), k(j, null, q(d.value, (i, f) => (p(), G(t(X), {
121
- key: t(v)(i) + f,
122
- closable: !i.meta?.affix,
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
- _: 2
139
- }, [
140
- c.showNavRight ? {
141
- name: "navRight",
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
- Ne as default
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 v, ref as Z } from "vue";
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 = Z(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
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 = v(x);
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(
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.473",
3
+ "version": "0.0.475",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.473";
1
+ const o = "0.0.475";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,9 +1,16 @@
1
1
  import type { RouteLocationNormalized } from 'vue-router';
2
2
  interface Props {
3
3
  iframePages: RouteLocationNormalized[];
4
- preloadPage?: boolean;
4
+ currentPath?: string;
5
5
  }
6
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
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");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const u=require("./iframe-page.vue2.cjs"),o=e.defineComponent({name:"vft-iframe-layout"}),l=e.defineComponent({...o,props:{iframePages:{},preloadPage:{type:Boolean}},setup(t){return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iframePages,r=>(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(u.default,{key:0,"frame-src":r.meta.frameSrc},null,8,["frame-src"])),[[e.vShow,r.fullPath===a.$route.fullPath]]):e.createCommentVNode("",!0)],64))),128))}});exports.default=l;
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>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IframePageProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
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 c=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const u=require("../loading/directive.cjs");require("../icon/index.cjs");const f=["src"],d=e.defineComponent({name:"vft-iframe-page"}),m=e.defineComponent({...d,props:{frameSrc:{}},setup(t){const a=c.useNamespace("iframe-page"),r=e.ref(),o=e.ref(!0),n=()=>{o.value=!1},i=()=>{o.value=!1},s=()=>{if(!r.value)return;r.value?.contentDocument?.readyState==="complete"&&setTimeout(()=>{n()},1e3)};return e.onMounted(()=>{e.nextTick(()=>{s()})}),(l,v)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a).b())},[e.createElementVNode("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(a).b()),src:t.frameSrc,onLoad:n,onError:i},null,42,f)],2)),[[e.unref(u.vLoading),o.value]])}});exports.default=m;
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
- preloadPage: {
7
- type: import("vue").PropType<boolean>;
6
+ currentPath: {
7
+ type: import("vue").PropType<string>;
8
8
  };
9
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
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
- preloadPage: {
15
- type: import("vue").PropType<boolean>;
19
+ currentPath: {
20
+ type: import("vue").PropType<string>;
16
21
  };
17
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
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"),C=require("../tabs/index.cjs"),N=require("@vueuse/core");require("@vft/utils");const a=require("../../utils/helper.cjs"),T=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const $=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"),y=require("@vft/store"),E=require("@vft/use"),K=require("hotkeys-js"),L=require("vue-router"),z=require("./tab-content.vue2.cjs"),R=require("./use/use-multiple-tabs.cjs");require("../context-menu/context-menu.vue2.cjs");require("../icon/index.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(s){const b=$.useNamespace("multiple-tabs"),c=e.getCurrentInstance().appContext.config.globalProperties.$router,v=R.initAffixTabs(c),l=y.useMultipleTabStore(),i=e.ref(""),u=e.ref(0),m=e.ref(),{go:g}=d.useRouterHelper(c),h=e.computed(()=>l.getTabList.filter(t=>!t.meta?.hideTab));e.watchEffect(()=>{if(i.value){const t=h.value.findIndex(n=>d.getRouterKeyPath(n)===i.value);t===-1?u.value=h.value?.length-1:u.value=t,u.value=u.value<v?.length?v?.length-1:u.value}}),N.isClient&&L.onBeforeRouteLeave(()=>{m.value=e.unref(c.currentRoute)}),d.listenerRouteChange(({route:t})=>{if(!t||t.meta?.hasTokenToRoot)return;const{meta:n={}}=t,{currentActivePath:r,hideTab:o}=n,f=o?r:null,x=d.getRouterKeyPath(t);if(i.value!==x&&(i.value=x),f){const p=c.getRoutes().find(M=>M.path===r);p&&l.addTab(p,e.unref(m),u.value,t)}else o||l.addTab(e.unref(t),e.unref(m),u.value)});function q(t){if(i.value===t.paneName)return;const n=h.value[t.attrs.index];i.value=t.paneName;const r=n?.meta?.hideActiveRoute?.fullPath;g(r||n.fullPath||n.path)}function S(t){l.closeTabByKey(t,c)}const{refs:_,setRefs:k}=E.useRefs();function P(t){const n=t.pane.attrs.index,r=t.event;_.value[n].handleContext(r)}const U=e.computed(()=>{const t={padding:"4px 0 0","border-bottom":"none","header-height":a.addUnit(26),"font-size":a.addUnit(13),"item-padding":`0 ${a.addUnit(10)}`,"close-icon-left":a.addUnit(8),"item-distance":"1px","item-max-width":a.addUnit(180),"scroll-padding":`0 ${a.addUnit(20)}`,"header-margin":`0 0 0 ${a.addUnit(10)}`,"item-border-radius":`${a.addUnit(5)} ${a.addUnit(5)} 0 0`,"item-border":"none"};return{...T.generateCssVars(t,"tabs"),...s.tabsStyle}}),{closeCurrent:w}=y.useTabs(),V={...T.generateCssVars({"sub-item-height":a.addUnit(40),"item-min-width":a.addUnit(150)},"menu"),...s.contextMenuStyle},B=()=>{l.toggleFullScreen(l.getTabList[u.value],c)};return e.onMounted(()=>{s.canDrag&&R.useTabsDrag(v),K("command+e, ctrl+e",()=>(w(),!1))}),(t,n)=>{const r=e.resolveComponent("vft-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(b).b()),style:e.normalizeStyle(U.value)},[e.createVNode(e.unref(C.VftTabs),{"show-bar":!1,"fix-tab-count":s.fixTabCount,"fix-extra-scroll-width":s.fixExtraScrollWidth,modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=o=>i.value=o),onTabClick:q,onTabRemove:S,onTabContextMenu:P},e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,f)=>(e.openBlock(),e.createBlock(e.unref(C.VftTabPane),{key:e.unref(d.getRouterKeyPath)(o)+f,closable:!o.meta?.affix,index:f,name:e.unref(d.getRouterKeyPath)(o)},{label:e.withCtx(()=>[e.createVNode(z.default,{"context-menu-style":V,"affix-num":e.unref(v)?.length,ref_for:!0,ref:e.unref(k)(f),"tab-item":o},null,8,["affix-num","tab-item"])]),_:2},1032,["closable","index","name"]))),128))]),_:2},[s.showNavRight?{name:"navRight",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"nav-right",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b).e("nav-right"))},[e.createVNode(r,{onClick:B,icon:e.unref(l).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;
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;