vft 0.0.431 → 0.0.434
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/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 +78 -74
- package/es/components/side-menu/use-drag-line.js +26 -31
- 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/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/side-menu/use-drag-line.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/md-container.scss +6 -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",
|
|
@@ -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";
|
|
@@ -3,6 +3,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
3
3
|
tocList: {
|
|
4
4
|
type: import("vue").PropType<string>;
|
|
5
5
|
};
|
|
6
|
+
scrollDom: {
|
|
7
|
+
type: import("vue").PropType<string>;
|
|
8
|
+
};
|
|
6
9
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
7
10
|
P: {};
|
|
8
11
|
B: {};
|
|
@@ -14,6 +17,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
14
17
|
tocList: {
|
|
15
18
|
type: import("vue").PropType<string>;
|
|
16
19
|
};
|
|
20
|
+
scrollDom: {
|
|
21
|
+
type: import("vue").PropType<string>;
|
|
22
|
+
};
|
|
17
23
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
18
24
|
__isFragment?: never;
|
|
19
25
|
__isTeleport?: never;
|
|
@@ -22,6 +28,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
22
28
|
tocList: {
|
|
23
29
|
type: import("vue").PropType<string>;
|
|
24
30
|
};
|
|
31
|
+
scrollDom: {
|
|
32
|
+
type: import("vue").PropType<string>;
|
|
33
|
+
};
|
|
25
34
|
}>> & 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 () => {
|
|
26
35
|
$slots: {
|
|
27
36
|
default?(_: {}): any;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftIcon as
|
|
3
|
-
import { VftIconText as
|
|
4
|
-
import { VftMdComment as
|
|
5
|
-
import { VftSideMenu as
|
|
6
|
-
import { VftTag as
|
|
1
|
+
import { defineComponent as S, getCurrentInstance as R, ref as $, computed as v, 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 C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as _, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
|
|
2
|
+
import { VftIcon as k } from "../icon/index.js";
|
|
3
|
+
import { VftIconText as O } from "../icon-text/index.js";
|
|
4
|
+
import { VftMdComment as j } from "../md-comment/index.js";
|
|
5
|
+
import { VftSideMenu as U } from "../side-menu/index.js";
|
|
6
|
+
import { VftTag as Y } from "../tag/index.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
|
-
import { handleScrollPosition as
|
|
8
|
+
import { handleScrollPosition as G, jumpElement as b, getRandomElementForArr as K, isClient as Q } 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 W } from "../../utils/ns-cover.js";
|
|
11
|
+
import { debounce as X } from "lodash-es";
|
|
12
12
|
import "../form/index.js";
|
|
13
|
-
import { useNamespace as
|
|
13
|
+
import { useNamespace as Z } 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
|
|
21
|
-
import { useCopyCode as
|
|
22
|
-
import { COMP_TYPE as
|
|
23
|
-
const
|
|
17
|
+
import { useRouterHelper as ee } from "@vft/router";
|
|
18
|
+
import { useEventListener as te } from "@vft/use";
|
|
19
|
+
import { usePhotoSwipe as oe } from "@vft/use/photoswipe";
|
|
20
|
+
import { formatToDateTime as ne, getDayTimestamp as ie } from "@vft/utils/date";
|
|
21
|
+
import { useCopyCode as ae } from "./use/useCopyCode.js";
|
|
22
|
+
import { COMP_TYPE as le } from "./utils.js";
|
|
23
|
+
const re = { class: "info-container" }, se = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "left"
|
|
26
|
-
},
|
|
26
|
+
}, ce = { class: "infos" }, me = {
|
|
27
27
|
class: "reading",
|
|
28
28
|
title: "阅读量"
|
|
29
|
-
},
|
|
29
|
+
}, de = ["data-path"], ue = S({
|
|
30
30
|
name: "vft-md-container"
|
|
31
|
-
}),
|
|
32
|
-
...
|
|
31
|
+
}), Pe = /* @__PURE__ */ S({
|
|
32
|
+
...ue,
|
|
33
33
|
props: {
|
|
34
|
-
tocList: {}
|
|
34
|
+
tocList: {},
|
|
35
|
+
scrollDom: { default: ".layout-content" }
|
|
35
36
|
},
|
|
36
|
-
setup(
|
|
37
|
-
const l =
|
|
38
|
-
|
|
39
|
-
const p =
|
|
40
|
-
function
|
|
41
|
-
|
|
37
|
+
setup(s) {
|
|
38
|
+
const l = Z("md-container"), T = R(), f = $(), d = v(() => s.tocList && s.tocList !== "undefined" ? JSON.parse(s.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
|
|
39
|
+
D(), ae();
|
|
40
|
+
const p = T.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
|
|
41
|
+
function E(o) {
|
|
42
|
+
w(`/?classify=${o}`);
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
-
() =>
|
|
44
|
+
const M = v(() => a.meta.category?.includes("api")), g = X(
|
|
45
|
+
() => G({
|
|
45
46
|
scrollDom: ".layout-content",
|
|
46
47
|
contentDom: ".header-anchor",
|
|
47
48
|
selectAttrName: "href",
|
|
@@ -53,31 +54,36 @@ const ie = { class: "info-container" }, ae = {
|
|
|
53
54
|
}
|
|
54
55
|
}),
|
|
55
56
|
100
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
), h = (o) => {
|
|
58
|
+
b(`#${o.index}`);
|
|
59
|
+
}, y = () => {
|
|
60
|
+
const o = document.querySelector(s.scrollDom);
|
|
61
|
+
o && o.removeEventListener("scroll", g);
|
|
62
|
+
};
|
|
63
|
+
return A(() => {
|
|
64
|
+
P(() => {
|
|
59
65
|
setTimeout(() => {
|
|
60
|
-
|
|
66
|
+
b(encodeURI(a.hash));
|
|
61
67
|
}), setTimeout(() => {
|
|
62
68
|
const t = document.querySelector(".layout-content");
|
|
63
|
-
t && t.addEventListener("scroll",
|
|
69
|
+
t && t.addEventListener("scroll", g);
|
|
64
70
|
}, 1500);
|
|
65
71
|
const o = document.querySelectorAll(".item.expand"), n = document.querySelectorAll(
|
|
66
72
|
"div.language-vue"
|
|
67
73
|
);
|
|
68
74
|
for (let t = 0; t < o.length; t++)
|
|
69
|
-
|
|
75
|
+
te(o[t], "click", () => {
|
|
70
76
|
n[t].offsetHeight === 0 ? (n[t].style.height = "auto", n[t].style.visibility = "visible") : (n[t].style.height = "0px", n[t].style.visibility = "hidden");
|
|
71
77
|
});
|
|
72
78
|
});
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class:
|
|
79
|
+
}), q(() => {
|
|
80
|
+
y();
|
|
81
|
+
}), z(() => {
|
|
82
|
+
y();
|
|
83
|
+
}), (o, n) => (r(), u("div", {
|
|
84
|
+
class: c([e(l).b(), e(l).is("api", M.value)])
|
|
79
85
|
}, [
|
|
80
|
-
d.value?.length ? (r(),
|
|
86
|
+
d.value?.length ? (r(), C(e(U), {
|
|
81
87
|
key: 0,
|
|
82
88
|
ref_key: "sideMenuRef",
|
|
83
89
|
ref: f,
|
|
@@ -89,52 +95,50 @@ const ie = { class: "info-container" }, ae = {
|
|
|
89
95
|
"unique-opened": !1,
|
|
90
96
|
"disable-sub-menu-action": "",
|
|
91
97
|
"attr-mapping": {
|
|
92
|
-
index: "slug"
|
|
93
|
-
originIndex: "slug",
|
|
94
|
-
originChildren: "children"
|
|
98
|
+
index: "slug"
|
|
95
99
|
},
|
|
96
|
-
onSelect:
|
|
97
|
-
onSubMenuClick:
|
|
98
|
-
}, null, 8, ["default-active", "menus"])) :
|
|
100
|
+
onSelect: h,
|
|
101
|
+
onSubMenuClick: h
|
|
102
|
+
}, null, 8, ["default-active", "menus"])) : x("", !0),
|
|
99
103
|
i("div", {
|
|
100
|
-
class:
|
|
104
|
+
class: c(e(l).e("header"))
|
|
101
105
|
}, [
|
|
102
106
|
i("h1", {
|
|
103
|
-
class:
|
|
104
|
-
},
|
|
105
|
-
i("div",
|
|
106
|
-
e(a).meta?.category?.length ? (r(), u("div",
|
|
107
|
-
|
|
107
|
+
class: c(e(l).e("title"))
|
|
108
|
+
}, _(e(a).meta?.title), 3),
|
|
109
|
+
i("div", re, [
|
|
110
|
+
e(a).meta?.category?.length ? (r(), u("div", se, [
|
|
111
|
+
m(e(k), {
|
|
108
112
|
size: 14,
|
|
109
|
-
color: e(
|
|
113
|
+
color: e(L),
|
|
110
114
|
icon: "icon-category"
|
|
111
115
|
}, null, 8, ["color"]),
|
|
112
|
-
(r(!0), u(I, null,
|
|
116
|
+
(r(!0), u(I, null, B(e(a).meta?.category, (t, N) => (r(), C(e(Y), {
|
|
113
117
|
size: "small",
|
|
114
118
|
class: "tag",
|
|
115
|
-
type: e(
|
|
116
|
-
key:
|
|
117
|
-
onClick: (
|
|
119
|
+
type: e(K)(e(le), 1)[0],
|
|
120
|
+
key: N,
|
|
121
|
+
onClick: (fe) => E(t)
|
|
118
122
|
}, {
|
|
119
|
-
default:
|
|
120
|
-
|
|
123
|
+
default: F(() => [
|
|
124
|
+
H(_(t), 1)
|
|
121
125
|
]),
|
|
122
126
|
_: 2
|
|
123
127
|
}, 1032, ["type", "onClick"]))), 128))
|
|
124
|
-
])) :
|
|
125
|
-
i("div",
|
|
126
|
-
|
|
128
|
+
])) : x("", !0),
|
|
129
|
+
i("div", ce, [
|
|
130
|
+
m(e(O), {
|
|
127
131
|
title: "发布时间",
|
|
128
132
|
icon: "icon-date",
|
|
129
133
|
size: 12,
|
|
130
134
|
class: "mr-10px",
|
|
131
135
|
distance: 5,
|
|
132
|
-
text: e(
|
|
133
|
-
(e(a).meta?.date ? new Date(e(a).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(
|
|
136
|
+
text: e(ne)(
|
|
137
|
+
(e(a).meta?.date ? new Date(e(a).meta.date).getTime() : (/* @__PURE__ */ new Date()).getTime()) - e(ie)()
|
|
134
138
|
)
|
|
135
139
|
}, null, 8, ["text"]),
|
|
136
|
-
i("div",
|
|
137
|
-
|
|
140
|
+
i("div", me, [
|
|
141
|
+
m(e(k), {
|
|
138
142
|
icon: "icon-reading",
|
|
139
143
|
size: 14,
|
|
140
144
|
class: "mr-5px"
|
|
@@ -142,17 +146,17 @@ const ie = { class: "info-container" }, ae = {
|
|
|
142
146
|
i("div", {
|
|
143
147
|
class: "waline-pageview-count lh-1",
|
|
144
148
|
"data-path": e(V)
|
|
145
|
-
}, "0", 8,
|
|
149
|
+
}, "0", 8, de)
|
|
146
150
|
])
|
|
147
151
|
])
|
|
148
152
|
])
|
|
149
153
|
], 2),
|
|
150
154
|
i("div", {
|
|
151
|
-
class:
|
|
155
|
+
class: c(e(l).e("content"))
|
|
152
156
|
}, [
|
|
153
|
-
|
|
157
|
+
J(o.$slots, "default")
|
|
154
158
|
], 2),
|
|
155
|
-
|
|
159
|
+
m(e(j)),
|
|
156
160
|
n[0] || (n[0] = i("ins", {
|
|
157
161
|
class: "adsbygoogle",
|
|
158
162
|
style: { display: "block", "text-align": "center" },
|
|
@@ -165,5 +169,5 @@ const ie = { class: "info-container" }, ae = {
|
|
|
165
169
|
}
|
|
166
170
|
});
|
|
167
171
|
export {
|
|
168
|
-
|
|
172
|
+
Pe as default
|
|
169
173
|
};
|
|
@@ -1,47 +1,42 @@
|
|
|
1
|
-
import "@
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function k(p, c, n) {
|
|
9
|
-
const i = x(!1), l = n.props?.dragWidthCfg?.minWidth || 200;
|
|
10
|
-
v(() => {
|
|
11
|
-
n.props?.dragWidthCfg && d(() => {
|
|
12
|
-
w(g, 100)();
|
|
1
|
+
import { useDebounceFn as x, useThrottleFn as v } from "@vft/use";
|
|
2
|
+
import { ref as w, onMounted as T, nextTick as c, unref as r } from "vue";
|
|
3
|
+
function X(l, m, o) {
|
|
4
|
+
const i = w(!1), a = o.props?.dragWidthCfg?.minWidth || 200;
|
|
5
|
+
T(() => {
|
|
6
|
+
o.props?.dragWidthCfg && c(() => {
|
|
7
|
+
x(g, 100)();
|
|
13
8
|
});
|
|
14
9
|
});
|
|
15
|
-
function f(
|
|
16
|
-
const
|
|
17
|
-
return
|
|
10
|
+
function f(e) {
|
|
11
|
+
const n = r(e);
|
|
12
|
+
return n ? Reflect.has(n, "$el") ? r(e)?.$el : r(e) : null;
|
|
18
13
|
}
|
|
19
|
-
function
|
|
14
|
+
function p(e, n, s) {
|
|
20
15
|
document.onmousemove = function(u) {
|
|
21
|
-
let
|
|
16
|
+
let t = e.left + (u.clientX - s);
|
|
22
17
|
u = u || window.event;
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
|
|
18
|
+
const d = o.props?.dragWidthCfg?.maxWidth || 800, W = r(a);
|
|
19
|
+
return t <= W ? void 0 : (t < 0 && (t = 0), t > d && (t = d), e.style.left = t + "px", v(() => {
|
|
20
|
+
o.emit("update:width", t + "px");
|
|
26
21
|
}, 150)(), !1);
|
|
27
22
|
};
|
|
28
23
|
}
|
|
29
|
-
function h(
|
|
24
|
+
function h(e) {
|
|
30
25
|
document.onmouseup = function() {
|
|
31
|
-
document.onmousemove = null, document.onmouseup = null, i.value = !0,
|
|
32
|
-
|
|
26
|
+
document.onmousemove = null, document.onmouseup = null, i.value = !0, c(() => {
|
|
27
|
+
o.emit("dragWidthEnd"), setTimeout(() => {
|
|
33
28
|
i.value = !1;
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
29
|
+
}, 100);
|
|
30
|
+
}), e.releaseCapture?.();
|
|
36
31
|
};
|
|
37
32
|
}
|
|
38
33
|
function g() {
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
const
|
|
42
|
-
|
|
34
|
+
const e = f(m);
|
|
35
|
+
if (!e) return;
|
|
36
|
+
const n = f(l);
|
|
37
|
+
n && (e.onmousedown = (s) => {
|
|
43
38
|
const u = s?.clientX;
|
|
44
|
-
return
|
|
39
|
+
return e.left = e.offsetLeft, p(e, n, u), h(e), e.setCapture?.(), !1;
|
|
45
40
|
});
|
|
46
41
|
}
|
|
47
42
|
return {
|
|
@@ -49,5 +44,5 @@ function k(p, c, n) {
|
|
|
49
44
|
};
|
|
50
45
|
}
|
|
51
46
|
export {
|
|
52
|
-
|
|
47
|
+
X as useDragLine
|
|
53
48
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne,
|
|
1
|
+
import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as G, resolveComponent as V } 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");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=>{let 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=>{let 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;
|
|
@@ -3,6 +3,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
3
3
|
tocList: {
|
|
4
4
|
type: import("vue").PropType<string>;
|
|
5
5
|
};
|
|
6
|
+
scrollDom: {
|
|
7
|
+
type: import("vue").PropType<string>;
|
|
8
|
+
};
|
|
6
9
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
7
10
|
P: {};
|
|
8
11
|
B: {};
|
|
@@ -14,6 +17,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
14
17
|
tocList: {
|
|
15
18
|
type: import("vue").PropType<string>;
|
|
16
19
|
};
|
|
20
|
+
scrollDom: {
|
|
21
|
+
type: import("vue").PropType<string>;
|
|
22
|
+
};
|
|
17
23
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
18
24
|
__isFragment?: never;
|
|
19
25
|
__isTeleport?: never;
|
|
@@ -22,6 +28,9 @@ export declare const VftMdContainer: import("vft/es/utils").SFCWithInstall<{
|
|
|
22
28
|
tocList: {
|
|
23
29
|
type: import("vue").PropType<string>;
|
|
24
30
|
};
|
|
31
|
+
scrollDom: {
|
|
32
|
+
type: import("vue").PropType<string>;
|
|
33
|
+
};
|
|
25
34
|
}>> & 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 () => {
|
|
26
35
|
$slots: {
|
|
27
36
|
default?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../icon/index.cjs"),E=require("../icon-text/index.cjs"),N=require("../md-comment/index.cjs"),_=require("../side-menu/index.cjs"),S=require("../tag/index.cjs");require("@vueuse/core");const i=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const b=require("../../utils/ns-cover.cjs"),T=require("lodash-es");require("../form/index.cjs");const D=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const $=require("@vft/router"),B=require("@vft/use"),L=require("@vft/use/photoswipe"),g=require("@vft/utils/date"),M=require("./use/useCopyCode.cjs"),w=require("./utils.cjs"),z={class:"info-container"},P={key:0,class:"left"},R={class:"infos"},A={class:"reading",title:"阅读量"},I=["data-path"],j=e.defineComponent({name:"vft-md-container"}),O=e.defineComponent({...j,props:{tocList:{},scrollDom:{default:".layout-content"}},setup(s){const l=D.useNamespace("md-container"),v=e.getCurrentInstance(),c=e.ref(),a=e.computed(()=>s.tocList&&s.tocList!=="undefined"?JSON.parse(s.tocList):""),{initPhotoSwipe:y}=L.usePhotoSwipe(`.${l.e("content")} img`);y(),M.useCopyCode();const u=v.appContext.config.globalProperties.$router,r=u.currentRoute.value,h=b.primaryColor(),C=i.isClient?location.pathname:"",{go:q}=$.useRouterHelper(u);function k(n){q(`/?classify=${n}`)}const x=e.computed(()=>r.meta.category?.includes("api")),d=T.debounce(()=>i.handleScrollPosition({scrollDom:".layout-content",contentDom:".header-anchor",selectAttrName:"href",offset:100,callback:n=>{c.value.menuRef.updateActiveIndex(n.slice(1))}}),100),m=n=>{i.jumpElement(`#${n.index}`)},f=()=>{const n=document.querySelector(s.scrollDom);n&&n.removeEventListener("scroll",d)};return e.onMounted(()=>{e.nextTick(()=>{setTimeout(()=>{i.jumpElement(encodeURI(r.hash))}),setTimeout(()=>{const t=document.querySelector(".layout-content");t&&t.addEventListener("scroll",d)},1500);const n=document.querySelectorAll(".item.expand"),o=document.querySelectorAll("div.language-vue");for(let t=0;t<n.length;t++)B.useEventListener(n[t],"click",()=>{o[t].offsetHeight===0?(o[t].style.height="auto",o[t].style.visibility="visible"):(o[t].style.height="0px",o[t].style.visibility="hidden")})})}),e.onDeactivated(()=>{f()}),e.onBeforeMount(()=>{f()}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(l).b(),e.unref(l).is("api",x.value)])},[a.value?.length?(e.openBlock(),e.createBlock(e.unref(_.VftSideMenu),{key:0,ref_key:"sideMenuRef",ref:c,"default-active":a.value[0].slug,class:"toc-side-menu",menus:a.value,"is-fixed-left":!1,"default-openeds-level":"","unique-opened":!1,"disable-sub-menu-action":"","attr-mapping":{index:"slug"},onSelect:m,onSubMenuClick:m},null,8,["default-active","menus"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("header"))},[e.createElementVNode("h1",{class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(e.unref(r).meta?.title),3),e.createElementVNode("div",z,[e.unref(r).meta?.category?.length?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(e.unref(p.VftIcon),{size:14,color:e.unref(h),icon:"icon-category"},null,8,["color"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).meta?.category,(t,V)=>(e.openBlock(),e.createBlock(e.unref(S.VftTag),{size:"small",class:"tag",type:e.unref(i.getRandomElementForArr)(e.unref(w.COMP_TYPE),1)[0],key:V,onClick:F=>k(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["type","onClick"]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",R,[e.createVNode(e.unref(E.VftIconText),{title:"发布时间",icon:"icon-date",size:12,class:"mr-10px",distance:5,text:e.unref(g.formatToDateTime)((e.unref(r).meta?.date?new Date(e.unref(r).meta.date).getTime():new Date().getTime())-e.unref(g.getDayTimestamp)())},null,8,["text"]),e.createElementVNode("div",A,[e.createVNode(e.unref(p.VftIcon),{icon:"icon-reading",size:14,class:"mr-5px"}),e.createElementVNode("div",{class:"waline-pageview-count lh-1","data-path":e.unref(C)},"0",8,I)])])])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).e("content"))},[e.renderSlot(n.$slots,"default")],2),e.createVNode(e.unref(N.VftMdComment)),o[0]||(o[0]=e.createElementVNode("ins",{class:"adsbygoogle",style:{display:"block","text-align":"center"},"data-ad-layout":"in-article","data-ad-format":"fluid","data-ad-client":"ca-pub-4046301015031382","data-ad-slot":"6525439078"},null,-1))],2))}});exports.default=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@vft/use"),t=require("vue");function v(l,a,o){const i=t.ref(!1),m=o.props?.dragWidthCfg?.minWidth||200;t.onMounted(()=>{o.props?.dragWidthCfg&&t.nextTick(()=>{d.useDebounceFn(h,100)()})});function c(e){const u=t.unref(e);return u?Reflect.has(u,"$el")?t.unref(e)?.$el:t.unref(e):null}function p(e,u,s){document.onmousemove=function(r){let n=e.left+(r.clientX-s);r=r||window.event;const f=o.props?.dragWidthCfg?.maxWidth||800,W=t.unref(m);return n<=W?void 0:(n<0&&(n=0),n>f&&(n=f),e.style.left=n+"px",d.useThrottleFn(()=>{o.emit("update:width",n+"px")},150)(),!1)}}function g(e){document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,i.value=!0,t.nextTick(()=>{o.emit("dragWidthEnd"),setTimeout(()=>{i.value=!1},100)}),e.releaseCapture?.()}}function h(){const e=c(a);if(!e)return;const u=c(l);u&&(e.onmousedown=s=>{const r=s?.clientX;return e.left=e.offsetLeft,p(e,u,r),g(e),e.setCapture?.(),!1})}return{isDraging:i}}exports.useDragLine=v;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.434";exports.version=e;
|