@macrulez/vue-form-schema 0.1.7 → 0.1.9
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/LICENSE +21 -0
- package/dist/MaskEngine-DAKSNIHQ.cjs +1 -0
- package/dist/MaskEngine-mLoXKd4d.js +251 -0
- package/dist/core/ValidationEngine.d.ts +6 -0
- package/dist/core/ValidationEngine.d.ts.map +1 -1
- package/dist/core/types.d.ts +10 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/useForm.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +159 -151
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/tailwind/index.d.ts +11 -0
- package/dist/ui/tailwind/index.d.ts.map +1 -0
- package/dist/ui-tailwind.cjs +1 -0
- package/dist/ui-tailwind.d.ts +397 -0
- package/dist/ui-tailwind.js +650 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +47 -10
- package/dist/ui.js +436 -300
- package/dist/valibot.d.ts +10 -2
- package/dist/yup.d.ts +10 -2
- package/dist/zod.d.ts +10 -2
- package/package.json +38 -24
- package/dist/MaskEngine-BqJQYybS.js +0 -233
- package/dist/MaskEngine-BwAs2Zb0.cjs +0 -1
- package/dist/__tests__/ConditionEvaluator.test.d.ts +0 -2
- package/dist/__tests__/ConditionEvaluator.test.d.ts.map +0 -1
- package/dist/__tests__/MaskEngine.test.d.ts +0 -2
- package/dist/__tests__/MaskEngine.test.d.ts.map +0 -1
- package/dist/__tests__/ValidationEngine.test.d.ts +0 -2
- package/dist/__tests__/ValidationEngine.test.d.ts.map +0 -1
- package/dist/__tests__/parsers.test.d.ts +0 -2
- package/dist/__tests__/parsers.test.d.ts.map +0 -1
- package/dist/__tests__/phase3.test.d.ts +0 -2
- package/dist/__tests__/phase3.test.d.ts.map +0 -1
- package/dist/__tests__/phase4.test.d.ts +0 -2
- package/dist/__tests__/phase4.test.d.ts.map +0 -1
- package/dist/__tests__/useFieldArray.test.d.ts +0 -2
- package/dist/__tests__/useFieldArray.test.d.ts.map +0 -1
- package/dist/__tests__/useForm.test.d.ts +0 -2
- package/dist/__tests__/useForm.test.d.ts.map +0 -1
- package/dist/__tests__/useMultiStepForm.test.d.ts +0 -2
- package/dist/__tests__/useMultiStepForm.test.d.ts.map +0 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { ComputedRef } from 'vue';
|
|
5
|
+
import { DefineComponent } from 'vue';
|
|
6
|
+
import { ExtractPropTypes } from 'vue';
|
|
7
|
+
import { PropType } from 'vue';
|
|
8
|
+
import { PublicProps } from 'vue';
|
|
9
|
+
import { Ref } from 'vue';
|
|
10
|
+
|
|
11
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
form: UseFormReturn;
|
|
13
|
+
components?: Partial<Record<FieldDefinition["type"], Component | string>>;
|
|
14
|
+
submitLabel?: string;
|
|
15
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
submit: () => void;
|
|
17
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
18
|
+
form: UseFormReturn;
|
|
19
|
+
components?: Partial<Record<FieldDefinition["type"], Component | string>>;
|
|
20
|
+
submitLabel?: string;
|
|
21
|
+
}>>> & Readonly<{
|
|
22
|
+
onSubmit?: (() => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
|
|
25
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
|
|
27
|
+
declare type __VLS_NonUndefinedable_10<T> = T extends undefined ? never : T;
|
|
28
|
+
|
|
29
|
+
declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
|
|
30
|
+
|
|
31
|
+
declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
|
|
32
|
+
|
|
33
|
+
declare type __VLS_NonUndefinedable_4<T> = T extends undefined ? never : T;
|
|
34
|
+
|
|
35
|
+
declare type __VLS_NonUndefinedable_5<T> = T extends undefined ? never : T;
|
|
36
|
+
|
|
37
|
+
declare type __VLS_NonUndefinedable_6<T> = T extends undefined ? never : T;
|
|
38
|
+
|
|
39
|
+
declare type __VLS_NonUndefinedable_7<T> = T extends undefined ? never : T;
|
|
40
|
+
|
|
41
|
+
declare type __VLS_NonUndefinedable_8<T> = T extends undefined ? never : T;
|
|
42
|
+
|
|
43
|
+
declare type __VLS_NonUndefinedable_9<T> = T extends undefined ? never : T;
|
|
44
|
+
|
|
45
|
+
declare function __VLS_template(): Partial<Record<`field-${string}`, (_: {
|
|
46
|
+
field: FieldDefinition;
|
|
47
|
+
value: unknown;
|
|
48
|
+
error: string[];
|
|
49
|
+
touched: boolean;
|
|
50
|
+
setValue: (v: unknown) => void;
|
|
51
|
+
touch: () => void;
|
|
52
|
+
}) => any>> & {
|
|
53
|
+
submit?(_: {
|
|
54
|
+
isSubmitting: boolean;
|
|
55
|
+
isValid: boolean;
|
|
56
|
+
}): any;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
60
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
61
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
62
|
+
} : {
|
|
63
|
+
type: PropType<T[K]>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare type __VLS_TypePropsToRuntimeProps_10<T> = {
|
|
69
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
70
|
+
type: PropType<__VLS_NonUndefinedable_10<T[K]>>;
|
|
71
|
+
} : {
|
|
72
|
+
type: PropType<T[K]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare type __VLS_TypePropsToRuntimeProps_2<T> = {
|
|
78
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
79
|
+
type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
|
|
80
|
+
} : {
|
|
81
|
+
type: PropType<T[K]>;
|
|
82
|
+
required: true;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
declare type __VLS_TypePropsToRuntimeProps_3<T> = {
|
|
87
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
88
|
+
type: PropType<__VLS_NonUndefinedable_3<T[K]>>;
|
|
89
|
+
} : {
|
|
90
|
+
type: PropType<T[K]>;
|
|
91
|
+
required: true;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
declare type __VLS_TypePropsToRuntimeProps_4<T> = {
|
|
96
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
97
|
+
type: PropType<__VLS_NonUndefinedable_4<T[K]>>;
|
|
98
|
+
} : {
|
|
99
|
+
type: PropType<T[K]>;
|
|
100
|
+
required: true;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
declare type __VLS_TypePropsToRuntimeProps_5<T> = {
|
|
105
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
106
|
+
type: PropType<__VLS_NonUndefinedable_5<T[K]>>;
|
|
107
|
+
} : {
|
|
108
|
+
type: PropType<T[K]>;
|
|
109
|
+
required: true;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
declare type __VLS_TypePropsToRuntimeProps_6<T> = {
|
|
114
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
115
|
+
type: PropType<__VLS_NonUndefinedable_6<T[K]>>;
|
|
116
|
+
} : {
|
|
117
|
+
type: PropType<T[K]>;
|
|
118
|
+
required: true;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare type __VLS_TypePropsToRuntimeProps_7<T> = {
|
|
123
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
124
|
+
type: PropType<__VLS_NonUndefinedable_7<T[K]>>;
|
|
125
|
+
} : {
|
|
126
|
+
type: PropType<T[K]>;
|
|
127
|
+
required: true;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
declare type __VLS_TypePropsToRuntimeProps_8<T> = {
|
|
132
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
133
|
+
type: PropType<__VLS_NonUndefinedable_8<T[K]>>;
|
|
134
|
+
} : {
|
|
135
|
+
type: PropType<T[K]>;
|
|
136
|
+
required: true;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
declare type __VLS_TypePropsToRuntimeProps_9<T> = {
|
|
141
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
142
|
+
type: PropType<__VLS_NonUndefinedable_9<T[K]>>;
|
|
143
|
+
} : {
|
|
144
|
+
type: PropType<T[K]>;
|
|
145
|
+
required: true;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
150
|
+
new (): {
|
|
151
|
+
$slots: S;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
declare type AsyncValidatorFn = (value: unknown, values: Record<string, unknown>) => Promise<string | null>;
|
|
156
|
+
|
|
157
|
+
declare interface FieldDefinition {
|
|
158
|
+
type: FieldType;
|
|
159
|
+
/** Dot-path for nested fields, e.g. "address.city" */
|
|
160
|
+
name: string;
|
|
161
|
+
label?: string;
|
|
162
|
+
placeholder?: string;
|
|
163
|
+
defaultValue?: unknown | ((values: Record<string, unknown>) => unknown);
|
|
164
|
+
required?: boolean;
|
|
165
|
+
/** Static or dynamic disabled state */
|
|
166
|
+
disabled?: boolean | ((values: Record<string, unknown>) => boolean);
|
|
167
|
+
/** Static or dynamic visibility; string is evaluated as expression */
|
|
168
|
+
visible?: boolean | string | ((values: Record<string, unknown>) => boolean);
|
|
169
|
+
validators?: ValidatorFn[];
|
|
170
|
+
asyncValidators?: AsyncValidatorFn[];
|
|
171
|
+
mask?: string | MaskConfig;
|
|
172
|
+
/** For select / radio — static list, sync function, or async function */
|
|
173
|
+
options?: FieldOption[] | ((values: Record<string, unknown>) => FieldOption[] | Promise<FieldOption[]>);
|
|
174
|
+
/**
|
|
175
|
+
* Field names whose values trigger re-fetching of async options.
|
|
176
|
+
* Only relevant when `options` is an async function.
|
|
177
|
+
*/
|
|
178
|
+
optionsDeps?: string[];
|
|
179
|
+
/** Internal: set by useForm when async options are loading. Read-only for consumers. */
|
|
180
|
+
optionsLoading?: boolean;
|
|
181
|
+
/** For group and array */
|
|
182
|
+
fields?: FieldDefinition[];
|
|
183
|
+
/**
|
|
184
|
+
* Applied on every setField call before the value is stored.
|
|
185
|
+
* Use for trimming, type coercion, formatting, etc.
|
|
186
|
+
*/
|
|
187
|
+
transform?: (value: unknown, values: Record<string, unknown>) => unknown;
|
|
188
|
+
/**
|
|
189
|
+
* Applied at submit time to produce the final payload value.
|
|
190
|
+
* Runs after all validation passes.
|
|
191
|
+
*/
|
|
192
|
+
parse?: (raw: unknown) => unknown;
|
|
193
|
+
/**
|
|
194
|
+
* Custom Vue component to render this field.
|
|
195
|
+
* Receives FormFieldProps and must emit 'update:modelValue' and 'blur'.
|
|
196
|
+
*/
|
|
197
|
+
component?: Component | string;
|
|
198
|
+
/** Accepted file types, e.g. "image/*,.pdf" — passed to <input accept> */
|
|
199
|
+
accept?: string;
|
|
200
|
+
/** Allow selecting multiple files */
|
|
201
|
+
multiple?: boolean;
|
|
202
|
+
/** Maximum file size in bytes */
|
|
203
|
+
maxSize?: number;
|
|
204
|
+
/** Maximum number of files (only relevant when multiple=true) */
|
|
205
|
+
maxFiles?: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare interface FieldOption {
|
|
209
|
+
label: string;
|
|
210
|
+
value: unknown;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare type FieldType = 'text' | 'number' | 'email' | 'select' | 'checkbox' | 'radio' | 'textarea' | 'date' | 'array' | 'group' | 'file';
|
|
214
|
+
|
|
215
|
+
declare interface MaskConfig {
|
|
216
|
+
preset?: MaskPreset;
|
|
217
|
+
/** Custom mask pattern: '#' = digit, 'A' = letter, other chars are literals */
|
|
218
|
+
pattern?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare type MaskPreset = 'phone-ru' | 'phone-eu' | 'date' | 'inn' | 'iban';
|
|
222
|
+
|
|
223
|
+
export declare const TailwindFormRenderer: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
224
|
+
|
|
225
|
+
export declare const TwArrayField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_10<{
|
|
226
|
+
field: FieldDefinition;
|
|
227
|
+
form: UseFormReturn;
|
|
228
|
+
components?: Partial<Record<FieldDefinition["type"], Component | string>>;
|
|
229
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_10<{
|
|
230
|
+
field: FieldDefinition;
|
|
231
|
+
form: UseFormReturn;
|
|
232
|
+
components?: Partial<Record<FieldDefinition["type"], Component | string>>;
|
|
233
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
234
|
+
|
|
235
|
+
export declare const TwCheckboxField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_6<{
|
|
236
|
+
field: FieldDefinition;
|
|
237
|
+
modelValue: boolean | null;
|
|
238
|
+
error?: string[];
|
|
239
|
+
touched?: boolean;
|
|
240
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
241
|
+
blur: () => void;
|
|
242
|
+
"update:modelValue": (value: boolean) => void;
|
|
243
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_6<{
|
|
244
|
+
field: FieldDefinition;
|
|
245
|
+
modelValue: boolean | null;
|
|
246
|
+
error?: string[];
|
|
247
|
+
touched?: boolean;
|
|
248
|
+
}>>> & Readonly<{
|
|
249
|
+
onBlur?: (() => any) | undefined;
|
|
250
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
251
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
252
|
+
|
|
253
|
+
export declare const TwDateField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<{
|
|
254
|
+
field: FieldDefinition;
|
|
255
|
+
modelValue: string | null;
|
|
256
|
+
error?: string[];
|
|
257
|
+
touched?: boolean;
|
|
258
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
259
|
+
blur: () => void;
|
|
260
|
+
"update:modelValue": (value: string) => void;
|
|
261
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<{
|
|
262
|
+
field: FieldDefinition;
|
|
263
|
+
modelValue: string | null;
|
|
264
|
+
error?: string[];
|
|
265
|
+
touched?: boolean;
|
|
266
|
+
}>>> & Readonly<{
|
|
267
|
+
onBlur?: (() => any) | undefined;
|
|
268
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
269
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
270
|
+
|
|
271
|
+
export declare const TwFileField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_9<{
|
|
272
|
+
field: FieldDefinition;
|
|
273
|
+
modelValue: File | File[] | null;
|
|
274
|
+
error?: string[];
|
|
275
|
+
touched?: boolean;
|
|
276
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
277
|
+
blur: () => void;
|
|
278
|
+
"update:modelValue": (value: File | File[] | null) => void;
|
|
279
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_9<{
|
|
280
|
+
field: FieldDefinition;
|
|
281
|
+
modelValue: File | File[] | null;
|
|
282
|
+
error?: string[];
|
|
283
|
+
touched?: boolean;
|
|
284
|
+
}>>> & Readonly<{
|
|
285
|
+
onBlur?: (() => any) | undefined;
|
|
286
|
+
"onUpdate:modelValue"?: ((value: File | File[] | null) => any) | undefined;
|
|
287
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
288
|
+
|
|
289
|
+
export declare const TwNumberField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_3<{
|
|
290
|
+
field: FieldDefinition;
|
|
291
|
+
modelValue: number | null;
|
|
292
|
+
error?: string[];
|
|
293
|
+
touched?: boolean;
|
|
294
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
295
|
+
blur: () => void;
|
|
296
|
+
"update:modelValue": (value: number | null) => void;
|
|
297
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_3<{
|
|
298
|
+
field: FieldDefinition;
|
|
299
|
+
modelValue: number | null;
|
|
300
|
+
error?: string[];
|
|
301
|
+
touched?: boolean;
|
|
302
|
+
}>>> & Readonly<{
|
|
303
|
+
onBlur?: (() => any) | undefined;
|
|
304
|
+
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
305
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
306
|
+
|
|
307
|
+
export declare const TwRadioField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<{
|
|
308
|
+
field: FieldDefinition;
|
|
309
|
+
modelValue: unknown;
|
|
310
|
+
error?: string[];
|
|
311
|
+
touched?: boolean;
|
|
312
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
313
|
+
blur: () => void;
|
|
314
|
+
"update:modelValue": (value: unknown) => void;
|
|
315
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<{
|
|
316
|
+
field: FieldDefinition;
|
|
317
|
+
modelValue: unknown;
|
|
318
|
+
error?: string[];
|
|
319
|
+
touched?: boolean;
|
|
320
|
+
}>>> & Readonly<{
|
|
321
|
+
onBlur?: (() => any) | undefined;
|
|
322
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
323
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
324
|
+
|
|
325
|
+
export declare const TwSelectField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<{
|
|
326
|
+
field: FieldDefinition;
|
|
327
|
+
modelValue: unknown;
|
|
328
|
+
error?: string[];
|
|
329
|
+
touched?: boolean;
|
|
330
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
331
|
+
blur: () => void;
|
|
332
|
+
"update:modelValue": (value: unknown) => void;
|
|
333
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<{
|
|
334
|
+
field: FieldDefinition;
|
|
335
|
+
modelValue: unknown;
|
|
336
|
+
error?: string[];
|
|
337
|
+
touched?: boolean;
|
|
338
|
+
}>>> & Readonly<{
|
|
339
|
+
onBlur?: (() => any) | undefined;
|
|
340
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
341
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
342
|
+
|
|
343
|
+
export declare const TwTextareaField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_4<{
|
|
344
|
+
field: FieldDefinition;
|
|
345
|
+
modelValue: string | null;
|
|
346
|
+
error?: string[];
|
|
347
|
+
touched?: boolean;
|
|
348
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
349
|
+
blur: () => void;
|
|
350
|
+
"update:modelValue": (value: string) => void;
|
|
351
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_4<{
|
|
352
|
+
field: FieldDefinition;
|
|
353
|
+
modelValue: string | null;
|
|
354
|
+
error?: string[];
|
|
355
|
+
touched?: boolean;
|
|
356
|
+
}>>> & Readonly<{
|
|
357
|
+
onBlur?: (() => any) | undefined;
|
|
358
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
359
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
360
|
+
|
|
361
|
+
export declare const TwTextField: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_2<{
|
|
362
|
+
field: FieldDefinition;
|
|
363
|
+
modelValue: string | null;
|
|
364
|
+
error?: string[];
|
|
365
|
+
touched?: boolean;
|
|
366
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
367
|
+
blur: () => void;
|
|
368
|
+
"update:modelValue": (value: string) => void;
|
|
369
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_2<{
|
|
370
|
+
field: FieldDefinition;
|
|
371
|
+
modelValue: string | null;
|
|
372
|
+
error?: string[];
|
|
373
|
+
touched?: boolean;
|
|
374
|
+
}>>> & Readonly<{
|
|
375
|
+
onBlur?: (() => any) | undefined;
|
|
376
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
377
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
378
|
+
|
|
379
|
+
declare interface UseFormReturn<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
380
|
+
fields: ComputedRef<FieldDefinition[]>;
|
|
381
|
+
values: Ref<T>;
|
|
382
|
+
errors: Ref<Record<string, string[]>>;
|
|
383
|
+
touched: Ref<Record<string, boolean>>;
|
|
384
|
+
/** Per-field async options loading state */
|
|
385
|
+
optionsLoading: Ref<Record<string, boolean>>;
|
|
386
|
+
isDirty: ComputedRef<boolean>;
|
|
387
|
+
isValid: ComputedRef<boolean>;
|
|
388
|
+
isSubmitting: Ref<boolean>;
|
|
389
|
+
submit(): Promise<void>;
|
|
390
|
+
reset(values?: Partial<T>): void;
|
|
391
|
+
setField(path: string, value: unknown): void;
|
|
392
|
+
getField(path: string): unknown;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare type ValidatorFn = (value: unknown, values: Record<string, unknown>) => string | null;
|
|
396
|
+
|
|
397
|
+
export { }
|