maz-ui 3.44.4-beta.2 → 3.44.4-beta.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/nuxt/index.json
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export declare function useFormValidator<Model extends BaseFormPayload, ModelKey
|
|
|
11
11
|
isSubmitting: Ref<boolean>;
|
|
12
12
|
isSubmitted: Ref<boolean>;
|
|
13
13
|
isValid: import("vue").ComputedRef<boolean>;
|
|
14
|
-
errors: import("vue").ComputedRef<Record<Extract<keyof Model, string>, import("./types").ValidationIssues
|
|
14
|
+
errors: import("vue").ComputedRef<Record<Extract<keyof Model, string>, import("./types").ValidationIssues>>;
|
|
15
15
|
model: Ref<Model>;
|
|
16
16
|
context: {
|
|
17
17
|
handleFieldInput: (name: ModelKey, force?: boolean) => void;
|
|
@@ -36,7 +36,7 @@ export declare function useFormValidator<Model extends BaseFormPayload, ModelKey
|
|
|
36
36
|
};
|
|
37
37
|
export declare function useFormField<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>, FieldType = Model[ModelKey] | undefined>(name: ModelKey, options?: FormFieldOptions<FieldType>): {
|
|
38
38
|
hasError: import("vue").ComputedRef<boolean>;
|
|
39
|
-
errors: import("vue").ComputedRef<import("./types").ValidationIssues
|
|
39
|
+
errors: import("vue").ComputedRef<import("./types").ValidationIssues>;
|
|
40
40
|
errorMessage: import("vue").ComputedRef<string | undefined>;
|
|
41
41
|
isValid: import("vue").ComputedRef<boolean>;
|
|
42
42
|
isDirty: import("vue").ComputedRef<boolean>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BaseIssue, BaseSchema, BaseSchemaAsync, ErrorMessage, InferIssue, ObjectSchema, ObjectSchemaAsync } from 'valibot';
|
|
2
2
|
import type { ComponentPublicInstance, Ref } from 'vue';
|
|
3
3
|
import type { useFormField, useFormValidator } from './index';
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type Validation
|
|
7
|
-
export type ObjectValidationSchema<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> = ObjectSchemaAsync<Record<ModelKey, ValidationAsync
|
|
8
|
-
export type ValidationIssues
|
|
4
|
+
export type ValidationSync = BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
5
|
+
export type ValidationAsync = ValidationSync | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
6
|
+
export type Validation = ValidationAsync;
|
|
7
|
+
export type ObjectValidationSchema<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> = ObjectSchemaAsync<Record<ModelKey, ValidationAsync>, ErrorMessage<BaseIssue<unknown>> | undefined> | ObjectSchema<Record<string, ValidationSync>, ErrorMessage<BaseIssue<unknown>> | undefined>;
|
|
8
|
+
export type ValidationIssues = InferIssue<Validation>[];
|
|
9
9
|
export type ExtractModelKey<T> = Extract<keyof T, string>;
|
|
10
10
|
export interface Options<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> {
|
|
11
11
|
/**
|
|
@@ -52,7 +52,7 @@ export interface FieldState<Model extends BaseFormPayload, FieldType = Model[Ext
|
|
|
52
52
|
blurred: boolean;
|
|
53
53
|
dirty: boolean;
|
|
54
54
|
error: boolean;
|
|
55
|
-
errors: ValidationIssues
|
|
55
|
+
errors: ValidationIssues;
|
|
56
56
|
valid: boolean;
|
|
57
57
|
initialValue?: FieldType | Readonly<FieldType>;
|
|
58
58
|
validating: boolean;
|
|
@@ -18,7 +18,7 @@ export declare function mergeFieldState<Model extends BaseFormPayload, ModelKey
|
|
|
18
18
|
schema: Ref<ObjectValidationSchema<Model>>;
|
|
19
19
|
options: FormFieldOptions<Model[ModelKey]>;
|
|
20
20
|
}): FieldsStates<Model>[ModelKey] & {
|
|
21
|
-
errors: ValidationIssues
|
|
21
|
+
errors: ValidationIssues;
|
|
22
22
|
blurred: boolean;
|
|
23
23
|
dirty: boolean;
|
|
24
24
|
error: boolean;
|
|
@@ -28,7 +28,7 @@ export declare function mergeFieldState<Model extends BaseFormPayload, ModelKey
|
|
|
28
28
|
validated: boolean;
|
|
29
29
|
mode: StrictOptions["mode"] | "none";
|
|
30
30
|
};
|
|
31
|
-
export declare function getFieldsErrors<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>(fieldsStates: FieldsStates<Model>): Record<ModelKey, ValidationIssues
|
|
31
|
+
export declare function getFieldsErrors<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>(fieldsStates: FieldsStates<Model>): Record<ModelKey, ValidationIssues>;
|
|
32
32
|
export declare function findInteractiveElements(el: HTMLElement): (HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement)[];
|
|
33
33
|
export declare function addEventToInteractiveElements({ interactiveElements, onBlur, onInput, mode, }: {
|
|
34
34
|
interactiveElements: HTMLElement[];
|