vft 0.0.464 → 0.0.465
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/es/components/carousel/use-carousel.js +1 -1
- package/es/components/col/col.vue.d.ts +3 -0
- package/es/components/col/col.vue2.js +23 -22
- package/es/components/col/index.d.ts +15 -0
- package/es/components/col/types.d.ts +1 -0
- 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/multiple-tabs/use/use-tab-dropdown.js +28 -22
- package/es/components/row/index.d.ts +9 -0
- package/es/components/row/row.vue2.js +16 -14
- package/es/components/row/types.d.ts +1 -0
- 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/col/col.vue.d.ts +3 -0
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/col/index.d.ts +15 -0
- package/lib/components/col/types.d.ts +1 -0
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/row/index.d.ts +9 -0
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/row/types.d.ts +1 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/src/multiple-tabs.scss +5 -1
- package/theme-style/vft-multiple-tabs.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 { carouselContextKey as Se, CAROUSEL_ITEM_NAME as H } from "./constants.js";
|
|
15
15
|
const L = 300, ze = (t, O, M) => {
|
|
16
16
|
const {
|
|
17
17
|
children: o,
|
|
@@ -8,16 +8,19 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
8
8
|
offset: number;
|
|
9
9
|
pull: number;
|
|
10
10
|
push: number;
|
|
11
|
+
className: string;
|
|
11
12
|
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ColProps>, {
|
|
12
13
|
tag: string;
|
|
13
14
|
span: number;
|
|
14
15
|
offset: number;
|
|
15
16
|
pull: number;
|
|
16
17
|
push: number;
|
|
18
|
+
className: string;
|
|
17
19
|
}>>> & Readonly<{}>, {
|
|
18
20
|
span: number;
|
|
19
21
|
push: number;
|
|
20
22
|
offset: number;
|
|
23
|
+
className: string;
|
|
21
24
|
tag: string;
|
|
22
25
|
pull: number;
|
|
23
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as f, inject as d, computed as n, createBlock as h, openBlock as $, resolveDynamicComponent as g, normalizeStyle as b, normalizeClass as v, withCtx as x, renderSlot as y } from "vue";
|
|
2
2
|
import "../row/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
|
-
import { isNumber as
|
|
4
|
+
import { isNumber as r, isObject as _ } from "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
@@ -9,11 +9,11 @@ import { useNamespace as C } from "../../hooks/use-namespace/index.js";
|
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
import { rowContextKey as
|
|
13
|
-
const
|
|
12
|
+
import { rowContextKey as N } from "../row/constants.js";
|
|
13
|
+
const j = f({
|
|
14
14
|
name: "vft-col"
|
|
15
15
|
}), G = /* @__PURE__ */ f({
|
|
16
|
-
...
|
|
16
|
+
...j,
|
|
17
17
|
props: {
|
|
18
18
|
tag: { default: "div" },
|
|
19
19
|
xs: {},
|
|
@@ -21,36 +21,37 @@ const E = f({
|
|
|
21
21
|
md: {},
|
|
22
22
|
lg: {},
|
|
23
23
|
xl: {},
|
|
24
|
+
className: { default: "" },
|
|
24
25
|
span: { default: 24 },
|
|
25
26
|
offset: { default: 0 },
|
|
26
27
|
pull: { default: 0 },
|
|
27
28
|
push: { default: 0 }
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
return a.value && (
|
|
33
|
-
}),
|
|
34
|
-
const
|
|
35
|
-
return ["span", "offset", "pull", "push"].forEach((
|
|
36
|
-
const l = s
|
|
37
|
-
|
|
38
|
-
}), ["xs", "sm", "md", "lg", "xl"].forEach((
|
|
39
|
-
|
|
30
|
+
setup(c) {
|
|
31
|
+
const e = c, o = C("col"), { gutter: a } = d(N, { gutter: n(() => 0) }), m = n(() => {
|
|
32
|
+
const t = {};
|
|
33
|
+
return a.value && (t.paddingLeft = t.paddingRight = `${a.value / 2}px`), t;
|
|
34
|
+
}), i = n(() => {
|
|
35
|
+
const t = [];
|
|
36
|
+
return ["span", "offset", "pull", "push"].forEach((s) => {
|
|
37
|
+
const l = e[s];
|
|
38
|
+
r(l) && (s === "span" ? t.push(o.b(`${e[s]}`)) : l > 0 && t.push(o.b(`${s}-${e[s]}`)));
|
|
39
|
+
}), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
|
|
40
|
+
r(e[s]) ? t.push(o.b(`${s}-${e[s]}`)) : _(e[s]) && Object.entries(e[s]).forEach(
|
|
40
41
|
([l, u]) => {
|
|
41
|
-
|
|
42
|
-
l !== "span" ? o.b(`${
|
|
42
|
+
t.push(
|
|
43
|
+
l !== "span" ? o.b(`${s}-${l}-${u}`) : o.b(`${s}-${u}`)
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
|
-
}), a.value &&
|
|
47
|
+
}), a.value && t.push(o.is("guttered")), e.className && t.push(e.className), [o.b(), t];
|
|
47
48
|
});
|
|
48
|
-
return (
|
|
49
|
-
class: v(
|
|
50
|
-
style: b(
|
|
49
|
+
return (t, p) => ($(), h(g(c.tag), {
|
|
50
|
+
class: v(i.value),
|
|
51
|
+
style: b(m.value)
|
|
51
52
|
}, {
|
|
52
53
|
default: x(() => [
|
|
53
|
-
y(
|
|
54
|
+
y(t.$slots, "default")
|
|
54
55
|
]),
|
|
55
56
|
_: 3
|
|
56
57
|
}, 8, ["class", "style"]));
|
|
@@ -12,6 +12,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
12
12
|
type: import("vue").PropType<number>;
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
|
+
className: {
|
|
16
|
+
type: import("vue").PropType<string>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
15
19
|
tag: {
|
|
16
20
|
type: import("vue").PropType<string>;
|
|
17
21
|
default: string;
|
|
@@ -39,6 +43,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
39
43
|
span: number;
|
|
40
44
|
push: number;
|
|
41
45
|
offset: number;
|
|
46
|
+
className: string;
|
|
42
47
|
tag: string;
|
|
43
48
|
pull: number;
|
|
44
49
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -61,6 +66,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
61
66
|
type: import("vue").PropType<number>;
|
|
62
67
|
default: number;
|
|
63
68
|
};
|
|
69
|
+
className: {
|
|
70
|
+
type: import("vue").PropType<string>;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
64
73
|
tag: {
|
|
65
74
|
type: import("vue").PropType<string>;
|
|
66
75
|
default: string;
|
|
@@ -88,6 +97,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
88
97
|
span: number;
|
|
89
98
|
push: number;
|
|
90
99
|
offset: number;
|
|
100
|
+
className: string;
|
|
91
101
|
tag: string;
|
|
92
102
|
pull: number;
|
|
93
103
|
}>;
|
|
@@ -107,6 +117,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
107
117
|
type: import("vue").PropType<number>;
|
|
108
118
|
default: number;
|
|
109
119
|
};
|
|
120
|
+
className: {
|
|
121
|
+
type: import("vue").PropType<string>;
|
|
122
|
+
default: string;
|
|
123
|
+
};
|
|
110
124
|
tag: {
|
|
111
125
|
type: import("vue").PropType<string>;
|
|
112
126
|
default: string;
|
|
@@ -134,6 +148,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
134
148
|
span: number;
|
|
135
149
|
push: number;
|
|
136
150
|
offset: number;
|
|
151
|
+
className: string;
|
|
137
152
|
tag: string;
|
|
138
153
|
pull: number;
|
|
139
154
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
@@ -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",
|
|
@@ -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 { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
|
|
17
|
+
import { useFormSize as at, useFormDisabled as nt } from "../form/hooks/use-form-common-props.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 } = et(), { inputId: Y } = tt(we.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = at(), x = nt(), 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, UPDATE_MODEL_EVENT as d, INPUT_EVENT as H } 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,36 +1,37 @@
|
|
|
1
1
|
import { getRouterKeyPath as d } from "@vft/router";
|
|
2
|
-
import { useMultipleTabStore as
|
|
2
|
+
import { useMultipleTabStore as D, useTabs as v } from "@vft/store";
|
|
3
3
|
import "@vft/utils";
|
|
4
|
-
import { reactive as
|
|
4
|
+
import { reactive as w, computed as M } from "vue";
|
|
5
5
|
import "../../context-menu/context-menu.vue2.js";
|
|
6
6
|
import "../../icon/index.js";
|
|
7
7
|
import "vue-router";
|
|
8
|
-
function
|
|
9
|
-
const i =
|
|
8
|
+
function K(e, t) {
|
|
9
|
+
const i = w({
|
|
10
10
|
current: null,
|
|
11
11
|
currentIndex: 0
|
|
12
|
-
}),
|
|
13
|
-
refreshPage:
|
|
14
|
-
closeAll:
|
|
12
|
+
}), n = D(), {
|
|
13
|
+
refreshPage: g,
|
|
14
|
+
closeAll: a,
|
|
15
15
|
close: u,
|
|
16
16
|
closeLeft: h,
|
|
17
|
-
closeOther:
|
|
18
|
-
closeRight:
|
|
19
|
-
newWinTab:
|
|
20
|
-
|
|
17
|
+
closeOther: f,
|
|
18
|
+
closeRight: p,
|
|
19
|
+
newWinTab: x,
|
|
20
|
+
fullScreen: b
|
|
21
|
+
} = v(), L = M(() => {
|
|
21
22
|
if (!e)
|
|
22
23
|
return;
|
|
23
|
-
const { meta: r } = e, o = i.currentIndex, c = o === 0 || o <=
|
|
24
|
+
const { meta: r } = e, o = i.currentIndex, c = o === 0 || o <= t, s = n.getTabList.length <= t || o === n.getTabList.length - 1 && n.getLastDragEndIndex >= 0, C = n.getTabList.length === t || n.getTabList.length === t + 1 && o === t, l = n.getTabList.length === t;
|
|
24
25
|
return [
|
|
25
26
|
{
|
|
26
27
|
iconCfg: { icon: "icon-refresh-right" },
|
|
27
28
|
text: "刷新",
|
|
28
|
-
handler: () =>
|
|
29
|
+
handler: () => g(e)
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
iconCfg: { icon: "icon-new-tab" },
|
|
32
33
|
text: "新页面打开",
|
|
33
|
-
handler: () =>
|
|
34
|
+
handler: () => x(e),
|
|
34
35
|
divider: !0
|
|
35
36
|
},
|
|
36
37
|
{
|
|
@@ -50,35 +51,40 @@ function E(e, n) {
|
|
|
50
51
|
text: "关闭右侧标签页",
|
|
51
52
|
disabled: s,
|
|
52
53
|
divider: !0,
|
|
53
|
-
handler: () =>
|
|
54
|
+
handler: () => p(e)
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
57
|
iconCfg: { icon: "icon-close-box-multiple-outline" },
|
|
57
58
|
text: "关闭其它标签页",
|
|
58
|
-
disabled:
|
|
59
|
-
handler: () =>
|
|
59
|
+
disabled: C,
|
|
60
|
+
handler: () => f(e)
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
iconCfg: { icon: "icon-vector-square-delete" },
|
|
63
64
|
text: "关闭所有标签页",
|
|
64
65
|
disabled: l,
|
|
65
|
-
handler: () =>
|
|
66
|
+
handler: () => a()
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
iconCfg: { icon: "icon-full-screen" },
|
|
70
|
+
text: "全屏",
|
|
71
|
+
handler: () => b(e)
|
|
66
72
|
}
|
|
67
73
|
];
|
|
68
74
|
});
|
|
69
|
-
function
|
|
75
|
+
function T(r) {
|
|
70
76
|
return (o) => {
|
|
71
77
|
if (!r)
|
|
72
78
|
return;
|
|
73
79
|
o?.preventDefault();
|
|
74
|
-
const c =
|
|
80
|
+
const c = n.getTabList.findIndex(
|
|
75
81
|
(s) => d(s) === d(r)
|
|
76
82
|
);
|
|
77
83
|
i.current = r, i.currentIndex = c;
|
|
78
84
|
};
|
|
79
85
|
}
|
|
80
|
-
return { getDropMenuList:
|
|
86
|
+
return { getDropMenuList: L, handleContextMenu: T };
|
|
81
87
|
}
|
|
82
88
|
export {
|
|
83
|
-
|
|
89
|
+
K as useTabDropdown
|
|
84
90
|
};
|
|
@@ -12,6 +12,9 @@ export declare const VftRow: import("vft/es/utils").SFCWithInstall<{
|
|
|
12
12
|
align: {
|
|
13
13
|
type: import("vue").PropType<import("./types").RowAlign>;
|
|
14
14
|
};
|
|
15
|
+
className: {
|
|
16
|
+
type: import("vue").PropType<string>;
|
|
17
|
+
};
|
|
15
18
|
}>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
16
19
|
P: {};
|
|
17
20
|
B: {};
|
|
@@ -32,6 +35,9 @@ export declare const VftRow: import("vft/es/utils").SFCWithInstall<{
|
|
|
32
35
|
align: {
|
|
33
36
|
type: import("vue").PropType<import("./types").RowAlign>;
|
|
34
37
|
};
|
|
38
|
+
className: {
|
|
39
|
+
type: import("vue").PropType<string>;
|
|
40
|
+
};
|
|
35
41
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
36
42
|
__isFragment?: never;
|
|
37
43
|
__isTeleport?: never;
|
|
@@ -49,6 +55,9 @@ export declare const VftRow: import("vft/es/utils").SFCWithInstall<{
|
|
|
49
55
|
align: {
|
|
50
56
|
type: import("vue").PropType<import("./types").RowAlign>;
|
|
51
57
|
};
|
|
58
|
+
className: {
|
|
59
|
+
type: import("vue").PropType<string>;
|
|
60
|
+
};
|
|
52
61
|
}>> & 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 () => {
|
|
53
62
|
$slots: {
|
|
54
63
|
default?(_: {}): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, provide as s, computed as r, createBlock as n, openBlock as m, resolveDynamicComponent as u, normalizeStyle as f, normalizeClass as c, withCtx as g, renderSlot as d } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import "@vft/utils";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -9,30 +9,32 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
11
|
import { rowContextKey as p } from "./constants.js";
|
|
12
|
-
const v =
|
|
12
|
+
const v = o({
|
|
13
13
|
name: "vft-row"
|
|
14
|
-
}),
|
|
14
|
+
}), b = /* @__PURE__ */ o({
|
|
15
15
|
...v,
|
|
16
16
|
props: {
|
|
17
17
|
tag: { default: "div" },
|
|
18
18
|
gutter: { default: 0 },
|
|
19
19
|
justify: { default: "start" },
|
|
20
|
-
align: { default: "top" }
|
|
20
|
+
align: { default: "top" },
|
|
21
|
+
className: {}
|
|
21
22
|
},
|
|
22
23
|
setup(t) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
gutter:
|
|
24
|
+
const a = y("row");
|
|
25
|
+
s(p, {
|
|
26
|
+
gutter: r(() => t.gutter)
|
|
26
27
|
});
|
|
27
|
-
const i =
|
|
28
|
+
const i = r(() => {
|
|
28
29
|
const e = {};
|
|
29
30
|
return t.gutter && (e.marginRight = e.marginLeft = `-${t.gutter / 2}px`), e;
|
|
30
|
-
}), l =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}), l = r(() => [
|
|
32
|
+
a.b(),
|
|
33
|
+
a.is(`justify-${t.justify}`, t.justify !== "start"),
|
|
34
|
+
a.is(`align-${t.align}`, t.align !== "top"),
|
|
35
|
+
t.className
|
|
34
36
|
]);
|
|
35
|
-
return (e, w) => (
|
|
37
|
+
return (e, w) => (m(), n(u(t.tag), {
|
|
36
38
|
class: c(l.value),
|
|
37
39
|
style: f(i.value)
|
|
38
40
|
}, {
|
|
@@ -44,5 +46,5 @@ const v = a({
|
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
b as default
|
|
48
50
|
};
|
|
@@ -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, createTextVNode as O, isVNode as le, resolveComponent as N } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../avatar-stack/index.js";
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
package/es/utils/vue/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasOwn as m, camelize as N, isArray as E } 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";
|
|
@@ -8,16 +8,19 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
8
8
|
offset: number;
|
|
9
9
|
pull: number;
|
|
10
10
|
push: number;
|
|
11
|
+
className: string;
|
|
11
12
|
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ColProps>, {
|
|
12
13
|
tag: string;
|
|
13
14
|
span: number;
|
|
14
15
|
offset: number;
|
|
15
16
|
pull: number;
|
|
16
17
|
push: number;
|
|
18
|
+
className: string;
|
|
17
19
|
}>>> & Readonly<{}>, {
|
|
18
20
|
span: number;
|
|
19
21
|
push: number;
|
|
20
22
|
offset: number;
|
|
23
|
+
className: string;
|
|
21
24
|
tag: string;
|
|
22
25
|
pull: number;
|
|
23
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../row/index.cjs");require("@vueuse/core");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../row/index.cjs");require("@vueuse/core");const r=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const m=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=require("../row/constants.cjs"),h=t.defineComponent({name:"vft-col"}),b=t.defineComponent({...h,props:{tag:{default:"div"},xs:{},sm:{},md:{},lg:{},xl:{},className:{default:""},span:{default:24},offset:{default:0},pull:{default:0},push:{default:0}},setup(o){const u=o,l=m.useNamespace("col"),{gutter:a}=t.inject(p.rowContextKey,{gutter:t.computed(()=>0)}),i=t.computed(()=>{const e={};return a.value&&(e.paddingLeft=e.paddingRight=`${a.value/2}px`),e}),f=t.computed(()=>{const e=[];return["span","offset","pull","push"].forEach(s=>{const n=u[s];r.isNumber(n)&&(s==="span"?e.push(l.b(`${u[s]}`)):n>0&&e.push(l.b(`${s}-${u[s]}`)))}),["xs","sm","md","lg","xl"].forEach(s=>{r.isNumber(u[s])?e.push(l.b(`${s}-${u[s]}`)):r.isObject(u[s])&&Object.entries(u[s]).forEach(([n,c])=>{e.push(n!=="span"?l.b(`${s}-${n}-${c}`):l.b(`${s}-${c}`))})}),a.value&&e.push(l.is("guttered")),u.className&&e.push(u.className),[l.b(),e]});return(e,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(f.value),style:t.normalizeStyle(i.value)},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["class","style"]))}});exports.default=b;
|
|
@@ -12,6 +12,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
12
12
|
type: import("vue").PropType<number>;
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
|
+
className: {
|
|
16
|
+
type: import("vue").PropType<string>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
15
19
|
tag: {
|
|
16
20
|
type: import("vue").PropType<string>;
|
|
17
21
|
default: string;
|
|
@@ -39,6 +43,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
39
43
|
span: number;
|
|
40
44
|
push: number;
|
|
41
45
|
offset: number;
|
|
46
|
+
className: string;
|
|
42
47
|
tag: string;
|
|
43
48
|
pull: number;
|
|
44
49
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -61,6 +66,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
61
66
|
type: import("vue").PropType<number>;
|
|
62
67
|
default: number;
|
|
63
68
|
};
|
|
69
|
+
className: {
|
|
70
|
+
type: import("vue").PropType<string>;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
64
73
|
tag: {
|
|
65
74
|
type: import("vue").PropType<string>;
|
|
66
75
|
default: string;
|
|
@@ -88,6 +97,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
88
97
|
span: number;
|
|
89
98
|
push: number;
|
|
90
99
|
offset: number;
|
|
100
|
+
className: string;
|
|
91
101
|
tag: string;
|
|
92
102
|
pull: number;
|
|
93
103
|
}>;
|
|
@@ -107,6 +117,10 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
107
117
|
type: import("vue").PropType<number>;
|
|
108
118
|
default: number;
|
|
109
119
|
};
|
|
120
|
+
className: {
|
|
121
|
+
type: import("vue").PropType<string>;
|
|
122
|
+
default: string;
|
|
123
|
+
};
|
|
110
124
|
tag: {
|
|
111
125
|
type: import("vue").PropType<string>;
|
|
112
126
|
default: string;
|
|
@@ -134,6 +148,7 @@ export declare const VftCol: import("vft/es/utils").SFCWithInstall<{
|
|
|
134
148
|
span: number;
|
|
135
149
|
push: number;
|
|
136
150
|
offset: number;
|
|
151
|
+
className: string;
|
|
137
152
|
tag: string;
|
|
138
153
|
pull: number;
|
|
139
154
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
@@ -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-common-props.cjs"),ne=require("../form/hooks/use-form-item.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=ne.useFormItem(),{inputId:F}=ne.useFormItemInputId(se.props,{formItemContext:k}),ie=te.useFormSize(),m=te.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-item.cjs"),ne=require("../form/hooks/use-form-common-props.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=te.useFormItem(),{inputId:F}=te.useFormItemInputId(se.props,{formItemContext:k}),ie=ne.useFormSize(),m=ne.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{const a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|