vft 0.0.477 → 0.0.479
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/carousel/use-carousel.js +1 -1
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/icon-text/icon-text.vue2.js +13 -13
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/md-container/index.d.ts +9 -0
- package/es/components/md-container/md-container.vue.d.ts +2 -0
- package/es/components/md-container/md-container.vue2.js +75 -74
- package/es/components/md-container/toc.js +5 -5
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/index.d.ts +9 -0
- package/lib/components/md-container/md-container.vue.d.ts +2 -0
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/theme-style/index.css +1 -1
- package/theme-style/src/loading.scss +0 -2
- package/theme-style/src/md-comment.scss +2 -0
- package/theme-style/src/md-container.scss +2 -2
- package/theme-style/vft-loading.css +1 -1
- package/theme-style/vft-md-comment.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/web-types.json +1 -1
|
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
11
11
|
import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
import {
|
|
14
|
+
import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
|
|
15
15
|
const L = 300, ze = (t, O, M) => {
|
|
16
16
|
const {
|
|
17
17
|
children: o,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keysOf as f } from "@vft/utils";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import { debugWarn as v } from "../../../utils/error.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../../form/index.js";
|
|
7
7
|
import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
|
|
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
|
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
|
|
11
11
|
import { configProviderContextKey as m } from "../constants.js";
|
|
12
|
-
const a =
|
|
12
|
+
const a = C();
|
|
13
13
|
function d(o, e = void 0) {
|
|
14
14
|
const n = l() ? x(m, a) : a;
|
|
15
15
|
return o ? i(() => n?.value?.[o] ?? e) : n;
|
|
@@ -27,7 +27,7 @@ function B(o) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const S = (o, e, n = !1) => {
|
|
30
|
-
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ?
|
|
30
|
+
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
|
|
31
31
|
if (!u) {
|
|
32
32
|
v(
|
|
33
33
|
"provideGlobalConfig",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as C, computed as o, createElementBlock as f, openBlock as l, normalizeStyle as k, normalizeClass as S, unref as r, createBlock as
|
|
1
|
+
import { defineComponent as C, computed as o, createElementBlock as f, openBlock as l, normalizeStyle as k, normalizeClass as S, unref as r, createBlock as c, createCommentVNode as y, mergeProps as s, normalizeProps as b, toDisplayString as I } from "vue";
|
|
2
2
|
import { VftClampTooltip as w } from "../clamp-tooltip/index.js";
|
|
3
3
|
import { VftIcon as h } from "../icon/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
@@ -33,21 +33,21 @@ const j = { key: 2 }, N = C({
|
|
|
33
33
|
useClamp: { type: Boolean }
|
|
34
34
|
},
|
|
35
35
|
setup(e) {
|
|
36
|
-
const
|
|
36
|
+
const u = V("icon-text"), i = o(() => e.hoverColor || e.color), n = o(() => H(e.icon, "icon", { size: e.size, color: e.color })), m = o(() => e.direction === "col"), v = o(() => {
|
|
37
37
|
const t = g(e.distance);
|
|
38
|
-
return
|
|
39
|
-
}), a = o(() => L(e.size)),
|
|
38
|
+
return m.value ? e.reverse ? { marginTop: t } : { marginBottom: t } : e.reverse ? { marginLeft: t } : { marginRight: t };
|
|
39
|
+
}), a = o(() => L(e.size)), d = o(() => a.value < 12), x = o(() => a.value && d.value ? { transform: `scale(${a.value / 12})` } : {}), z = o(() => {
|
|
40
40
|
const t = O(
|
|
41
41
|
{
|
|
42
42
|
cursor: e.pointer ? "pointer" : void 0,
|
|
43
43
|
color: e.color,
|
|
44
44
|
"hover-color": e.hoverColor ? i.value : void 0,
|
|
45
|
-
fontSize:
|
|
45
|
+
fontSize: g(e.size)
|
|
46
46
|
},
|
|
47
47
|
"icon-text"
|
|
48
48
|
);
|
|
49
49
|
return {
|
|
50
|
-
...
|
|
50
|
+
...d.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
|
|
51
51
|
...t,
|
|
52
52
|
...x.value
|
|
53
53
|
};
|
|
@@ -59,19 +59,19 @@ const j = { key: 2 }, N = C({
|
|
|
59
59
|
}));
|
|
60
60
|
return (t, T) => (l(), f("span", {
|
|
61
61
|
class: S([
|
|
62
|
-
r(
|
|
63
|
-
r(
|
|
62
|
+
r(u).b(),
|
|
63
|
+
r(u).is("col", m.value),
|
|
64
64
|
{ "disable-icon-hover": e.disableIconHover }
|
|
65
65
|
]),
|
|
66
66
|
style: k(z.value)
|
|
67
67
|
}, [
|
|
68
|
-
!e.reverse && n.value?.icon ? (l(),
|
|
68
|
+
!e.reverse && n.value?.icon ? (l(), c(r(h), s({ key: 0 }, n.value, {
|
|
69
69
|
"hover-color": e.hoverColor && !e.disableIconHover ? i.value : void 0,
|
|
70
|
-
style:
|
|
70
|
+
style: v.value
|
|
71
71
|
}), null, 16, ["hover-color", "style"])) : y("", !0),
|
|
72
|
-
e.useClamp ? (l(),
|
|
73
|
-
e.reverse && n.value?.icon ? (l(),
|
|
74
|
-
style:
|
|
72
|
+
e.useClamp ? (l(), c(r(w), b(s({ key: 1 }, B.value)), null, 16)) : (l(), f("span", j, I(e.text), 1)),
|
|
73
|
+
e.reverse && n.value?.icon ? (l(), c(r(h), s({ key: 3 }, n.value, {
|
|
74
|
+
style: v.value,
|
|
75
75
|
"hover-color": e.hoverColor && !e.disableIconHover ? i.value : void 0
|
|
76
76
|
}), null, 16, ["style", "hover-color"])) : y("", !0)
|
|
77
77
|
], 6));
|
|
@@ -13,8 +13,8 @@ import "../../hooks/use-z-index/index.js";
|
|
|
13
13
|
import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
|
|
14
14
|
import { useAttrs as Ze, useCursor as _e } from "@vft/use";
|
|
15
15
|
import { calcTextareaHeight as he } from "./utils.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
|
|
17
|
+
import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.js";
|
|
18
18
|
const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
|
|
19
19
|
__name: "input",
|
|
20
20
|
props: {
|
|
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
85
85
|
n.is("focus", v.value)
|
|
86
86
|
]), d = Ze({
|
|
87
87
|
excludeKeys: l(() => Object.keys(X.value))
|
|
88
|
-
}), { form: Ce, formItem: F } =
|
|
88
|
+
}), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = et(), x = tt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
|
|
91
91
|
icon: "icon-circle-close",
|
|
92
92
|
size: 16
|
|
93
93
|
})), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
|
|
2
2
|
import { EVENT_CODE as g } from "../../../constants/aria.js";
|
|
3
|
-
import { CHANGE_EVENT as i,
|
|
3
|
+
import { CHANGE_EVENT as i, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import { isUndefined as K } from "@vft/utils";
|
|
6
6
|
import { debugWarn as C } from "../../../utils/error.js";
|
|
@@ -6,6 +6,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
6
6
|
scrollDom: {
|
|
7
7
|
type: import("vue").PropType<string>;
|
|
8
8
|
};
|
|
9
|
+
showComment: {
|
|
10
|
+
type: import("vue").PropType<boolean>;
|
|
11
|
+
};
|
|
9
12
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
10
13
|
P: {};
|
|
11
14
|
B: {};
|
|
@@ -20,6 +23,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
20
23
|
scrollDom: {
|
|
21
24
|
type: import("vue").PropType<string>;
|
|
22
25
|
};
|
|
26
|
+
showComment: {
|
|
27
|
+
type: import("vue").PropType<boolean>;
|
|
28
|
+
};
|
|
23
29
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
24
30
|
__isFragment?: never;
|
|
25
31
|
__isTeleport?: never;
|
|
@@ -31,6 +37,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
31
37
|
scrollDom: {
|
|
32
38
|
type: import("vue").PropType<string>;
|
|
33
39
|
};
|
|
40
|
+
showComment: {
|
|
41
|
+
type: import("vue").PropType<boolean>;
|
|
42
|
+
};
|
|
34
43
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
35
44
|
$slots: {
|
|
36
45
|
default?(_: {}): any;
|
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, getCurrentInstance as $, ref as N, computed as x, onMounted as A, nextTick as P, onDeactivated as q, onBeforeMount as z, createElementBlock as u, openBlock as r, normalizeClass as c, unref as e, createBlock as f, createCommentVNode as p, createElementVNode as l, toDisplayString as k, createVNode as g, Fragment as B, renderList as I, withCtx as O, createTextVNode as F, renderSlot as H } from "vue";
|
|
2
2
|
import { VftIcon as b } from "../icon/index.js";
|
|
3
|
-
import { VftIconText as
|
|
3
|
+
import { VftIconText as J } from "../icon-text/index.js";
|
|
4
4
|
import { VftMdComment as j } from "../md-comment/index.js";
|
|
5
5
|
import { VftSideMenu as U } from "../side-menu/index.js";
|
|
6
6
|
import { VftTag as Y } from "../tag/index.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
|
-
import { handleScrollPosition as G, jumpElement as
|
|
8
|
+
import { handleScrollPosition as G, getAdaptiveOffset as K, jumpElement as D, getRandomElementForArr as Q, isClient as W } from "@vft/utils";
|
|
9
9
|
import "../config-provider/hooks/use-global-config.js";
|
|
10
|
-
import { primaryColor as
|
|
11
|
-
import { debounce as
|
|
10
|
+
import { primaryColor as X } from "../../utils/ns-cover.js";
|
|
11
|
+
import { debounce as Z } from "lodash-es";
|
|
12
12
|
import "../form/index.js";
|
|
13
|
-
import { useNamespace as
|
|
13
|
+
import { useNamespace as ee } from "../../hooks/use-namespace/index.js";
|
|
14
14
|
import "../../hooks/use-model-toggle/index.js";
|
|
15
15
|
import "@popperjs/core";
|
|
16
16
|
import "../../hooks/use-z-index/index.js";
|
|
17
|
-
import { useRouterHelper as
|
|
18
|
-
import { useEventListener as
|
|
19
|
-
import { usePhotoSwipe as
|
|
20
|
-
import { formatToDateTime as
|
|
17
|
+
import { useRouterHelper as te } from "@vft/router";
|
|
18
|
+
import { useEventListener as oe } from "@vft/use";
|
|
19
|
+
import { usePhotoSwipe as ne } from "@vft/use/photoswipe";
|
|
20
|
+
import { formatToDateTime as ie, getDayTimestamp as le } from "@vft/utils/date";
|
|
21
21
|
import { useCopyCode as ae } from "./use/useCopyCode.js";
|
|
22
|
-
import { COMP_TYPE as
|
|
23
|
-
const re = { class: "info-container" },
|
|
22
|
+
import { COMP_TYPE as se } from "./utils.js";
|
|
23
|
+
const re = { class: "info-container" }, ce = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "left"
|
|
26
|
-
},
|
|
26
|
+
}, me = { class: "infos" }, de = {
|
|
27
27
|
class: "reading",
|
|
28
28
|
title: "阅读量"
|
|
29
|
-
}, ue = ["data-path"],
|
|
29
|
+
}, ue = ["data-path"], fe = S({
|
|
30
30
|
name: "vft-md-container"
|
|
31
|
-
}), qe = /* @__PURE__ */
|
|
32
|
-
...
|
|
31
|
+
}), qe = /* @__PURE__ */ S({
|
|
32
|
+
...fe,
|
|
33
33
|
props: {
|
|
34
34
|
tocList: {},
|
|
35
|
-
scrollDom: { default: ".layout-content" }
|
|
35
|
+
scrollDom: { default: ".layout-content" },
|
|
36
|
+
showComment: { type: Boolean, default: !0 }
|
|
36
37
|
},
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
38
|
+
setup(a) {
|
|
39
|
+
const s = ee("md-container"), T = $(), m = N(), d = x(() => a.tocList && a.tocList !== "undefined" ? JSON.parse(a.tocList) : ""), { initPhotoSwipe: w } = ne(`.${s.e("content")} img`);
|
|
40
|
+
w(), ae();
|
|
41
|
+
const h = T.appContext.config.globalProperties.$router, n = h.currentRoute.value, L = X(), V = W ? location.pathname : "", { go: _ } = te(h);
|
|
41
42
|
function E(o) {
|
|
42
|
-
|
|
43
|
+
_(`/?classify=${o}`);
|
|
43
44
|
}
|
|
44
|
-
const M =
|
|
45
|
+
const M = x(() => n.meta.category?.includes("api")), v = Z(
|
|
45
46
|
() => G({
|
|
46
|
-
scrollDom:
|
|
47
|
+
scrollDom: a.scrollDom,
|
|
47
48
|
contentDom: ".header-anchor",
|
|
48
49
|
selectAttrName: "href",
|
|
49
|
-
offset:
|
|
50
|
+
offset: K(210, 1920, 1500, 1920),
|
|
50
51
|
callback: (o) => {
|
|
51
|
-
|
|
52
|
+
m.value?.menuRef && (m.value.menuRef.activeIndex = o.slice(1));
|
|
52
53
|
}
|
|
53
54
|
}),
|
|
54
55
|
100
|
|
55
|
-
),
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
const o = document.querySelector(
|
|
59
|
-
o && o.removeEventListener("scroll",
|
|
56
|
+
), y = (o) => {
|
|
57
|
+
D(`[id="${o.index}"]`, a.scrollDom, 120);
|
|
58
|
+
}, C = () => {
|
|
59
|
+
const o = document.querySelector(a.scrollDom);
|
|
60
|
+
o && o.removeEventListener("scroll", v);
|
|
60
61
|
};
|
|
61
|
-
return
|
|
62
|
-
|
|
62
|
+
return A(() => {
|
|
63
|
+
P(() => {
|
|
63
64
|
setTimeout(() => {
|
|
64
|
-
|
|
65
|
+
n.hash && D(`[id="${encodeURI(n.hash).slice(1)}"]`);
|
|
65
66
|
}), setTimeout(() => {
|
|
66
67
|
const t = document.querySelector(".layout-content");
|
|
67
|
-
t && t.addEventListener("scroll",
|
|
68
|
+
t && t.addEventListener("scroll", v);
|
|
68
69
|
}, 1500);
|
|
69
|
-
const o = document.querySelectorAll(".item.expand"),
|
|
70
|
+
const o = document.querySelectorAll(".item.expand"), i = document.querySelectorAll(
|
|
70
71
|
"div.language-vue"
|
|
71
72
|
);
|
|
72
73
|
for (let t = 0; t < o.length; t++)
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
oe(o[t], "click", () => {
|
|
75
|
+
i[t].offsetHeight === 0 ? (i[t].style.height = "auto", i[t].style.visibility = "visible") : (i[t].style.height = "0px", i[t].style.visibility = "hidden");
|
|
75
76
|
});
|
|
76
77
|
});
|
|
78
|
+
}), q(() => {
|
|
79
|
+
C();
|
|
77
80
|
}), z(() => {
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
}), (o, n) => (s(), f("div", {
|
|
82
|
-
class: c([e(l).b(), e(l).is("api", M.value)])
|
|
81
|
+
C();
|
|
82
|
+
}), (o, i) => (r(), u("div", {
|
|
83
|
+
class: c([e(s).b(), e(s).is("api", M.value)])
|
|
83
84
|
}, [
|
|
84
|
-
d.value?.length ? (
|
|
85
|
+
d.value?.length ? (r(), f(e(U), {
|
|
85
86
|
key: 0,
|
|
86
87
|
ref_key: "sideMenuRef",
|
|
87
|
-
ref:
|
|
88
|
+
ref: m,
|
|
88
89
|
"default-active": d.value[0].slug,
|
|
89
90
|
class: "toc-side-menu",
|
|
90
91
|
menus: d.value,
|
|
@@ -95,53 +96,53 @@ const re = { class: "info-container" }, se = {
|
|
|
95
96
|
"attr-mapping": {
|
|
96
97
|
index: "slug"
|
|
97
98
|
},
|
|
98
|
-
onSelect:
|
|
99
|
-
onSubMenuClick:
|
|
100
|
-
}, null, 8, ["default-active", "menus"])) :
|
|
101
|
-
|
|
102
|
-
class: c(e(
|
|
99
|
+
onSelect: y,
|
|
100
|
+
onSubMenuClick: y
|
|
101
|
+
}, null, 8, ["default-active", "menus"])) : p("", !0),
|
|
102
|
+
l("div", {
|
|
103
|
+
class: c(e(s).e("header"))
|
|
103
104
|
}, [
|
|
104
|
-
|
|
105
|
-
class: c(e(
|
|
106
|
-
}, k(e(
|
|
107
|
-
|
|
108
|
-
e(
|
|
109
|
-
|
|
105
|
+
l("h1", {
|
|
106
|
+
class: c(e(s).e("title"))
|
|
107
|
+
}, k(e(n).meta?.title), 3),
|
|
108
|
+
l("div", re, [
|
|
109
|
+
e(n).meta?.category?.length ? (r(), u("div", ce, [
|
|
110
|
+
g(e(b), {
|
|
110
111
|
size: 14,
|
|
111
112
|
color: e(L),
|
|
112
113
|
icon: "icon-category"
|
|
113
114
|
}, null, 8, ["color"]),
|
|
114
|
-
(
|
|
115
|
+
(r(!0), u(B, null, I(e(n).meta?.category, (t, R) => (r(), f(e(Y), {
|
|
115
116
|
size: "small",
|
|
116
117
|
class: "tag",
|
|
117
|
-
type: e(
|
|
118
|
+
type: e(Q)(e(se), 1)[0],
|
|
118
119
|
key: R,
|
|
119
|
-
onClick: (
|
|
120
|
+
onClick: (pe) => E(t)
|
|
120
121
|
}, {
|
|
121
|
-
default:
|
|
122
|
-
|
|
122
|
+
default: O(() => [
|
|
123
|
+
F(k(t), 1)
|
|
123
124
|
]),
|
|
124
125
|
_: 2
|
|
125
126
|
}, 1032, ["type", "onClick"]))), 128))
|
|
126
|
-
])) :
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
])) : p("", !0),
|
|
128
|
+
l("div", me, [
|
|
129
|
+
g(e(J), {
|
|
129
130
|
title: "发布时间",
|
|
130
131
|
icon: "icon-date",
|
|
131
132
|
size: 12,
|
|
132
133
|
class: "mr-10px",
|
|
133
134
|
distance: 5,
|
|
134
|
-
text: e(
|
|
135
|
-
(e(
|
|
135
|
+
text: e(ie)(
|
|
136
|
+
(e(n).meta?.date ? new Date(e(n).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(le)()
|
|
136
137
|
)
|
|
137
138
|
}, null, 8, ["text"]),
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
l("div", de, [
|
|
140
|
+
g(e(b), {
|
|
140
141
|
icon: "icon-reading",
|
|
141
142
|
size: 14,
|
|
142
143
|
class: "mr-5px"
|
|
143
144
|
}),
|
|
144
|
-
|
|
145
|
+
l("div", {
|
|
145
146
|
class: "waline-pageview-count lh-1",
|
|
146
147
|
"data-path": e(V)
|
|
147
148
|
}, "0", 8, ue)
|
|
@@ -149,13 +150,13 @@ const re = { class: "info-container" }, se = {
|
|
|
149
150
|
])
|
|
150
151
|
])
|
|
151
152
|
], 2),
|
|
152
|
-
|
|
153
|
-
class: c(e(
|
|
153
|
+
l("div", {
|
|
154
|
+
class: c(e(s).e("content"))
|
|
154
155
|
}, [
|
|
155
|
-
|
|
156
|
+
H(o.$slots, "default")
|
|
156
157
|
], 2),
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
a.showComment ? (r(), f(e(j), { key: 1 })) : p("", !0),
|
|
159
|
+
i[0] || (i[0] = l("ins", {
|
|
159
160
|
class: "adsbygoogle",
|
|
160
161
|
style: { display: "block", "text-align": "center" },
|
|
161
162
|
"data-ad-layout": "in-article",
|
|
@@ -32,7 +32,7 @@ const k = ({ title: t, level: e, slug: l }) => o(
|
|
|
32
32
|
])
|
|
33
33
|
) : null;
|
|
34
34
|
function y(t, e) {
|
|
35
|
-
t.preventDefault(), h("
|
|
35
|
+
t.preventDefault(), h(`[id="${e}"]`);
|
|
36
36
|
}
|
|
37
37
|
const A = v({
|
|
38
38
|
props: {
|
|
@@ -68,15 +68,15 @@ const A = v({
|
|
|
68
68
|
`#toc a.toc-link[href$="${n}"]`
|
|
69
69
|
);
|
|
70
70
|
if (!p) return;
|
|
71
|
-
const { top: i, height:
|
|
72
|
-
s < i ? u(e.value.scrollTop + s - i) : s +
|
|
73
|
-
e.value.scrollTop + s +
|
|
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
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
}), () => {
|
|
79
|
-
const n = t.items.length ? a(t.items, t.headerDepth, r.value) : a([], t.headerDepth, r.value);
|
|
79
|
+
const n = t.items.length ? a(t.items, t.headerDepth, r.value) || [] : a([], t.headerDepth, r.value) || null;
|
|
80
80
|
return n ? o("div", { class: "toc-place-holder" }, [
|
|
81
81
|
o("aside", { id: "toc" }, [
|
|
82
82
|
o("div", { class: "toc-header" }, ["此页内容"]),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne,
|
|
1
|
+
import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as O, resolveComponent as N } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../avatar-stack/index.js";
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
package/es/utils/vue/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
|
|
2
2
|
import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
|
|
3
3
|
import { debugWarn as O } from "../error.js";
|
|
4
4
|
const R = "utils/vue/vnode";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../clamp-tooltip/index.cjs"),s=require("../icon/index.cjs");require("@vueuse/core");const v=require("@vft/utils"),d=require("../../utils/helper.cjs"),C=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../clamp-tooltip/index.cjs"),s=require("../icon/index.cjs");require("@vueuse/core");const v=require("@vft/utils"),d=require("../../utils/helper.cjs"),C=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const k={key:2},x=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...x,props:{text:{},icon:{},color:{},hoverColor:{},disableIconHover:{type:Boolean},distance:{default:3},reverse:{type:Boolean},size:{},direction:{default:"row"},pointer:{type:Boolean},adjustOrigin:{type:Boolean,default:!0},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const i=B.useNamespace("icon-text"),r=e.computed(()=>o.hoverColor||o.color),n=e.computed(()=>v.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),c=e.computed(()=>o.direction==="col"),a=e.computed(()=>{const t=d.addUnit(o.distance);return c.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),l=e.computed(()=>v.removeUnit(o.size)),u=e.computed(()=>l.value<12),m=e.computed(()=>l.value&&u.value?{transform:`scale(${l.value/12})`}:{}),f=e.computed(()=>{const t=C.generateCssVars({cursor:o.pointer?"pointer":void 0,color:o.color,"hover-color":o.hoverColor?r.value:void 0,fontSize:d.addUnit(o.size)},"icon-text");return{...u.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...m.value}}),y=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,g)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(i).b(),e.unref(i).is("col",c.value),{"disable-icon-hover":o.disableIconHover}]),style:e.normalizeStyle(f.value)},[!o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:0},n.value,{"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0,style:a.value}),null,16,["hover-color","style"])):e.createCommentVNode("",!0),o.useClamp?(e.openBlock(),e.createBlock(e.unref(h.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},y.value)),null,16)):(e.openBlock(),e.createElementBlock("span",k,e.toDisplayString(o.text),1)),o.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:3},n.value,{style:a.value,"hover-color":o.hoverColor&&!o.disableIconHover?r.value:void 0}),null,16,["style","hover-color"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-item.cjs"),ne=require("../form/hooks/use-form-common-props.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=te.useFormItem(),{inputId:F}=te.useFormItemInputId(se.props,{formItemContext:k}),ie=ne.useFormSize(),m=ne.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-common-props.cjs"),ne=require("../form/hooks/use-form-item.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=ne.useFormItem(),{inputId:F}=ne.useFormItemInputId(se.props,{formItemContext:k}),ie=te.useFormSize(),m=te.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|
|
@@ -6,6 +6,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
6
6
|
scrollDom: {
|
|
7
7
|
type: import("vue").PropType<string>;
|
|
8
8
|
};
|
|
9
|
+
showComment: {
|
|
10
|
+
type: import("vue").PropType<boolean>;
|
|
11
|
+
};
|
|
9
12
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
10
13
|
P: {};
|
|
11
14
|
B: {};
|
|
@@ -20,6 +23,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
20
23
|
scrollDom: {
|
|
21
24
|
type: import("vue").PropType<string>;
|
|
22
25
|
};
|
|
26
|
+
showComment: {
|
|
27
|
+
type: import("vue").PropType<boolean>;
|
|
28
|
+
};
|
|
23
29
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
24
30
|
__isFragment?: never;
|
|
25
31
|
__isTeleport?: never;
|
|
@@ -31,6 +37,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
31
37
|
scrollDom: {
|
|
32
38
|
type: import("vue").PropType<string>;
|
|
33
39
|
};
|
|
40
|
+
showComment: {
|
|
41
|
+
type: import("vue").PropType<boolean>;
|
|
42
|
+
};
|
|
34
43
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
35
44
|
$slots: {
|
|
36
45
|
default?(_: {}): any;
|