@foormjs/vue 0.2.3 → 0.2.4

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.d.ts CHANGED
@@ -1,9 +1,50 @@
1
- import { TAtscriptAnnotatedType } from '@atscript/typescript/utils';
2
- import { TAtscriptTypeObject } from '@atscript/typescript/utils';
1
+ import { AllowedComponentProps } from 'vue';
2
+ import { ComponentCustomProps } from 'vue';
3
+ import { InferDataType } from '@atscript/typescript';
4
+ import { default as OoForm } from './components/oo-form.vue';
5
+ import { Reactive } from 'vue';
6
+ import { RendererElement } from 'vue';
7
+ import { RendererNode } from 'vue';
8
+ import { ShallowUnwrapRef } from 'vue';
9
+ import { TAtscriptAnnotatedType } from '@atscript/typescript';
10
+ import { TAtscriptTypeObject } from '@atscript/typescript';
11
+ import { TComputed } from 'foorm';
3
12
  import { TFoormEntryOptions } from 'foorm';
4
13
  import { TFoormField } from 'foorm';
14
+ import { TFoormFnScope } from 'foorm';
15
+ import { TFoormModel } from 'foorm';
16
+ import { VNode } from 'vue';
17
+ import { VNodeProps } from 'vue';
5
18
 
6
- export declare const OoField: <TFormData = any, TFormContext = any>(__VLS_props: any, __VLS_ctx?: {
19
+ export declare const OoField: <TFormData = any, TFormContext = any>(__VLS_props: {
20
+ validators: ((scope: TFoormFnScope<unknown, Record<string, unknown>, Record<string, unknown>>) => string | boolean)[];
21
+ error?: string | undefined;
22
+ field: string;
23
+ type: string;
24
+ component?: string | undefined;
25
+ autocomplete?: string | undefined;
26
+ altAction?: string | undefined;
27
+ order?: number | undefined;
28
+ name?: string | undefined;
29
+ phantom?: boolean | undefined;
30
+ label: TComputed<string>;
31
+ description?: TComputed<string> | undefined;
32
+ hint?: TComputed<string> | undefined;
33
+ placeholder?: TComputed<string> | undefined;
34
+ optional: TComputed<boolean>;
35
+ disabled: TComputed<boolean>;
36
+ hidden: TComputed<boolean>;
37
+ readonly: TComputed<boolean>;
38
+ classes?: TComputed<string | Record<string, boolean>> | undefined;
39
+ styles?: TComputed<string | Record<string, string>> | undefined;
40
+ options?: TComputed<TFoormEntryOptions[]> | undefined;
41
+ attrs?: Record<string, unknown> | undefined;
42
+ value?: unknown;
43
+ maxLength?: number | undefined;
44
+ minLength?: number | undefined;
45
+ min?: number | undefined;
46
+ max?: number | undefined;
47
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: {
7
48
  attrs: any;
8
49
  emit: any;
9
50
  slots: {
@@ -11,142 +52,179 @@ export declare const OoField: <TFormData = any, TFormContext = any>(__VLS_props:
11
52
  onBlur: any;
12
53
  error: any;
13
54
  model: any;
14
- formData: any;
15
- formContext: any;
16
- label: any;
17
- description: any;
18
- hint: any;
19
- placeholder: any;
20
- classes: any;
21
- styles: any;
22
- optional: any;
23
- disabled: any;
24
- hidden: any;
25
- readonly: any;
26
- type: any;
27
- altAction: any;
28
- component: any;
29
- vName: any;
30
- field: any;
31
- options: any;
32
- maxLength: any;
33
- required: any;
34
- autocomplete: any;
35
- attrs: any;
55
+ formData: TFormData;
56
+ formContext: TFormContext | undefined;
57
+ label: string;
58
+ description: string;
59
+ hint: string;
60
+ placeholder: string;
61
+ value: any;
62
+ classes: {
63
+ error: boolean;
64
+ disabled: boolean;
65
+ required: boolean;
66
+ };
67
+ styles: string | Record<string, string>;
68
+ optional: boolean;
69
+ disabled: boolean;
70
+ hidden: boolean;
71
+ readonly: boolean;
72
+ type: string;
73
+ altAction: string | undefined;
74
+ component: string | undefined;
75
+ vName: string | undefined;
76
+ field: string;
77
+ options: TFoormEntryOptions[];
78
+ maxLength: number | undefined;
79
+ required: boolean | undefined;
80
+ autocomplete: string | undefined;
81
+ attrs: Record<string, unknown> | undefined;
36
82
  }): any;
37
83
  };
38
- }, __VLS_expose?: (exposed: any) => void, __VLS_setup?: Promise<{
39
- props: any;
40
- expose(exposed: any): void;
84
+ } | undefined, __VLS_expose?: ((exposed: ShallowUnwrapRef< {}>) => void) | undefined, __VLS_setup?: Promise<{
85
+ props: {
86
+ validators: ((scope: TFoormFnScope<unknown, Record<string, unknown>, Record<string, unknown>>) => string | boolean)[];
87
+ error?: string | undefined;
88
+ field: string;
89
+ type: string;
90
+ component?: string | undefined;
91
+ autocomplete?: string | undefined;
92
+ altAction?: string | undefined;
93
+ order?: number | undefined;
94
+ name?: string | undefined;
95
+ phantom?: boolean | undefined;
96
+ label: TComputed<string>;
97
+ description?: TComputed<string> | undefined;
98
+ hint?: TComputed<string> | undefined;
99
+ placeholder?: TComputed<string> | undefined;
100
+ optional: TComputed<boolean>;
101
+ disabled: TComputed<boolean>;
102
+ hidden: TComputed<boolean>;
103
+ readonly: TComputed<boolean>;
104
+ classes?: TComputed<string | Record<string, boolean>> | undefined;
105
+ styles?: TComputed<string | Record<string, string>> | undefined;
106
+ options?: TComputed<TFoormEntryOptions[]> | undefined;
107
+ attrs?: Record<string, unknown> | undefined;
108
+ value?: unknown;
109
+ maxLength?: number | undefined;
110
+ minLength?: number | undefined;
111
+ min?: number | undefined;
112
+ max?: number | undefined;
113
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
114
+ expose(exposed: ShallowUnwrapRef< {}>): void;
41
115
  attrs: any;
42
116
  slots: {
43
117
  default?(_: {
44
118
  onBlur: any;
45
119
  error: any;
46
120
  model: any;
47
- formData: any;
48
- formContext: any;
49
- label: any;
50
- description: any;
51
- hint: any;
52
- placeholder: any;
53
- classes: any;
54
- styles: any;
55
- optional: any;
56
- disabled: any;
57
- hidden: any;
58
- readonly: any;
59
- type: any;
60
- altAction: any;
61
- component: any;
62
- vName: any;
63
- field: any;
64
- options: any;
65
- maxLength: any;
66
- required: any;
67
- autocomplete: any;
68
- attrs: any;
121
+ formData: TFormData;
122
+ formContext: TFormContext | undefined;
123
+ label: string;
124
+ description: string;
125
+ hint: string;
126
+ placeholder: string;
127
+ value: any;
128
+ classes: {
129
+ error: boolean;
130
+ disabled: boolean;
131
+ required: boolean;
132
+ };
133
+ styles: string | Record<string, string>;
134
+ optional: boolean;
135
+ disabled: boolean;
136
+ hidden: boolean;
137
+ readonly: boolean;
138
+ type: string;
139
+ altAction: string | undefined;
140
+ component: string | undefined;
141
+ vName: string | undefined;
142
+ field: string;
143
+ options: TFoormEntryOptions[];
144
+ maxLength: number | undefined;
145
+ required: boolean | undefined;
146
+ autocomplete: string | undefined;
147
+ attrs: Record<string, unknown> | undefined;
69
148
  }): any;
70
149
  };
71
150
  emit: any;
72
- }>) => any;
151
+ }>) => VNode<RendererNode, RendererElement, {
152
+ [key: string]: any;
153
+ }> & {
154
+ __ctx?: {
155
+ props: {
156
+ validators: ((scope: TFoormFnScope<unknown, Record<string, unknown>, Record<string, unknown>>) => string | boolean)[];
157
+ error?: string | undefined;
158
+ field: string;
159
+ type: string;
160
+ component?: string | undefined;
161
+ autocomplete?: string | undefined;
162
+ altAction?: string | undefined;
163
+ order?: number | undefined;
164
+ name?: string | undefined;
165
+ phantom?: boolean | undefined;
166
+ label: TComputed<string>;
167
+ description?: TComputed<string> | undefined;
168
+ hint?: TComputed<string> | undefined;
169
+ placeholder?: TComputed<string> | undefined;
170
+ optional: TComputed<boolean>;
171
+ disabled: TComputed<boolean>;
172
+ hidden: TComputed<boolean>;
173
+ readonly: TComputed<boolean>;
174
+ classes?: TComputed<string | Record<string, boolean>> | undefined;
175
+ styles?: TComputed<string | Record<string, string>> | undefined;
176
+ options?: TComputed<TFoormEntryOptions[]> | undefined;
177
+ attrs?: Record<string, unknown> | undefined;
178
+ value?: unknown;
179
+ maxLength?: number | undefined;
180
+ minLength?: number | undefined;
181
+ min?: number | undefined;
182
+ max?: number | undefined;
183
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
184
+ expose(exposed: ShallowUnwrapRef< {}>): void;
185
+ attrs: any;
186
+ slots: {
187
+ default?(_: {
188
+ onBlur: any;
189
+ error: any;
190
+ model: any;
191
+ formData: TFormData;
192
+ formContext: TFormContext | undefined;
193
+ label: string;
194
+ description: string;
195
+ hint: string;
196
+ placeholder: string;
197
+ value: any;
198
+ classes: {
199
+ error: boolean;
200
+ disabled: boolean;
201
+ required: boolean;
202
+ };
203
+ styles: string | Record<string, string>;
204
+ optional: boolean;
205
+ disabled: boolean;
206
+ hidden: boolean;
207
+ readonly: boolean;
208
+ type: string;
209
+ altAction: string | undefined;
210
+ component: string | undefined;
211
+ vName: string | undefined;
212
+ field: string;
213
+ options: TFoormEntryOptions[];
214
+ maxLength: number | undefined;
215
+ required: boolean | undefined;
216
+ autocomplete: string | undefined;
217
+ attrs: Record<string, unknown> | undefined;
218
+ }): any;
219
+ };
220
+ emit: any;
221
+ } | undefined;
222
+ };
73
223
 
74
- export declare const OoForm: <TFormData = any, TFormContext = any>(__VLS_props: any, __VLS_ctx?: {
75
- attrs: any;
76
- emit: any;
77
- slots: Partial<Record<`field:${any}`, (_: any) => any>> & {
78
- "form.header"?(_: {
79
- clearErrors: any;
80
- reset: any;
81
- title: any;
82
- formContext: any;
83
- disabled: any;
84
- }): any;
85
- "form.before"?(_: {
86
- clearErrors: any;
87
- reset: any;
88
- }): any;
89
- "form.after"?(_: {
90
- clearErrors: any;
91
- reset: any;
92
- disabled: any;
93
- formContext: any;
94
- }): any;
95
- "form.submit"?(_: {
96
- disabled: any;
97
- text: any;
98
- clearErrors: any;
99
- reset: any;
100
- formContext: any;
101
- }): any;
102
- "form.footer"?(_: {
103
- disabled: any;
104
- clearErrors: any;
105
- reset: any;
106
- formContext: any;
107
- }): any;
108
- };
109
- }, __VLS_expose?: (exposed: any) => void, __VLS_setup?: Promise<{
110
- props: any;
111
- expose(exposed: any): void;
112
- attrs: any;
113
- slots: Partial<Record<`field:${any}`, (_: any) => any>> & {
114
- "form.header"?(_: {
115
- clearErrors: any;
116
- reset: any;
117
- title: any;
118
- formContext: any;
119
- disabled: any;
120
- }): any;
121
- "form.before"?(_: {
122
- clearErrors: any;
123
- reset: any;
124
- }): any;
125
- "form.after"?(_: {
126
- clearErrors: any;
127
- reset: any;
128
- disabled: any;
129
- formContext: any;
130
- }): any;
131
- "form.submit"?(_: {
132
- disabled: any;
133
- text: any;
134
- clearErrors: any;
135
- reset: any;
136
- formContext: any;
137
- }): any;
138
- "form.footer"?(_: {
139
- disabled: any;
140
- clearErrors: any;
141
- reset: any;
142
- formContext: any;
143
- }): any;
144
- };
145
- emit: any;
146
- }>) => any;
224
+ export { OoForm }
147
225
 
148
226
  export declare interface TFoormComponentProps<V, TFormData, TFormContext> {
149
- onBlur: Function;
227
+ onBlur: (event: FocusEvent) => void;
150
228
  error?: string;
151
229
  model: {
152
230
  value: V;
@@ -173,8 +251,8 @@ export declare interface TFoormComponentProps<V, TFormData, TFormContext> {
173
251
  }
174
252
 
175
253
  export declare function useFoorm<T extends TAtscriptAnnotatedType<TAtscriptTypeObject<any, any>>>(type: T): {
176
- form: any;
177
- formData: any;
254
+ form: TFoormModel;
255
+ formData: Reactive<InferDataType<T["type"]>>;
178
256
  };
179
257
 
180
258
  export { }