vft 0.0.443 → 0.0.447
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +2 -2
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/config-provider/config-provider.vue.d.ts +1 -1
- package/es/components/config-provider/config-provider.vue2.js +8 -9
- 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/md-container.vue2.js +15 -15
- package/es/components/message/message.vue.d.ts +1 -18
- package/es/components/message/message.vue2.js +62 -54
- package/es/components/message/types.d.ts +23 -7
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/verify-code/useImageVerify.js +1 -1
- package/es/components/verify-code/verify-code.vue2.js +16 -16
- 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/config-provider/config-provider.vue.d.ts +1 -1
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/message/message.vue.d.ts +1 -18
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/message/types.d.ts +23 -7
- package/lib/components/verify-code/useImageVerify.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/tags.json +1 -1
- package/theme-style/base.css +1 -1
- package/theme-style/dark/css-vars.css +1 -1
- package/theme-style/index.css +2 -2
- package/theme-style/src/common/var.scss +7 -7
- package/theme-style/src/dark/css-vars.scss +8 -1
- package/theme-style/src/icon.scss +1 -0
- package/theme-style/src/md-container.scss +1 -1
- package/theme-style/src/message.scss +8 -14
- package/theme-style/src/mixins/_var.scss +9 -0
- package/theme-style/src/var.scss +3 -1
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-icon.css +1 -1
- package/theme-style/vft-input.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/theme-style/vft-message.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/theme-style/vft-var.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,5 +1,5 @@
|
|
|
1
1
|
import type { DialogConfigContext } from 'vft/es/components';
|
|
2
|
-
import {
|
|
2
|
+
import type { ButtonConfigContext } from 'vft/es/components/button';
|
|
3
3
|
import type { MessageConfigContext } from 'vft/es/components/message';
|
|
4
4
|
export interface ConfigProviderProps {
|
|
5
5
|
/** 主题风格 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { defineComponent as s, watch as m, computed as
|
|
1
|
+
import { defineComponent as s, watch as m, computed as l, onActivated as u, onDeactivated as h, onBeforeUnmount as g, getCurrentInstance as p, createElementBlock as v, openBlock as b, normalizeStyle as k, normalizeClass as C, unref as V, renderSlot as y } from "vue";
|
|
2
2
|
import { inBrowser as S, kebabCase as B } from "@vft/utils";
|
|
3
|
-
import "../button/index.js";
|
|
4
3
|
import "@vueuse/core";
|
|
5
4
|
import { provideGlobalConfig as E } from "./hooks/use-global-config.js";
|
|
6
5
|
import "lodash-es";
|
|
@@ -12,7 +11,7 @@ import "../../hooks/use-z-index/index.js";
|
|
|
12
11
|
import { messageConfig as n } from "./constants.js";
|
|
13
12
|
const z = s({
|
|
14
13
|
name: "vft-config-provider"
|
|
15
|
-
}),
|
|
14
|
+
}), N = /* @__PURE__ */ s({
|
|
16
15
|
...z,
|
|
17
16
|
props: {
|
|
18
17
|
theme: { default: "light" },
|
|
@@ -41,7 +40,7 @@ const z = s({
|
|
|
41
40
|
},
|
|
42
41
|
{ immediate: !0, deep: !0 }
|
|
43
42
|
);
|
|
44
|
-
const c =
|
|
43
|
+
const c = l(() => {
|
|
45
44
|
const e = t.theme === "dark";
|
|
46
45
|
return f({
|
|
47
46
|
...t.themeVars,
|
|
@@ -68,15 +67,15 @@ const z = s({
|
|
|
68
67
|
a[`--${t.namespace}-${B(o)}`] = e[o];
|
|
69
68
|
}), a;
|
|
70
69
|
}
|
|
71
|
-
const
|
|
72
|
-
return E(
|
|
73
|
-
class:
|
|
74
|
-
style:
|
|
70
|
+
const d = p();
|
|
71
|
+
return E(d.props), (e, a) => (b(), v("div", {
|
|
72
|
+
class: C([V(i).b(), { "vft-dark": t.theme === "dark" }]),
|
|
73
|
+
style: k(c.value)
|
|
75
74
|
}, [
|
|
76
75
|
y(e.$slots, "default")
|
|
77
76
|
], 6));
|
|
78
77
|
}
|
|
79
78
|
});
|
|
80
79
|
export {
|
|
81
|
-
|
|
80
|
+
N as default
|
|
82
81
|
};
|
|
@@ -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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as T, getCurrentInstance as
|
|
1
|
+
import { defineComponent as T, getCurrentInstance as N, ref as $, computed as y, onMounted as P, nextTick as q, onDeactivated as z, onBeforeMount as A, createElementBlock as f, openBlock as s, normalizeClass as c, unref as e, createBlock as C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as k, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
|
|
2
2
|
import { VftIcon as b } from "../icon/index.js";
|
|
3
3
|
import { VftIconText as O } from "../icon-text/index.js";
|
|
4
4
|
import { VftMdComment as j } from "../md-comment/index.js";
|
|
@@ -26,35 +26,35 @@ const re = { class: "info-container" }, se = {
|
|
|
26
26
|
}, ce = { class: "infos" }, me = {
|
|
27
27
|
class: "reading",
|
|
28
28
|
title: "阅读量"
|
|
29
|
-
},
|
|
29
|
+
}, ue = ["data-path"], de = T({
|
|
30
30
|
name: "vft-md-container"
|
|
31
31
|
}), qe = /* @__PURE__ */ T({
|
|
32
|
-
...
|
|
32
|
+
...de,
|
|
33
33
|
props: {
|
|
34
34
|
tocList: {},
|
|
35
35
|
scrollDom: { default: ".layout-content" }
|
|
36
36
|
},
|
|
37
37
|
setup(r) {
|
|
38
|
-
const l = Z("md-container"), _ =
|
|
38
|
+
const l = Z("md-container"), _ = N(), u = $(), d = y(() => r.tocList && r.tocList !== "undefined" ? JSON.parse(r.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
|
|
39
39
|
D(), ae();
|
|
40
40
|
const p = _.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
|
|
41
41
|
function E(o) {
|
|
42
42
|
w(`/?classify=${o}`);
|
|
43
43
|
}
|
|
44
|
-
const M =
|
|
44
|
+
const M = y(() => a.meta.category?.includes("api")), g = X(
|
|
45
45
|
() => G({
|
|
46
46
|
scrollDom: ".layout-content",
|
|
47
47
|
contentDom: ".header-anchor",
|
|
48
48
|
selectAttrName: "href",
|
|
49
49
|
offset: 130,
|
|
50
50
|
callback: (o) => {
|
|
51
|
-
|
|
51
|
+
u.value?.menuRef && (u.value.menuRef.activeIndex = o.slice(1));
|
|
52
52
|
}
|
|
53
53
|
}),
|
|
54
54
|
100
|
|
55
55
|
), h = (o) => {
|
|
56
56
|
S(`#${o.index}`, r.scrollDom, 120);
|
|
57
|
-
},
|
|
57
|
+
}, v = () => {
|
|
58
58
|
const o = document.querySelector(r.scrollDom);
|
|
59
59
|
o && o.removeEventListener("scroll", g);
|
|
60
60
|
};
|
|
@@ -75,16 +75,16 @@ const re = { class: "info-container" }, se = {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
}), z(() => {
|
|
78
|
-
|
|
78
|
+
v();
|
|
79
79
|
}), A(() => {
|
|
80
|
-
|
|
81
|
-
}), (o, n) => (s(),
|
|
80
|
+
v();
|
|
81
|
+
}), (o, n) => (s(), f("div", {
|
|
82
82
|
class: c([e(l).b(), e(l).is("api", M.value)])
|
|
83
83
|
}, [
|
|
84
84
|
d.value?.length ? (s(), C(e(U), {
|
|
85
85
|
key: 0,
|
|
86
86
|
ref_key: "sideMenuRef",
|
|
87
|
-
ref:
|
|
87
|
+
ref: u,
|
|
88
88
|
"default-active": d.value[0].slug,
|
|
89
89
|
class: "toc-side-menu",
|
|
90
90
|
menus: d.value,
|
|
@@ -105,17 +105,17 @@ const re = { class: "info-container" }, se = {
|
|
|
105
105
|
class: c(e(l).e("title"))
|
|
106
106
|
}, k(e(a).meta?.title), 3),
|
|
107
107
|
i("div", re, [
|
|
108
|
-
e(a).meta?.category?.length ? (s(),
|
|
108
|
+
e(a).meta?.category?.length ? (s(), f("div", se, [
|
|
109
109
|
m(e(b), {
|
|
110
110
|
size: 14,
|
|
111
111
|
color: e(L),
|
|
112
112
|
icon: "icon-category"
|
|
113
113
|
}, null, 8, ["color"]),
|
|
114
|
-
(s(!0),
|
|
114
|
+
(s(!0), f(I, null, B(e(a).meta?.category, (t, R) => (s(), C(e(Y), {
|
|
115
115
|
size: "small",
|
|
116
116
|
class: "tag",
|
|
117
117
|
type: e(K)(e(le), 1)[0],
|
|
118
|
-
key:
|
|
118
|
+
key: R,
|
|
119
119
|
onClick: (fe) => E(t)
|
|
120
120
|
}, {
|
|
121
121
|
default: F(() => [
|
|
@@ -144,7 +144,7 @@ const re = { class: "info-container" }, se = {
|
|
|
144
144
|
i("div", {
|
|
145
145
|
class: "waline-pageview-count lh-1",
|
|
146
146
|
"data-path": e(V)
|
|
147
|
-
}, "0", 8,
|
|
147
|
+
}, "0", 8, ue)
|
|
148
148
|
])
|
|
149
149
|
])
|
|
150
150
|
])
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MessageType } from './types';
|
|
3
|
-
export interface MessageProps {
|
|
4
|
-
customClass?: string;
|
|
5
|
-
center?: boolean;
|
|
6
|
-
dangerouslyUseHTMLString?: boolean;
|
|
7
|
-
duration: number;
|
|
8
|
-
icon?: string;
|
|
9
|
-
id: string;
|
|
10
|
-
message?: string | VNode | (() => VNode);
|
|
11
|
-
onClose?: Function;
|
|
12
|
-
showClose?: boolean;
|
|
13
|
-
type: MessageType;
|
|
14
|
-
offset: number;
|
|
15
|
-
zIndex?: number;
|
|
16
|
-
grouping?: boolean;
|
|
17
|
-
repeatNum?: number;
|
|
18
|
-
}
|
|
1
|
+
import type { MessageProps } from './types';
|
|
19
2
|
declare function close(): void;
|
|
20
3
|
declare function __VLS_template(): {
|
|
21
4
|
default?(_: {}): any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { EVENT_CODE as K } from "@vft/constants";
|
|
3
|
-
import { useEventListener as Q } from "@vft/use";
|
|
4
|
-
import { isObject as W } from "@vft/utils";
|
|
1
|
+
import { defineComponent as V, ref as f, computed as i, onMounted as H, watch as $, createBlock as w, openBlock as c, Transition as D, unref as o, withCtx as F, withDirectives as P, createElementVNode as j, normalizeStyle as A, normalizeClass as a, createElementBlock as d, createCommentVNode as k, renderSlot as U, createVNode as Z, normalizeProps as G, guardReactiveProps as q, toDisplayString as J, mergeProps as K, withModifiers as Q, vShow as W } from "vue";
|
|
5
2
|
import { VftIcon as B } from "../icon/index.js";
|
|
6
|
-
import {
|
|
3
|
+
import { EVENT_CODE as X } from "@vft/constants";
|
|
4
|
+
import { useEventListener as Y } from "@vft/use";
|
|
5
|
+
import { singleAttrToObj as T } from "@vft/utils";
|
|
6
|
+
import { useResizeObserver as _, useTimeoutFn as ee } from "@vueuse/core";
|
|
7
7
|
import "../config-provider/index.js";
|
|
8
|
-
import { getLastOffset as
|
|
9
|
-
import { useGlobalComponentSettings as
|
|
10
|
-
const
|
|
8
|
+
import { getLastOffset as oe, getOffsetOrSpace as te } from "./instance.js";
|
|
9
|
+
import { useGlobalComponentSettings as ne } from "../config-provider/hooks/use-global-config.js";
|
|
10
|
+
const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
11
11
|
__name: "message",
|
|
12
12
|
props: {
|
|
13
13
|
customClass: {},
|
|
@@ -15,6 +15,7 @@ const oe = ["id"], ne = ["innerHTML"], ge = /* @__PURE__ */ N({
|
|
|
15
15
|
dangerouslyUseHTMLString: { type: Boolean },
|
|
16
16
|
duration: {},
|
|
17
17
|
icon: {},
|
|
18
|
+
closeIcon: {},
|
|
18
19
|
id: {},
|
|
19
20
|
message: { type: [String, Object, Function] },
|
|
20
21
|
onClose: { type: Function },
|
|
@@ -27,95 +28,102 @@ const oe = ["id"], ne = ["innerHTML"], ge = /* @__PURE__ */ N({
|
|
|
27
28
|
},
|
|
28
29
|
emits: ["destroy"],
|
|
29
30
|
setup(e, { expose: b }) {
|
|
30
|
-
const t = e, { ns: n, zIndex: M } =
|
|
31
|
+
const t = e, { ns: n, zIndex: M } = ne("message"), { currentZIndex: S, nextZIndex: x } = M, u = f(), l = f(!1), g = f(0);
|
|
31
32
|
let v;
|
|
32
|
-
const
|
|
33
|
+
const L = /* @__PURE__ */ new Map([
|
|
33
34
|
["success", { icon: "icon-success-filled" }],
|
|
34
35
|
["error", { icon: "icon-circle-close-filled" }],
|
|
35
36
|
["warning", { icon: "icon-warning-filled" }]
|
|
36
|
-
]), y = i(
|
|
37
|
+
]), y = i(
|
|
38
|
+
() => T(t.icon, "icon", {
|
|
39
|
+
icon: L.get(t.type)?.icon
|
|
40
|
+
})
|
|
41
|
+
), I = i(
|
|
42
|
+
() => T(t.icon, "icon", {
|
|
43
|
+
icon: "icon-close"
|
|
44
|
+
})
|
|
45
|
+
), O = i(() => {
|
|
37
46
|
const s = t.type;
|
|
38
47
|
return { [n.bm("icon", s)]: s };
|
|
39
|
-
}),
|
|
40
|
-
() =>
|
|
41
|
-
),
|
|
48
|
+
}), z = i(() => oe(t.id)), p = i(
|
|
49
|
+
() => te(t.id, t.offset) + z.value
|
|
50
|
+
), E = i(() => g.value + p.value), N = i(() => ({
|
|
42
51
|
top: `${p.value}px`,
|
|
43
52
|
zIndex: S.value
|
|
44
53
|
}));
|
|
45
|
-
function
|
|
46
|
-
t.duration !== 0 && ({ stop: v } =
|
|
47
|
-
|
|
54
|
+
function m() {
|
|
55
|
+
t.duration !== 0 && ({ stop: v } = ee(() => {
|
|
56
|
+
r();
|
|
48
57
|
}, t.duration));
|
|
49
58
|
}
|
|
50
59
|
function C() {
|
|
51
60
|
v?.();
|
|
52
61
|
}
|
|
53
|
-
function
|
|
62
|
+
function r() {
|
|
54
63
|
l.value = !1;
|
|
55
64
|
}
|
|
56
|
-
function
|
|
57
|
-
s ===
|
|
65
|
+
function R({ code: s }) {
|
|
66
|
+
s === X.esc && r();
|
|
58
67
|
}
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
}),
|
|
68
|
+
return H(() => {
|
|
69
|
+
m(), x(), l.value = !0;
|
|
70
|
+
}), $(
|
|
62
71
|
() => t.repeatNum,
|
|
63
72
|
() => {
|
|
64
|
-
C(),
|
|
73
|
+
C(), m();
|
|
65
74
|
}
|
|
66
|
-
),
|
|
67
|
-
g.value =
|
|
75
|
+
), Y(document, "keydown", R), _(u, () => {
|
|
76
|
+
g.value = u.value.getBoundingClientRect().height;
|
|
68
77
|
}), b({
|
|
69
78
|
visible: l,
|
|
70
|
-
bottom:
|
|
71
|
-
close:
|
|
72
|
-
}), (s, h) => (c(),
|
|
79
|
+
bottom: E,
|
|
80
|
+
close: r
|
|
81
|
+
}), (s, h) => (c(), w(D, {
|
|
73
82
|
name: o(n).b("fade"),
|
|
74
83
|
onBeforeLeave: e.onClose,
|
|
75
|
-
onAfterLeave: h[0] || (h[0] = (
|
|
84
|
+
onAfterLeave: h[0] || (h[0] = (ce) => s.$emit("destroy"))
|
|
76
85
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
86
|
+
default: F(() => [
|
|
87
|
+
P(j("div", {
|
|
79
88
|
id: e.id,
|
|
80
89
|
ref_key: "messageRef",
|
|
81
|
-
ref:
|
|
82
|
-
class:
|
|
90
|
+
ref: u,
|
|
91
|
+
class: a([
|
|
83
92
|
o(n).b(),
|
|
84
93
|
{ [o(n).m(e.type)]: e.type && !e.icon },
|
|
85
94
|
o(n).is("center", e.center),
|
|
86
95
|
o(n).is("closable", e.showClose),
|
|
87
96
|
e.customClass
|
|
88
97
|
]),
|
|
89
|
-
style:
|
|
98
|
+
style: A(N.value),
|
|
90
99
|
role: "alert",
|
|
91
100
|
onMouseenter: C,
|
|
92
|
-
onMouseleave:
|
|
101
|
+
onMouseleave: m
|
|
93
102
|
}, [
|
|
94
|
-
y.value?.icon ? (c(),
|
|
103
|
+
y.value?.icon ? (c(), d("div", {
|
|
95
104
|
key: 0,
|
|
96
|
-
class:
|
|
105
|
+
class: a([o(n).e("icon"), O.value])
|
|
97
106
|
}, [
|
|
98
|
-
|
|
99
|
-
], 2)) :
|
|
107
|
+
Z(o(B), G(q(y.value)), null, 16)
|
|
108
|
+
], 2)) : k("", !0),
|
|
100
109
|
U(s.$slots, "default", {}, () => [
|
|
101
|
-
e.dangerouslyUseHTMLString ? (c(),
|
|
110
|
+
e.dangerouslyUseHTMLString ? (c(), d("p", {
|
|
102
111
|
key: 1,
|
|
103
|
-
class:
|
|
112
|
+
class: a(o(n).e("content")),
|
|
104
113
|
innerHTML: e.message
|
|
105
|
-
}, null, 10,
|
|
114
|
+
}, null, 10, ie)) : (c(), d("p", {
|
|
106
115
|
key: 0,
|
|
107
|
-
class:
|
|
108
|
-
},
|
|
116
|
+
class: a(o(n).e("content"))
|
|
117
|
+
}, J(e.message), 3))
|
|
109
118
|
]),
|
|
110
|
-
e.showClose ? (c(),
|
|
119
|
+
e.showClose ? (c(), w(o(B), K({
|
|
111
120
|
key: 1,
|
|
112
|
-
class:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
[J, l.value]
|
|
121
|
+
class: o(n).e("closeBtn")
|
|
122
|
+
}, I.value, {
|
|
123
|
+
onClick: Q(r, ["stop"])
|
|
124
|
+
}), null, 16, ["class"])) : k("", !0)
|
|
125
|
+
], 46, se), [
|
|
126
|
+
[W, l.value]
|
|
119
127
|
])
|
|
120
128
|
]),
|
|
121
129
|
_: 3
|
|
@@ -123,5 +131,5 @@ const oe = ["id"], ne = ["innerHTML"], ge = /* @__PURE__ */ N({
|
|
|
123
131
|
}
|
|
124
132
|
});
|
|
125
133
|
export {
|
|
126
|
-
|
|
134
|
+
ye as default
|
|
127
135
|
};
|
|
@@ -45,20 +45,36 @@ export declare const messageDefaults: {
|
|
|
45
45
|
appendTo: HTMLElement;
|
|
46
46
|
};
|
|
47
47
|
export interface MessageProps {
|
|
48
|
+
/** 自定义类名 */
|
|
48
49
|
customClass?: string;
|
|
50
|
+
/** 是否居中布局 */
|
|
49
51
|
center?: boolean;
|
|
52
|
+
/** 是否将 message 属性作为 HTML 片段处理 */
|
|
50
53
|
dangerouslyUseHTMLString?: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
/** 显示时间,单位毫秒。设为 0 则不会自动关闭 */
|
|
55
|
+
duration: number;
|
|
56
|
+
/** 自定义图标,该属性会覆盖 type 的图标 */
|
|
57
|
+
icon?: any;
|
|
58
|
+
/** 自定义关闭图标 */
|
|
59
|
+
closeIcon?: any;
|
|
60
|
+
/** 消息的唯一标识 */
|
|
61
|
+
id: string;
|
|
62
|
+
/** 消息文字 */
|
|
54
63
|
message?: string | VNode | (() => VNode);
|
|
55
|
-
|
|
64
|
+
/** 关闭时的回调函数 */
|
|
65
|
+
onClose?: () => void;
|
|
66
|
+
/** 是否显示关闭按钮 */
|
|
56
67
|
showClose?: boolean;
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
/** 消息类型 */
|
|
69
|
+
type: MessageType;
|
|
70
|
+
/** 消息距离窗口顶部的偏移量 */
|
|
71
|
+
offset: number;
|
|
72
|
+
/** 消息的层级 */
|
|
59
73
|
zIndex?: number;
|
|
74
|
+
/** 合并内容相同的消息,不支持 VNode 类型的消息 */
|
|
60
75
|
grouping?: boolean;
|
|
61
|
-
|
|
76
|
+
/** 重复次数,类似于 Badge。当和 grouping 属性一起使用时作为初始数量使用 */
|
|
77
|
+
repeatNum?: number;
|
|
62
78
|
}
|
|
63
79
|
export type MessageOptions = Partial<Omit<MessageProps, 'id'> & {
|
|
64
80
|
appendTo?: HTMLElement | string;
|
|
@@ -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";
|
|
@@ -32,7 +32,7 @@ function g(l, e, n) {
|
|
|
32
32
|
const s = a[o(0, a.length)];
|
|
33
33
|
f += s;
|
|
34
34
|
const i = o(18, 41), d = o(-30, 30);
|
|
35
|
-
t.font = `${i}px Simhei`, t.textBaseline = "top", t.fillStyle = c(80, 150), t.save(), t.translate(30 * r + 23, 15), t.rotate(d * Math.PI / 180), t.fillText(s,
|
|
35
|
+
t.font = `${i}px Simhei`, t.textBaseline = "top", t.fillStyle = c(80, 150), t.save(), t.translate(30 * r + 23, 15), t.rotate(d * Math.PI / 180), t.fillText(s, 0, -10), t.restore();
|
|
36
36
|
}
|
|
37
37
|
for (let r = 0; r < 5; r += 1)
|
|
38
38
|
t.beginPath(), t.moveTo(o(0, e), o(0, n)), t.lineTo(o(0, e), o(0, n)), t.strokeStyle = c(180, 230), t.closePath(), t.stroke();
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { defineComponent as d, computed as s, createElementBlock as f, openBlock as u, normalizeStyle as o, createElementVNode as g, unref as
|
|
1
|
+
import { defineComponent as d, computed as s, createElementBlock as f, openBlock as u, normalizeStyle as o, createElementVNode as g, unref as k } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import { addUnit as t } from "../../utils/helper.js";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../form/index.js";
|
|
7
|
-
import
|
|
8
|
-
const y = ["width", "height"],
|
|
7
|
+
import w from "./useImageVerify.js";
|
|
8
|
+
const y = ["width", "height"], v = d({
|
|
9
9
|
name: "vft-verify-code"
|
|
10
|
-
}),
|
|
11
|
-
...
|
|
10
|
+
}), I = /* @__PURE__ */ d({
|
|
11
|
+
...v,
|
|
12
12
|
props: {
|
|
13
13
|
height: { default: 40 },
|
|
14
14
|
width: { default: 150 },
|
|
15
15
|
radius: { default: 5 }
|
|
16
16
|
},
|
|
17
17
|
emits: ["click"],
|
|
18
|
-
setup(e, { expose:
|
|
19
|
-
const n =
|
|
18
|
+
setup(e, { expose: c, emit: r }) {
|
|
19
|
+
const n = r, h = s(() => ({
|
|
20
20
|
width: t(e.width),
|
|
21
21
|
height: t(e.height)
|
|
22
|
-
})), { domRef:
|
|
22
|
+
})), { domRef: m, imgCode: l, getCode: i } = w(e.width, e.height), a = () => {
|
|
23
23
|
i(), n("click");
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return c({
|
|
26
26
|
getCode: i,
|
|
27
|
-
code:
|
|
28
|
-
}), (
|
|
29
|
-
style: o(
|
|
30
|
-
onClick:
|
|
27
|
+
code: l
|
|
28
|
+
}), (C, p) => (u(), f("div", {
|
|
29
|
+
style: o(h.value),
|
|
30
|
+
onClick: a
|
|
31
31
|
}, [
|
|
32
32
|
g("canvas", {
|
|
33
33
|
ref_key: "domRef",
|
|
34
|
-
ref:
|
|
35
|
-
style: o({ borderRadius:
|
|
34
|
+
ref: m,
|
|
35
|
+
style: o({ borderRadius: k(t)(e.radius) }),
|
|
36
36
|
width: e.width,
|
|
37
37
|
height: e.height,
|
|
38
38
|
class: "cursor-pointer"
|
|
@@ -41,5 +41,5 @@ const y = ["width", "height"], w = d({
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
I as default
|
|
45
45
|
};
|
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,5 +1,5 @@
|
|
|
1
1
|
import type { DialogConfigContext } from 'vft/es/components';
|
|
2
|
-
import {
|
|
2
|
+
import type { ButtonConfigContext } from 'vft/es/components/button';
|
|
3
3
|
import type { MessageConfigContext } from 'vft/es/components/message';
|
|
4
4
|
export interface ConfigProviderProps {
|
|
5
5
|
/** 主题风格 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@vft/utils");require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@vft/utils");require("@vueuse/core");const d=require("./hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const f=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const r=require("./constants.cjs"),g=e.defineComponent({name:"vft-config-provider"}),h=e.defineComponent({...g,props:{theme:{default:"light"},themeVars:{},themeVarsDark:{},themeVarsLight:{},iconfontClass:{},iconifyPrefixClass:{default:"ico-"},namespace:{default:"vft"},zIndex:{},message:{},dialog:{},projectCfg:{},button:{},baseUnit:{type:[String,Boolean],default:!1},baseUnitSize:{default:1080}},setup(n){const c=f.useNamespace("config-provider");e.watch(()=>n.message,t=>{Object.keys(r.messageConfig).forEach(a=>{delete r.messageConfig[a]}),Object.assign(r.messageConfig,t??{})},{immediate:!0,deep:!0});const u=e.computed(()=>{const t=n.theme==="dark";return m({...n.themeVars,...t?n.themeVarsDark:n.themeVarsLight})});if(o.inBrowser){const t=()=>{document.documentElement.classList.add(n.theme)},a=(s=n.theme)=>{document.documentElement.classList.remove(s)};e.watch(()=>n.theme,(s,i)=>{i&&a(i),t()},{immediate:!0}),e.onActivated(t),e.onDeactivated(a),e.onBeforeUnmount(a)}function m(t){const a={};return Object.keys(t).forEach(s=>{a[`--${n.namespace}-${o.kebabCase(s)}`]=t[s]}),a}const l=e.getCurrentInstance();return d.provideGlobalConfig(l.props),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(c).b(),{"vft-dark":n.theme==="dark"}]),style:e.normalizeStyle(u.value)},[e.renderSlot(t.$slots,"default")],6))}});exports.default=h;
|