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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "3.44.4-beta.2",
7
+ "version": "3.44.4-beta.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.1",
10
10
  "unbuild": "2.0.0"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "maz-ui",
3
3
  "type": "module",
4
- "version": "3.44.4-beta.2",
4
+ "version": "3.44.4-beta.4",
5
5
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -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<Model>>>;
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<BaseFormPayload>>;
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 ValidationAsync<TInput extends BaseFormPayload, TOutput extends BaseFormPayload = TInput, TIssue extends BaseIssue<TInput> = BaseIssue<TInput>> = BaseSchema<TInput, TOutput, TIssue> | BaseSchemaAsync<TInput, TOutput, TIssue>;
5
- export type ValidationSync<TInput extends BaseFormPayload, TOutput extends BaseFormPayload = TInput, TIssue extends BaseIssue<TInput> = BaseIssue<TInput>> = BaseSchema<TInput, TOutput, TIssue>;
6
- export type Validation<TInput extends BaseFormPayload> = ValidationSync<TInput> | ValidationAsync<TInput>;
7
- export type ObjectValidationSchema<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> = ObjectSchemaAsync<Record<ModelKey, ValidationAsync<Model>>, ErrorMessage<BaseIssue<unknown>> | undefined> | ObjectSchema<Record<ModelKey, ValidationSync<Model>>, ErrorMessage<BaseIssue<unknown>> | undefined>;
8
- export type ValidationIssues<TInput extends BaseFormPayload> = InferIssue<Validation<TInput>>[];
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<Model>;
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<Model>;
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<Model>>;
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[];