vft 0.0.335 → 0.0.338
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/form/form-item.vue.d.ts +3 -0
- package/es/components/form/form-item.vue2.js +101 -95
- package/es/components/form/index.d.ts +48 -0
- package/es/components/form/types.d.ts +2 -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/search/style/css.d.ts +1 -0
- package/es/components/search/style/css.js +1 -0
- package/es/components/search/style/index.d.ts +1 -0
- package/es/components/search/style/index.js +1 -0
- package/es/components/super-form/index.d.ts +15 -0
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/super-form/super-form.vue.d.ts +1 -0
- package/es/components/super-form/super-form.vue2.js +3 -3
- package/es/components/super-form/types.d.ts +1 -0
- package/es/components/super-form/use/helper.js +53 -137
- 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/form/form-item.vue.d.ts +3 -0
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/index.d.ts +48 -0
- package/lib/components/form/types.d.ts +2 -0
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/search/style/css.cjs +1 -1
- package/lib/components/search/style/css.d.ts +1 -0
- package/lib/components/search/style/index.cjs +1 -1
- package/lib/components/search/style/index.d.ts +1 -0
- package/lib/components/super-form/index.d.ts +15 -0
- package/lib/components/super-form/super-form.vue.d.ts +1 -0
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +1 -0
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/checkbox.scss +46 -45
- package/theme-style/vft-checkbox.css +1 -1
- package/web-types.json +1 -1
|
@@ -10,7 +10,7 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
10
10
|
import { useOrderedChildren as Ie } from "../../hooks/use-ordered-children/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { carouselContextKey as ge, CAROUSEL_ITEM_NAME as H } from "./constants.js";
|
|
14
14
|
const L = 300, _e = (t, O, M) => {
|
|
15
15
|
const {
|
|
16
16
|
children: o,
|
|
@@ -13,6 +13,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
13
13
|
inlineMessage: string;
|
|
14
14
|
labelWidth: string;
|
|
15
15
|
showMessage: boolean;
|
|
16
|
+
hideLabel: boolean;
|
|
16
17
|
}>>, {
|
|
17
18
|
size: import("vue").ComputedRef<import("vft/es/constants").ComponentSize>;
|
|
18
19
|
validateMessage: import("vue").Ref<string, string>;
|
|
@@ -27,6 +28,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
27
28
|
inlineMessage: string;
|
|
28
29
|
labelWidth: string;
|
|
29
30
|
showMessage: boolean;
|
|
31
|
+
hideLabel: boolean;
|
|
30
32
|
}>>> & Readonly<{
|
|
31
33
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
32
34
|
}>, {
|
|
@@ -34,6 +36,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
34
36
|
labelWidth: string | number;
|
|
35
37
|
inlineMessage: string | boolean;
|
|
36
38
|
showMessage: boolean;
|
|
39
|
+
hideLabel: boolean;
|
|
37
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
41
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
39
42
|
export default _default;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as Y, useSlots as ye, inject as
|
|
2
|
-
import { refDebounced as
|
|
3
|
-
import { isBoolean as
|
|
1
|
+
import { defineComponent as Y, useSlots as ye, inject as D, ref as b, computed as a, watch as E, reactive as Se, toRefs as ke, provide as qe, onMounted as Ie, onBeforeUnmount as Ve, createElementBlock as _e, openBlock as F, unref as f, normalizeClass as g, createBlock as T, createCommentVNode as R, createElementVNode as G, withCtx as B, resolveDynamicComponent as we, normalizeStyle as K, renderSlot as M, createTextVNode as Ce, toDisplayString as U, createVNode as Fe, TransitionGroup as Re, nextTick as Be } from "vue";
|
|
2
|
+
import { refDebounced as Me } from "@vueuse/core";
|
|
3
|
+
import { isBoolean as We, getProp as W, isFunction as ze } from "@vft/utils";
|
|
4
4
|
import { addUnit as O, castArray as H } from "../../utils/helper.js";
|
|
5
5
|
import { isArray as J, clone as Q } from "lodash-es";
|
|
6
6
|
import { useId as $e } from "../../hooks/use-id/index.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as xe } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
11
|
import Pe from "async-validator";
|
|
12
|
-
import { formContextKey as
|
|
13
|
-
import
|
|
14
|
-
import { useFormSize as
|
|
15
|
-
const
|
|
12
|
+
import { formContextKey as Ae, formItemContextKey as X } from "./constants.js";
|
|
13
|
+
import Ne from "./form-label-wrap.js";
|
|
14
|
+
import { useFormSize as Le } from "./hooks/use-form-common-props.js";
|
|
15
|
+
const je = ["role", "aria-labelledby"], De = Y({
|
|
16
16
|
name: "vft-form-item"
|
|
17
17
|
}), rt = /* @__PURE__ */ Y({
|
|
18
|
-
...
|
|
18
|
+
...De,
|
|
19
19
|
props: {
|
|
20
20
|
label: {},
|
|
21
21
|
labelWidth: { default: "" },
|
|
@@ -28,26 +28,28 @@ const De = ["role", "aria-labelledby"], Ee = Y({
|
|
|
28
28
|
validateStatus: {},
|
|
29
29
|
inlineMessage: { type: [String, Boolean], default: "" },
|
|
30
30
|
showMessage: { type: Boolean, default: !0 },
|
|
31
|
-
size: {}
|
|
31
|
+
size: {},
|
|
32
|
+
hideRequiredAsterisk: { type: Boolean },
|
|
33
|
+
hideLabel: { type: Boolean, default: !1 }
|
|
32
34
|
},
|
|
33
35
|
emits: ["update:error"],
|
|
34
36
|
setup(Z, { expose: ee, emit: te }) {
|
|
35
|
-
const t = Z, re = te,
|
|
36
|
-
let
|
|
37
|
-
const
|
|
37
|
+
const t = Z, re = te, z = ye(), o = D(Ae, void 0), oe = D(X, void 0), y = Le(void 0, { formItem: !1 }), s = xe("form-item"), S = $e().value, d = b([]), c = b(""), le = Me(c, 100), n = b(""), $ = b();
|
|
38
|
+
let x, v = !1;
|
|
39
|
+
const h = a(
|
|
38
40
|
() => t.labelPosition || o?.labelPosition
|
|
39
|
-
),
|
|
40
|
-
if (
|
|
41
|
+
), P = a(() => {
|
|
42
|
+
if (h.value === "top")
|
|
41
43
|
return {};
|
|
42
44
|
const e = O(t.labelWidth || o?.labelWidth || "");
|
|
43
45
|
return e ? { width: e } : {};
|
|
44
46
|
}), ae = a(() => {
|
|
45
|
-
if (
|
|
47
|
+
if (h.value === "top" || o?.inline)
|
|
46
48
|
return {};
|
|
47
49
|
if (!t.label && !t.labelWidth && ue)
|
|
48
50
|
return {};
|
|
49
51
|
const e = O(t.labelWidth || o?.labelWidth || "");
|
|
50
|
-
return !t.label && !
|
|
52
|
+
return !t.label && !z.label ? { marginLeft: e } : {};
|
|
51
53
|
}), se = a(() => [
|
|
52
54
|
s.b(),
|
|
53
55
|
s.m(y.value),
|
|
@@ -55,174 +57,178 @@ const De = ["role", "aria-labelledby"], Ee = Y({
|
|
|
55
57
|
s.is("validating", c.value === "validating"),
|
|
56
58
|
s.is("success", c.value === "success"),
|
|
57
59
|
s.is("required", fe.value || t.required),
|
|
58
|
-
s.is(
|
|
60
|
+
s.is(
|
|
61
|
+
"no-asterisk",
|
|
62
|
+
t?.hideRequiredAsterisk || o?.hideRequiredAsterisk
|
|
63
|
+
),
|
|
59
64
|
o?.requireAsteriskPosition === "right" ? "asterisk-right" : "asterisk-left",
|
|
60
65
|
{
|
|
61
66
|
[s.m("feedback")]: o?.statusIcon,
|
|
62
|
-
[s.m(`label-${
|
|
67
|
+
[s.m(`label-${h.value}`)]: h.value
|
|
63
68
|
}
|
|
64
69
|
]), ie = a(
|
|
65
|
-
() =>
|
|
70
|
+
() => We(t.inlineMessage) ? t.inlineMessage : o?.inlineMessage || !1
|
|
66
71
|
), ne = a(() => [
|
|
67
72
|
s.e("error"),
|
|
68
73
|
{ [s.em("error", "inline")]: ie.value }
|
|
69
|
-
]),
|
|
74
|
+
]), A = a(() => t.prop ? J(t.prop) ? t.prop.join(".") : t.prop : ""), k = a(() => !!(t.label || z.label)), q = a(() => t.for ?? (d.value.length === 1 ? d.value[0] : void 0)), I = a(() => !q.value && k.value), ue = !!oe, V = a(() => {
|
|
70
75
|
const e = o?.model;
|
|
71
76
|
if (!(!e || !t.prop))
|
|
72
|
-
return
|
|
73
|
-
}),
|
|
77
|
+
return W(e, t.prop).value;
|
|
78
|
+
}), _ = a(() => {
|
|
74
79
|
const { required: e } = t, r = [];
|
|
75
80
|
t.rules && r.push(
|
|
76
81
|
...H(t.rules).map((l) => (l.trigger = l.trigger || "blur", l))
|
|
77
82
|
);
|
|
78
83
|
const i = o?.rules;
|
|
79
84
|
if (i && t.prop) {
|
|
80
|
-
const l =
|
|
85
|
+
const l = W(
|
|
81
86
|
i,
|
|
82
87
|
t.prop
|
|
83
88
|
).value;
|
|
84
89
|
l && r.push(...H(l));
|
|
85
90
|
}
|
|
86
91
|
if (e !== void 0) {
|
|
87
|
-
const l = r.map((u,
|
|
92
|
+
const l = r.map((u, m) => [u, m]).filter(([u]) => Object.keys(u).includes("required"));
|
|
88
93
|
if (l.length > 0)
|
|
89
|
-
for (const [u,
|
|
90
|
-
u.required !== e && (r[
|
|
94
|
+
for (const [u, m] of l)
|
|
95
|
+
u.required !== e && (r[m] = { ...u, required: e });
|
|
91
96
|
else
|
|
92
97
|
r.push({ required: e });
|
|
93
98
|
}
|
|
94
99
|
return r;
|
|
95
|
-
}), de = a(() =>
|
|
96
|
-
() =>
|
|
97
|
-
),
|
|
100
|
+
}), de = a(() => _.value.length > 0), ce = (e) => _.value.filter((i) => !i.trigger || !e ? !0 : J(i.trigger) ? i.trigger.includes(e) : i.trigger === e).map(({ trigger: i, ...l }) => l), fe = a(
|
|
101
|
+
() => _.value.some((e) => e.required)
|
|
102
|
+
), pe = a(
|
|
98
103
|
() => le.value === "error" && t.showMessage && (o?.showMessage ?? !0)
|
|
99
|
-
),
|
|
104
|
+
), N = a(
|
|
100
105
|
() => `${t.label || ""}${o?.labelSuffix || ""}`
|
|
101
|
-
),
|
|
106
|
+
), p = (e) => {
|
|
102
107
|
c.value = e;
|
|
103
|
-
},
|
|
108
|
+
}, me = (e) => {
|
|
104
109
|
const { errors: r, fields: i } = e;
|
|
105
|
-
(!r || !i) && console.error(e),
|
|
110
|
+
(!r || !i) && console.error(e), p("error"), n.value = r ? r?.[0]?.message ?? `${t.prop} is required` : "", o?.emit("validate", t.prop, !1, n.value);
|
|
106
111
|
}, ve = () => {
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
const r =
|
|
112
|
+
p("success"), o?.emit("validate", t.prop, !0, "");
|
|
113
|
+
}, he = async (e) => {
|
|
114
|
+
const r = A.value;
|
|
110
115
|
return new Pe({
|
|
111
116
|
[r]: e
|
|
112
|
-
}).validate({ [r]:
|
|
113
|
-
},
|
|
117
|
+
}).validate({ [r]: V.value }, { firstFields: !0 }).then(() => (ve(), !0)).catch((l) => (me(l), Promise.reject(l)));
|
|
118
|
+
}, L = async (e, r) => {
|
|
114
119
|
if (v || !t.prop)
|
|
115
120
|
return !1;
|
|
116
121
|
const i = ze(r);
|
|
117
122
|
if (!de.value)
|
|
118
123
|
return r?.(!1), !1;
|
|
119
124
|
const l = ce(e);
|
|
120
|
-
return l.length === 0 ? (r?.(!0), !0) : (
|
|
121
|
-
const { fields:
|
|
122
|
-
return r?.(!1,
|
|
125
|
+
return l.length === 0 ? (r?.(!0), !0) : (p("validating"), he(l).then(() => (r?.(!0), !0)).catch((u) => {
|
|
126
|
+
const { fields: m } = u;
|
|
127
|
+
return r?.(!1, m), i ? !1 : Promise.reject(m);
|
|
123
128
|
}));
|
|
124
|
-
},
|
|
125
|
-
t.error && re("update:error", ""),
|
|
129
|
+
}, w = () => {
|
|
130
|
+
t.error && re("update:error", ""), p(""), n.value = "", v = !1;
|
|
126
131
|
}, j = async () => {
|
|
127
132
|
const e = o?.model;
|
|
128
133
|
if (!e || !t.prop) return;
|
|
129
|
-
const r =
|
|
130
|
-
v = !0, r.value = Q(
|
|
131
|
-
},
|
|
134
|
+
const r = W(e, t.prop);
|
|
135
|
+
v = !0, r.value = Q(x), await Be(), w(), v = !1;
|
|
136
|
+
}, be = (e) => {
|
|
132
137
|
d.value.includes(e) || d.value.push(e);
|
|
133
|
-
},
|
|
138
|
+
}, ge = (e) => {
|
|
134
139
|
d.value = d.value.filter((r) => r !== e);
|
|
135
140
|
};
|
|
136
|
-
|
|
141
|
+
E(
|
|
137
142
|
() => t.error,
|
|
138
143
|
(e) => {
|
|
139
|
-
n.value = e || "",
|
|
144
|
+
n.value = e || "", p(e ? "error" : "");
|
|
140
145
|
},
|
|
141
146
|
{ immediate: !0 }
|
|
142
|
-
),
|
|
147
|
+
), E(
|
|
143
148
|
() => t.validateStatus,
|
|
144
|
-
(e) =>
|
|
149
|
+
(e) => p(e || "")
|
|
145
150
|
);
|
|
146
|
-
const
|
|
147
|
-
...
|
|
148
|
-
$el:
|
|
151
|
+
const C = Se({
|
|
152
|
+
...ke(t),
|
|
153
|
+
$el: $,
|
|
149
154
|
size: y,
|
|
150
155
|
validateMessage: n,
|
|
151
156
|
validateState: c,
|
|
152
157
|
labelId: S,
|
|
153
158
|
inputIds: d,
|
|
154
|
-
isGroup:
|
|
155
|
-
hasLabel:
|
|
156
|
-
fieldValue:
|
|
157
|
-
addInputId:
|
|
158
|
-
removeInputId:
|
|
159
|
+
isGroup: I,
|
|
160
|
+
hasLabel: k,
|
|
161
|
+
fieldValue: V,
|
|
162
|
+
addInputId: be,
|
|
163
|
+
removeInputId: ge,
|
|
159
164
|
resetField: j,
|
|
160
|
-
clearValidate:
|
|
161
|
-
validate:
|
|
162
|
-
propString:
|
|
165
|
+
clearValidate: w,
|
|
166
|
+
validate: L,
|
|
167
|
+
propString: A
|
|
163
168
|
});
|
|
164
|
-
return
|
|
165
|
-
t.prop && (o?.addField(
|
|
166
|
-
}),
|
|
167
|
-
o?.removeField(
|
|
169
|
+
return qe(X, C), Ie(() => {
|
|
170
|
+
t.prop && (o?.addField(C), x = Q(V.value));
|
|
171
|
+
}), Ve(() => {
|
|
172
|
+
o?.removeField(C);
|
|
168
173
|
}), ee({
|
|
169
174
|
size: y,
|
|
170
175
|
validateMessage: n,
|
|
171
176
|
validateState: c,
|
|
172
|
-
validate:
|
|
173
|
-
clearValidate:
|
|
177
|
+
validate: L,
|
|
178
|
+
clearValidate: w,
|
|
174
179
|
resetField: j
|
|
175
|
-
}), (e, r) => (
|
|
180
|
+
}), (e, r) => (F(), _e("div", {
|
|
176
181
|
ref_key: "formItemRef",
|
|
177
|
-
ref:
|
|
178
|
-
class:
|
|
179
|
-
role:
|
|
180
|
-
"aria-labelledby":
|
|
182
|
+
ref: $,
|
|
183
|
+
class: g(se.value),
|
|
184
|
+
role: I.value ? "group" : void 0,
|
|
185
|
+
"aria-labelledby": I.value ? f(S) : void 0
|
|
181
186
|
}, [
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
e.hideLabel ? R("", !0) : (F(), T(f(Ne), {
|
|
188
|
+
key: 0,
|
|
189
|
+
"is-auto-width": P.value.width === "auto",
|
|
184
190
|
"update-all": f(o)?.labelWidth === "auto"
|
|
185
191
|
}, {
|
|
186
|
-
default:
|
|
187
|
-
|
|
192
|
+
default: B(() => [
|
|
193
|
+
k.value ? (F(), T(we(q.value ? "label" : "div"), {
|
|
188
194
|
key: 0,
|
|
189
195
|
id: f(S),
|
|
190
|
-
for:
|
|
191
|
-
class:
|
|
192
|
-
style: K(
|
|
196
|
+
for: q.value,
|
|
197
|
+
class: g(f(s).e("label")),
|
|
198
|
+
style: K(P.value)
|
|
193
199
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
M(e.$slots, "label", { label:
|
|
196
|
-
|
|
200
|
+
default: B(() => [
|
|
201
|
+
M(e.$slots, "label", { label: N.value }, () => [
|
|
202
|
+
Ce(U(N.value), 1)
|
|
197
203
|
])
|
|
198
204
|
]),
|
|
199
205
|
_: 3
|
|
200
|
-
}, 8, ["id", "for", "class", "style"])) :
|
|
206
|
+
}, 8, ["id", "for", "class", "style"])) : R("", !0)
|
|
201
207
|
]),
|
|
202
208
|
_: 3
|
|
203
|
-
}, 8, ["is-auto-width", "update-all"]),
|
|
204
|
-
|
|
205
|
-
class:
|
|
209
|
+
}, 8, ["is-auto-width", "update-all"])),
|
|
210
|
+
G("div", {
|
|
211
|
+
class: g(f(s).e("content")),
|
|
206
212
|
style: K(ae.value)
|
|
207
213
|
}, [
|
|
208
214
|
M(e.$slots, "default"),
|
|
209
|
-
|
|
215
|
+
Fe(Re, {
|
|
210
216
|
name: `${f(s).namespace.value}-zoom-in-top`
|
|
211
217
|
}, {
|
|
212
|
-
default:
|
|
213
|
-
|
|
218
|
+
default: B(() => [
|
|
219
|
+
pe.value ? M(e.$slots, "error", {
|
|
214
220
|
key: 0,
|
|
215
221
|
error: n.value
|
|
216
222
|
}, () => [
|
|
217
|
-
|
|
218
|
-
class:
|
|
223
|
+
G("div", {
|
|
224
|
+
class: g(ne.value)
|
|
219
225
|
}, U(n.value), 3)
|
|
220
|
-
]) :
|
|
226
|
+
]) : R("", !0)
|
|
221
227
|
]),
|
|
222
228
|
_: 3
|
|
223
229
|
}, 8, ["name"])
|
|
224
230
|
], 6)
|
|
225
|
-
], 10,
|
|
231
|
+
], 10, je));
|
|
226
232
|
}
|
|
227
233
|
});
|
|
228
234
|
export {
|
|
@@ -228,12 +228,19 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
228
228
|
type: import("vue").PropType<boolean>;
|
|
229
229
|
default: boolean;
|
|
230
230
|
};
|
|
231
|
+
hideRequiredAsterisk: {
|
|
232
|
+
type: import("vue").PropType<boolean>;
|
|
233
|
+
};
|
|
231
234
|
for: {
|
|
232
235
|
type: import("vue").PropType<string>;
|
|
233
236
|
};
|
|
234
237
|
validateStatus: {
|
|
235
238
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
236
239
|
};
|
|
240
|
+
hideLabel: {
|
|
241
|
+
type: import("vue").PropType<boolean>;
|
|
242
|
+
default: boolean;
|
|
243
|
+
};
|
|
237
244
|
}>> & Readonly<{
|
|
238
245
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
239
246
|
}>, {
|
|
@@ -250,6 +257,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
250
257
|
labelWidth: string | number;
|
|
251
258
|
inlineMessage: string | boolean;
|
|
252
259
|
showMessage: boolean;
|
|
260
|
+
hideLabel: boolean;
|
|
253
261
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
254
262
|
P: {};
|
|
255
263
|
B: {};
|
|
@@ -292,12 +300,19 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
292
300
|
type: import("vue").PropType<boolean>;
|
|
293
301
|
default: boolean;
|
|
294
302
|
};
|
|
303
|
+
hideRequiredAsterisk: {
|
|
304
|
+
type: import("vue").PropType<boolean>;
|
|
305
|
+
};
|
|
295
306
|
for: {
|
|
296
307
|
type: import("vue").PropType<string>;
|
|
297
308
|
};
|
|
298
309
|
validateStatus: {
|
|
299
310
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
300
311
|
};
|
|
312
|
+
hideLabel: {
|
|
313
|
+
type: import("vue").PropType<boolean>;
|
|
314
|
+
default: boolean;
|
|
315
|
+
};
|
|
301
316
|
}>> & Readonly<{
|
|
302
317
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
303
318
|
}>, {
|
|
@@ -312,6 +327,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
312
327
|
labelWidth: string | number;
|
|
313
328
|
inlineMessage: string | boolean;
|
|
314
329
|
showMessage: boolean;
|
|
330
|
+
hideLabel: boolean;
|
|
315
331
|
}>;
|
|
316
332
|
__isFragment?: never;
|
|
317
333
|
__isTeleport?: never;
|
|
@@ -351,12 +367,19 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
351
367
|
type: import("vue").PropType<boolean>;
|
|
352
368
|
default: boolean;
|
|
353
369
|
};
|
|
370
|
+
hideRequiredAsterisk: {
|
|
371
|
+
type: import("vue").PropType<boolean>;
|
|
372
|
+
};
|
|
354
373
|
for: {
|
|
355
374
|
type: import("vue").PropType<string>;
|
|
356
375
|
};
|
|
357
376
|
validateStatus: {
|
|
358
377
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
359
378
|
};
|
|
379
|
+
hideLabel: {
|
|
380
|
+
type: import("vue").PropType<boolean>;
|
|
381
|
+
default: boolean;
|
|
382
|
+
};
|
|
360
383
|
}>> & Readonly<{
|
|
361
384
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
362
385
|
}>, {
|
|
@@ -373,6 +396,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
373
396
|
labelWidth: string | number;
|
|
374
397
|
inlineMessage: string | boolean;
|
|
375
398
|
showMessage: boolean;
|
|
399
|
+
hideLabel: boolean;
|
|
376
400
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
377
401
|
$slots: {
|
|
378
402
|
label?(_: {
|
|
@@ -421,12 +445,19 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
421
445
|
type: import("vue").PropType<boolean>;
|
|
422
446
|
default: boolean;
|
|
423
447
|
};
|
|
448
|
+
hideRequiredAsterisk: {
|
|
449
|
+
type: import("vue").PropType<boolean>;
|
|
450
|
+
};
|
|
424
451
|
for: {
|
|
425
452
|
type: import("vue").PropType<string>;
|
|
426
453
|
};
|
|
427
454
|
validateStatus: {
|
|
428
455
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
429
456
|
};
|
|
457
|
+
hideLabel: {
|
|
458
|
+
type: import("vue").PropType<boolean>;
|
|
459
|
+
default: boolean;
|
|
460
|
+
};
|
|
430
461
|
}>> & Readonly<{
|
|
431
462
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
432
463
|
}>, {
|
|
@@ -443,6 +474,7 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
443
474
|
labelWidth: string | number;
|
|
444
475
|
inlineMessage: string | boolean;
|
|
445
476
|
showMessage: boolean;
|
|
477
|
+
hideLabel: boolean;
|
|
446
478
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
447
479
|
P: {};
|
|
448
480
|
B: {};
|
|
@@ -485,12 +517,19 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
485
517
|
type: import("vue").PropType<boolean>;
|
|
486
518
|
default: boolean;
|
|
487
519
|
};
|
|
520
|
+
hideRequiredAsterisk: {
|
|
521
|
+
type: import("vue").PropType<boolean>;
|
|
522
|
+
};
|
|
488
523
|
for: {
|
|
489
524
|
type: import("vue").PropType<string>;
|
|
490
525
|
};
|
|
491
526
|
validateStatus: {
|
|
492
527
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
493
528
|
};
|
|
529
|
+
hideLabel: {
|
|
530
|
+
type: import("vue").PropType<boolean>;
|
|
531
|
+
default: boolean;
|
|
532
|
+
};
|
|
494
533
|
}>> & Readonly<{
|
|
495
534
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
496
535
|
}>, {
|
|
@@ -505,6 +544,7 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
505
544
|
labelWidth: string | number;
|
|
506
545
|
inlineMessage: string | boolean;
|
|
507
546
|
showMessage: boolean;
|
|
547
|
+
hideLabel: boolean;
|
|
508
548
|
}>;
|
|
509
549
|
__isFragment?: never;
|
|
510
550
|
__isTeleport?: never;
|
|
@@ -544,12 +584,19 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
544
584
|
type: import("vue").PropType<boolean>;
|
|
545
585
|
default: boolean;
|
|
546
586
|
};
|
|
587
|
+
hideRequiredAsterisk: {
|
|
588
|
+
type: import("vue").PropType<boolean>;
|
|
589
|
+
};
|
|
547
590
|
for: {
|
|
548
591
|
type: import("vue").PropType<string>;
|
|
549
592
|
};
|
|
550
593
|
validateStatus: {
|
|
551
594
|
type: import("vue").PropType<"" | "error" | "validating" | "success">;
|
|
552
595
|
};
|
|
596
|
+
hideLabel: {
|
|
597
|
+
type: import("vue").PropType<boolean>;
|
|
598
|
+
default: boolean;
|
|
599
|
+
};
|
|
553
600
|
}>> & Readonly<{
|
|
554
601
|
"onUpdate:error"?: ((val: string) => any) | undefined;
|
|
555
602
|
}>, {
|
|
@@ -566,6 +613,7 @@ export declare const VftFormItem: import("vft/es/utils").SFCWithInstall<{
|
|
|
566
613
|
labelWidth: string | number;
|
|
567
614
|
inlineMessage: string | boolean;
|
|
568
615
|
showMessage: boolean;
|
|
616
|
+
hideLabel: boolean;
|
|
569
617
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
570
618
|
$slots: {
|
|
571
619
|
label?(_: {
|
|
@@ -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 { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
|
|
17
|
+
import { useFormSize as at, useFormDisabled as ot } from "../form/hooks/use-form-common-props.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 } = et(), { inputId: Y } = tt(xe.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = at(), h = ot(), 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, 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";
|
|
@@ -4,6 +4,10 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
4
4
|
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
5
5
|
default: string;
|
|
6
6
|
};
|
|
7
|
+
labelPosition: {
|
|
8
|
+
type: import("vue").PropType<"top" | "left" | "right">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
7
11
|
showResetButton: {
|
|
8
12
|
type: import("vue").PropType<boolean>;
|
|
9
13
|
default: boolean;
|
|
@@ -141,6 +145,7 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
141
145
|
"field-value-change": () => void;
|
|
142
146
|
}, import("vue").PublicProps, {
|
|
143
147
|
size: import("vft/es/constants").ComponentSize;
|
|
148
|
+
labelPosition: "left" | "right" | "top";
|
|
144
149
|
showResetButton: boolean;
|
|
145
150
|
showSubmitButton: boolean;
|
|
146
151
|
showCommonButton: boolean;
|
|
@@ -166,6 +171,10 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
166
171
|
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
167
172
|
default: string;
|
|
168
173
|
};
|
|
174
|
+
labelPosition: {
|
|
175
|
+
type: import("vue").PropType<"top" | "left" | "right">;
|
|
176
|
+
default: string;
|
|
177
|
+
};
|
|
169
178
|
showResetButton: {
|
|
170
179
|
type: import("vue").PropType<boolean>;
|
|
171
180
|
default: boolean;
|
|
@@ -298,6 +307,7 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
298
307
|
formModel: import("vue").ComputedRef<import("../types").Recordable>;
|
|
299
308
|
}, {}, {}, {}, {
|
|
300
309
|
size: import("vft/es/constants").ComponentSize;
|
|
310
|
+
labelPosition: "left" | "right" | "top";
|
|
301
311
|
showResetButton: boolean;
|
|
302
312
|
showSubmitButton: boolean;
|
|
303
313
|
showCommonButton: boolean;
|
|
@@ -320,6 +330,10 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
320
330
|
type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
|
|
321
331
|
default: string;
|
|
322
332
|
};
|
|
333
|
+
labelPosition: {
|
|
334
|
+
type: import("vue").PropType<"top" | "left" | "right">;
|
|
335
|
+
default: string;
|
|
336
|
+
};
|
|
323
337
|
showResetButton: {
|
|
324
338
|
type: import("vue").PropType<boolean>;
|
|
325
339
|
default: boolean;
|
|
@@ -457,6 +471,7 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
457
471
|
"field-value-change": () => void;
|
|
458
472
|
}, string, {
|
|
459
473
|
size: import("vft/es/constants").ComponentSize;
|
|
474
|
+
labelPosition: "left" | "right" | "top";
|
|
460
475
|
showResetButton: boolean;
|
|
461
476
|
showSubmitButton: boolean;
|
|
462
477
|
showCommonButton: boolean;
|