vft 0.0.421 → 0.0.422
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 +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/full-screen/full-screen.vue2.js +9 -8
- package/es/components/full-screen/index.d.ts +6 -0
- package/es/components/icon-text/icon-text.vue2.js +35 -30
- package/es/components/icon-text/index.d.ts +6 -0
- package/es/components/icon-text/types.d.ts +1 -0
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/logo/index.d.ts +0 -4
- package/es/components/logo/logo.vue.d.ts +1 -6
- package/es/components/logo/logo.vue2.js +29 -26
- package/es/components/logo/types.d.ts +4 -2
- package/es/components/multiple-tabs/tab-content.vue2.js +1 -1
- package/es/components/multiple-tabs/use/use-multiple-tabs.js +1 -1
- 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/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/full-screen/index.d.ts +6 -0
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/icon-text/index.d.ts +6 -0
- package/lib/components/icon-text/types.d.ts +1 -0
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/logo/index.d.ts +0 -4
- package/lib/components/logo/logo.vue.d.ts +1 -6
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/logo/types.d.ts +4 -2
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-multiple-tabs.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/icon-text.scss +7 -3
- package/theme-style/src/input.scss +0 -2
- package/theme-style/src/md-container.scss +0 -1
- package/theme-style/src/mixins/mixins.scss +54 -51
- package/theme-style/src/scrollbar.scss +16 -16
- package/theme-style/src/side-menu.scss +0 -1
- package/theme-style/src/tabs.scss +0 -1
- package/theme-style/vft-icon-text.css +1 -1
- package/theme-style/vft-input.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/theme-style/vft-scrollbar.css +1 -1
- package/theme-style/vft-side-menu.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 { getCurrentInstance as l, computed as i, unref as p, provide as
|
|
4
|
+
import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide 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 = g();
|
|
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 ? C : void 0);
|
|
31
31
|
if (!u) {
|
|
32
32
|
v(
|
|
33
33
|
"provideGlobalConfig",
|
|
@@ -4,22 +4,23 @@ import { delObjAttrNotExist as u } from "@vft/utils";
|
|
|
4
4
|
import { VftIconText as f } from "../icon-text/index.js";
|
|
5
5
|
import "@vueuse/core";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
|
-
import { primaryColor as
|
|
7
|
+
import { primaryColor as d } from "../../utils/ns-cover.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "../form/index.js";
|
|
10
|
-
import { useNamespace as
|
|
10
|
+
import { useNamespace as x } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
const
|
|
14
|
+
const _ = r({
|
|
15
15
|
name: "full-screen"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
16
|
+
}), z = /* @__PURE__ */ r({
|
|
17
|
+
..._,
|
|
18
18
|
props: {
|
|
19
19
|
text: {},
|
|
20
20
|
icon: {},
|
|
21
21
|
color: {},
|
|
22
22
|
hoverColor: {},
|
|
23
|
+
disableIconHover: { type: Boolean },
|
|
23
24
|
distance: {},
|
|
24
25
|
reverse: { type: Boolean },
|
|
25
26
|
size: {},
|
|
@@ -32,8 +33,8 @@ const d = r({
|
|
|
32
33
|
useClamp: { type: Boolean }
|
|
33
34
|
},
|
|
34
35
|
setup(t) {
|
|
35
|
-
const n = t, l =
|
|
36
|
-
return (
|
|
36
|
+
const n = t, l = x("full-screen"), { toggle: i, isFullscreen: e } = a(), c = d().value;
|
|
37
|
+
return (y, B) => (s(), p(o(f), m({
|
|
37
38
|
class: o(l).b(),
|
|
38
39
|
distance: 2,
|
|
39
40
|
"hover-color": o(c),
|
|
@@ -44,5 +45,5 @@ const d = r({
|
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
z as default
|
|
48
49
|
};
|
|
@@ -11,6 +11,9 @@ export declare const VftFullScreen: import("vft/es/utils").SFCWithInstall<import
|
|
|
11
11
|
hoverColor: {
|
|
12
12
|
type: import("vue").PropType<string>;
|
|
13
13
|
};
|
|
14
|
+
disableIconHover: {
|
|
15
|
+
type: import("vue").PropType<boolean>;
|
|
16
|
+
};
|
|
14
17
|
distance: {
|
|
15
18
|
type: import("vue").PropType<string | number>;
|
|
16
19
|
};
|
|
@@ -54,6 +57,9 @@ export declare const VftFullScreen: import("vft/es/utils").SFCWithInstall<import
|
|
|
54
57
|
hoverColor: {
|
|
55
58
|
type: import("vue").PropType<string>;
|
|
56
59
|
};
|
|
60
|
+
disableIconHover: {
|
|
61
|
+
type: import("vue").PropType<boolean>;
|
|
62
|
+
};
|
|
57
63
|
distance: {
|
|
58
64
|
type: import("vue").PropType<string | number>;
|
|
59
65
|
};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftClampTooltip as
|
|
3
|
-
import { VftIcon as
|
|
1
|
+
import { defineComponent as g, computed as t, createElementBlock as f, openBlock as r, normalizeStyle as k, normalizeClass as S, unref as l, createBlock as c, createCommentVNode as h, mergeProps as u, normalizeProps as b, toDisplayString as x } from "vue";
|
|
2
|
+
import { VftClampTooltip as I } from "../clamp-tooltip/index.js";
|
|
3
|
+
import { VftIcon as y } from "../icon/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
|
-
import { singleAttrToObj as
|
|
6
|
-
import { addUnit as
|
|
7
|
-
import { generateCssVars as
|
|
5
|
+
import { singleAttrToObj as w, removeUnit as H } from "@vft/utils";
|
|
6
|
+
import { addUnit as C } from "../../utils/helper.js";
|
|
7
|
+
import { generateCssVars as L } from "../../utils/ns-cover.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "../form/index.js";
|
|
10
|
-
import { useNamespace as
|
|
10
|
+
import { useNamespace as O } from "../../hooks/use-namespace/index.js";
|
|
11
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
const
|
|
14
|
+
const V = { key: 2 }, j = g({
|
|
15
15
|
name: "vft-icon-text"
|
|
16
|
-
}), M = /* @__PURE__ */
|
|
17
|
-
...
|
|
16
|
+
}), M = /* @__PURE__ */ g({
|
|
17
|
+
...j,
|
|
18
18
|
props: {
|
|
19
19
|
text: {},
|
|
20
20
|
icon: {},
|
|
21
21
|
color: {},
|
|
22
22
|
hoverColor: {},
|
|
23
|
+
disableIconHover: { type: Boolean },
|
|
23
24
|
distance: { default: 3 },
|
|
24
25
|
reverse: { type: Boolean },
|
|
25
26
|
size: {},
|
|
@@ -32,43 +33,47 @@ const N = { key: 2 }, P = C({
|
|
|
32
33
|
useClamp: { type: Boolean }
|
|
33
34
|
},
|
|
34
35
|
setup(e) {
|
|
35
|
-
const m =
|
|
36
|
-
const o =
|
|
36
|
+
const m = O("icon-text"), i = t(() => e.hoverColor ? e.hoverColor : e.color), n = t(() => w(e.icon, "icon", { size: e.size, color: e.color })), v = t(() => e.direction === "col"), d = t(() => {
|
|
37
|
+
const o = C(e.distance);
|
|
37
38
|
return v.value ? e.reverse ? { marginTop: o } : { marginBottom: o } : e.reverse ? { marginLeft: o } : { marginRight: o };
|
|
38
|
-
}), a = t(() =>
|
|
39
|
-
const o =
|
|
39
|
+
}), a = t(() => H(e.size)), s = t(() => a.value < 12), p = t(() => a.value && s.value ? { transform: `scale(${a.value / 12})` } : {}), z = t(() => {
|
|
40
|
+
const o = L(
|
|
40
41
|
{
|
|
41
42
|
cursor: e.pointer ? "pointer" : void 0,
|
|
42
43
|
color: e.color,
|
|
43
|
-
"hover-color": i.value,
|
|
44
|
-
fontSize:
|
|
44
|
+
"hover-color": e.hoverColor ? i.value : void 0,
|
|
45
|
+
fontSize: s.value ? "12px" : C(e.size)
|
|
45
46
|
},
|
|
46
47
|
"icon-text"
|
|
47
48
|
);
|
|
48
49
|
return {
|
|
49
|
-
...
|
|
50
|
+
...s.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
|
|
50
51
|
...o,
|
|
51
52
|
...p.value
|
|
52
53
|
};
|
|
53
|
-
}),
|
|
54
|
+
}), B = t(() => ({
|
|
54
55
|
text: e.text,
|
|
55
56
|
maxLines: e.maxLines,
|
|
56
57
|
showTooltip: e.showTooltip,
|
|
57
58
|
...e.clampTooltipCfg
|
|
58
59
|
}));
|
|
59
|
-
return (o,
|
|
60
|
-
class:
|
|
61
|
-
|
|
60
|
+
return (o, T) => (r(), f("span", {
|
|
61
|
+
class: S([
|
|
62
|
+
l(m).b(),
|
|
63
|
+
l(m).is("col", v.value),
|
|
64
|
+
{ "disable-icon-hover": o.disableIconHover }
|
|
65
|
+
]),
|
|
66
|
+
style: k(z.value)
|
|
62
67
|
}, [
|
|
63
|
-
!o.reverse && n.value?.icon ? (r(),
|
|
64
|
-
"hover-color": i.value,
|
|
65
|
-
style:
|
|
66
|
-
}), null, 16, ["hover-color", "style"])) :
|
|
67
|
-
o.useClamp ? (r(),
|
|
68
|
-
o.reverse && n.value?.icon ? (r(),
|
|
69
|
-
style:
|
|
70
|
-
"hover-color": i.value
|
|
71
|
-
}), null, 16, ["style", "hover-color"])) :
|
|
68
|
+
!o.reverse && n.value?.icon ? (r(), c(l(y), u({ key: 0 }, n.value, {
|
|
69
|
+
"hover-color": o.hoverColor && !o.disableIconHover ? i.value : void 0,
|
|
70
|
+
style: d.value
|
|
71
|
+
}), null, 16, ["hover-color", "style"])) : h("", !0),
|
|
72
|
+
o.useClamp ? (r(), c(l(I), b(u({ key: 1 }, B.value)), null, 16)) : (r(), f("span", V, x(o.text), 1)),
|
|
73
|
+
o.reverse && n.value?.icon ? (r(), c(l(y), u({ key: 3 }, n.value, {
|
|
74
|
+
style: d.value,
|
|
75
|
+
"hover-color": o.hoverColor && !o.disableIconHover ? i.value : void 0
|
|
76
|
+
}), null, 16, ["style", "hover-color"])) : h("", !0)
|
|
72
77
|
], 6));
|
|
73
78
|
}
|
|
74
79
|
});
|
|
@@ -12,6 +12,9 @@ export declare const VftIconText: import("vft/es/utils").SFCWithInstall<import("
|
|
|
12
12
|
hoverColor: {
|
|
13
13
|
type: import("vue").PropType<string>;
|
|
14
14
|
};
|
|
15
|
+
disableIconHover: {
|
|
16
|
+
type: import("vue").PropType<boolean>;
|
|
17
|
+
};
|
|
15
18
|
distance: {
|
|
16
19
|
type: import("vue").PropType<string | number>;
|
|
17
20
|
};
|
|
@@ -56,6 +59,9 @@ export declare const VftIconText: import("vft/es/utils").SFCWithInstall<import("
|
|
|
56
59
|
hoverColor: {
|
|
57
60
|
type: import("vue").PropType<string>;
|
|
58
61
|
};
|
|
62
|
+
disableIconHover: {
|
|
63
|
+
type: import("vue").PropType<boolean>;
|
|
64
|
+
};
|
|
59
65
|
distance: {
|
|
60
66
|
type: import("vue").PropType<string | number>;
|
|
61
67
|
};
|
|
@@ -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 ye } 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 ot } from "../form/hooks/use-form-item.js";
|
|
18
18
|
const nt = ["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 nt = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
85
85
|
o.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 } = ot(xe.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = et(), h = tt(), o = pe("input"), Z = pe("textarea"), M = H(), b = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || b.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,11 +1,9 @@
|
|
|
1
1
|
export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
title: {
|
|
3
3
|
type: import("vue").PropType<string>;
|
|
4
|
-
required: true;
|
|
5
4
|
};
|
|
6
5
|
logo: {
|
|
7
6
|
type: import("vue").PropType<string>;
|
|
8
|
-
required: true;
|
|
9
7
|
};
|
|
10
8
|
jumpPath: {
|
|
11
9
|
type: import("vue").PropType<string>;
|
|
@@ -13,11 +11,9 @@ export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
13
11
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
12
|
title: {
|
|
15
13
|
type: import("vue").PropType<string>;
|
|
16
|
-
required: true;
|
|
17
14
|
};
|
|
18
15
|
logo: {
|
|
19
16
|
type: import("vue").PropType<string>;
|
|
20
|
-
required: true;
|
|
21
17
|
};
|
|
22
18
|
jumpPath: {
|
|
23
19
|
type: import("vue").PropType<string>;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
title: string;
|
|
3
|
-
logo: string;
|
|
4
|
-
/** 点击 logo 跳转路径 */
|
|
5
|
-
jumpPath?: string;
|
|
6
|
-
}
|
|
1
|
+
import type { LogoProps } from './types';
|
|
7
2
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<LogoProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<LogoProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
3
|
export default _default;
|
|
9
4
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouterHelper as k } from "@vft/router";
|
|
1
|
+
import { defineComponent as m, computed as i, getCurrentInstance as d, createElementBlock as r, createCommentVNode as l, openBlock as n, normalizeStyle as k, normalizeClass as s, unref as a, toDisplayString as C } from "vue";
|
|
3
2
|
import "@vueuse/core";
|
|
4
3
|
import "@vft/utils";
|
|
5
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
5
|
import "lodash-es";
|
|
7
6
|
import "../form/index.js";
|
|
8
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
9
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
9
|
import "@popperjs/core";
|
|
11
10
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
|
|
11
|
+
import { useRouterHelper as y } from "@vft/router";
|
|
12
|
+
const v = ["src"], P = m({
|
|
13
13
|
name: "vft-logo"
|
|
14
|
-
}),
|
|
15
|
-
...
|
|
14
|
+
}), _ = /* @__PURE__ */ m({
|
|
15
|
+
...P,
|
|
16
16
|
props: {
|
|
17
17
|
title: {},
|
|
18
18
|
logo: {},
|
|
19
|
-
jumpPath: {}
|
|
19
|
+
jumpPath: { default: "/" }
|
|
20
20
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const t =
|
|
23
|
-
function
|
|
24
|
-
|
|
21
|
+
setup(e) {
|
|
22
|
+
const t = h("logo"), c = i(() => [t.b()]), u = d().appContext.config.globalProperties.$router, { go: p } = y(u);
|
|
23
|
+
function g() {
|
|
24
|
+
e.jumpPath && p(e.jumpPath);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
() =>
|
|
26
|
+
const f = i(
|
|
27
|
+
() => e.jumpPath ? {} : t.cssVarBlock({ cursor: "inital" })
|
|
28
28
|
);
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
return (o, B) => o.logo || o.title ? (n(), r("div", {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: s(c.value),
|
|
32
|
+
onClick: g,
|
|
33
|
+
style: k(f.value)
|
|
33
34
|
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
o.logo ? (n(), r("img", {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: s(a(t).e("img")),
|
|
38
|
+
src: o.logo,
|
|
37
39
|
alt: ""
|
|
38
|
-
}, null, 10,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
}, null, 10, v)) : l("", !0),
|
|
41
|
+
o.title ? (n(), r("div", {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: s(a(t).e("title"))
|
|
44
|
+
}, C(o.title), 3)) : l("", !0)
|
|
45
|
+
], 6)) : l("", !0);
|
|
43
46
|
}
|
|
44
47
|
});
|
|
45
48
|
export {
|
|
46
|
-
|
|
49
|
+
_ as default
|
|
47
50
|
};
|
|
@@ -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"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@vft/use"),u=require("@vft/utils"),c=require("../icon-text/index.cjs");require("@vueuse/core");require("../config-provider/hooks/use-global-config.cjs");const a=require("../../utils/ns-cover.cjs");require("lodash-es");require("../form/index.cjs");const p=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const f=e.defineComponent({name:"full-screen"}),d=e.defineComponent({...f,props:{text:{},icon:{},color:{},hoverColor:{},disableIconHover:{type:Boolean},distance:{},reverse:{type:Boolean},size:{},direction:{},pointer:{type:Boolean},adjustOrigin:{type:Boolean},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const n=o,t=p.useNamespace("full-screen"),{toggle:s,isFullscreen:r}=l.useFullscreen(),i=a.primaryColor().value;return(q,m)=>(e.openBlock(),e.createBlock(e.unref(c.VftIconText),e.mergeProps({class:e.unref(t).b(),distance:2,"hover-color":e.unref(i),onClick:e.unref(s),icon:e.unref(r)?"icon-exit-full-screen":"icon-full-screen",text:e.unref(r)?"退出全屏":"全屏"},e.unref(u.delObjAttrNotExist)(n,!0,!0),{pointer:""}),null,16,["class","hover-color","onClick","icon","text"]))}});exports.default=d;
|
|
@@ -11,6 +11,9 @@ export declare const VftFullScreen: import("vft/es/utils").SFCWithInstall<import
|
|
|
11
11
|
hoverColor: {
|
|
12
12
|
type: import("vue").PropType<string>;
|
|
13
13
|
};
|
|
14
|
+
disableIconHover: {
|
|
15
|
+
type: import("vue").PropType<boolean>;
|
|
16
|
+
};
|
|
14
17
|
distance: {
|
|
15
18
|
type: import("vue").PropType<string | number>;
|
|
16
19
|
};
|
|
@@ -54,6 +57,9 @@ export declare const VftFullScreen: import("vft/es/utils").SFCWithInstall<import
|
|
|
54
57
|
hoverColor: {
|
|
55
58
|
type: import("vue").PropType<string>;
|
|
56
59
|
};
|
|
60
|
+
disableIconHover: {
|
|
61
|
+
type: import("vue").PropType<boolean>;
|
|
62
|
+
};
|
|
57
63
|
distance: {
|
|
58
64
|
type: import("vue").PropType<string | number>;
|
|
59
65
|
};
|
|
@@ -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"),g=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 p={key:2},k=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...k,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 c=B.useNamespace("icon-text"),n=e.computed(()=>o.hoverColor?o.hoverColor:o.color),r=e.computed(()=>v.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),a=e.computed(()=>o.direction==="col"),u=e.computed(()=>{const t=d.addUnit(o.distance);return a.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),l=e.computed(()=>v.removeUnit(o.size)),i=e.computed(()=>l.value<12),m=e.computed(()=>l.value&&i.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?n.value:void 0,fontSize:i.value?"12px":d.addUnit(o.size)},"icon-text");return{...i.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...m.value}}),h=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,y)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(c).b(),e.unref(c).is("col",a.value),{"disable-icon-hover":t.disableIconHover}]),style:e.normalizeStyle(f.value)},[!t.reverse&&r.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:0},r.value,{"hover-color":t.hoverColor&&!t.disableIconHover?n.value:void 0,style:u.value}),null,16,["hover-color","style"])):e.createCommentVNode("",!0),t.useClamp?(e.openBlock(),e.createBlock(e.unref(g.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},h.value)),null,16)):(e.openBlock(),e.createElementBlock("span",p,e.toDisplayString(t.text),1)),t.reverse&&r.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:3},r.value,{style:u.value,"hover-color":t.hoverColor&&!t.disableIconHover?n.value:void 0}),null,16,["style","hover-color"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
|
|
@@ -12,6 +12,9 @@ export declare const VftIconText: import("vft/es/utils").SFCWithInstall<import("
|
|
|
12
12
|
hoverColor: {
|
|
13
13
|
type: import("vue").PropType<string>;
|
|
14
14
|
};
|
|
15
|
+
disableIconHover: {
|
|
16
|
+
type: import("vue").PropType<boolean>;
|
|
17
|
+
};
|
|
15
18
|
distance: {
|
|
16
19
|
type: import("vue").PropType<string | number>;
|
|
17
20
|
};
|
|
@@ -56,6 +59,9 @@ export declare const VftIconText: import("vft/es/utils").SFCWithInstall<import("
|
|
|
56
59
|
hoverColor: {
|
|
57
60
|
type: import("vue").PropType<string>;
|
|
58
61
|
};
|
|
62
|
+
disableIconHover: {
|
|
63
|
+
type: import("vue").PropType<boolean>;
|
|
64
|
+
};
|
|
59
65
|
distance: {
|
|
60
66
|
type: import("vue").PropType<string | number>;
|
|
61
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const k=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"),oe=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:ne,emit:ae}){const l=ae,v=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const o={};return t.containerRole==="combobox"&&(o["aria-haspopup"]=v["aria-haspopup"],o["aria-owns"]=v["aria-owns"],o["aria-expanded"]=v["aria-expanded"]),o}),le=e.computed(()=>[t.type==="textarea"?A.b():n.b(),n.m(ie.value),n.is("disabled",m.value),n.is("exceed",fe.value),n.is("focus",c.value),{[n.b("group")]:i.prepend||i.append,[n.bm("group","append")]:i.append,[n.bm("group","prepend")]:i.prepend,[n.m("prefix")]:i.prefix||t.prefixIcon,[n.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[n.bm("suffix","password-clear")]:E.value&&z.value},v.class]),se=e.getCurrentInstance(),re=e.computed(()=>[n.e("wrapper"),n.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:C}=te.useFormItem(),{inputId:F}=te.useFormItemInputId(se.props,{formItemContext:C}),ie=oe.useFormSize(),m=oe.useFormDisabled(),n=Z.useNamespace("input"),A=Z.useNamespace("textarea"),w=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),x=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>w.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),g=e.computed(()=>C?.validateState||""),K=e.computed(()=>g.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[g.value]),de=e.computed(()=>x.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[v.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)),p=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(()=>!!p.value&&N.value>Number(r.value.maxlength)),pe=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||p.value||!!g.value&&R.value),[ve,ye]=_.useCursor(w);Y.useResizeObserver(f,o=>{if(!p.value||t.resize!=="both")return;const a=o[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 o=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,o,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},b=()=>{const o=h.value;!o||o.value===u.value||(o.value=u.value)},P=async o=>{ve();let{value:a}=o.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){b();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),b(),ye()}},j=o=>{l("change",o.target.value)},he=()=>{l("suffixClick",t.modelValue)},ge=()=>{l("prefixClick",t.modelValue)},L=o=>{l("compositionstart",o),y.value=!0},be=o=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(o),W=o=>{l("compositionupdate",o);const a=o.target?.value,d=a[a.length-1]||"";y.value=!be(d)},H=o=>{l("compositionend",o),y.value&&(y.value=!1,P(o))},ke=()=>{x.value=!x.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},Ce=()=>h.value?.blur(),G=o=>{c.value=!0,l("focus",o)},J=o=>{c.value=!1,l("blur",o),t.validateEvent&&C?.validate?.("blur").catch(a=>T.debugWarn(a))},we=o=>{V.value=!1,l("mouseleave",o)},xe=o=>{V.value=!0,l("mouseenter",o)},Q=o=>{let a=o.key;if(o.target.type==="number"&&["e","+","-0","E"].includes(a))return o.returnValue=!1,!1;l("keydown",o)},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&&C?.validate?.("change").catch(o=>T.debugWarn(o))}),e.watch(u,()=>b()),e.watch(()=>t.type,async()=>{await e.nextTick(),b(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),b(),e.nextTick(B)}),ne({input:w,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:Ce,select:Ee,clear:X,resizeTextarea:B}),(o,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:o.containerRole,onMouseenter:xe,onMouseleave:we,onMousewheel:a[1]||(a[1]=d=>o.type==="number"&&c.value?d.preventDefault():null)}),[o.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).be("group","prepend"))},[e.renderSlot(o.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[o.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("prefix-inner")),onClick:ge},[e.renderSlot(o.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(n).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:w,class:e.unref(n).e("inner")},e.unref(r),{type:o.showPassword?x.value?"text":"password":o.type,disabled:e.unref(m),formatter:o.formatter,parser:o.parser,readonly:o.readonly,autocomplete:o.autocomplete,tabindex:o.tabindex,"aria-label":o.label,placeholder:o.placeholder,style:o.inputStyle,form:o.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),pe.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(n).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("suffix-inner")),onClick:he},[!E.value||!z.value||!p.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(o.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(n).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(n).e("icon"),e.unref(n).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(k.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(n).e("icon"),e.unref(n).e("password")],onClick:ke}),null,16,["class"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(n).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),g.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(n).e("icon"),e.unref(n).e("validateIcon"),e.unref(n).is("loading",g.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),o.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).be("group","append"))},[e.renderSlot(o.$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:o.tabindex,disabled:e.unref(m),readonly:o.readonly,autocomplete:o.autocomplete,style:$.value,"aria-label":o.label,placeholder:o.placeholder,form:o.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),p.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(n).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,o.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 k=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"),oe=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:ne,emit:ae}){const l=ae,v=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const o={};return t.containerRole==="combobox"&&(o["aria-haspopup"]=v["aria-haspopup"],o["aria-owns"]=v["aria-owns"],o["aria-expanded"]=v["aria-expanded"]),o}),le=e.computed(()=>[t.type==="textarea"?A.b():n.b(),n.m(ie.value),n.is("disabled",m.value),n.is("exceed",fe.value),n.is("focus",c.value),{[n.b("group")]:i.prepend||i.append,[n.bm("group","append")]:i.append,[n.bm("group","prepend")]:i.prepend,[n.m("prefix")]:i.prefix||t.prefixIcon,[n.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[n.bm("suffix","password-clear")]:E.value&&z.value},v.class]),se=e.getCurrentInstance(),re=e.computed(()=>[n.e("wrapper"),n.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:C}=oe.useFormItem(),{inputId:F}=oe.useFormItemInputId(se.props,{formItemContext:C}),ie=te.useFormSize(),m=te.useFormDisabled(),n=Z.useNamespace("input"),A=Z.useNamespace("textarea"),w=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),x=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>w.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),g=e.computed(()=>C?.validateState||""),K=e.computed(()=>g.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[g.value]),de=e.computed(()=>x.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[v.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)),p=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(()=>!!p.value&&N.value>Number(r.value.maxlength)),pe=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||p.value||!!g.value&&R.value),[ve,ye]=_.useCursor(w);Y.useResizeObserver(f,o=>{if(!p.value||t.resize!=="both")return;const a=o[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 o=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,o,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},b=()=>{const o=h.value;!o||o.value===u.value||(o.value=u.value)},P=async o=>{ve();let{value:a}=o.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){b();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),b(),ye()}},j=o=>{l("change",o.target.value)},he=()=>{l("suffixClick",t.modelValue)},ge=()=>{l("prefixClick",t.modelValue)},L=o=>{l("compositionstart",o),y.value=!0},be=o=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(o),W=o=>{l("compositionupdate",o);const a=o.target?.value,d=a[a.length-1]||"";y.value=!be(d)},H=o=>{l("compositionend",o),y.value&&(y.value=!1,P(o))},ke=()=>{x.value=!x.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},Ce=()=>h.value?.blur(),G=o=>{c.value=!0,l("focus",o)},J=o=>{c.value=!1,l("blur",o),t.validateEvent&&C?.validate?.("blur").catch(a=>T.debugWarn(a))},we=o=>{V.value=!1,l("mouseleave",o)},xe=o=>{V.value=!0,l("mouseenter",o)},Q=o=>{let a=o.key;if(o.target.type==="number"&&["e","+","-0","E"].includes(a))return o.returnValue=!1,!1;l("keydown",o)},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&&C?.validate?.("change").catch(o=>T.debugWarn(o))}),e.watch(u,()=>b()),e.watch(()=>t.type,async()=>{await e.nextTick(),b(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),b(),e.nextTick(B)}),ne({input:w,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:Ce,select:Ee,clear:X,resizeTextarea:B}),(o,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:o.containerRole,onMouseenter:xe,onMouseleave:we,onMousewheel:a[1]||(a[1]=d=>o.type==="number"&&c.value?d.preventDefault():null)}),[o.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).be("group","prepend"))},[e.renderSlot(o.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[o.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("prefix-inner")),onClick:ge},[e.renderSlot(o.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(n).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:w,class:e.unref(n).e("inner")},e.unref(r),{type:o.showPassword?x.value?"text":"password":o.type,disabled:e.unref(m),formatter:o.formatter,parser:o.parser,readonly:o.readonly,autocomplete:o.autocomplete,tabindex:o.tabindex,"aria-label":o.label,placeholder:o.placeholder,style:o.inputStyle,form:o.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),pe.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(n).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("suffix-inner")),onClick:he},[!E.value||!z.value||!p.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(o.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(n).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(n).e("icon"),e.unref(n).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(k.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(n).e("icon"),e.unref(n).e("password")],onClick:ke}),null,16,["class"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(n).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),g.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(k.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(n).e("icon"),e.unref(n).e("validateIcon"),e.unref(n).is("loading",g.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),o.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).be("group","append"))},[e.renderSlot(o.$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:o.tabindex,disabled:e.unref(m),readonly:o.readonly,autocomplete:o.autocomplete,style:$.value,"aria-label":o.label,placeholder:o.placeholder,form:o.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),p.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(n).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,o.type!=="hidden"]])}});exports.default=ze;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
title: {
|
|
3
3
|
type: import("vue").PropType<string>;
|
|
4
|
-
required: true;
|
|
5
4
|
};
|
|
6
5
|
logo: {
|
|
7
6
|
type: import("vue").PropType<string>;
|
|
8
|
-
required: true;
|
|
9
7
|
};
|
|
10
8
|
jumpPath: {
|
|
11
9
|
type: import("vue").PropType<string>;
|
|
@@ -13,11 +11,9 @@ export declare const VftLogo: import("vft/es/utils").SFCWithInstall<import("vue"
|
|
|
13
11
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
12
|
title: {
|
|
15
13
|
type: import("vue").PropType<string>;
|
|
16
|
-
required: true;
|
|
17
14
|
};
|
|
18
15
|
logo: {
|
|
19
16
|
type: import("vue").PropType<string>;
|
|
20
|
-
required: true;
|
|
21
17
|
};
|
|
22
18
|
jumpPath: {
|
|
23
19
|
type: import("vue").PropType<string>;
|