vft 0.0.511 → 0.0.513
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/select/useSelect.js +231 -232
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.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/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +2 -0
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
import { jumpElement as h } from "@vft/utils";
|
|
2
|
-
import v from "
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const y = ({ title: e, level: o, slug: t }) => n(
|
|
2
|
+
import { defineComponent as v, ref as f, getCurrentInstance as g, computed as T, onMounted as C, watch as $, h as o } from "vue";
|
|
3
|
+
import { isActiveLink as I } from "./utils.js";
|
|
4
|
+
const k = ({ title: t, level: e, slug: l }) => o(
|
|
6
5
|
"a",
|
|
7
6
|
{
|
|
8
|
-
href: `#${
|
|
9
|
-
class: ["toc-link", `level${
|
|
7
|
+
href: `#${l}`,
|
|
8
|
+
class: ["toc-link", `level${e}`]
|
|
10
9
|
},
|
|
11
|
-
|
|
12
|
-
),
|
|
10
|
+
t
|
|
11
|
+
), a = (t, e, l) => t.length && e > 0 ? o(
|
|
13
12
|
"ul",
|
|
14
13
|
{ class: "toc-list" },
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
t.map((c) => [
|
|
15
|
+
o(
|
|
17
16
|
"li",
|
|
18
17
|
{
|
|
19
18
|
class: [
|
|
20
19
|
"toc-item",
|
|
21
20
|
{
|
|
22
|
-
active:
|
|
23
|
-
|
|
24
|
-
`#${decodeURIComponent(
|
|
21
|
+
active: I(
|
|
22
|
+
l,
|
|
23
|
+
`#${decodeURIComponent(c.slug)}`
|
|
25
24
|
)
|
|
26
25
|
}
|
|
27
26
|
],
|
|
28
|
-
onClick: (
|
|
27
|
+
onClick: (r) => y(r, c.slug)
|
|
29
28
|
},
|
|
30
|
-
|
|
29
|
+
k(c)
|
|
31
30
|
),
|
|
32
|
-
|
|
31
|
+
a(c.children, e - 1, l)
|
|
33
32
|
])
|
|
34
33
|
) : null;
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
function y(t, e) {
|
|
35
|
+
t.preventDefault(), h(`[id="${e}"]`);
|
|
37
36
|
}
|
|
38
|
-
const
|
|
37
|
+
const A = v({
|
|
39
38
|
props: {
|
|
40
39
|
/**
|
|
41
40
|
* TOC items config
|
|
@@ -56,37 +55,37 @@ const w = g({
|
|
|
56
55
|
default: 2
|
|
57
56
|
}
|
|
58
57
|
},
|
|
59
|
-
setup(
|
|
60
|
-
const
|
|
61
|
-
|
|
58
|
+
setup(t) {
|
|
59
|
+
const e = f(), c = g().appContext.config.globalProperties.$router, r = T(() => c.currentRoute.value), u = (n) => {
|
|
60
|
+
e.value?.scrollTo({ top: n, behavior: "smooth" });
|
|
62
61
|
};
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
() =>
|
|
66
|
-
(
|
|
67
|
-
if (
|
|
62
|
+
return C(() => {
|
|
63
|
+
$(
|
|
64
|
+
() => r.value.hash,
|
|
65
|
+
(n) => {
|
|
66
|
+
if (e.value) {
|
|
68
67
|
const p = document.querySelector(
|
|
69
|
-
`#toc a.toc-link[href$="${
|
|
68
|
+
`#toc a.toc-link[href$="${n}"]`
|
|
70
69
|
);
|
|
71
70
|
if (!p) return;
|
|
72
|
-
const { top:
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
const { top: i, height: d } = e.value.getBoundingClientRect(), { top: s, height: m } = p.getBoundingClientRect();
|
|
72
|
+
s < i ? u(e.value.scrollTop + s - i) : s + m > i + d && u(
|
|
73
|
+
e.value.scrollTop + s + m - i - d
|
|
75
74
|
);
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
);
|
|
79
78
|
}), () => {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
const n = t.items.length ? a(t.items, t.headerDepth, r.value) || [] : a([], t.headerDepth, r.value) || null;
|
|
80
|
+
return n ? o("div", { class: "toc-place-holder" }, [
|
|
81
|
+
o("aside", { id: "toc" }, [
|
|
82
|
+
o("div", { class: "toc-header" }, ["此页内容"]),
|
|
83
|
+
o("div", { class: "toc-wrapper", ref: e }, [n])
|
|
85
84
|
])
|
|
86
85
|
]) : null;
|
|
87
86
|
};
|
|
88
87
|
}
|
|
89
88
|
});
|
|
90
89
|
export {
|
|
91
|
-
|
|
90
|
+
A as default
|
|
92
91
|
};
|
|
@@ -106,12 +106,12 @@ const xe = ["aria-label", "aria-describedby"], we = ["id"], he = J({
|
|
|
106
106
|
), F(
|
|
107
107
|
() => d.value,
|
|
108
108
|
(n) => {
|
|
109
|
-
n && (l.boxType !== "prompt" && (e.autofocus ? C.value = P.value?.$el ?? f.value : C.value = f.value), e.zIndex = $()), l.boxType === "prompt" && (n ? T().then(() => {
|
|
109
|
+
console.log(333), n && (l.boxType !== "prompt" && (e.autofocus ? C.value = P.value?.$el ?? f.value : C.value = f.value), e.zIndex = $()), l.boxType === "prompt" && (n ? T().then(() => {
|
|
110
110
|
B.value && B.value.$el && (e.autofocus ? C.value = le() ?? f.value : C.value = f.value);
|
|
111
111
|
}) : (e.editorErrorMessage = "", e.validateError = !1));
|
|
112
112
|
}
|
|
113
113
|
), ie(async () => {
|
|
114
|
-
await T(), l.closeOnHashChange && window.addEventListener("hashchange", b);
|
|
114
|
+
await T(), console.log(444), l.closeOnHashChange && window.addEventListener("hashchange", b);
|
|
115
115
|
}), re(() => {
|
|
116
116
|
l.closeOnHashChange && window.removeEventListener("hashchange", b);
|
|
117
117
|
});
|
|
@@ -164,7 +164,7 @@ const xe = ["aria-label", "aria-describedby"], we = ["id"], he = J({
|
|
|
164
164
|
handleClose: U,
|
|
165
165
|
handleAction: r
|
|
166
166
|
}), (n, o) => (u(), y(ue, {
|
|
167
|
-
name: "fade-in-linear",
|
|
167
|
+
name: "vft-fade-in-linear",
|
|
168
168
|
onAfterLeave: o[11] || (o[11] = (s) => n.$emit("vanish"))
|
|
169
169
|
}, {
|
|
170
170
|
default: x(() => [
|
|
@@ -1,101 +1,100 @@
|
|
|
1
|
-
import { isString as g, hasOwn as
|
|
2
|
-
import { isClient as
|
|
3
|
-
import { debugWarn as
|
|
1
|
+
import { isString as g, hasOwn as m, isFunction as u, isElement as f, isObject as E, isUndefined as x } from "@vft/utils";
|
|
2
|
+
import { isClient as C } from "@vueuse/core";
|
|
3
|
+
import { debugWarn as b } from "../../utils/error.js";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
5
|
-
import { isVNode as
|
|
5
|
+
import { isVNode as p, render as h, createVNode as A } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
8
|
-
import
|
|
9
|
-
const a = /* @__PURE__ */ new Map(),
|
|
8
|
+
import O from "./message-box.vue2.js";
|
|
9
|
+
const a = /* @__PURE__ */ new Map(), T = (e) => {
|
|
10
10
|
let n = document.body;
|
|
11
|
-
return e.appendTo && (g(e.appendTo) && (n = document.querySelector(e.appendTo)), f(e.appendTo) && (n = e.appendTo), f(n) || (
|
|
11
|
+
return e.appendTo && (g(e.appendTo) && (n = document.querySelector(e.appendTo)), f(e.appendTo) && (n = e.appendTo), f(n) || (b(
|
|
12
12
|
"VftMessageBox",
|
|
13
13
|
"the appendTo option is not an HTMLElement. Falling back to document.body."
|
|
14
14
|
), n = document.body)), n;
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
T,
|
|
15
|
+
}, d = (e, n) => () => {
|
|
16
|
+
e.component?.exposed?.handleAction(n);
|
|
17
|
+
}, _ = (e, n, s = null) => {
|
|
18
|
+
const c = A(
|
|
19
|
+
O,
|
|
21
20
|
e,
|
|
22
|
-
|
|
23
|
-
default:
|
|
24
|
-
confirm:
|
|
25
|
-
cancel:
|
|
26
|
-
close:
|
|
21
|
+
u(e.message) || p(e.message) ? {
|
|
22
|
+
default: u(e.message) ? () => e.message({
|
|
23
|
+
confirm: d(c, "confirm"),
|
|
24
|
+
cancel: d(c, "cancel"),
|
|
25
|
+
close: d(c, "close")
|
|
27
26
|
}) : () => e.message
|
|
28
27
|
} : null
|
|
29
28
|
);
|
|
30
|
-
return
|
|
29
|
+
return c.appContext = s, h(c, n), T(e).appendChild(n.firstElementChild), c.component;
|
|
31
30
|
}, M = () => document.createElement("div"), w = (e, n) => {
|
|
32
|
-
const
|
|
31
|
+
const s = M();
|
|
33
32
|
e.onVanish = () => {
|
|
34
|
-
|
|
33
|
+
h(null, s), a.delete(l);
|
|
35
34
|
}, e.onAction = (t) => {
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
e.showInput ?
|
|
35
|
+
const i = a.get(l);
|
|
36
|
+
let r;
|
|
37
|
+
e.showInput ? r = { value: l.state.inputValue, action: t } : r = t, e.callback ? e.callback(r, c.proxy) : t === "cancel" || t === "close" ? e.distinguishCancelAndClose && t !== "cancel" ? i.reject("close") : i.reject("cancel") : i.resolve(r);
|
|
39
38
|
};
|
|
40
|
-
const
|
|
39
|
+
const c = _(e, s, n), l = c.exposed;
|
|
41
40
|
for (const t in e)
|
|
42
|
-
|
|
43
|
-
return
|
|
41
|
+
m(e, t) && !m(c.props, t) && (l.state[t] = e[t]);
|
|
42
|
+
return l.visible.value = !0, l;
|
|
44
43
|
};
|
|
45
|
-
function
|
|
46
|
-
if (!
|
|
47
|
-
let
|
|
48
|
-
return g(e) ||
|
|
44
|
+
function o(e, n = null) {
|
|
45
|
+
if (!C) return Promise.reject();
|
|
46
|
+
let s;
|
|
47
|
+
return g(e) || p(e) ? e = {
|
|
49
48
|
message: e
|
|
50
|
-
} :
|
|
49
|
+
} : s = e.callback, new Promise((c, l) => {
|
|
51
50
|
const t = w(
|
|
52
51
|
e,
|
|
53
|
-
n ??
|
|
52
|
+
n ?? o._context
|
|
54
53
|
);
|
|
55
54
|
a.set(t, {
|
|
56
55
|
options: e,
|
|
57
|
-
callback:
|
|
58
|
-
resolve:
|
|
59
|
-
reject:
|
|
56
|
+
callback: s,
|
|
57
|
+
resolve: c,
|
|
58
|
+
reject: l
|
|
60
59
|
});
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
|
-
const
|
|
62
|
+
const S = ["alert", "confirm", "prompt"], v = {
|
|
64
63
|
alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
|
|
65
64
|
confirm: { showCancelButton: !0 },
|
|
66
65
|
prompt: { showCancelButton: !0, showInput: !0 }
|
|
67
66
|
};
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
S.forEach((e) => {
|
|
68
|
+
o[e] = B(
|
|
70
69
|
e
|
|
71
70
|
);
|
|
72
71
|
});
|
|
73
|
-
function
|
|
74
|
-
return (n, c, l
|
|
72
|
+
function B(e) {
|
|
73
|
+
return (n, s, c, l) => {
|
|
75
74
|
let t = "";
|
|
76
|
-
return
|
|
75
|
+
return E(s) ? (c = s, t = "") : x(s) ? t = "" : t = s, o(
|
|
77
76
|
Object.assign(
|
|
78
77
|
{
|
|
79
78
|
title: t,
|
|
80
79
|
message: n,
|
|
81
80
|
type: "",
|
|
82
|
-
...
|
|
81
|
+
...v[e]
|
|
83
82
|
},
|
|
84
|
-
|
|
83
|
+
c,
|
|
85
84
|
{
|
|
86
85
|
boxType: e
|
|
87
86
|
}
|
|
88
87
|
),
|
|
89
|
-
|
|
88
|
+
l
|
|
90
89
|
);
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
|
-
|
|
92
|
+
o.close = () => {
|
|
94
93
|
a.forEach((e, n) => {
|
|
95
94
|
n.doClose();
|
|
96
95
|
}), a.clear();
|
|
97
96
|
};
|
|
98
|
-
|
|
97
|
+
o._context = null;
|
|
99
98
|
export {
|
|
100
|
-
|
|
99
|
+
o as default
|
|
101
100
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as O, computed as e, openBlock as n, createBlock as s, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as i, mergeProps as c, createTextVNode as l, toDisplayString as p, createCommentVNode as f, renderSlot as B } from "vue";
|
|
2
2
|
import { VftRow as g } from "../row/index.js";
|
|
3
|
-
import { VftButton as
|
|
3
|
+
import { VftButton as b } from "../button/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "@vft/utils";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -10,8 +10,7 @@ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
|
10
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
|
|
14
|
-
const q = /* @__PURE__ */ w({
|
|
13
|
+
const A = /* @__PURE__ */ O({
|
|
15
14
|
__name: "modal-footer-action",
|
|
16
15
|
props: {
|
|
17
16
|
showSubmitButton: { type: Boolean },
|
|
@@ -21,41 +20,41 @@ const q = /* @__PURE__ */ w({
|
|
|
21
20
|
actionRowOptions: {}
|
|
22
21
|
},
|
|
23
22
|
setup(t) {
|
|
24
|
-
const
|
|
23
|
+
const a = h("form-action"), d = e(() => ({
|
|
25
24
|
justify: "end",
|
|
26
25
|
...t.actionRowOptions
|
|
27
|
-
})),
|
|
28
|
-
() => Object.assign({ btnText:
|
|
29
|
-
),
|
|
30
|
-
() => Object.assign({ btnText:
|
|
26
|
+
})), r = e(
|
|
27
|
+
() => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
|
|
28
|
+
), u = e(
|
|
29
|
+
() => Object.assign({ btnText: "取消" }, t.cancelButtonOptions)
|
|
31
30
|
);
|
|
32
|
-
return (
|
|
33
|
-
default:
|
|
34
|
-
t.showCancelButton ? (n(), s(o(
|
|
35
|
-
class: o(
|
|
31
|
+
return (m, v) => (n(), s(o(g), w(y(d.value)), {
|
|
32
|
+
default: i(() => [
|
|
33
|
+
t.showCancelButton ? (n(), s(o(b), c({ key: 0 }, u.value, {
|
|
34
|
+
class: o(a).e("cancel")
|
|
36
35
|
}), {
|
|
37
|
-
default:
|
|
38
|
-
p(
|
|
36
|
+
default: i(() => [
|
|
37
|
+
l(p(u.value.btnText), 1)
|
|
39
38
|
]),
|
|
40
39
|
_: 1
|
|
41
|
-
}, 16, ["class"])) :
|
|
42
|
-
|
|
43
|
-
t.showSubmitButton ? (n(), s(o(
|
|
40
|
+
}, 16, ["class"])) : f("", !0),
|
|
41
|
+
B(m.$slots, "submitBefore"),
|
|
42
|
+
t.showSubmitButton ? (n(), s(o(b), c({
|
|
44
43
|
key: 1,
|
|
45
44
|
type: "primary",
|
|
46
|
-
class: o(
|
|
47
|
-
},
|
|
48
|
-
default:
|
|
49
|
-
p(
|
|
45
|
+
class: o(a).e("submit")
|
|
46
|
+
}, r.value), {
|
|
47
|
+
default: i(() => [
|
|
48
|
+
l(p(r.value.btnText), 1)
|
|
50
49
|
]),
|
|
51
50
|
_: 1
|
|
52
|
-
}, 16, ["class"])) :
|
|
53
|
-
|
|
51
|
+
}, 16, ["class"])) : f("", !0),
|
|
52
|
+
B(m.$slots, "submitAfter")
|
|
54
53
|
]),
|
|
55
54
|
_: 3
|
|
56
55
|
}, 16));
|
|
57
56
|
}
|
|
58
57
|
});
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
A as default
|
|
61
60
|
};
|
|
@@ -7,11 +7,11 @@ import { addUnit as o } from "../../utils/helper.js";
|
|
|
7
7
|
import { generateCssVars as M } from "../../utils/ns-cover.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "../form/index.js";
|
|
10
|
-
import { useNamespace as
|
|
10
|
+
import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
import { useRouterHelper as
|
|
14
|
+
import { useRouterHelper as ie, getRouterKeyPath as b, listenerRouteChange as re } from "@vft/router";
|
|
15
15
|
import { useMultipleTabStore as se, isTabPinned as $, useTabs as ue } from "@vft/store";
|
|
16
16
|
import { useRefs as ce } from "@vft/use";
|
|
17
17
|
import fe from "hotkeys-js";
|
|
@@ -19,10 +19,9 @@ import { onBeforeRouteLeave as me } from "vue-router";
|
|
|
19
19
|
import de from "./tab-content.vue2.js";
|
|
20
20
|
import { initAffixTabs as ve, useTabsDrag as he } from "./use/use-multiple-tabs.js";
|
|
21
21
|
import "../context-menu/context-menu.vue2.js";
|
|
22
|
-
import "../../locale/use-locale.js";
|
|
23
22
|
const be = B({
|
|
24
23
|
name: "vft-multiple-tabs"
|
|
25
|
-
}),
|
|
24
|
+
}), ze = /* @__PURE__ */ B({
|
|
26
25
|
...be,
|
|
27
26
|
props: {
|
|
28
27
|
tabsStyle: {},
|
|
@@ -33,15 +32,15 @@ const be = B({
|
|
|
33
32
|
fixExtraScrollWidth: {}
|
|
34
33
|
},
|
|
35
34
|
setup(u) {
|
|
36
|
-
const R =
|
|
37
|
-
() =>
|
|
35
|
+
const R = le("multiple-tabs"), s = q().appContext.config.globalProperties.$router, I = ve(s), l = se(), f = d(
|
|
36
|
+
() => l.getTabList.filter((e) => !e.meta?.hideTab && $(e)).length
|
|
38
37
|
), L = d(
|
|
39
38
|
() => Math.max(u.fixTabCount, f.value)
|
|
40
|
-
), r = v(""),
|
|
39
|
+
), r = v(""), i = v(0), p = v(), { go: C } = ie(s), m = d(() => l.getTabList.filter((e) => !e.meta?.hideTab));
|
|
41
40
|
G(() => {
|
|
42
41
|
if (r.value) {
|
|
43
42
|
const e = m.value.findIndex((n) => b(n) === r.value);
|
|
44
|
-
e === -1 ?
|
|
43
|
+
e === -1 ? i.value = m.value?.length - 1 : i.value = e, i.value = i.value < f.value ? f.value - 1 : i.value;
|
|
45
44
|
}
|
|
46
45
|
}), oe && me(() => {
|
|
47
46
|
p.value = t(s.currentRoute);
|
|
@@ -51,13 +50,13 @@ const be = B({
|
|
|
51
50
|
const { meta: n = {} } = e, { currentActivePath: a, hideTab: c } = n, W = c ? a : null, S = b(e);
|
|
52
51
|
if (r.value !== S && (r.value = S), W) {
|
|
53
52
|
const k = s.getRoutes().find((j) => j.path === a);
|
|
54
|
-
k &&
|
|
53
|
+
k && l.addTab(
|
|
55
54
|
k,
|
|
56
55
|
t(p),
|
|
57
|
-
|
|
56
|
+
i.value,
|
|
58
57
|
e
|
|
59
58
|
);
|
|
60
|
-
} else c ||
|
|
59
|
+
} else c || l.addTab(t(e), t(p), i.value);
|
|
61
60
|
});
|
|
62
61
|
function N(e) {
|
|
63
62
|
if (r.value === e.paneName)
|
|
@@ -68,7 +67,7 @@ const be = B({
|
|
|
68
67
|
C(a || n.fullPath || n.path);
|
|
69
68
|
}
|
|
70
69
|
function _(e) {
|
|
71
|
-
|
|
70
|
+
l.closeTabByKey(e, s);
|
|
72
71
|
}
|
|
73
72
|
const { refs: E, setRefs: F } = ce();
|
|
74
73
|
function A(e) {
|
|
@@ -101,11 +100,11 @@ const be = B({
|
|
|
101
100
|
),
|
|
102
101
|
...u.contextMenuStyle
|
|
103
102
|
}, K = () => {
|
|
104
|
-
|
|
103
|
+
l.toggleFullScreen(l.getTabList[i.value], s);
|
|
105
104
|
}, x = v(!1);
|
|
106
105
|
let y;
|
|
107
106
|
const U = () => {
|
|
108
|
-
clearInterval(y), x.value = !0,
|
|
107
|
+
clearInterval(y), x.value = !0, l.refreshPage(0, s, l.getTabList[i.value]), y = setTimeout(() => {
|
|
109
108
|
x.value = !1;
|
|
110
109
|
}, 500);
|
|
111
110
|
};
|
|
@@ -162,7 +161,7 @@ const be = B({
|
|
|
162
161
|
}, null, 8, ["rotate"]),
|
|
163
162
|
h(t(w), {
|
|
164
163
|
onClick: K,
|
|
165
|
-
icon: t(
|
|
164
|
+
icon: t(l).isFullScreen ? "icon-collapse" : "icon-expand",
|
|
166
165
|
pointer: ""
|
|
167
166
|
}, null, 8, ["icon"])
|
|
168
167
|
], 2)
|
|
@@ -175,5 +174,5 @@ const be = B({
|
|
|
175
174
|
}
|
|
176
175
|
});
|
|
177
176
|
export {
|
|
178
|
-
|
|
177
|
+
ze as default
|
|
179
178
|
};
|
|
@@ -1,114 +1,113 @@
|
|
|
1
|
-
import { getRouterKeyPath as
|
|
2
|
-
import { useMultipleTabStore as S, useTabs as O, isTabPinned as
|
|
1
|
+
import { getRouterKeyPath as a } from "@vft/router";
|
|
2
|
+
import { useMultipleTabStore as S, useTabs as O, isTabPinned as U } from "@vft/store";
|
|
3
3
|
import "@vft/utils";
|
|
4
|
-
import { reactive as
|
|
4
|
+
import { reactive as q, computed as y } from "vue";
|
|
5
5
|
import "../../context-menu/context-menu.vue2.js";
|
|
6
6
|
import "../../icon/index.js";
|
|
7
|
-
import y from "../../../locale/use-locale.js";
|
|
8
7
|
import "vue-router";
|
|
9
|
-
function
|
|
10
|
-
const
|
|
8
|
+
function F(e, o) {
|
|
9
|
+
const s = q({
|
|
11
10
|
current: null,
|
|
12
11
|
currentIndex: 0
|
|
13
|
-
}),
|
|
14
|
-
refreshPage:
|
|
15
|
-
closeAll:
|
|
16
|
-
close:
|
|
17
|
-
closeLeft:
|
|
18
|
-
closeOther:
|
|
19
|
-
closeRight:
|
|
20
|
-
newWinTab:
|
|
21
|
-
fullScreen:
|
|
22
|
-
alonePage:
|
|
23
|
-
pinTab:
|
|
24
|
-
unpinTab:
|
|
25
|
-
} = O(), D =
|
|
12
|
+
}), n = S(), {
|
|
13
|
+
refreshPage: g,
|
|
14
|
+
closeAll: u,
|
|
15
|
+
close: h,
|
|
16
|
+
closeLeft: p,
|
|
17
|
+
closeOther: f,
|
|
18
|
+
closeRight: x,
|
|
19
|
+
newWinTab: b,
|
|
20
|
+
fullScreen: T,
|
|
21
|
+
alonePage: C,
|
|
22
|
+
pinTab: L,
|
|
23
|
+
unpinTab: v
|
|
24
|
+
} = O(), D = y(() => {
|
|
26
25
|
if (!e)
|
|
27
26
|
return;
|
|
28
|
-
const { meta:
|
|
27
|
+
const { meta: i } = e, t = s.currentIndex, r = U(e), c = !r, l = !!i?.userPinned, w = t === 0 || t <= o, M = n.getTabList.length <= o || t === n.getTabList.length - 1 && n.getLastDragEndIndex >= 0, R = n.getTabList.length === o || n.getTabList.length === o + 1 && t === o, d = n.getTabList.length === o;
|
|
29
28
|
return [
|
|
30
29
|
{
|
|
31
30
|
iconCfg: { icon: "icon-refresh-right" },
|
|
32
|
-
text:
|
|
33
|
-
handler: () =>
|
|
31
|
+
text: "刷新",
|
|
32
|
+
handler: () => g(e)
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
35
|
iconCfg: { icon: "icon-new-tab" },
|
|
37
|
-
text:
|
|
38
|
-
handler: () =>
|
|
36
|
+
text: "新页面打开",
|
|
37
|
+
handler: () => b(e),
|
|
39
38
|
divider: !0
|
|
40
39
|
},
|
|
41
40
|
{
|
|
42
41
|
iconCfg: { icon: "icon-close-tab" },
|
|
43
|
-
text:
|
|
42
|
+
text: "关闭标签页",
|
|
44
43
|
disabled: r || d,
|
|
45
|
-
handler: () =>
|
|
44
|
+
handler: () => h(e)
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
47
|
iconCfg: { icon: "icon-arrow-close-left" },
|
|
49
|
-
text:
|
|
50
|
-
disabled:
|
|
51
|
-
handler: () =>
|
|
48
|
+
text: "关闭左侧标签页",
|
|
49
|
+
disabled: w,
|
|
50
|
+
handler: () => p(e)
|
|
52
51
|
},
|
|
53
52
|
{
|
|
54
53
|
iconCfg: { icon: "icon-arrow-close-right" },
|
|
55
|
-
text:
|
|
54
|
+
text: "关闭右侧标签页",
|
|
56
55
|
disabled: M,
|
|
57
56
|
divider: !0,
|
|
58
|
-
handler: () =>
|
|
57
|
+
handler: () => x(e)
|
|
59
58
|
},
|
|
60
59
|
{
|
|
61
60
|
iconCfg: { icon: "icon-close-box-multiple-outline" },
|
|
62
|
-
text:
|
|
61
|
+
text: "关闭其它标签页",
|
|
63
62
|
disabled: R,
|
|
64
|
-
handler: () =>
|
|
63
|
+
handler: () => f(e)
|
|
65
64
|
},
|
|
66
65
|
{
|
|
67
66
|
iconCfg: { icon: "icon-vector-square-delete" },
|
|
68
|
-
text:
|
|
67
|
+
text: "关闭所有标签页",
|
|
69
68
|
disabled: d,
|
|
70
69
|
divider: !0,
|
|
71
|
-
handler: () =>
|
|
70
|
+
handler: () => u()
|
|
72
71
|
},
|
|
73
72
|
{
|
|
74
73
|
iconCfg: { icon: "icon-full-screen" },
|
|
75
|
-
text:
|
|
76
|
-
handler: () =>
|
|
74
|
+
text: "全屏",
|
|
75
|
+
handler: () => T(e)
|
|
77
76
|
},
|
|
78
77
|
{
|
|
79
78
|
iconCfg: { icon: "icon-separate" },
|
|
80
|
-
text:
|
|
81
|
-
handler: () =>
|
|
82
|
-
divider: c ||
|
|
79
|
+
text: "独立页面",
|
|
80
|
+
handler: () => C(e),
|
|
81
|
+
divider: c || l
|
|
83
82
|
},
|
|
84
83
|
...c ? [
|
|
85
84
|
{
|
|
86
85
|
iconCfg: { icon: "icon-tab-pin" },
|
|
87
|
-
text:
|
|
88
|
-
handler: () =>
|
|
86
|
+
text: "固定",
|
|
87
|
+
handler: () => L(e)
|
|
89
88
|
}
|
|
90
|
-
] :
|
|
89
|
+
] : l ? [
|
|
91
90
|
{
|
|
92
91
|
iconCfg: { icon: "icon-tab-unpin" },
|
|
93
|
-
text:
|
|
94
|
-
handler: () =>
|
|
92
|
+
text: "取消固定",
|
|
93
|
+
handler: () => v(e)
|
|
95
94
|
}
|
|
96
95
|
] : []
|
|
97
96
|
];
|
|
98
97
|
});
|
|
99
|
-
function
|
|
100
|
-
return (
|
|
101
|
-
if (!
|
|
98
|
+
function P(i) {
|
|
99
|
+
return (t) => {
|
|
100
|
+
if (!i)
|
|
102
101
|
return;
|
|
103
|
-
|
|
104
|
-
const r =
|
|
105
|
-
(c) =>
|
|
102
|
+
t?.preventDefault();
|
|
103
|
+
const r = n.getTabList.findIndex(
|
|
104
|
+
(c) => a(c) === a(i)
|
|
106
105
|
);
|
|
107
|
-
s.current =
|
|
106
|
+
s.current = i, s.currentIndex = r;
|
|
108
107
|
};
|
|
109
108
|
}
|
|
110
|
-
return { getDropMenuList: D, handleContextMenu:
|
|
109
|
+
return { getDropMenuList: D, handleContextMenu: P };
|
|
111
110
|
}
|
|
112
111
|
export {
|
|
113
|
-
|
|
112
|
+
F as useTabDropdown
|
|
114
113
|
};
|