vft 0.0.119 → 0.0.121
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/attributes.json +1 -1
- package/es/component.js +25 -23
- package/es/components/backtop/backtop.vue2.js +3 -2
- package/es/components/button/button.vue2.js +21 -21
- package/es/components/context-menu/context-menu.vue2.js +3 -2
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +53 -57
- package/es/components/footer-layout/footer-layout.vue2.js +3 -2
- package/es/components/header-layout/header-layout.vue2.js +3 -2
- package/es/components/index.js +269 -261
- package/es/components/md-container/md-container.vue2.js +3 -2
- package/es/components/menu/menu-item.vue2.js +3 -2
- package/es/components/menu/sub-menu.vue2.js +3 -2
- package/es/components/message/message.vue2.js +12 -12
- package/es/components/modal/index.js +15 -0
- package/es/components/modal/modal.vue.js +4 -0
- package/es/components/modal/modal.vue2.js +92 -0
- package/es/components/modal/style/css.js +4 -0
- package/es/components/modal/style/index.js +4 -0
- package/es/components/modal/use/use-modal.js +95 -0
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -14
- package/es/components/multiple-tabs/tab-content.vue2.js +11 -12
- package/es/components/multiple-tabs/use/use-multiple-tabs.js +22 -23
- package/es/components/result/result.vue2.js +3 -2
- package/es/components/side-menu/side-menu.vue2.js +26 -25
- package/es/components/super-form/component-map.js +24 -23
- package/es/components/super-form/super-form-action.vue2.js +28 -29
- package/es/components/super-form/super-form-item.vue2.js +132 -123
- package/es/components/super-form/super-form.vue2.js +139 -136
- package/es/components/super-form/use/use-form-events.js +144 -139
- package/es/components/table/field.js +90 -52
- package/es/components/table/index.js +15 -12
- package/es/components/table/types.js +1 -0
- package/es/components/tabs/tab-nav.vue2.js +3 -2
- package/es/components/upload/upload-content.vue2.js +2 -2
- package/es/components/upload/upload.vue2.js +40 -49
- package/es/index.js +354 -346
- package/es/package.json.js +1 -1
- package/lib/component.cjs +1 -1
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/modal/index.cjs +1 -0
- package/lib/components/modal/modal.vue.cjs +1 -0
- package/lib/components/modal/modal.vue2.cjs +1 -0
- package/lib/components/modal/style/css.cjs +1 -0
- package/lib/components/modal/style/index.cjs +1 -0
- package/lib/components/modal/use/use-modal.cjs +1 -0
- 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/multiple-tabs/use/use-multiple-tabs.cjs +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/super-form/component-map.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/index.cjs +1 -1
- package/lib/components/table/types.cjs +1 -0
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +3 -3
- package/tags.json +1 -1
- package/theme-style/src/index.scss +1 -0
- package/theme-style/src/modal.scss +0 -0
- package/theme-style/vft-modal.css +0 -0
- package/web-types.json +1 -1
- /package/es/components/{table/type.js → modal/types.js} +0 -0
- /package/lib/components/{table/type.cjs → modal/types.cjs} +0 -0
|
@@ -84,6 +84,7 @@ import "../autocomplete/index.js";
|
|
|
84
84
|
import "../super-form/index.js";
|
|
85
85
|
import "../progress/index.js";
|
|
86
86
|
import "../upload/index.js";
|
|
87
|
+
import "../modal/index.js";
|
|
87
88
|
import "../md-container/index.js";
|
|
88
89
|
import "../md-comment/index.js";
|
|
89
90
|
import "../md-tabs/index.js";
|
|
@@ -97,7 +98,7 @@ const ee = ["title"], g = (
|
|
|
97
98
|
), te = Y({
|
|
98
99
|
name: "vft-menu-item",
|
|
99
100
|
inheritAttrs: !1
|
|
100
|
-
}),
|
|
101
|
+
}), qt = /* @__PURE__ */ Y({
|
|
101
102
|
...te,
|
|
102
103
|
props: {
|
|
103
104
|
index: {},
|
|
@@ -194,5 +195,5 @@ const ee = ["title"], g = (
|
|
|
194
195
|
}
|
|
195
196
|
});
|
|
196
197
|
export {
|
|
197
|
-
|
|
198
|
+
qt as default
|
|
198
199
|
};
|
|
@@ -76,6 +76,7 @@ import "../autocomplete/index.js";
|
|
|
76
76
|
import "../super-form/index.js";
|
|
77
77
|
import "../progress/index.js";
|
|
78
78
|
import "../upload/index.js";
|
|
79
|
+
import "../modal/index.js";
|
|
79
80
|
import "../md-container/index.js";
|
|
80
81
|
import "../md-comment/index.js";
|
|
81
82
|
import "../md-tabs/index.js";
|
|
@@ -98,7 +99,7 @@ const q = (
|
|
|
98
99
|
), Te = G({
|
|
99
100
|
name: "vft-sub-menu",
|
|
100
101
|
inheritAttrs: !1
|
|
101
|
-
}),
|
|
102
|
+
}), at = /* @__PURE__ */ G({
|
|
102
103
|
...Te,
|
|
103
104
|
props: {
|
|
104
105
|
index: {},
|
|
@@ -313,5 +314,5 @@ const q = (
|
|
|
313
314
|
}
|
|
314
315
|
});
|
|
315
316
|
export {
|
|
316
|
-
|
|
317
|
+
at as default
|
|
317
318
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, ref as d, computed as s, onMounted as H, watch as $, openBlock as i, createBlock as D, Transition as F, unref as n, withCtx as
|
|
1
|
+
import { defineComponent as V, ref as d, computed as s, onMounted as H, watch as $, openBlock as i, createBlock as D, Transition as F, unref as n, withCtx as P, withDirectives as U, createElementVNode as Z, normalizeClass as r, normalizeStyle as j, createElementBlock as u, createVNode as w, normalizeProps as A, guardReactiveProps as G, createCommentVNode as k, renderSlot as _, toDisplayString as q, withModifiers as J, vShow as K } from "vue";
|
|
2
2
|
import { EVENT_CODE as Q } from "@vft/constants";
|
|
3
3
|
import { isObject as W } from "@vft/utils";
|
|
4
4
|
import { useResizeObserver as X, useTimeoutFn as Y } from "@vueuse/core";
|
|
@@ -16,7 +16,7 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
16
16
|
duration: {},
|
|
17
17
|
icon: {},
|
|
18
18
|
id: {},
|
|
19
|
-
message: { type: [String,
|
|
19
|
+
message: { type: [String, Function] },
|
|
20
20
|
onClose: { type: Function },
|
|
21
21
|
showClose: { type: Boolean },
|
|
22
22
|
type: {},
|
|
@@ -26,14 +26,14 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
26
26
|
repeatNum: {}
|
|
27
27
|
},
|
|
28
28
|
emits: ["destroy"],
|
|
29
|
-
setup(
|
|
30
|
-
const o =
|
|
29
|
+
setup(M, { expose: S }) {
|
|
30
|
+
const o = M, { ns: t, zIndex: b } = ne("message"), { currentZIndex: L, nextZIndex: T } = b, f = d(), l = d(!1), g = d(0);
|
|
31
31
|
let c;
|
|
32
|
-
const
|
|
32
|
+
const z = /* @__PURE__ */ new Map([
|
|
33
33
|
["success", { icon: "ico-ep:success-filled" }],
|
|
34
34
|
["error", { icon: "ico-ep:circle-close-filled" }],
|
|
35
35
|
["warning", { icon: "ico-ep:warning-filled" }]
|
|
36
|
-
]), v = s(() => (o.icon ? W(o.icon) ? o.icon : { icon: o.icon } : "") ||
|
|
36
|
+
]), v = s(() => (o.icon ? W(o.icon) ? o.icon : { icon: o.icon } : "") || z.get(o.type) || ""), O = s(() => {
|
|
37
37
|
const e = o.type;
|
|
38
38
|
return { [t.bm("icon", e)]: e };
|
|
39
39
|
}), E = s(() => ee(o.id)), y = s(
|
|
@@ -57,7 +57,7 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
57
57
|
e === Q.esc && a();
|
|
58
58
|
}
|
|
59
59
|
return H(() => {
|
|
60
|
-
m(),
|
|
60
|
+
m(), T(), l.value = !0;
|
|
61
61
|
}), $(
|
|
62
62
|
() => o.repeatNum,
|
|
63
63
|
() => {
|
|
@@ -65,7 +65,7 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
65
65
|
}
|
|
66
66
|
), x(document, "keydown", R), X(f, () => {
|
|
67
67
|
g.value = f.value.getBoundingClientRect().height;
|
|
68
|
-
}),
|
|
68
|
+
}), S({
|
|
69
69
|
visible: l,
|
|
70
70
|
bottom: I,
|
|
71
71
|
close: a
|
|
@@ -74,10 +74,10 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
74
74
|
onBeforeLeave: e.onClose,
|
|
75
75
|
onAfterLeave: h[0] || (h[0] = (p) => e.$emit("destroy"))
|
|
76
76
|
}, {
|
|
77
|
-
default:
|
|
77
|
+
default: P(() => {
|
|
78
78
|
var p;
|
|
79
79
|
return [
|
|
80
|
-
|
|
80
|
+
U(Z("div", {
|
|
81
81
|
id: e.id,
|
|
82
82
|
ref_key: "messageRef",
|
|
83
83
|
ref: f,
|
|
@@ -88,14 +88,14 @@ const te = ["id"], se = ["innerHTML"], ie = ["onClick"], ge = /* @__PURE__ */ V(
|
|
|
88
88
|
n(t).is("closable", e.showClose),
|
|
89
89
|
e.customClass
|
|
90
90
|
]),
|
|
91
|
-
style:
|
|
91
|
+
style: j(N.value),
|
|
92
92
|
role: "alert",
|
|
93
93
|
onMouseenter: C,
|
|
94
94
|
onMouseleave: m
|
|
95
95
|
}, [
|
|
96
96
|
(p = v.value) != null && p.icon ? (i(), u("div", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class: r([n(t).e("icon"),
|
|
98
|
+
class: r([n(t).e("icon"), O.value])
|
|
99
99
|
}, [
|
|
100
100
|
w(n(B), A(G(v.value)), null, 16)
|
|
101
101
|
], 2)) : k("", !0),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { withInstall as o } from "../../utils/vue/install.js";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "@vft/utils";
|
|
4
|
+
import "lodash";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "../../utils/ns-cover.js";
|
|
7
|
+
import t from "./modal.vue2.js";
|
|
8
|
+
import { useModal as d, useModalInner as u } from "./use/use-modal.js";
|
|
9
|
+
const l = o(t);
|
|
10
|
+
export {
|
|
11
|
+
l as VftModal,
|
|
12
|
+
l as default,
|
|
13
|
+
d as useModal,
|
|
14
|
+
u as useModalInner
|
|
15
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent as C, useAttrs as V, ref as u, getCurrentInstance as v, computed as d, unref as l, watchEffect as M, watch as b, nextTick as f, openBlock as k, createBlock as w, mergeProps as F, withCtx as _, renderSlot as P } from "vue";
|
|
2
|
+
import { VftDialog as x } from "../dialog/index.js";
|
|
3
|
+
import { isFunction as R, deepMerge as T } from "@vft/utils";
|
|
4
|
+
const E = /* @__PURE__ */ C({
|
|
5
|
+
__name: "modal",
|
|
6
|
+
props: {
|
|
7
|
+
closeFunc: {},
|
|
8
|
+
appendToBody: { type: Boolean, default: !1 },
|
|
9
|
+
beforeClose: {},
|
|
10
|
+
destroyOnClose: { type: Boolean, default: !1 },
|
|
11
|
+
closeOnClickModal: { type: Boolean, default: !0 },
|
|
12
|
+
closeOnPressEscape: { type: Boolean, default: !0 },
|
|
13
|
+
lockScroll: { type: Boolean, default: !0 },
|
|
14
|
+
modal: { type: Boolean, default: !0 },
|
|
15
|
+
openDelay: { default: 0 },
|
|
16
|
+
closeDelay: { default: 0 },
|
|
17
|
+
top: {},
|
|
18
|
+
modelValue: { type: Boolean, default: !1 },
|
|
19
|
+
modalClass: {},
|
|
20
|
+
width: {},
|
|
21
|
+
zIndex: {},
|
|
22
|
+
trapFocus: { type: Boolean, default: !1 },
|
|
23
|
+
center: { type: Boolean, default: !1 },
|
|
24
|
+
alignCenter: { type: Boolean, default: !1 },
|
|
25
|
+
closeIcon: {},
|
|
26
|
+
customClass: { default: "" },
|
|
27
|
+
draggable: { type: Boolean, default: !1 },
|
|
28
|
+
fullscreen: { type: Boolean, default: !1 },
|
|
29
|
+
showClose: { type: Boolean, default: !0 },
|
|
30
|
+
title: { default: "" }
|
|
31
|
+
},
|
|
32
|
+
emits: {
|
|
33
|
+
"visible-change": [],
|
|
34
|
+
close: [],
|
|
35
|
+
ok: [],
|
|
36
|
+
register: [],
|
|
37
|
+
"update:modelValue": []
|
|
38
|
+
},
|
|
39
|
+
setup(i, { emit: a }) {
|
|
40
|
+
const o = i, p = V(), n = u(null), t = u(!1), s = u(null), m = {
|
|
41
|
+
setModalProps: h,
|
|
42
|
+
emitVisible: void 0,
|
|
43
|
+
redoModalHeight: () => {
|
|
44
|
+
f(() => {
|
|
45
|
+
l(s) && l(s).setModalHeight();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, c = v();
|
|
49
|
+
c && a("register", m, c.uid);
|
|
50
|
+
const y = d(() => ({
|
|
51
|
+
...o,
|
|
52
|
+
...l(n)
|
|
53
|
+
})), g = d(() => ({
|
|
54
|
+
...p,
|
|
55
|
+
...l(y),
|
|
56
|
+
modelValue: l(t)
|
|
57
|
+
}));
|
|
58
|
+
M(() => {
|
|
59
|
+
t.value = !!o.modelValue;
|
|
60
|
+
}), b(
|
|
61
|
+
() => l(t),
|
|
62
|
+
(e) => {
|
|
63
|
+
a("visible-change", e), a("update:modelValue", e), f(() => {
|
|
64
|
+
o.scrollTop && e && l(s) && l(s).scrollTop();
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
immediate: !1
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
async function B(e) {
|
|
72
|
+
if (e == null || e.stopPropagation(), o.closeFunc && R(o.closeFunc)) {
|
|
73
|
+
const r = await o.closeFunc();
|
|
74
|
+
t.value = !r;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
t.value = !1, a("close", e);
|
|
78
|
+
}
|
|
79
|
+
function h(e) {
|
|
80
|
+
n.value = T(l(n) || {}, e), Reflect.has(e, "modelValue") && (t.value = !!e.modelValue);
|
|
81
|
+
}
|
|
82
|
+
return (e, r) => (k(), w(l(x), F(g.value, { onClose: B }), {
|
|
83
|
+
default: _(() => [
|
|
84
|
+
P(e.$slots, "default")
|
|
85
|
+
]),
|
|
86
|
+
_: 3
|
|
87
|
+
}, 16));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
E as default
|
|
92
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { reactive as m, ref as d, computed as v, unref as n, toRaw as c, getCurrentInstance as P, watchEffect as V, nextTick as w } from "vue";
|
|
2
|
+
import { isFunction as H } from "@vft/utils";
|
|
3
|
+
import { isEqual as I } from "lodash";
|
|
4
|
+
import { onBeforeUnMountedOrDeactivated as h } from "@vft/use";
|
|
5
|
+
const i = m({}), p = m({});
|
|
6
|
+
function x() {
|
|
7
|
+
const r = d(null), l = d(!1), s = d("");
|
|
8
|
+
function u(e, o) {
|
|
9
|
+
if (!P())
|
|
10
|
+
throw new Error("useModal() can only be used inside setup() or functional components!");
|
|
11
|
+
s.value = o, h(() => {
|
|
12
|
+
r.value = null, l.value = !1, i[n(s)] = null;
|
|
13
|
+
}), !(n(l) && e === n(r)) && (r.value = e, l.value = !0, e.emitVisible = (M, a) => {
|
|
14
|
+
p[a] = M;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const t = () => {
|
|
18
|
+
const e = n(r);
|
|
19
|
+
return e || console.error("useModal instance is undefined!"), e;
|
|
20
|
+
}, f = {
|
|
21
|
+
setModalProps: (e) => {
|
|
22
|
+
var o;
|
|
23
|
+
(o = t()) == null || o.setModalProps(e);
|
|
24
|
+
},
|
|
25
|
+
getVisible: v(() => p[~~n(s)]),
|
|
26
|
+
redoModalHeight: () => {
|
|
27
|
+
var e, o;
|
|
28
|
+
(o = (e = t()) == null ? void 0 : e.redoModalHeight) == null || o.call(e);
|
|
29
|
+
},
|
|
30
|
+
openModal: (e = !0, o, M = !0) => {
|
|
31
|
+
var g;
|
|
32
|
+
if ((g = t()) == null || g.setModalProps({
|
|
33
|
+
modelValue: e
|
|
34
|
+
}), !o)
|
|
35
|
+
return;
|
|
36
|
+
const a = n(s);
|
|
37
|
+
if (M) {
|
|
38
|
+
i[a] = null, i[a] = c(o);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
I(c(i[a]), c(o)) || (i[a] = c(o));
|
|
42
|
+
},
|
|
43
|
+
closeModal: () => {
|
|
44
|
+
var e;
|
|
45
|
+
(e = t()) == null || e.setModalProps({ modelValue: !1 });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return [u, f];
|
|
49
|
+
}
|
|
50
|
+
const D = (r) => {
|
|
51
|
+
const l = d(null), s = P(), u = d(""), t = () => {
|
|
52
|
+
const e = n(l);
|
|
53
|
+
return e || console.error("useModalInner instance is undefined!"), e;
|
|
54
|
+
}, f = (e, o) => {
|
|
55
|
+
h(() => {
|
|
56
|
+
l.value = null;
|
|
57
|
+
}), u.value = o, l.value = e, s == null || s.emit("register", e, o);
|
|
58
|
+
};
|
|
59
|
+
return V(() => {
|
|
60
|
+
const e = i[n(u)];
|
|
61
|
+
e && (!r || !H(r) || w(() => {
|
|
62
|
+
r(e);
|
|
63
|
+
}));
|
|
64
|
+
}), [
|
|
65
|
+
f,
|
|
66
|
+
{
|
|
67
|
+
changeLoading: (e = !0) => {
|
|
68
|
+
var o;
|
|
69
|
+
(o = t()) == null || o.setModalProps({ loading: e });
|
|
70
|
+
},
|
|
71
|
+
getVisible: v(() => p[~~n(u)]),
|
|
72
|
+
changeOkLoading: (e = !0) => {
|
|
73
|
+
var o;
|
|
74
|
+
(o = t()) == null || o.setModalProps({ confirmLoading: e });
|
|
75
|
+
},
|
|
76
|
+
closeModal: () => {
|
|
77
|
+
var e;
|
|
78
|
+
(e = t()) == null || e.setModalProps({ modelValue: !1 });
|
|
79
|
+
},
|
|
80
|
+
setModalProps: (e) => {
|
|
81
|
+
var o;
|
|
82
|
+
(o = t()) == null || o.setModalProps(e);
|
|
83
|
+
},
|
|
84
|
+
redoModalHeight: () => {
|
|
85
|
+
var o;
|
|
86
|
+
const e = (o = t()) == null ? void 0 : o.redoModalHeight;
|
|
87
|
+
e && e();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
x as useModal,
|
|
94
|
+
D as useModalInner
|
|
95
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P,
|
|
1
|
+
import { defineComponent as P, getCurrentInstance as D, ref as b, computed as h, watchEffect as E, unref as r, openBlock as x, createElementBlock as R, normalizeClass as H, normalizeStyle as K, createVNode as S, withCtx as C, Fragment as $, renderList as F, createBlock as U } from "vue";
|
|
2
2
|
import { useRouterHelper as j, getRouterKeyPath as f, listenerRouteChange as q } from "@vft/router";
|
|
3
3
|
import { useMultipleTabStore as G, useTabs as J } from "@vft/store";
|
|
4
4
|
import { useRefs as L } from "@vft/use";
|
|
@@ -87,6 +87,7 @@ import "../autocomplete/index.js";
|
|
|
87
87
|
import "../super-form/index.js";
|
|
88
88
|
import "../progress/index.js";
|
|
89
89
|
import "../upload/index.js";
|
|
90
|
+
import "../modal/index.js";
|
|
90
91
|
import "../md-container/index.js";
|
|
91
92
|
import "../md-comment/index.js";
|
|
92
93
|
import "../md-tabs/index.js";
|
|
@@ -101,7 +102,7 @@ const ot = (
|
|
|
101
102
|
W("multiple-tabs")
|
|
102
103
|
), rt = P({
|
|
103
104
|
name: "vft-multiple-tabs"
|
|
104
|
-
}),
|
|
105
|
+
}), We = /* @__PURE__ */ P({
|
|
105
106
|
...rt,
|
|
106
107
|
props: {
|
|
107
108
|
tabsStyle: {},
|
|
@@ -109,9 +110,9 @@ const ot = (
|
|
|
109
110
|
canDrag: { type: Boolean }
|
|
110
111
|
},
|
|
111
112
|
setup(d) {
|
|
112
|
-
const i = tt();
|
|
113
|
+
const l = D().appContext.config.globalProperties.$router, i = tt(l);
|
|
113
114
|
d.canDrag && et(i);
|
|
114
|
-
const
|
|
115
|
+
const s = G(), m = b(""), a = b(0), v = b(), { go: g } = j(l), c = h(() => s.getTabList.filter((t) => {
|
|
115
116
|
var e;
|
|
116
117
|
return !((e = t.meta) != null && e.hideTab);
|
|
117
118
|
}));
|
|
@@ -122,17 +123,17 @@ const ot = (
|
|
|
122
123
|
e === -1 ? a.value = ((t = c.value) == null ? void 0 : t.length) - 1 : a.value = e, a.value = a.value < (i == null ? void 0 : i.length) ? (i == null ? void 0 : i.length) - 1 : a.value;
|
|
123
124
|
}
|
|
124
125
|
}), Q(() => {
|
|
125
|
-
v.value = r(
|
|
126
|
+
v.value = r(l.currentRoute);
|
|
126
127
|
}), q((t) => {
|
|
127
128
|
var T;
|
|
128
129
|
if (!t || (T = t.meta) != null && T.hasTokenToRoot)
|
|
129
130
|
return;
|
|
130
|
-
const { meta: e = {} } = t, { currentActivePath: o, hideTab: n } = e, p = n ? o : null,
|
|
131
|
-
if (m.value !==
|
|
132
|
-
let y =
|
|
133
|
-
y &&
|
|
131
|
+
const { meta: e = {} } = t, { currentActivePath: o, hideTab: n } = e, p = n ? o : null, u = f(t);
|
|
132
|
+
if (m.value !== u && (m.value = u), p) {
|
|
133
|
+
let y = l.getRoutes().find((z) => z.path === o);
|
|
134
|
+
y && s.addTab(y, r(v), a.value, t);
|
|
134
135
|
} else
|
|
135
|
-
|
|
136
|
+
s.addTab(r(t), r(v), a.value);
|
|
136
137
|
});
|
|
137
138
|
function M(t) {
|
|
138
139
|
var n, p;
|
|
@@ -144,7 +145,7 @@ const ot = (
|
|
|
144
145
|
g(o || e.fullPath || e.path);
|
|
145
146
|
}
|
|
146
147
|
function k(t) {
|
|
147
|
-
|
|
148
|
+
s.closeTabByKey(t, l);
|
|
148
149
|
}
|
|
149
150
|
const [B, I] = L();
|
|
150
151
|
function N(t) {
|
|
@@ -196,11 +197,11 @@ const ot = (
|
|
|
196
197
|
name: r(f)(o)
|
|
197
198
|
}, {
|
|
198
199
|
label: C(() => {
|
|
199
|
-
var
|
|
200
|
+
var u;
|
|
200
201
|
return [
|
|
201
202
|
S(Z, {
|
|
202
203
|
contextMenuStyle: A.value,
|
|
203
|
-
affixNum: (
|
|
204
|
+
affixNum: (u = r(i)) == null ? void 0 : u.length,
|
|
204
205
|
ref_for: !0,
|
|
205
206
|
ref: r(I)(n),
|
|
206
207
|
tabItem: o
|
|
@@ -217,5 +218,5 @@ const ot = (
|
|
|
217
218
|
}
|
|
218
219
|
});
|
|
219
220
|
export {
|
|
220
|
-
|
|
221
|
+
We as default
|
|
221
222
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { defineComponent as u, computed as
|
|
1
|
+
import { defineComponent as u, computed as s, openBlock as c, createElementBlock as r, withModifiers as f, toDisplayString as x } from "vue";
|
|
2
2
|
import "@vft/utils";
|
|
3
3
|
import "../context-menu/context-menu.vue2.js";
|
|
4
|
-
import { useContextMenu as
|
|
4
|
+
import { useContextMenu as p } from "../context-menu/useContextMenu.js";
|
|
5
5
|
import { useTabDropdown as b } from "./use/use-tab-dropdown.js";
|
|
6
6
|
import "@vft/use";
|
|
7
|
-
import "vue-router";
|
|
8
7
|
import "@vft/store";
|
|
9
|
-
const d = ["title", "onContextmenu"],
|
|
8
|
+
const d = ["title", "onContextmenu"], D = /* @__PURE__ */ u({
|
|
10
9
|
__name: "tab-content",
|
|
11
10
|
props: {
|
|
12
11
|
tabItem: {},
|
|
@@ -14,24 +13,24 @@ const d = ["title", "onContextmenu"], S = /* @__PURE__ */ u({
|
|
|
14
13
|
contextMenuStyle: {},
|
|
15
14
|
visible: { type: Boolean }
|
|
16
15
|
},
|
|
17
|
-
setup(t, { expose:
|
|
18
|
-
const [
|
|
16
|
+
setup(t, { expose: a }) {
|
|
17
|
+
const [i] = p(), n = s(() => t.tabItem.meta && t.tabItem.meta.title), { getDropMenuList: m, handleContextMenu: l } = b(t.tabItem, t.affixNum);
|
|
19
18
|
function o(e) {
|
|
20
|
-
l(t.tabItem)(e),
|
|
19
|
+
l(t.tabItem)(e), i({
|
|
21
20
|
event: e,
|
|
22
21
|
styles: t.contextMenuStyle,
|
|
23
|
-
items:
|
|
22
|
+
items: m.value
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
return
|
|
25
|
+
return a({
|
|
27
26
|
handleContext: o
|
|
28
|
-
}), (e, C) => (
|
|
27
|
+
}), (e, C) => (c(), r("span", {
|
|
29
28
|
title: n.value,
|
|
30
29
|
class: "vft-multiple-tabs__title",
|
|
31
30
|
onContextmenu: f(o, ["stop"])
|
|
32
|
-
},
|
|
31
|
+
}, x(n.value), 41, d));
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
34
|
export {
|
|
36
|
-
|
|
35
|
+
D as default
|
|
37
36
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useSortable as
|
|
2
|
-
import { isNullOrUndefined as
|
|
1
|
+
import { useSortable as b } from "@vft/use";
|
|
2
|
+
import { isNullOrUndefined as c, arrSort as m } from "@vft/utils";
|
|
3
3
|
import { ref as d, nextTick as x, toRaw as p } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const o = d([]), n = c(), f = T();
|
|
4
|
+
import { useMultipleTabStore as u } from "@vft/store";
|
|
5
|
+
function h(o) {
|
|
6
|
+
const r = d([]), f = u();
|
|
8
7
|
function i(e) {
|
|
9
8
|
const t = [];
|
|
10
9
|
return e && e.forEach((s) => {
|
|
@@ -12,42 +11,42 @@ function R() {
|
|
|
12
11
|
(l = s.meta) != null && l.affix && t.push(p(s));
|
|
13
12
|
}), t;
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
const e = i(
|
|
17
|
-
|
|
14
|
+
function n() {
|
|
15
|
+
const e = i(o.getRoutes());
|
|
16
|
+
m(e, ["meta", "order"]), r.value = e;
|
|
18
17
|
for (const t of e)
|
|
19
|
-
|
|
18
|
+
f.addTab({
|
|
20
19
|
meta: t.meta,
|
|
21
20
|
name: t.name,
|
|
22
21
|
path: t.path
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
|
-
let
|
|
26
|
-
return
|
|
24
|
+
let a = !1;
|
|
25
|
+
return a || (n(), a = !0), r.value.map((e) => {
|
|
27
26
|
var t;
|
|
28
27
|
return (t = e.meta) == null ? void 0 : t.title;
|
|
29
28
|
}).filter(Boolean);
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
30
|
+
function v(o) {
|
|
31
|
+
const r = u();
|
|
33
32
|
x(() => {
|
|
34
|
-
var
|
|
35
|
-
const f = (
|
|
33
|
+
var n;
|
|
34
|
+
const f = (n = document.querySelectorAll(".vft-tabs__nav")) == null ? void 0 : n[0], { initSortable: i } = b(f, {
|
|
36
35
|
draggable: ".is-closable",
|
|
37
|
-
filter: (
|
|
36
|
+
filter: (a) => {
|
|
38
37
|
var t;
|
|
39
|
-
const e = (t =
|
|
38
|
+
const e = (t = a == null ? void 0 : a.target) == null ? void 0 : t.innerText;
|
|
40
39
|
return e ? o.includes(e) : !1;
|
|
41
40
|
},
|
|
42
|
-
onEnd: (
|
|
43
|
-
const { oldIndex: e, newIndex: t } =
|
|
44
|
-
|
|
41
|
+
onEnd: (a) => {
|
|
42
|
+
const { oldIndex: e, newIndex: t } = a;
|
|
43
|
+
c(e) || c(t) || e === t || r.sortTabs(e, t);
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
46
|
i();
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
h as initAffixTabs,
|
|
51
|
+
v as useTabsDrag
|
|
53
52
|
};
|
|
@@ -82,6 +82,7 @@ import "../autocomplete/index.js";
|
|
|
82
82
|
import "../super-form/index.js";
|
|
83
83
|
import "../progress/index.js";
|
|
84
84
|
import "../upload/index.js";
|
|
85
|
+
import "../modal/index.js";
|
|
85
86
|
import "../md-container/index.js";
|
|
86
87
|
import "../md-comment/index.js";
|
|
87
88
|
import "../md-tabs/index.js";
|
|
@@ -94,7 +95,7 @@ const i = (
|
|
|
94
95
|
x("result")
|
|
95
96
|
), I = c({
|
|
96
97
|
name: "vft-result"
|
|
97
|
-
}),
|
|
98
|
+
}), po = /* @__PURE__ */ c({
|
|
98
99
|
...I,
|
|
99
100
|
props: {
|
|
100
101
|
title: {},
|
|
@@ -133,5 +134,5 @@ const i = (
|
|
|
133
134
|
}
|
|
134
135
|
});
|
|
135
136
|
export {
|
|
136
|
-
|
|
137
|
+
po as default
|
|
137
138
|
};
|