@inksightdev/ui 0.2.2 → 0.3.0
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/composables/useFormField.d.ts +28 -0
- package/dist/composables/veeValidateExamples.d.ts +109 -0
- package/dist/index-D7ldGb8i.js +3484 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13869 -9225
- package/dist/style.css +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FieldMeta } from 'vee-validate';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export interface FormFieldProps {
|
|
4
|
+
modelValue?: string | number;
|
|
5
|
+
label?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
autocomplete?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function useFormField(fieldValue: Ref<any>, fieldMeta: FieldMeta<any>, baseProps?: Partial<FormFieldProps>): import('vue').ComputedRef<{
|
|
17
|
+
modelValue: any;
|
|
18
|
+
label?: string | undefined;
|
|
19
|
+
type?: string | undefined;
|
|
20
|
+
placeholder?: string | undefined;
|
|
21
|
+
disabled?: boolean | undefined;
|
|
22
|
+
readonly?: boolean | undefined;
|
|
23
|
+
required?: boolean | undefined;
|
|
24
|
+
error: string;
|
|
25
|
+
hint?: string | undefined;
|
|
26
|
+
autocomplete?: string | undefined;
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complete example of using @inksightdev/ui components with vee-validate
|
|
3
|
+
*
|
|
4
|
+
* This demonstrates:
|
|
5
|
+
* - Form validation with schemas (Zod)
|
|
6
|
+
* - Field-level error handling
|
|
7
|
+
* - Custom field components integration
|
|
8
|
+
* - Type-safe form handling
|
|
9
|
+
*/
|
|
10
|
+
export declare function useLoginForm(): {
|
|
11
|
+
values: {
|
|
12
|
+
email?: string | undefined;
|
|
13
|
+
password?: string | undefined;
|
|
14
|
+
rememberMe?: boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
17
|
+
emailField: import('vee-validate').FieldContext<unknown>;
|
|
18
|
+
passwordField: import('vee-validate').FieldContext<unknown>;
|
|
19
|
+
rememberMeField: import('vee-validate').FieldContext<unknown>;
|
|
20
|
+
onSubmit: (e?: Event) => Promise<Promise<void> | undefined>;
|
|
21
|
+
resetForm: (state?: Partial<import('vee-validate').FormState<{
|
|
22
|
+
email?: string | undefined;
|
|
23
|
+
password?: string | undefined;
|
|
24
|
+
rememberMe?: boolean | undefined;
|
|
25
|
+
}>> | undefined, opts?: Partial<import('vee-validate').ResetFormOpts>) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare function useRegistrationForm(): {
|
|
28
|
+
values: {
|
|
29
|
+
firstName?: string | undefined;
|
|
30
|
+
lastName?: string | undefined;
|
|
31
|
+
email?: string | undefined;
|
|
32
|
+
phone?: string | undefined;
|
|
33
|
+
password?: string | undefined;
|
|
34
|
+
confirmPassword?: string | undefined;
|
|
35
|
+
dateOfBirth?: string | undefined;
|
|
36
|
+
country?: string | undefined;
|
|
37
|
+
interests?: string[] | undefined;
|
|
38
|
+
agreeToTerms?: boolean | undefined;
|
|
39
|
+
};
|
|
40
|
+
isSubmitting: import('vue').Ref<boolean, boolean>;
|
|
41
|
+
fields: {
|
|
42
|
+
firstName: import('vee-validate').FieldContext<unknown>;
|
|
43
|
+
lastName: import('vee-validate').FieldContext<unknown>;
|
|
44
|
+
email: import('vee-validate').FieldContext<unknown>;
|
|
45
|
+
phone: import('vee-validate').FieldContext<unknown>;
|
|
46
|
+
password: import('vee-validate').FieldContext<unknown>;
|
|
47
|
+
confirmPassword: import('vee-validate').FieldContext<unknown>;
|
|
48
|
+
dateOfBirth: import('vee-validate').FieldContext<unknown>;
|
|
49
|
+
country: import('vee-validate').FieldContext<unknown>;
|
|
50
|
+
interests: import('vee-validate').FieldContext<unknown>;
|
|
51
|
+
agreeToTerms: import('vee-validate').FieldContext<unknown>;
|
|
52
|
+
};
|
|
53
|
+
onSubmit: (e?: Event) => Promise<Promise<void> | undefined>;
|
|
54
|
+
resetForm: (state?: Partial<import('vee-validate').FormState<{
|
|
55
|
+
firstName?: string | undefined;
|
|
56
|
+
lastName?: string | undefined;
|
|
57
|
+
email?: string | undefined;
|
|
58
|
+
phone?: string | undefined;
|
|
59
|
+
password?: string | undefined;
|
|
60
|
+
confirmPassword?: string | undefined;
|
|
61
|
+
dateOfBirth?: string | undefined;
|
|
62
|
+
country?: string | undefined;
|
|
63
|
+
interests?: string[] | undefined;
|
|
64
|
+
agreeToTerms?: boolean | undefined;
|
|
65
|
+
}>> | undefined, opts?: Partial<import('vee-validate').ResetFormOpts>) => void;
|
|
66
|
+
};
|
|
67
|
+
export declare function useDynamicForm(): {
|
|
68
|
+
onSubmit: (e?: Event) => Promise<void | undefined>;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Usage patterns for different component types:
|
|
72
|
+
*/
|
|
73
|
+
export declare const USAGE_EXAMPLES: {
|
|
74
|
+
/**
|
|
75
|
+
* FormField component
|
|
76
|
+
* Most common use case - single field with label, error, hint
|
|
77
|
+
*/
|
|
78
|
+
formField: string;
|
|
79
|
+
/**
|
|
80
|
+
* Input component alone
|
|
81
|
+
* For custom label or error UI
|
|
82
|
+
*/
|
|
83
|
+
input: string;
|
|
84
|
+
/**
|
|
85
|
+
* Select component
|
|
86
|
+
* For dropdown/select validation
|
|
87
|
+
*/
|
|
88
|
+
select: string;
|
|
89
|
+
/**
|
|
90
|
+
* Checkbox component
|
|
91
|
+
* For single or multiple selection
|
|
92
|
+
*/
|
|
93
|
+
checkbox: string;
|
|
94
|
+
/**
|
|
95
|
+
* Radio group component
|
|
96
|
+
* For single-select options
|
|
97
|
+
*/
|
|
98
|
+
radio: string;
|
|
99
|
+
/**
|
|
100
|
+
* Switch component
|
|
101
|
+
* For boolean toggle validation
|
|
102
|
+
*/
|
|
103
|
+
switch: string;
|
|
104
|
+
/**
|
|
105
|
+
* DatePicker component
|
|
106
|
+
* For date validation
|
|
107
|
+
*/
|
|
108
|
+
datePicker: string;
|
|
109
|
+
};
|