maz-ui 3.44.4-beta.0 → 3.44.4-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/components/MazAccordion.d.ts +12 -10
- package/components/MazAnimatedCounter.d.ts +15 -13
- package/components/MazAvatar.d.ts +9 -7
- package/components/MazBackdrop.d.ts +12 -21
- package/components/MazBadge.d.ts +6 -4
- package/components/MazBottomSheet.d.ts +8 -6
- package/components/MazBtn.d.ts +12 -10
- package/components/MazCard.d.ts +16 -14
- package/components/MazCard.mjs +1 -1
- package/components/MazCardSpotlight.d.ts +7 -5
- package/components/MazCarousel.d.ts +9 -7
- package/components/MazChart.d.ts +6 -6
- package/components/MazCheckbox.d.ts +7 -5
- package/components/MazCircularProgressBar.d.ts +27 -24
- package/components/MazDialog.d.ts +16 -24
- package/components/MazDialogPromise/use-maz-dialog-promise.d.ts +29 -29
- package/components/MazDrawer.d.ts +12 -10
- package/components/MazDropdown.d.ts +27 -25
- package/components/MazDropzone.d.ts +15 -15
- package/components/MazExpandAnimation.d.ts +6 -4
- package/components/MazFullscreenLoader.d.ts +6 -4
- package/components/MazIcon.d.ts +3 -3
- package/components/MazInput.d.ts +15 -133
- package/components/MazInputCode.d.ts +2 -2
- package/components/MazInputNumber.d.ts +2 -2
- package/components/MazInputPrice.d.ts +7 -5
- package/components/MazInputTags.d.ts +1 -1
- package/components/MazLazyImg.d.ts +9 -7
- package/components/MazLink.d.ts +10 -8
- package/components/MazPagination.d.ts +20 -18
- package/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +53 -70
- package/components/MazPhoneNumberInput.d.ts +17 -25
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +3 -3
- package/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +3 -3
- package/components/MazPicker.d.ts +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazPullToRefresh.d.ts +9 -7
- package/components/MazRadio.d.ts +27 -24
- package/components/MazRadioButtons.d.ts +10 -8
- package/components/MazReadingProgressBar.d.ts +1 -1
- package/components/MazSelect.d.ts +16 -125
- package/components/MazSelect.mjs +1 -1
- package/components/MazStepper.d.ts +10 -8
- package/components/MazSwitch.d.ts +9 -7
- package/components/MazTable.d.ts +67 -65
- package/components/MazTable.mjs +1 -1
- package/components/MazTableCell.d.ts +4 -2
- package/components/MazTableRow.d.ts +4 -2
- package/components/MazTableTitle.d.ts +4 -2
- package/components/MazTabs.d.ts +6 -4
- package/components/MazTabsBar.d.ts +18 -16
- package/components/MazTabsContent.d.ts +4 -2
- package/components/MazTabsContentItem.d.ts +6 -4
- package/components/MazTextarea.d.ts +1 -1
- package/components/MazTransitionExpand.d.ts +6 -4
- package/components/MazTransitionExpand.mjs +2 -2
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazPickerMonthSwitcher.css +1 -1
- package/components/assets/MazPickerYearSwitcher.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTabsBar.css +1 -1
- package/components/assets/MazTransitionExpand.css +1 -1
- package/components/chunks/{MazBtn-B5XwteK7.mjs → MazBtn-BURByjBO.mjs} +2 -2
- package/components/chunks/{MazBtn-CQSo596y.mjs → MazBtn-D1TNsXIe.mjs} +2 -2
- package/components/chunks/{MazBtn-gj2W8kzn.mjs → MazBtn-YtY4PeyZ.mjs} +2 -2
- package/components/chunks/{MazCard-BBwohtCJ.mjs → MazCard-BiDXoNWK.mjs} +1 -1
- package/components/chunks/{MazCheckbox-isKq9dAX.mjs → MazCheckbox-BMzMZ-_l.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CqHZNrGa.mjs → MazCheckbox-B_Rx3ZCe.mjs} +1 -1
- package/components/chunks/{MazGallery-Din0Z37d.mjs → MazGallery-SSMQ_JIA.mjs} +2 -2
- package/components/chunks/{MazIcon-D2DkwtXq.mjs → MazIcon-CwITLbPL.mjs} +1 -1
- package/components/chunks/{MazIcon-DHzZGzIp.mjs → MazIcon-x_aGvHlZ.mjs} +1 -1
- package/components/chunks/{MazPhoneNumberInput-CYcy4OZW.mjs → MazPhoneNumberInput-fo2MtuWB.mjs} +6 -6
- package/components/chunks/{MazPicker-DCTIkgDd.mjs → MazPicker-Df-LRtwz.mjs} +2 -2
- package/components/chunks/{MazPickerMonthSwitcher-CINBaU3n.mjs → MazPickerMonthSwitcher-CrrfUDPA.mjs} +2 -2
- package/components/chunks/{MazPickerShortcuts-vvPV1aW8.mjs → MazPickerShortcuts-Dpm1ra_Y.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-CkqFNhde.mjs → MazPickerYearSwitcher-BIeGuXI7.mjs} +2 -2
- package/components/chunks/{MazSelect-DvNLFDvj.mjs → MazSelect-xBiD7HuJ.mjs} +6 -6
- package/components/chunks/{MazSpinner-C7s8yroP.mjs → MazSpinner-C5MXwcx7.mjs} +1 -1
- package/components/chunks/{MazSpinner-BVd7-OTu.mjs → MazSpinner-CrDTibNk.mjs} +1 -1
- package/components/chunks/{MazSpinner-CpYgtvc9.mjs → MazSpinner-CvucKhXp.mjs} +1 -1
- package/components/chunks/MazSpinner-DDmCKWOx.mjs +37 -0
- package/components/chunks/{MazSpinner-CAG800x4.mjs → MazSpinner-QIX5R4Hk.mjs} +1 -1
- package/components/chunks/{MazTable-BN-Yp2RW.mjs → MazTable-1D7GRSpa.mjs} +6 -6
- package/components/chunks/{MazTransitionExpand-CYyEf_hd.mjs → MazTransitionExpand-BLFZPAt_.mjs} +11 -11
- package/modules/assets/index.css +1 -1
- package/modules/chunks/{MazBtn-BVqZ8Wej.cjs → MazBtn-BLvj2Vcl.cjs} +1 -1
- package/modules/chunks/{MazBtn-Cuj6yEZn.mjs → MazBtn-DhVNaOBj.mjs} +2 -2
- package/modules/chunks/{MazIcon-CyWCmQpN.cjs → MazIcon-BhCADEJL.cjs} +1 -1
- package/modules/chunks/{MazIcon-COFexHFo.mjs → MazIcon-ZPJHGsC7.mjs} +1 -1
- package/modules/chunks/{MazSpinner-BtXwGTnk.mjs → MazSpinner-Dx_yL6x9.mjs} +1 -1
- package/modules/chunks/{MazSpinner-Dz0kdTmr.cjs → MazSpinner-OdoRwyjg.cjs} +1 -1
- package/modules/chunks/{index-DW2zAKgR.cjs → index-BT3W7L22.cjs} +2 -2
- package/modules/chunks/{index-BBOf37yd.mjs → index-CgWq2KzW.mjs} +363 -360
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +2 -2
- package/nuxt/types.d.mts +4 -23
- package/nuxt/types.d.ts +4 -23
- package/package.json +25 -25
- package/types/components/MazAccordion.vue.d.ts +12 -10
- package/types/components/MazAnimatedCounter.vue.d.ts +15 -13
- package/types/components/MazAvatar.vue.d.ts +9 -7
- package/types/components/MazBackdrop.vue.d.ts +12 -21
- package/types/components/MazBadge.vue.d.ts +6 -4
- package/types/components/MazBottomSheet.vue.d.ts +8 -6
- package/types/components/MazBtn.vue.d.ts +12 -10
- package/types/components/MazCard.vue.d.ts +16 -14
- package/types/components/MazCardSpotlight.vue.d.ts +7 -5
- package/types/components/MazCarousel.vue.d.ts +9 -7
- package/types/components/MazChart.vue.d.ts +6 -6
- package/types/components/MazCheckbox.vue.d.ts +7 -5
- package/types/components/MazCircularProgressBar.vue.d.ts +27 -24
- package/types/components/MazDialog.vue.d.ts +16 -24
- package/types/components/MazDialogPromise/use-maz-dialog-promise.d.ts +29 -29
- package/types/components/MazDrawer.vue.d.ts +12 -10
- package/types/components/MazDropdown.vue.d.ts +27 -25
- package/types/components/MazDropzone.vue.d.ts +15 -15
- package/types/components/MazExpandAnimation.vue.d.ts +6 -4
- package/types/components/MazFullscreenLoader.vue.d.ts +6 -4
- package/types/components/MazIcon.vue.d.ts +3 -3
- package/types/components/MazInput.vue.d.ts +15 -133
- package/types/components/MazInputCode.vue.d.ts +2 -2
- package/types/components/MazInputNumber.vue.d.ts +2 -2
- package/types/components/MazInputPrice.vue.d.ts +7 -5
- package/types/components/MazInputTags.vue.d.ts +1 -1
- package/types/components/MazLazyImg.vue.d.ts +9 -7
- package/types/components/MazLink.vue.d.ts +10 -8
- package/types/components/MazPagination.vue.d.ts +20 -18
- package/types/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +53 -70
- package/types/components/MazPhoneNumberInput.vue.d.ts +17 -25
- package/types/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +3 -3
- package/types/components/MazPicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +3 -3
- package/types/components/MazPicker.vue.d.ts +1 -1
- package/types/components/MazPullToRefresh.vue.d.ts +9 -7
- package/types/components/MazRadio.vue.d.ts +27 -24
- package/types/components/MazRadioButtons.vue.d.ts +10 -8
- package/types/components/MazReadingProgressBar.vue.d.ts +1 -1
- package/types/components/MazSelect.vue.d.ts +16 -125
- package/types/components/MazStepper.vue.d.ts +10 -8
- package/types/components/MazSwitch.vue.d.ts +9 -7
- package/types/components/MazTable.vue.d.ts +67 -65
- package/types/components/MazTableCell.vue.d.ts +4 -2
- package/types/components/MazTableRow.vue.d.ts +4 -2
- package/types/components/MazTableTitle.vue.d.ts +4 -2
- package/types/components/MazTabs.vue.d.ts +6 -4
- package/types/components/MazTabsBar.vue.d.ts +18 -16
- package/types/components/MazTabsContent.vue.d.ts +4 -2
- package/types/components/MazTabsContentItem.vue.d.ts +6 -4
- package/types/components/MazTextarea.vue.d.ts +1 -1
- package/types/components/MazTransitionExpand.vue.d.ts +6 -4
- package/types/modules/composables/use-form-validator/index.d.ts +5 -7
- package/types/modules/composables/use-form-validator/types.d.ts +16 -11
- package/types/modules/composables/use-form-validator/utils.d.ts +13 -13
- package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +2 -2
- package/types/modules/plugins/toaster/MazToast.vue.d.ts +1 -1
- package/types/tailwindcss/tailwind.config.d.ts +2 -2
- package/components/chunks/MazSpinner-D1paofz3.mjs +0 -37
|
@@ -31,27 +31,18 @@ export interface Props {
|
|
|
31
31
|
*/
|
|
32
32
|
autoScroll?: boolean;
|
|
33
33
|
}
|
|
34
|
-
declare
|
|
35
|
-
queryParam: string;
|
|
36
|
-
autoScroll: boolean;
|
|
37
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
38
|
-
queryParam: string;
|
|
39
|
-
autoScroll: boolean;
|
|
40
|
-
}>>>, {
|
|
41
|
-
queryParam: string;
|
|
42
|
-
autoScroll: boolean;
|
|
43
|
-
}, {}>, {
|
|
34
|
+
declare function __VLS_template(): {
|
|
44
35
|
item?(_: {
|
|
45
36
|
item: {
|
|
46
37
|
label: string;
|
|
47
38
|
disabled: boolean;
|
|
48
39
|
badge: {
|
|
49
40
|
content: string | number | boolean;
|
|
50
|
-
color?: BadgeColor
|
|
51
|
-
pastel?: boolean
|
|
52
|
-
outline?: boolean
|
|
53
|
-
size?: string
|
|
54
|
-
roundedSize?: BadgeRoundedSize
|
|
41
|
+
color?: BadgeColor;
|
|
42
|
+
pastel?: boolean;
|
|
43
|
+
outline?: boolean;
|
|
44
|
+
size?: string;
|
|
45
|
+
roundedSize?: BadgeRoundedSize;
|
|
55
46
|
} | undefined;
|
|
56
47
|
};
|
|
57
48
|
active: boolean;
|
|
@@ -60,7 +51,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
60
51
|
"badge-content"?(_: {
|
|
61
52
|
content: string | number | boolean;
|
|
62
53
|
}): any;
|
|
63
|
-
}
|
|
54
|
+
};
|
|
55
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
56
|
+
queryParam: string;
|
|
57
|
+
autoScroll: boolean;
|
|
58
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
59
|
+
queryParam: string;
|
|
60
|
+
autoScroll: boolean;
|
|
61
|
+
}>>>, {
|
|
62
|
+
queryParam: string;
|
|
63
|
+
autoScroll: boolean;
|
|
64
|
+
}, {}>;
|
|
65
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
64
66
|
export default _default;
|
|
65
67
|
type __VLS_WithDefaults<P, D> = {
|
|
66
68
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
2
|
default?(_: {}): any;
|
|
3
|
-
}
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
5
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
4
6
|
export default _default;
|
|
5
7
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
8
|
new (): {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import("vue").DefineComponent<{
|
|
2
5
|
tab: {
|
|
3
6
|
type: NumberConstructor;
|
|
4
7
|
required: true;
|
|
@@ -8,9 +11,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
8
11
|
type: NumberConstructor;
|
|
9
12
|
required: true;
|
|
10
13
|
};
|
|
11
|
-
}>>, {}, {}
|
|
12
|
-
|
|
13
|
-
}>;
|
|
14
|
+
}>>, {}, {}>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
14
16
|
export default _default;
|
|
15
17
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
16
18
|
new (): {
|
|
@@ -2,15 +2,17 @@ export interface Props {
|
|
|
2
2
|
/** Duration of the animation in milliseconds */
|
|
3
3
|
animationDuration?: string;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
6
9
|
animationDuration: string;
|
|
7
10
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
8
11
|
animationDuration: string;
|
|
9
12
|
}>>>, {
|
|
10
13
|
animationDuration: string;
|
|
11
|
-
}, {}
|
|
12
|
-
|
|
13
|
-
}>;
|
|
14
|
+
}, {}>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
14
16
|
export default _default;
|
|
15
17
|
type __VLS_WithDefaults<P, D> = {
|
|
16
18
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
-
import type { BaseFormPayload, ExtractModelKey, FieldsStates, FormFieldOptions, ObjectValidationSchema, Options } from './types';
|
|
3
2
|
import { scrollToError } from './utils';
|
|
4
|
-
|
|
5
|
-
export declare function useFormValidator<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>, Schema extends ObjectValidationSchema = ObjectValidationSchema
|
|
3
|
+
import type { BaseFormPayload, ExtractModelKey, FieldsStates, FormFieldOptions, ObjectValidationSchema, Options } from './types';
|
|
4
|
+
export declare function useFormValidator<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>, Schema extends ObjectValidationSchema<Model> = ObjectValidationSchema<Model>>({ schema, model, defaultValues, options, }: {
|
|
6
5
|
schema: Ref<Schema>;
|
|
7
6
|
model?: Ref<Partial<Model>>;
|
|
8
7
|
defaultValues?: Ref<Partial<Model>>;
|
|
@@ -12,7 +11,7 @@ export declare function useFormValidator<Model extends BaseFormPayload, ModelKey
|
|
|
12
11
|
isSubmitting: Ref<boolean>;
|
|
13
12
|
isSubmitted: Ref<boolean>;
|
|
14
13
|
isValid: import("vue").ComputedRef<boolean>;
|
|
15
|
-
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<Model>>>;
|
|
16
15
|
model: Ref<Model>;
|
|
17
16
|
context: {
|
|
18
17
|
handleFieldInput: (name: ModelKey, force?: boolean) => void;
|
|
@@ -22,7 +21,7 @@ export declare function useFormValidator<Model extends BaseFormPayload, ModelKey
|
|
|
22
21
|
addFieldValidationWatch: (name: ModelKey) => void;
|
|
23
22
|
validateField: (name: ModelKey) => Promise<void>;
|
|
24
23
|
options: {
|
|
25
|
-
mode: "eager" | "lazy" | "
|
|
24
|
+
mode: "eager" | "lazy" | "aggressive" | "onBlur" | "onInput";
|
|
26
25
|
throttledFields: Partial<Record<Extract<keyof Model, string>, number | true>> | null;
|
|
27
26
|
debouncedFields: Partial<Record<Extract<keyof Model, string>, number | true>> | null;
|
|
28
27
|
scrollToErrorSelector: string;
|
|
@@ -35,10 +34,9 @@ export declare function useFormValidator<Model extends BaseFormPayload, ModelKey
|
|
|
35
34
|
scrollToError: typeof scrollToError;
|
|
36
35
|
handleSubmit: (successCallback: (model: Model) => Promise<unknown> | unknown, enableScrollOrSelector?: boolean | string) => (event: Event) => Promise<void>;
|
|
37
36
|
};
|
|
38
|
-
export type UseFormField<T extends BaseFormPayload = BaseFormPayload, Key extends Extract<keyof T, string> = Extract<keyof T, string>> = typeof useFormField<T, Key>;
|
|
39
37
|
export declare function useFormField<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>, FieldType = Model[ModelKey] | undefined>(name: ModelKey, options?: FormFieldOptions<FieldType>): {
|
|
40
38
|
hasError: import("vue").ComputedRef<boolean>;
|
|
41
|
-
errors: import("vue").ComputedRef<import("./types").ValidationIssues
|
|
39
|
+
errors: import("vue").ComputedRef<import("./types").ValidationIssues<BaseFormPayload>>;
|
|
42
40
|
errorMessage: import("vue").ComputedRef<string | undefined>;
|
|
43
41
|
isValid: import("vue").ComputedRef<boolean>;
|
|
44
42
|
isDirty: import("vue").ComputedRef<boolean>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type { BaseIssue, BaseSchema, BaseSchemaAsync, ErrorMessage, InferIssue,
|
|
1
|
+
import type { BaseIssue, BaseSchema, BaseSchemaAsync, ErrorMessage, InferIssue, ObjectSchema, ObjectSchemaAsync } from 'valibot';
|
|
2
2
|
import type { ComponentPublicInstance, Ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
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>>[];
|
|
6
9
|
export type ExtractModelKey<T> = Extract<keyof T, string>;
|
|
7
10
|
export interface Options<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> {
|
|
8
11
|
/**
|
|
@@ -42,24 +45,26 @@ export interface FormContext<Model extends BaseFormPayload = BaseFormPayload, Mo
|
|
|
42
45
|
validateField: (name: ModelKey) => void;
|
|
43
46
|
fieldsStates: FieldsStates<Model>;
|
|
44
47
|
options: StrictOptions;
|
|
45
|
-
schema: Ref<ObjectValidationSchema
|
|
48
|
+
schema: Ref<ObjectValidationSchema<Model>>;
|
|
46
49
|
payload: Ref<Model>;
|
|
47
50
|
}
|
|
48
|
-
export interface FieldState<
|
|
51
|
+
export interface FieldState<Model extends BaseFormPayload, FieldType = Model[ExtractModelKey<Model>]> {
|
|
49
52
|
blurred: boolean;
|
|
50
53
|
dirty: boolean;
|
|
51
54
|
error: boolean;
|
|
52
|
-
errors: ValidationIssues
|
|
55
|
+
errors: ValidationIssues<Model>;
|
|
53
56
|
valid: boolean;
|
|
54
|
-
initialValue
|
|
57
|
+
initialValue?: FieldType | Readonly<FieldType>;
|
|
55
58
|
validating: boolean;
|
|
56
59
|
validated: boolean;
|
|
57
60
|
mode: StrictOptions['mode'] | 'none';
|
|
58
61
|
}
|
|
59
|
-
export type FieldsStates<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> = Record<ModelKey, FieldState<Model
|
|
60
|
-
export type BaseFormPayload = Record<string,
|
|
62
|
+
export type FieldsStates<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>> = Record<ModelKey, FieldState<Model>>;
|
|
63
|
+
export type BaseFormPayload = Record<string, any>;
|
|
61
64
|
export interface FormFieldOptions<T> {
|
|
62
65
|
mode?: StrictOptions['mode'] | 'none';
|
|
63
66
|
defaultValue?: T;
|
|
64
|
-
componentRef?: Ref<ComponentPublicInstance | undefined>;
|
|
67
|
+
componentRef?: Ref<ComponentPublicInstance | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | undefined>;
|
|
65
68
|
}
|
|
69
|
+
export type UseFormValidator<T extends BaseFormPayload = BaseFormPayload> = typeof useFormValidator<T>;
|
|
70
|
+
export type UseFormField<T extends BaseFormPayload = BaseFormPayload> = typeof useFormField<T>;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { BaseFormPayload, ExtractModelKey, FieldState, FieldsStates, FormFieldOptions, ObjectValidationSchema, StrictOptions, ValidationIssues } from './types';
|
|
3
3
|
export declare function getValibotValidationMethod(): Promise<typeof import("valibot").safeParseAsync>;
|
|
4
|
-
export declare function fieldHasValidation(field: string, schema: ObjectValidationSchema): boolean;
|
|
4
|
+
export declare function fieldHasValidation<Model extends BaseFormPayload>(field: string, schema: ObjectValidationSchema<Model>): boolean;
|
|
5
5
|
export declare function scrollToError(selector?: string): void;
|
|
6
|
-
export declare function isEmptyValue(value: unknown):
|
|
7
|
-
export declare function getFieldState<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>({ name, schema, initialValue, mode, }: {
|
|
6
|
+
export declare function isEmptyValue(value: unknown): value is "" | null | undefined;
|
|
7
|
+
export declare function getFieldState<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>({ name, schema, initialValue, mode, }: {
|
|
8
8
|
name: ModelKey;
|
|
9
|
-
schema?: ObjectValidationSchema
|
|
10
|
-
initialValue
|
|
9
|
+
schema?: ObjectValidationSchema<Model>;
|
|
10
|
+
initialValue?: Model[ModelKey] | Readonly<Model[ModelKey]>;
|
|
11
11
|
mode?: StrictOptions['mode'] | 'none';
|
|
12
|
-
}): FieldState<Model
|
|
13
|
-
export declare function getFieldsStates<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>(schema: ObjectValidationSchema
|
|
12
|
+
}): FieldState<Model>;
|
|
13
|
+
export declare function getFieldsStates<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>(schema: ObjectValidationSchema<Model>, payload: Partial<Model>, mode: StrictOptions['mode']): FieldsStates<Model>;
|
|
14
14
|
export declare function mergeFieldState<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>({ name, fieldsStates, payload, schema, options, }: {
|
|
15
15
|
name: ModelKey;
|
|
16
16
|
fieldsStates: FieldsStates<Model>;
|
|
17
17
|
payload: Ref<Model>;
|
|
18
|
-
schema: Ref<ObjectValidationSchema
|
|
18
|
+
schema: Ref<ObjectValidationSchema<Model>>;
|
|
19
19
|
options: FormFieldOptions<Model[ModelKey]>;
|
|
20
20
|
}): FieldsStates<Model>[ModelKey] & {
|
|
21
|
-
errors: ValidationIssues
|
|
21
|
+
errors: ValidationIssues<Model>;
|
|
22
22
|
blurred: boolean;
|
|
23
23
|
dirty: boolean;
|
|
24
24
|
error: boolean;
|
|
25
25
|
valid: boolean;
|
|
26
|
-
initialValue
|
|
26
|
+
initialValue?: Model[Extract<keyof Model, string>] | Readonly<Model[Extract<keyof Model, string>]> | undefined;
|
|
27
27
|
validating: boolean;
|
|
28
28
|
validated: boolean;
|
|
29
|
-
mode: "
|
|
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
|
|
32
|
-
export declare function findInteractiveElements(el: HTMLElement):
|
|
31
|
+
export declare function getFieldsErrors<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<Model> = ExtractModelKey<Model>>(fieldsStates: FieldsStates<Model>): Record<ModelKey, ValidationIssues<Model>>;
|
|
32
|
+
export declare function findInteractiveElements(el: HTMLElement): (HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement)[];
|
|
33
33
|
export declare function addEventToInteractiveElements({ interactiveElements, onBlur, onInput, mode, }: {
|
|
34
34
|
interactiveElements: HTMLElement[];
|
|
35
35
|
onBlur: () => void;
|
|
@@ -60,8 +60,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
60
60
|
};
|
|
61
61
|
offset: number;
|
|
62
62
|
animation: {
|
|
63
|
-
duration?: number
|
|
64
|
-
easing?: string
|
|
63
|
+
duration?: number;
|
|
64
|
+
easing?: string;
|
|
65
65
|
};
|
|
66
66
|
openInstanceClass: string;
|
|
67
67
|
zoom: boolean;
|
|
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
46
46
|
link: ToasterLink;
|
|
47
47
|
timeout: number | boolean;
|
|
48
48
|
position: ToasterPosition;
|
|
49
|
-
type: "
|
|
49
|
+
type: LocalToasterOptions["type"];
|
|
50
50
|
message: string;
|
|
51
51
|
icon: boolean;
|
|
52
52
|
maxToasts: number | boolean;
|
|
@@ -56,7 +56,7 @@ export declare const baseConfig: {
|
|
|
56
56
|
};
|
|
57
57
|
plugins: {
|
|
58
58
|
handler: import("tailwindcss/types/config").PluginCreator;
|
|
59
|
-
config?: Partial<import("tailwindcss/types/config").Config
|
|
59
|
+
config?: Partial<import("tailwindcss/types/config").Config>;
|
|
60
60
|
}[];
|
|
61
61
|
};
|
|
62
62
|
export declare const tailwindConfig: {
|
|
@@ -115,7 +115,7 @@ export declare const tailwindConfig: {
|
|
|
115
115
|
};
|
|
116
116
|
plugins: {
|
|
117
117
|
handler: import("tailwindcss/types/config").PluginCreator;
|
|
118
|
-
config?: Partial<import("tailwindcss/types/config").Config
|
|
118
|
+
config?: Partial<import("tailwindcss/types/config").Config>;
|
|
119
119
|
}[];
|
|
120
120
|
};
|
|
121
121
|
export default baseConfig;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineComponent as t, openBlock as o, createElementBlock as n, normalizeClass as s, pushScopeId as c, popScopeId as a, createElementVNode as r } from "vue";
|
|
2
|
-
import { _ as i } from "./MazPhoneNumberInput-CYcy4OZW.mjs";
|
|
3
|
-
import '../assets/MazSpinner.css';const p = (e) => (c("data-v-c16a57a3"), e = e(), a(), e), d = ["width", "height"], l = /* @__PURE__ */ p(() => /* @__PURE__ */ r(
|
|
4
|
-
"path",
|
|
5
|
-
{ d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" },
|
|
6
|
-
null,
|
|
7
|
-
-1
|
|
8
|
-
/* HOISTED */
|
|
9
|
-
)), m = [
|
|
10
|
-
l
|
|
11
|
-
], h = /* @__PURE__ */ t({
|
|
12
|
-
__name: "MazSpinner",
|
|
13
|
-
props: {
|
|
14
|
-
size: { type: String, default: "2em" },
|
|
15
|
-
color: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: "primary"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
setup(e) {
|
|
21
|
-
return (_, u) => (o(), n("svg", {
|
|
22
|
-
width: e.size,
|
|
23
|
-
height: e.size,
|
|
24
|
-
version: "1.1",
|
|
25
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
-
x: "0px",
|
|
27
|
-
y: "0px",
|
|
28
|
-
viewBox: "0 0 50 50",
|
|
29
|
-
"xml:space": "preserve",
|
|
30
|
-
class: s(["m-spinner", `m-spinner--${e.color}`]),
|
|
31
|
-
style: { "enable-background": "new 0 0 50 50" }
|
|
32
|
-
}, m, 10, d));
|
|
33
|
-
}
|
|
34
|
-
}), f = /* @__PURE__ */ i(h, [["__scopeId", "data-v-c16a57a3"]]);
|
|
35
|
-
export {
|
|
36
|
-
f as default
|
|
37
|
-
};
|