magoo 0.1.0-beta.0 → 0.1.0-beta.2
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/README.md +2 -0
- package/README.pt-BR.md +2 -0
- package/dist/index.d.ts +962 -1
- package/package.json +5 -1
- package/dist/src/App.vue.d.ts +0 -2
- package/dist/src/components/MButton/MButton.spec.d.ts +0 -1
- package/dist/src/components/MButton/MButton.stories.d.ts +0 -8
- package/dist/src/components/MButton/MButton.vue.d.ts +0 -31
- package/dist/src/components/MButton/index.d.ts +0 -1
- package/dist/src/components/MCheckbox/MCheckbox.spec.d.ts +0 -1
- package/dist/src/components/MCheckbox/MCheckbox.stories.d.ts +0 -8
- package/dist/src/components/MCheckbox/MCheckbox.vue.d.ts +0 -35
- package/dist/src/components/MCheckbox/index.d.ts +0 -1
- package/dist/src/components/MCheckboxList/MCheckboxList.spec.d.ts +0 -1
- package/dist/src/components/MCheckboxList/MCheckboxList.stories.d.ts +0 -8
- package/dist/src/components/MCheckboxList/MCheckboxList.vue.d.ts +0 -45
- package/dist/src/components/MCheckboxList/index.d.ts +0 -1
- package/dist/src/components/MErrorMessage/MErrorMessage.spec.d.ts +0 -1
- package/dist/src/components/MErrorMessage/MErrorMessage.stories.d.ts +0 -8
- package/dist/src/components/MErrorMessage/MErrorMessage.vue.d.ts +0 -8
- package/dist/src/components/MErrorMessage/index.d.ts +0 -1
- package/dist/src/components/MFieldsetPanel/MFieldsetPanel.spec.d.ts +0 -1
- package/dist/src/components/MFieldsetPanel/MFieldsetPanel.stories.d.ts +0 -7
- package/dist/src/components/MFieldsetPanel/MFieldsetPanel.vue.d.ts +0 -26
- package/dist/src/components/MFieldsetPanel/index.d.ts +0 -1
- package/dist/src/components/MFileUpload/MFileUpload.spec.d.ts +0 -1
- package/dist/src/components/MFileUpload/MFileUpload.stories.d.ts +0 -10
- package/dist/src/components/MFileUpload/MFileUpload.vue.d.ts +0 -65
- package/dist/src/components/MFileUpload/index.d.ts +0 -1
- package/dist/src/components/MForm/MForm.spec.d.ts +0 -1
- package/dist/src/components/MForm/MForm.stories.d.ts +0 -7
- package/dist/src/components/MForm/MForm.vue.d.ts +0 -46
- package/dist/src/components/MForm/index.d.ts +0 -1
- package/dist/src/components/MInput/MInput.spec.d.ts +0 -1
- package/dist/src/components/MInput/MInput.stories.d.ts +0 -12
- package/dist/src/components/MInput/MInput.vue.d.ts +0 -39
- package/dist/src/components/MInput/index.d.ts +0 -1
- package/dist/src/components/MList/MList.spec.d.ts +0 -1
- package/dist/src/components/MList/MList.stories.d.ts +0 -15
- package/dist/src/components/MList/MList.vue.d.ts +0 -142
- package/dist/src/components/MList/index.d.ts +0 -1
- package/dist/src/components/MNumber/MNumber.spec.d.ts +0 -1
- package/dist/src/components/MNumber/MNumber.stories.d.ts +0 -9
- package/dist/src/components/MNumber/MNumber.vue.d.ts +0 -41
- package/dist/src/components/MNumber/index.d.ts +0 -1
- package/dist/src/components/MPassword/MPassword.spec.d.ts +0 -1
- package/dist/src/components/MPassword/MPassword.stories.d.ts +0 -8
- package/dist/src/components/MPassword/MPassword.vue.d.ts +0 -43
- package/dist/src/components/MPassword/index.d.ts +0 -1
- package/dist/src/components/MRadio/MRadio.spec.d.ts +0 -1
- package/dist/src/components/MRadio/MRadio.stories.d.ts +0 -8
- package/dist/src/components/MRadio/MRadio.vue.d.ts +0 -33
- package/dist/src/components/MRadio/index.d.ts +0 -1
- package/dist/src/components/MRadioList/MRadioList.spec.d.ts +0 -1
- package/dist/src/components/MRadioList/MRadioList.stories.d.ts +0 -8
- package/dist/src/components/MRadioList/MRadioList.vue.d.ts +0 -45
- package/dist/src/components/MRadioList/index.d.ts +0 -1
- package/dist/src/components/MSelect/MSelect.spec.d.ts +0 -1
- package/dist/src/components/MSelect/MSelect.stories.d.ts +0 -8
- package/dist/src/components/MSelect/MSelect.vue.d.ts +0 -43
- package/dist/src/components/MSelect/index.d.ts +0 -1
- package/dist/src/components/MSwitch/MSwitch.spec.d.ts +0 -1
- package/dist/src/components/MSwitch/MSwitch.stories.d.ts +0 -11
- package/dist/src/components/MSwitch/MSwitch.vue.d.ts +0 -41
- package/dist/src/components/MSwitch/index.d.ts +0 -1
- package/dist/src/components/MTextarea/MTextarea.spec.d.ts +0 -1
- package/dist/src/components/MTextarea/MTextarea.stories.d.ts +0 -8
- package/dist/src/components/MTextarea/MTextarea.vue.d.ts +0 -37
- package/dist/src/components/MTextarea/index.d.ts +0 -1
- package/dist/src/components/MValidationSummary/MValidationSummary.spec.d.ts +0 -1
- package/dist/src/components/MValidationSummary/MValidationSummary.stories.d.ts +0 -8
- package/dist/src/components/MValidationSummary/MValidationSummary.vue.d.ts +0 -25
- package/dist/src/components/MValidationSummary/index.d.ts +0 -1
- package/dist/src/components/index.d.ts +0 -17
- package/dist/src/composables/useFieldDescribedBy.d.ts +0 -4
- package/dist/src/composables/useFieldErrors.d.ts +0 -7
- package/dist/src/composables/useFieldIds.d.ts +0 -6
- package/dist/src/index.d.ts +0 -9
- package/dist/src/main.d.ts +0 -0
- package/dist/src/themes/theme.d.ts +0 -3
- package/dist/src/types/forms.d.ts +0 -32
- package/dist/src/types/index.d.ts +0 -1
- package/dist/src/validation/index.d.ts +0 -4
- package/dist/src/validation/types.d.ts +0 -40
- package/dist/src/validation/useFormValidation.d.ts +0 -56
- package/dist/src/validation/useFormValidation.spec.d.ts +0 -1
- package/dist/src/validation/utils.d.ts +0 -17
- package/dist/src/validation/utils.spec.d.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,962 @@
|
|
|
1
|
-
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
3
|
+
import { ComponentProvideOptions } from 'vue';
|
|
4
|
+
import { ComputedRef } from 'vue';
|
|
5
|
+
import { DefineComponent } from 'vue';
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
7
|
+
import { Ref } from 'vue';
|
|
8
|
+
|
|
9
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
label: string;
|
|
11
|
+
type: "button" | "submit" | "reset";
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
ariaLabel: string;
|
|
15
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
16
|
+
|
|
17
|
+
declare const __VLS_component_2: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
|
|
18
|
+
legend: string;
|
|
19
|
+
id: string;
|
|
20
|
+
hint: string;
|
|
21
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLFieldSetElement>;
|
|
22
|
+
|
|
23
|
+
declare const __VLS_component_3: DefineComponent<__VLS_Props_11, {
|
|
24
|
+
focusFirstInvalid: typeof focusInvalid;
|
|
25
|
+
formElement: Ref<HTMLFormElement | undefined, HTMLFormElement | undefined>;
|
|
26
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
27
|
+
submit: (value: Record<string, unknown>) => any;
|
|
28
|
+
invalid: (errors: MagooErrorMap) => any;
|
|
29
|
+
}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{
|
|
30
|
+
onSubmit?: ((value: Record<string, unknown>) => any) | undefined;
|
|
31
|
+
onInvalid?: ((errors: MagooErrorMap) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
values: Record<string, unknown>;
|
|
34
|
+
errors: Record<string, MagooFieldError>;
|
|
35
|
+
validation: MagooFormController | null;
|
|
36
|
+
focusFirstInvalid: boolean;
|
|
37
|
+
novalidate: boolean;
|
|
38
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
39
|
+
formElement: HTMLFormElement;
|
|
40
|
+
}, HTMLFormElement>;
|
|
41
|
+
|
|
42
|
+
declare const __VLS_component_4: DefineComponent<__VLS_Props_17, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
43
|
+
search: (value: string) => any;
|
|
44
|
+
"update:page": (value: number) => any;
|
|
45
|
+
"update:sort": (value: string) => any;
|
|
46
|
+
"update:sortDirection": (value: SortDirection) => any;
|
|
47
|
+
"update:pageSize": (value: number | "all") => any;
|
|
48
|
+
query: (value: MListQuery) => any;
|
|
49
|
+
retry: () => any;
|
|
50
|
+
}, string, PublicProps, Readonly<__VLS_Props_17> & Readonly<{
|
|
51
|
+
onSearch?: ((value: string) => any) | undefined;
|
|
52
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
53
|
+
"onUpdate:sort"?: ((value: string) => any) | undefined;
|
|
54
|
+
"onUpdate:sortDirection"?: ((value: SortDirection) => any) | undefined;
|
|
55
|
+
"onUpdate:pageSize"?: ((value: number | "all") => any) | undefined;
|
|
56
|
+
onQuery?: ((value: MListQuery) => any) | undefined;
|
|
57
|
+
onRetry?: (() => any) | undefined;
|
|
58
|
+
}>, {
|
|
59
|
+
sort: string;
|
|
60
|
+
label: string;
|
|
61
|
+
loading: boolean;
|
|
62
|
+
ariaLabel: string;
|
|
63
|
+
id: string;
|
|
64
|
+
hint: string;
|
|
65
|
+
items: ListItem[];
|
|
66
|
+
itemKey: string | ((item: ListItem, index: number) => string | number);
|
|
67
|
+
itemLabel: string | ((item: ListItem, index: number) => string);
|
|
68
|
+
searchable: boolean;
|
|
69
|
+
searchLabel: string;
|
|
70
|
+
searchPlaceholder: string;
|
|
71
|
+
searchAutocomplete: string;
|
|
72
|
+
searchFields: string[];
|
|
73
|
+
searchDebounce: number;
|
|
74
|
+
clearSearchLabel: string;
|
|
75
|
+
sortable: boolean;
|
|
76
|
+
sortLabel: string;
|
|
77
|
+
sortPlaceholder: string;
|
|
78
|
+
ascendingLabel: string;
|
|
79
|
+
descendingLabel: string;
|
|
80
|
+
sortOptions: MListSortOption[];
|
|
81
|
+
sortDirection: SortDirection;
|
|
82
|
+
page: number;
|
|
83
|
+
pageSize: number;
|
|
84
|
+
pageSizeOptions: (number | "all")[];
|
|
85
|
+
pageSizeLabel: string;
|
|
86
|
+
allPageSizeLabel: string;
|
|
87
|
+
density: "compact" | "comfortable";
|
|
88
|
+
serverSide: boolean;
|
|
89
|
+
totalItems: number;
|
|
90
|
+
loadError: string;
|
|
91
|
+
retryLabel: string;
|
|
92
|
+
emptyLabel: string;
|
|
93
|
+
loadingLabel: string;
|
|
94
|
+
paginationLabel: string;
|
|
95
|
+
previousPageLabel: string;
|
|
96
|
+
nextPageLabel: string;
|
|
97
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
98
|
+
searchInput: HTMLInputElement;
|
|
99
|
+
sortSelect: HTMLSelectElement;
|
|
100
|
+
pageSizeSelect: HTMLSelectElement;
|
|
101
|
+
paginationNav: HTMLElement;
|
|
102
|
+
}, any>;
|
|
103
|
+
|
|
104
|
+
declare type __VLS_Props = {
|
|
105
|
+
label?: string;
|
|
106
|
+
type?: 'button' | 'submit' | 'reset';
|
|
107
|
+
disabled?: boolean;
|
|
108
|
+
loading?: boolean;
|
|
109
|
+
ariaLabel?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare type __VLS_Props_10 = {
|
|
113
|
+
id?: string;
|
|
114
|
+
legend?: string;
|
|
115
|
+
hint?: string;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
declare type __VLS_Props_11 = {
|
|
119
|
+
values?: Record<string, unknown>;
|
|
120
|
+
errors?: Record<string, MagooFieldError>;
|
|
121
|
+
validation?: MagooFormController | null;
|
|
122
|
+
focusFirstInvalid?: boolean;
|
|
123
|
+
novalidate?: boolean;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare type __VLS_Props_12 = {
|
|
127
|
+
modelValue?: boolean;
|
|
128
|
+
label?: string;
|
|
129
|
+
id?: string;
|
|
130
|
+
name?: string;
|
|
131
|
+
disabled?: boolean;
|
|
132
|
+
error?: string | string[];
|
|
133
|
+
hint?: string;
|
|
134
|
+
invalid?: boolean;
|
|
135
|
+
loading?: boolean;
|
|
136
|
+
submitTriggered?: boolean;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
declare type __VLS_Props_13 = {
|
|
140
|
+
modelValue?: string;
|
|
141
|
+
legend?: string;
|
|
142
|
+
label?: string;
|
|
143
|
+
id?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
required?: boolean;
|
|
146
|
+
options?: Array<{
|
|
147
|
+
label: string;
|
|
148
|
+
value: string;
|
|
149
|
+
}>;
|
|
150
|
+
disabled?: boolean;
|
|
151
|
+
error?: string | string[];
|
|
152
|
+
hint?: string;
|
|
153
|
+
invalid?: boolean;
|
|
154
|
+
loading?: boolean;
|
|
155
|
+
submitTriggered?: boolean;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
declare type __VLS_Props_14 = {
|
|
159
|
+
modelValue?: string;
|
|
160
|
+
label?: string;
|
|
161
|
+
id?: string;
|
|
162
|
+
name?: string;
|
|
163
|
+
options?: Array<{
|
|
164
|
+
label: string;
|
|
165
|
+
value: string;
|
|
166
|
+
}>;
|
|
167
|
+
required?: boolean;
|
|
168
|
+
disabled?: boolean;
|
|
169
|
+
error?: string | string[];
|
|
170
|
+
hint?: string;
|
|
171
|
+
invalid?: boolean;
|
|
172
|
+
loading?: boolean;
|
|
173
|
+
submitTriggered?: boolean;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
declare type __VLS_Props_15 = {
|
|
177
|
+
modelValue?: string;
|
|
178
|
+
label?: string;
|
|
179
|
+
id?: string;
|
|
180
|
+
name?: string;
|
|
181
|
+
rows?: number;
|
|
182
|
+
required?: boolean;
|
|
183
|
+
disabled?: boolean;
|
|
184
|
+
error?: string | string[];
|
|
185
|
+
hint?: string;
|
|
186
|
+
invalid?: boolean;
|
|
187
|
+
loading?: boolean;
|
|
188
|
+
submitTriggered?: boolean;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
declare type __VLS_Props_16 = {
|
|
192
|
+
errors?: Record<string, MagooFieldError>;
|
|
193
|
+
/** Nomes legíveis por campo, exibidos como prefixo da mensagem. */
|
|
194
|
+
labels?: Record<string, string>;
|
|
195
|
+
/** IDs dos controles quando diferem do `name`. */
|
|
196
|
+
fieldIds?: Record<string, string>;
|
|
197
|
+
title?: string;
|
|
198
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
199
|
+
/** Move o foco para o resumo quando ele passa a exibir erros. */
|
|
200
|
+
autofocus?: boolean;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
declare type __VLS_Props_17 = {
|
|
204
|
+
items?: ListItem[];
|
|
205
|
+
id?: string;
|
|
206
|
+
label?: string;
|
|
207
|
+
hint?: string;
|
|
208
|
+
ariaLabel?: string;
|
|
209
|
+
itemKey?: string | ((item: ListItem, index: number) => string | number);
|
|
210
|
+
itemLabel?: string | ((item: ListItem, index: number) => string);
|
|
211
|
+
searchable?: boolean;
|
|
212
|
+
searchLabel?: string;
|
|
213
|
+
searchPlaceholder?: string;
|
|
214
|
+
searchAutocomplete?: string;
|
|
215
|
+
searchFields?: string[];
|
|
216
|
+
searchDebounce?: number;
|
|
217
|
+
clearSearchLabel?: string;
|
|
218
|
+
sortable?: boolean;
|
|
219
|
+
sortLabel?: string;
|
|
220
|
+
sortPlaceholder?: string;
|
|
221
|
+
ascendingLabel?: string;
|
|
222
|
+
descendingLabel?: string;
|
|
223
|
+
sortOptions?: MListSortOption[];
|
|
224
|
+
sort?: string;
|
|
225
|
+
sortDirection?: SortDirection;
|
|
226
|
+
page?: number;
|
|
227
|
+
pageSize?: number;
|
|
228
|
+
pageSizeOptions?: (number | 'all')[];
|
|
229
|
+
pageSizeLabel?: string;
|
|
230
|
+
allPageSizeLabel?: string;
|
|
231
|
+
density?: 'compact' | 'comfortable';
|
|
232
|
+
serverSide?: boolean;
|
|
233
|
+
totalItems?: number;
|
|
234
|
+
loadError?: string;
|
|
235
|
+
retryLabel?: string;
|
|
236
|
+
loading?: boolean;
|
|
237
|
+
emptyLabel?: string;
|
|
238
|
+
loadingLabel?: string;
|
|
239
|
+
paginationLabel?: string;
|
|
240
|
+
previousPageLabel?: string;
|
|
241
|
+
nextPageLabel?: string;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
declare type __VLS_Props_2 = {
|
|
245
|
+
label?: string;
|
|
246
|
+
id?: string;
|
|
247
|
+
modelValue?: string;
|
|
248
|
+
type?: string;
|
|
249
|
+
name?: string;
|
|
250
|
+
required?: boolean;
|
|
251
|
+
disabled?: boolean;
|
|
252
|
+
error?: string | string[];
|
|
253
|
+
hint?: string;
|
|
254
|
+
invalid?: boolean;
|
|
255
|
+
loading?: boolean;
|
|
256
|
+
autocomplete?: string;
|
|
257
|
+
submitTriggered?: boolean;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
declare type __VLS_Props_3 = {
|
|
261
|
+
modelValue?: number | null;
|
|
262
|
+
label?: string;
|
|
263
|
+
id?: string;
|
|
264
|
+
name?: string;
|
|
265
|
+
min?: number;
|
|
266
|
+
max?: number;
|
|
267
|
+
step?: number | 'any';
|
|
268
|
+
required?: boolean;
|
|
269
|
+
disabled?: boolean;
|
|
270
|
+
error?: string | string[];
|
|
271
|
+
hint?: string;
|
|
272
|
+
invalid?: boolean;
|
|
273
|
+
loading?: boolean;
|
|
274
|
+
submitTriggered?: boolean;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
declare type __VLS_Props_4 = {
|
|
278
|
+
label?: string;
|
|
279
|
+
id?: string;
|
|
280
|
+
modelValue?: string;
|
|
281
|
+
name?: string;
|
|
282
|
+
required?: boolean;
|
|
283
|
+
disabled?: boolean;
|
|
284
|
+
error?: string | string[];
|
|
285
|
+
hint?: string;
|
|
286
|
+
invalid?: boolean;
|
|
287
|
+
loading?: boolean;
|
|
288
|
+
autocomplete?: string;
|
|
289
|
+
submitTriggered?: boolean;
|
|
290
|
+
showPasswordLabel?: string;
|
|
291
|
+
hidePasswordLabel?: string;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
declare type __VLS_Props_5 = {
|
|
295
|
+
label?: string;
|
|
296
|
+
id?: string;
|
|
297
|
+
name?: string;
|
|
298
|
+
modelValue?: File[];
|
|
299
|
+
accept?: string;
|
|
300
|
+
multiple?: boolean;
|
|
301
|
+
maxSize?: number;
|
|
302
|
+
maxFiles?: number;
|
|
303
|
+
required?: boolean;
|
|
304
|
+
disabled?: boolean;
|
|
305
|
+
loading?: boolean;
|
|
306
|
+
progress?: number;
|
|
307
|
+
error?: string | string[];
|
|
308
|
+
hint?: string;
|
|
309
|
+
invalid?: boolean;
|
|
310
|
+
submitTriggered?: boolean;
|
|
311
|
+
buttonLabel?: string;
|
|
312
|
+
dropHint?: string;
|
|
313
|
+
removeLabel?: string;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
declare type __VLS_Props_6 = {
|
|
317
|
+
modelValue?: boolean;
|
|
318
|
+
label?: string;
|
|
319
|
+
id?: string;
|
|
320
|
+
name?: string;
|
|
321
|
+
required?: boolean;
|
|
322
|
+
disabled?: boolean;
|
|
323
|
+
loading?: boolean;
|
|
324
|
+
error?: string | string[];
|
|
325
|
+
hint?: string;
|
|
326
|
+
invalid?: boolean;
|
|
327
|
+
submitTriggered?: boolean;
|
|
328
|
+
onLabel?: string;
|
|
329
|
+
offLabel?: string;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
declare type __VLS_Props_7 = {
|
|
333
|
+
modelValue?: boolean;
|
|
334
|
+
label?: string;
|
|
335
|
+
id?: string;
|
|
336
|
+
name?: string;
|
|
337
|
+
required?: boolean;
|
|
338
|
+
disabled?: boolean;
|
|
339
|
+
error?: string | string[];
|
|
340
|
+
hint?: string;
|
|
341
|
+
invalid?: boolean;
|
|
342
|
+
loading?: boolean;
|
|
343
|
+
submitTriggered?: boolean;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
declare type __VLS_Props_8 = {
|
|
347
|
+
modelValue?: string[];
|
|
348
|
+
legend?: string;
|
|
349
|
+
label?: string;
|
|
350
|
+
id?: string;
|
|
351
|
+
name?: string;
|
|
352
|
+
required?: boolean;
|
|
353
|
+
options?: Array<{
|
|
354
|
+
label: string;
|
|
355
|
+
value: string;
|
|
356
|
+
}>;
|
|
357
|
+
disabled?: boolean;
|
|
358
|
+
error?: string | string[];
|
|
359
|
+
hint?: string;
|
|
360
|
+
invalid?: boolean;
|
|
361
|
+
loading?: boolean;
|
|
362
|
+
submitTriggered?: boolean;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
declare type __VLS_Props_9 = {
|
|
366
|
+
message?: MagooFieldError;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
declare function __VLS_template(): {
|
|
370
|
+
attrs: Partial<{}>;
|
|
371
|
+
slots: {
|
|
372
|
+
loading?(_: {}): any;
|
|
373
|
+
default?(_: {}): any;
|
|
374
|
+
};
|
|
375
|
+
refs: {};
|
|
376
|
+
rootEl: HTMLButtonElement;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
declare function __VLS_template_2(): {
|
|
380
|
+
attrs: Partial<{}>;
|
|
381
|
+
slots: {
|
|
382
|
+
default?(_: {}): any;
|
|
383
|
+
};
|
|
384
|
+
refs: {};
|
|
385
|
+
rootEl: HTMLFieldSetElement;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
declare function __VLS_template_3(): {
|
|
389
|
+
attrs: Partial<{}>;
|
|
390
|
+
slots: {
|
|
391
|
+
default?(_: {}): any;
|
|
392
|
+
};
|
|
393
|
+
refs: {
|
|
394
|
+
formElement: HTMLFormElement;
|
|
395
|
+
};
|
|
396
|
+
rootEl: HTMLFormElement;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
declare function __VLS_template_4(): {
|
|
400
|
+
attrs: Partial<{}>;
|
|
401
|
+
slots: {
|
|
402
|
+
header?(_: {
|
|
403
|
+
total: number;
|
|
404
|
+
}): any;
|
|
405
|
+
item?(_: {
|
|
406
|
+
item: ListItem;
|
|
407
|
+
index: number;
|
|
408
|
+
}): any;
|
|
409
|
+
};
|
|
410
|
+
refs: {
|
|
411
|
+
searchInput: HTMLInputElement;
|
|
412
|
+
sortSelect: HTMLSelectElement;
|
|
413
|
+
pageSizeSelect: HTMLSelectElement;
|
|
414
|
+
paginationNav: HTMLElement;
|
|
415
|
+
};
|
|
416
|
+
rootEl: any;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
420
|
+
|
|
421
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
422
|
+
|
|
423
|
+
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
424
|
+
|
|
425
|
+
declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
|
|
426
|
+
|
|
427
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
428
|
+
new (): {
|
|
429
|
+
$slots: S;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
434
|
+
new (): {
|
|
435
|
+
$slots: S;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
440
|
+
new (): {
|
|
441
|
+
$slots: S;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
declare type __VLS_WithTemplateSlots_4<T, S> = T & {
|
|
446
|
+
new (): {
|
|
447
|
+
$slots: S;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
export declare function applyTheme(theme: MagooTheme | undefined, target?: HTMLElement): void;
|
|
452
|
+
|
|
453
|
+
/** Remove chaves sem mensagens e deduplica mensagens por campo. */
|
|
454
|
+
export declare function compactErrors(errors: MagooErrorMap): MagooErrorMap;
|
|
455
|
+
|
|
456
|
+
declare const _default: {
|
|
457
|
+
install(app: App): void;
|
|
458
|
+
};
|
|
459
|
+
export default _default;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Adaptador padrão: aceita `string`, `string[]`, `boolean`, `null`,
|
|
463
|
+
* `undefined` e objetos `{ message }` (formato comum em bibliotecas externas).
|
|
464
|
+
*/
|
|
465
|
+
export declare const defaultRuleResultAdapter: MagooRuleResultAdapter;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Foca o primeiro controle inválido dentro do container.
|
|
469
|
+
*
|
|
470
|
+
* Prioriza `aria-invalid="true"` (estado real exposto pelos campos) e recorre
|
|
471
|
+
* ao `name` do primeiro erro quando o estado ainda não foi refletido no DOM.
|
|
472
|
+
*/
|
|
473
|
+
export declare function focusFirstInvalidField(container: ParentNode | null | undefined, errors?: MagooErrorMap): HTMLElement | null;
|
|
474
|
+
|
|
475
|
+
declare function focusInvalid(): HTMLElement | null;
|
|
476
|
+
|
|
477
|
+
export declare function hasErrors(errors: MagooErrorMap): boolean;
|
|
478
|
+
|
|
479
|
+
declare type ListItem = Record<string, unknown>;
|
|
480
|
+
|
|
481
|
+
/** Chave reservada para erros que pertencem ao formulário como um todo. */
|
|
482
|
+
export declare const MAGOO_FORM_ERROR_KEY = "$form";
|
|
483
|
+
|
|
484
|
+
export declare type MagooErrorMap = Record<string, string[]>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Estado convertido por um adaptador de validação externa.
|
|
488
|
+
*
|
|
489
|
+
* O adaptador deve mapear o estado da biblioteca escolhida pelo host para este
|
|
490
|
+
* contrato antes de repassá-lo aos componentes Magoo.
|
|
491
|
+
*/
|
|
492
|
+
export declare interface MagooFieldAdapterState {
|
|
493
|
+
value?: unknown;
|
|
494
|
+
error?: MagooFieldError;
|
|
495
|
+
invalid?: boolean;
|
|
496
|
+
touched?: boolean;
|
|
497
|
+
dirty?: boolean;
|
|
498
|
+
validating?: boolean;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export declare interface MagooFieldBinding<TValue = unknown> {
|
|
502
|
+
name: string;
|
|
503
|
+
modelValue: TValue;
|
|
504
|
+
'onUpdate:modelValue': (value: TValue) => void;
|
|
505
|
+
onBlur: () => void;
|
|
506
|
+
error: string[];
|
|
507
|
+
submitTriggered: boolean;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Mensagem ou conjunto de mensagens que um campo pode exibir.
|
|
512
|
+
*
|
|
513
|
+
* O formato é intencionalmente independente de qualquer biblioteca de
|
|
514
|
+
* validação para permitir integração por adaptadores no projeto host.
|
|
515
|
+
*/
|
|
516
|
+
export declare type MagooFieldError = string | string[];
|
|
517
|
+
|
|
518
|
+
export declare interface MagooFieldRuntimeState {
|
|
519
|
+
touched: boolean;
|
|
520
|
+
dirty: boolean;
|
|
521
|
+
validating: boolean;
|
|
522
|
+
validated: boolean;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export declare interface MagooFieldSchema<TValue = unknown, TValues extends Record<string, unknown> = Record<string, unknown>> {
|
|
526
|
+
rules?: MagooValidationRule<TValue, TValues>[];
|
|
527
|
+
/** Campos cuja alteração deve revalidar este campo (ex.: confirmação de senha). */
|
|
528
|
+
dependsOn?: (keyof TValues & string)[];
|
|
529
|
+
/** Sobrescreve os gatilhos globais para este campo. */
|
|
530
|
+
validateOn?: MagooValidationTrigger[];
|
|
531
|
+
/** Interrompe na primeira regra que falhar. */
|
|
532
|
+
bail?: boolean;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Estado de validação e interação consumido pelos componentes de campo.
|
|
537
|
+
*/
|
|
538
|
+
export declare interface MagooFieldState {
|
|
539
|
+
error?: MagooFieldError;
|
|
540
|
+
invalid?: boolean;
|
|
541
|
+
touched?: boolean;
|
|
542
|
+
dirty?: boolean;
|
|
543
|
+
validating?: boolean;
|
|
544
|
+
submitted?: boolean;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/** Contrato mínimo que o `MForm` precisa; qualquer `MagooFormValidation<T>` o satisfaz. */
|
|
548
|
+
export declare interface MagooFormController {
|
|
549
|
+
values: Record<string, unknown>;
|
|
550
|
+
allErrors: ComputedRef<MagooErrorMap>;
|
|
551
|
+
handleSubmit: () => Promise<boolean>;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Regra de formulário: pode devolver mensagens por campo e/ou mensagens
|
|
556
|
+
* globais sob `MAGOO_FORM_ERROR_KEY`.
|
|
557
|
+
*/
|
|
558
|
+
export declare type MagooFormRule<TValues extends Record<string, unknown> = Record<string, unknown>> = (values: TValues) => Record<string, MagooRuleResult> | MagooRuleResult | Promise<Record<string, MagooRuleResult> | MagooRuleResult>;
|
|
559
|
+
|
|
560
|
+
export declare interface MagooFormValidation<TValues extends Record<string, unknown> = Record<string, unknown>> {
|
|
561
|
+
values: TValues;
|
|
562
|
+
errors: Readonly<Ref<MagooErrorMap>>;
|
|
563
|
+
serverErrors: Readonly<Ref<MagooErrorMap>>;
|
|
564
|
+
allErrors: ComputedRef<MagooErrorMap>;
|
|
565
|
+
visibleErrors: ComputedRef<MagooErrorMap>;
|
|
566
|
+
formErrors: ComputedRef<string[]>;
|
|
567
|
+
isValid: ComputedRef<boolean>;
|
|
568
|
+
isValidating: ComputedRef<boolean>;
|
|
569
|
+
submitted: Readonly<Ref<boolean>>;
|
|
570
|
+
submitCount: Readonly<Ref<number>>;
|
|
571
|
+
fieldState: (name: keyof TValues & string) => MagooFieldState;
|
|
572
|
+
field: <K extends keyof TValues & string>(name: K) => MagooFieldBinding<TValues[K]>;
|
|
573
|
+
setValue: <K extends keyof TValues & string>(name: K, value: TValues[K]) => void;
|
|
574
|
+
handleInput: <K extends keyof TValues & string>(name: K, value: TValues[K]) => void;
|
|
575
|
+
handleBlur: (name: keyof TValues & string) => void;
|
|
576
|
+
touch: (name: keyof TValues & string) => void;
|
|
577
|
+
validateField: (name: keyof TValues & string) => Promise<string[]>;
|
|
578
|
+
validateForm: () => Promise<boolean>;
|
|
579
|
+
handleSubmit: (onValid?: (values: TValues) => void | Promise<void>) => Promise<boolean>;
|
|
580
|
+
setFieldErrors: (name: string, messages: MagooFieldError) => void;
|
|
581
|
+
setServerErrors: (errors: Record<string, MagooFieldError>) => void;
|
|
582
|
+
clearServerErrors: (name?: string) => void;
|
|
583
|
+
reset: (nextValues?: Partial<TValues>) => void;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export declare interface MagooRuleContext<TValues extends Record<string, unknown> = Record<string, unknown>> {
|
|
587
|
+
field: keyof TValues & string;
|
|
588
|
+
values: TValues;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Resultado bruto de uma regra. Valores falsy ou `true` significam "válido";
|
|
593
|
+
* strings representam mensagens de erro.
|
|
594
|
+
*/
|
|
595
|
+
export declare type MagooRuleResult = MagooFieldError | boolean | null | undefined | void;
|
|
596
|
+
|
|
597
|
+
/** Converte a saída de uma regra para uma lista de mensagens. */
|
|
598
|
+
export declare type MagooRuleResultAdapter = (result: unknown) => string[];
|
|
599
|
+
|
|
600
|
+
declare type MagooTheme = 'light' | 'dark' | 'system';
|
|
601
|
+
|
|
602
|
+
export declare type MagooValidationRule<TValue = unknown, TValues extends Record<string, unknown> = Record<string, unknown>> = (value: TValue, context: MagooRuleContext<TValues>) => MagooRuleResult | Promise<MagooRuleResult>;
|
|
603
|
+
|
|
604
|
+
export declare type MagooValidationSchema<TValues extends Record<string, unknown> = Record<string, unknown>> = {
|
|
605
|
+
[K in keyof TValues & string]?: MagooFieldSchema<TValues[K], TValues> | MagooValidationRule<TValues[K], TValues>[];
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
export declare type MagooValidationTrigger = 'input' | 'blur' | 'submit';
|
|
609
|
+
|
|
610
|
+
export declare const MButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
611
|
+
|
|
612
|
+
export declare const MCheckbox: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
613
|
+
"update:modelValue": (value: boolean) => any;
|
|
614
|
+
blur: (event: FocusEvent) => any;
|
|
615
|
+
focus: (event: FocusEvent) => any;
|
|
616
|
+
}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{
|
|
617
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
618
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
619
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
620
|
+
}>, {
|
|
621
|
+
name: string;
|
|
622
|
+
label: string;
|
|
623
|
+
disabled: boolean;
|
|
624
|
+
loading: boolean;
|
|
625
|
+
modelValue: boolean;
|
|
626
|
+
id: string;
|
|
627
|
+
required: boolean;
|
|
628
|
+
error: string | string[];
|
|
629
|
+
hint: string;
|
|
630
|
+
invalid: boolean;
|
|
631
|
+
submitTriggered: boolean;
|
|
632
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
633
|
+
|
|
634
|
+
export declare const MCheckboxList: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
635
|
+
"update:modelValue": (value: string[]) => any;
|
|
636
|
+
blur: (event: FocusEvent) => any;
|
|
637
|
+
focus: (event: FocusEvent) => any;
|
|
638
|
+
}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{
|
|
639
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
640
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
641
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
642
|
+
}>, {
|
|
643
|
+
name: string;
|
|
644
|
+
label: string;
|
|
645
|
+
disabled: boolean;
|
|
646
|
+
loading: boolean;
|
|
647
|
+
legend: string;
|
|
648
|
+
modelValue: string[];
|
|
649
|
+
id: string;
|
|
650
|
+
required: boolean;
|
|
651
|
+
error: string | string[];
|
|
652
|
+
hint: string;
|
|
653
|
+
invalid: boolean;
|
|
654
|
+
submitTriggered: boolean;
|
|
655
|
+
options: Array<{
|
|
656
|
+
label: string;
|
|
657
|
+
value: string;
|
|
658
|
+
}>;
|
|
659
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
660
|
+
|
|
661
|
+
export declare function mergeErrors(...maps: MagooErrorMap[]): MagooErrorMap;
|
|
662
|
+
|
|
663
|
+
export declare const MErrorMessage: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {
|
|
664
|
+
message: MagooFieldError;
|
|
665
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
666
|
+
|
|
667
|
+
export declare const MFieldsetPanel: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
668
|
+
|
|
669
|
+
export declare const MFileUpload: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
670
|
+
"update:modelValue": (files: File[]) => any;
|
|
671
|
+
blur: (event: FocusEvent) => any;
|
|
672
|
+
focus: (event: FocusEvent) => any;
|
|
673
|
+
reject: (rejections: {
|
|
674
|
+
file: File;
|
|
675
|
+
reason: RejectionReason;
|
|
676
|
+
}[]) => any;
|
|
677
|
+
remove: (file: File, index: number) => any;
|
|
678
|
+
}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{
|
|
679
|
+
"onUpdate:modelValue"?: ((files: File[]) => any) | undefined;
|
|
680
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
681
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
682
|
+
onReject?: ((rejections: {
|
|
683
|
+
file: File;
|
|
684
|
+
reason: RejectionReason;
|
|
685
|
+
}[]) => any) | undefined;
|
|
686
|
+
onRemove?: ((file: File, index: number) => any) | undefined;
|
|
687
|
+
}>, {
|
|
688
|
+
name: string;
|
|
689
|
+
label: string;
|
|
690
|
+
disabled: boolean;
|
|
691
|
+
loading: boolean;
|
|
692
|
+
progress: number;
|
|
693
|
+
modelValue: File[];
|
|
694
|
+
id: string;
|
|
695
|
+
required: boolean;
|
|
696
|
+
error: string | string[];
|
|
697
|
+
hint: string;
|
|
698
|
+
invalid: boolean;
|
|
699
|
+
submitTriggered: boolean;
|
|
700
|
+
accept: string;
|
|
701
|
+
multiple: boolean;
|
|
702
|
+
maxSize: number;
|
|
703
|
+
maxFiles: number;
|
|
704
|
+
buttonLabel: string;
|
|
705
|
+
dropHint: string;
|
|
706
|
+
removeLabel: string;
|
|
707
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
708
|
+
fileInput: HTMLInputElement;
|
|
709
|
+
removeButtons: HTMLButtonElement;
|
|
710
|
+
}, any>;
|
|
711
|
+
|
|
712
|
+
export declare const MForm: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
713
|
+
|
|
714
|
+
export declare const MInput: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
715
|
+
"update:modelValue": (value: string) => any;
|
|
716
|
+
blur: (event: FocusEvent) => any;
|
|
717
|
+
focus: (event: FocusEvent) => any;
|
|
718
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
719
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
720
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
721
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
722
|
+
}>, {
|
|
723
|
+
name: string;
|
|
724
|
+
label: string;
|
|
725
|
+
type: string;
|
|
726
|
+
disabled: boolean;
|
|
727
|
+
loading: boolean;
|
|
728
|
+
modelValue: string;
|
|
729
|
+
id: string;
|
|
730
|
+
required: boolean;
|
|
731
|
+
error: string | string[];
|
|
732
|
+
hint: string;
|
|
733
|
+
invalid: boolean;
|
|
734
|
+
submitTriggered: boolean;
|
|
735
|
+
autocomplete: string;
|
|
736
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
737
|
+
|
|
738
|
+
export declare const MList: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
739
|
+
|
|
740
|
+
declare interface MListQuery {
|
|
741
|
+
page: number;
|
|
742
|
+
pageSize: number | 'all';
|
|
743
|
+
search: string;
|
|
744
|
+
sort: string;
|
|
745
|
+
sortDirection: SortDirection;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
declare interface MListSortOption {
|
|
749
|
+
label: string;
|
|
750
|
+
value: string;
|
|
751
|
+
compare?: (a: Record<string, unknown>, b: Record<string, unknown>) => number;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export declare const MNumber: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
755
|
+
"update:modelValue": (value: number | null) => any;
|
|
756
|
+
blur: (event: FocusEvent) => any;
|
|
757
|
+
focus: (event: FocusEvent) => any;
|
|
758
|
+
}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{
|
|
759
|
+
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
760
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
761
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
762
|
+
}>, {
|
|
763
|
+
name: string;
|
|
764
|
+
label: string;
|
|
765
|
+
disabled: boolean;
|
|
766
|
+
loading: boolean;
|
|
767
|
+
modelValue: number | null;
|
|
768
|
+
id: string;
|
|
769
|
+
required: boolean;
|
|
770
|
+
error: string | string[];
|
|
771
|
+
hint: string;
|
|
772
|
+
invalid: boolean;
|
|
773
|
+
submitTriggered: boolean;
|
|
774
|
+
min: number;
|
|
775
|
+
max: number;
|
|
776
|
+
step: number | "any";
|
|
777
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
778
|
+
|
|
779
|
+
export declare const MPassword: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
780
|
+
"update:modelValue": (value: string) => any;
|
|
781
|
+
blur: (event: FocusEvent) => any;
|
|
782
|
+
focus: (event: FocusEvent) => any;
|
|
783
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
784
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
785
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
786
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
787
|
+
}>, {
|
|
788
|
+
name: string;
|
|
789
|
+
label: string;
|
|
790
|
+
disabled: boolean;
|
|
791
|
+
loading: boolean;
|
|
792
|
+
modelValue: string;
|
|
793
|
+
id: string;
|
|
794
|
+
required: boolean;
|
|
795
|
+
error: string | string[];
|
|
796
|
+
hint: string;
|
|
797
|
+
invalid: boolean;
|
|
798
|
+
submitTriggered: boolean;
|
|
799
|
+
autocomplete: string;
|
|
800
|
+
showPasswordLabel: string;
|
|
801
|
+
hidePasswordLabel: string;
|
|
802
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
803
|
+
passwordInput: HTMLInputElement;
|
|
804
|
+
}, any>;
|
|
805
|
+
|
|
806
|
+
export declare const MRadio: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
807
|
+
"update:modelValue": (value: boolean) => any;
|
|
808
|
+
blur: (event: FocusEvent) => any;
|
|
809
|
+
focus: (event: FocusEvent) => any;
|
|
810
|
+
}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{
|
|
811
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
812
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
813
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
814
|
+
}>, {
|
|
815
|
+
name: string;
|
|
816
|
+
label: string;
|
|
817
|
+
disabled: boolean;
|
|
818
|
+
loading: boolean;
|
|
819
|
+
modelValue: boolean;
|
|
820
|
+
id: string;
|
|
821
|
+
error: string | string[];
|
|
822
|
+
hint: string;
|
|
823
|
+
invalid: boolean;
|
|
824
|
+
submitTriggered: boolean;
|
|
825
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
826
|
+
|
|
827
|
+
export declare const MRadioList: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
828
|
+
"update:modelValue": (value: string) => any;
|
|
829
|
+
blur: (event: FocusEvent) => any;
|
|
830
|
+
focus: (event: FocusEvent) => any;
|
|
831
|
+
}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{
|
|
832
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
833
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
834
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
835
|
+
}>, {
|
|
836
|
+
name: string;
|
|
837
|
+
label: string;
|
|
838
|
+
disabled: boolean;
|
|
839
|
+
loading: boolean;
|
|
840
|
+
legend: string;
|
|
841
|
+
modelValue: string;
|
|
842
|
+
id: string;
|
|
843
|
+
required: boolean;
|
|
844
|
+
error: string | string[];
|
|
845
|
+
hint: string;
|
|
846
|
+
invalid: boolean;
|
|
847
|
+
submitTriggered: boolean;
|
|
848
|
+
options: Array<{
|
|
849
|
+
label: string;
|
|
850
|
+
value: string;
|
|
851
|
+
}>;
|
|
852
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
853
|
+
|
|
854
|
+
export declare const MSelect: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
855
|
+
"update:modelValue": (value: string) => any;
|
|
856
|
+
blur: (event: FocusEvent) => any;
|
|
857
|
+
focus: (event: FocusEvent) => any;
|
|
858
|
+
}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{
|
|
859
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
860
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
861
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
862
|
+
}>, {
|
|
863
|
+
name: string;
|
|
864
|
+
label: string;
|
|
865
|
+
disabled: boolean;
|
|
866
|
+
loading: boolean;
|
|
867
|
+
modelValue: string;
|
|
868
|
+
id: string;
|
|
869
|
+
required: boolean;
|
|
870
|
+
error: string | string[];
|
|
871
|
+
hint: string;
|
|
872
|
+
invalid: boolean;
|
|
873
|
+
submitTriggered: boolean;
|
|
874
|
+
options: Array<{
|
|
875
|
+
label: string;
|
|
876
|
+
value: string;
|
|
877
|
+
}>;
|
|
878
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
879
|
+
|
|
880
|
+
export declare const MSwitch: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
881
|
+
"update:modelValue": (value: boolean) => any;
|
|
882
|
+
blur: (event: FocusEvent) => any;
|
|
883
|
+
focus: (event: FocusEvent) => any;
|
|
884
|
+
}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{
|
|
885
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
886
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
887
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
888
|
+
}>, {
|
|
889
|
+
name: string;
|
|
890
|
+
label: string;
|
|
891
|
+
disabled: boolean;
|
|
892
|
+
loading: boolean;
|
|
893
|
+
modelValue: boolean;
|
|
894
|
+
id: string;
|
|
895
|
+
required: boolean;
|
|
896
|
+
error: string | string[];
|
|
897
|
+
hint: string;
|
|
898
|
+
invalid: boolean;
|
|
899
|
+
submitTriggered: boolean;
|
|
900
|
+
onLabel: string;
|
|
901
|
+
offLabel: string;
|
|
902
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
903
|
+
switchInput: HTMLInputElement;
|
|
904
|
+
}, any>;
|
|
905
|
+
|
|
906
|
+
export declare const MTextarea: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
907
|
+
"update:modelValue": (value: string) => any;
|
|
908
|
+
blur: (event: FocusEvent) => any;
|
|
909
|
+
focus: (event: FocusEvent) => any;
|
|
910
|
+
}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{
|
|
911
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
912
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
913
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
914
|
+
}>, {
|
|
915
|
+
name: string;
|
|
916
|
+
label: string;
|
|
917
|
+
disabled: boolean;
|
|
918
|
+
loading: boolean;
|
|
919
|
+
modelValue: string;
|
|
920
|
+
id: string;
|
|
921
|
+
required: boolean;
|
|
922
|
+
error: string | string[];
|
|
923
|
+
hint: string;
|
|
924
|
+
invalid: boolean;
|
|
925
|
+
submitTriggered: boolean;
|
|
926
|
+
rows: number;
|
|
927
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
928
|
+
|
|
929
|
+
export declare const MValidationSummary: DefineComponent<__VLS_Props_16, {
|
|
930
|
+
focus: () => void | undefined;
|
|
931
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {
|
|
932
|
+
title: string;
|
|
933
|
+
errors: Record<string, MagooFieldError>;
|
|
934
|
+
labels: Record<string, string>;
|
|
935
|
+
fieldIds: Record<string, string>;
|
|
936
|
+
headingLevel: 2 | 3 | 4 | 5 | 6;
|
|
937
|
+
autofocus: boolean;
|
|
938
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
939
|
+
root: HTMLDivElement;
|
|
940
|
+
}, any>;
|
|
941
|
+
|
|
942
|
+
declare type RejectionReason = 'size' | 'type' | 'count';
|
|
943
|
+
|
|
944
|
+
declare type SortDirection = 'asc' | 'desc';
|
|
945
|
+
|
|
946
|
+
export declare function useFormValidation<TValues extends Record<string, unknown>>(options: UseFormValidationOptions<TValues>): MagooFormValidation<TValues>;
|
|
947
|
+
|
|
948
|
+
export declare interface UseFormValidationOptions<TValues extends Record<string, unknown>> {
|
|
949
|
+
/** Objeto de valores. Objetos reativos são usados diretamente; objetos simples são envolvidos em `reactive`. */
|
|
950
|
+
values: TValues;
|
|
951
|
+
schema?: MagooValidationSchema<TValues>;
|
|
952
|
+
formRules?: MagooFormRule<TValues>[];
|
|
953
|
+
/** Gatilhos padrão para todos os campos. */
|
|
954
|
+
validateOn?: MagooValidationTrigger[];
|
|
955
|
+
/** Revalida no `input` um campo que já exibe erro, para que a correção seja refletida imediatamente. */
|
|
956
|
+
revalidateOnInput?: boolean;
|
|
957
|
+
/** Interrompe na primeira regra que falhar (pode ser sobrescrito por campo). */
|
|
958
|
+
bail?: boolean;
|
|
959
|
+
adapter?: MagooRuleResultAdapter;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export { }
|