maz-ui 4.0.0-beta.4 → 4.0.0-beta.6
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/assets/MazAccordion.DUQCf8vy.css +1 -0
- package/dist/assets/{MazBtn.BnRxVlqS.css → MazBtn.FsG6p6NF.css} +1 -1
- package/dist/assets/MazCheckbox.CFqw9ybT.css +1 -0
- package/dist/assets/MazDatePicker.8GyrtM-j.css +1 -0
- package/dist/assets/MazInput.WPopv89k.css +1 -0
- package/dist/assets/MazPickerMonthSwitcher.CszcpCcY.css +1 -0
- package/dist/assets/{MazPickerYearSwitcher.Dl30Dwor.css → MazPickerYearSwitcher.Cn-nS-Vv.css} +1 -1
- package/dist/assets/MazPopover.D-WwUjU_.css +1 -0
- package/dist/assets/MazRadio.XGYnbTuB.css +1 -0
- package/dist/assets/MazSelect.DEBsk61Q.css +1 -0
- package/dist/assets/{MazStepper.DYMde9uq.css → MazStepper.DtWZmm-f.css} +1 -1
- package/dist/assets/MazSwitch.Bxmh2iFj.css +1 -0
- package/dist/assets/{MazTable.B1tkeUfE.css → MazTable.DMlQdImb.css} +1 -1
- package/dist/assets/{toast.kunueRvo.css → toast.CC2VQab8.css} +1 -1
- package/dist/chunks/{MazDatePicker.CT5yJhSN.js → MazDatePicker.EVP68BQf.js} +28 -30
- package/dist/chunks/{MazDropdown.vue_vue_type_style_index_0_lang.De5b1GG8.js → MazDropdown.vue_vue_type_style_index_0_lang.DjPJ9-gt.js} +1 -1
- package/dist/chunks/{MazInputPrice.vue_vue_type_script_setup_true_lang.GMKzSu7R.js → MazInputPrice.vue_vue_type_script_setup_true_lang.BA6TDX-T.js} +31 -1
- package/dist/chunks/{MazPickerCalendar.RS6ZMdDK.js → MazPickerCalendar.CzPlAVdQ.js} +1 -1
- package/dist/chunks/{MazPickerCalendarMonth.hQBSVkc9.js → MazPickerCalendarMonth.gZBcslia.js} +1 -1
- package/dist/chunks/{MazPickerCalendarSwitcher.Cp2ux3E4.js → MazPickerCalendarSwitcher.CzAkb2yj.js} +1 -1
- package/dist/chunks/{MazPickerContainer.DnfB3Dqg.js → MazPickerContainer.BodulCQp.js} +1 -1
- package/dist/chunks/{MazPickerHeader.Dlz2yJ1D.js → MazPickerHeader.ns_pHhiy.js} +1 -1
- package/dist/chunks/{MazPickerMonthSwitcher.BpfCGGxQ.js → MazPickerMonthSwitcher.BuZuUauW.js} +5 -6
- package/dist/chunks/{MazPickerTime.EuWWNfid.js → MazPickerTime.DMVpW3Ha.js} +1 -1
- package/dist/chunks/{MazPickerYearSwitcher.D4aO09D3.js → MazPickerYearSwitcher.METGgjem.js} +8 -27
- package/dist/chunks/{MazSwitch.vue_vue_type_style_index_0_lang.DQE0vFhe.js → MazSwitch.vue_vue_type_style_index_0_lang.CU43Y1ky.js} +1 -1
- package/dist/chunks/{MazTable.vue_vue_type_script_setup_true_lang.bm7ng8fK.js → MazTable.vue_vue_type_script_setup_true_lang.CK2bk5tI.js} +2 -2
- package/dist/chunks/{utils.BBuYjMbK.js → dom-events.CvkK8Xn2.js} +219 -115
- package/dist/chunks/{normalizeString.CFe2M8S_.js → useStringMatching.D5UvsCUS.js} +40 -1
- package/dist/chunks/vClickOutside.C69k0jaG.js +107 -0
- package/dist/components/MazAccordion.js +2 -2
- package/dist/components/MazBtn.js +2 -3
- package/dist/components/MazCheckbox.js +10 -12
- package/dist/components/MazChecklist.js +1 -2
- package/dist/components/MazDatePicker.js +1 -1
- package/dist/components/MazDropdown.js +1 -1
- package/dist/components/MazInput.js +9 -10
- package/dist/components/MazInputPrice.js +1 -1
- package/dist/components/MazPopover.js +163 -77
- package/dist/components/MazPullToRefresh.js +7 -2
- package/dist/components/MazRadio.js +8 -16
- package/dist/components/MazReadingProgressBar.js +9 -2
- package/dist/components/MazSelect.js +22 -12
- package/dist/components/MazSelectCountry.js +7 -2
- package/dist/components/MazStepper.js +2 -2
- package/dist/components/MazSwitch.js +1 -1
- package/dist/components/MazTable.js +3 -3
- package/dist/components/MazTableCell.js +1 -1
- package/dist/components/MazTableRow.js +1 -1
- package/dist/components/MazTableTitle.js +1 -1
- package/dist/components/MazTextarea.js +23 -2
- package/dist/components/index.js +4 -4
- package/dist/composables/index.js +2 -2
- package/dist/composables/useDisplayNames.js +7 -1
- package/dist/composables/useFormField.js +15 -19
- package/dist/composables/useFormValidator.js +41 -28
- package/dist/composables/useIdleTimeout.js +108 -1
- package/dist/composables/useStringMatching.js +3 -40
- package/dist/composables/useSwipe.js +77 -1
- package/dist/composables/useUserVisibility.js +47 -1
- package/dist/css/main.css +1 -1
- package/dist/directives/index.js +7 -7
- package/dist/directives/vClickOutside.js +4 -102
- package/dist/directives/vTooltip.js +96 -59
- package/dist/index.js +1 -114
- package/dist/plugins/toast.js +8 -11
- package/dist/resolvers/MazComponentsResolver.js +7 -1
- package/dist/resolvers/MazModulesResolver.js +3 -0
- package/dist/tailwindcss/tailwind.config.js +5 -2
- package/dist/tailwindcss/variables/design-tokens.js +3 -0
- package/dist/types/components/MazAccordion.vue.d.ts +15 -2
- package/dist/types/components/MazCheckbox.vue.d.ts +0 -6
- package/dist/types/components/MazDatePicker.vue.d.ts +4 -12
- package/dist/types/components/MazInputNumber.vue.d.ts +1 -1
- package/dist/types/components/MazPopover.vue.d.ts +7 -4
- package/dist/types/components/MazStepper.vue.d.ts +13 -2
- package/dist/types/components/MazTable.vue.d.ts +63 -2
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/composables/index.d.ts +1 -1
- package/dist/types/composables/useDisplayNames.d.ts +3 -3
- package/dist/types/composables/useFormField.d.ts +3 -41
- package/dist/types/composables/useFormValidator/dom-events.d.ts +19 -0
- package/dist/types/composables/useFormValidator/state-management.d.ts +54 -0
- package/dist/types/composables/useFormValidator/types.d.ts +9 -20
- package/dist/types/composables/useFormValidator/validation.d.ts +43 -0
- package/dist/types/composables/useFormValidator.d.ts +16 -10
- package/dist/types/directives/vTooltip.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tailwindcss/tailwind.config.d.ts +5 -0
- package/dist/types/tailwindcss/variables/design-tokens.d.ts +3 -0
- package/package.json +8 -9
- package/dist/assets/MazAccordion.esK3rR4p.css +0 -1
- package/dist/assets/MazCheckbox.BFo5eYS6.css +0 -1
- package/dist/assets/MazDatePicker.V5JwKPrQ.css +0 -1
- package/dist/assets/MazInput.DW2KOJHY.css +0 -1
- package/dist/assets/MazPickerMonthSwitcher.168v7Hs1.css +0 -1
- package/dist/assets/MazPopover.COR-tym7.css +0 -1
- package/dist/assets/MazRadio.DKMFWwy_.css +0 -1
- package/dist/assets/MazSelect.DZZpDg8z.css +0 -1
- package/dist/assets/MazSwitch.Z1ZMm7tx.css +0 -1
- package/dist/chunks/TextareaAutogrow.C22LQx0k.js +0 -25
- package/dist/chunks/debounceCallback.B69vn57Q.js +0 -7
- package/dist/chunks/formatCurrency.C8NzW9Ii.js +0 -34
- package/dist/chunks/formatDate.DZ_OzdnV.js +0 -21
- package/dist/chunks/getCountryFlagUrl.dQjriBXx.js +0 -9
- package/dist/chunks/idleTimeout.-ICpdeGV.js +0 -111
- package/dist/chunks/isServer.BokzeB-Q.js +0 -6
- package/dist/chunks/isStandaloneMode.BpUpOTbA.js +0 -10
- package/dist/chunks/pascalCase.D_nuQ66I.js +0 -11
- package/dist/chunks/swipeHandler.8emelhOL.js +0 -80
- package/dist/chunks/throttle.DN8ARw0a.js +0 -11
- package/dist/chunks/throttleId.7PhWZjcS.js +0 -62
- package/dist/chunks/userVisibility.BbQSJASv.js +0 -50
- package/dist/chunks/x-mark.CTalOvvY.js +0 -23
- package/dist/types/composables/useFormValidator/utils.d.ts +0 -116
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { BaseFormPayload, CustomInstance, ExtractModelKey, FieldsStates, FieldState, FormContext, FormFieldOptions, FormSchema, StrictOptions } from './types';
|
|
3
|
+
export declare function getFieldState<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, schema, initialValue, fieldState, options, }: {
|
|
4
|
+
name: ModelKey;
|
|
5
|
+
schema?: FormSchema<Model>;
|
|
6
|
+
initialValue?: Model[ModelKey];
|
|
7
|
+
fieldState: FieldState<Model>;
|
|
8
|
+
options?: Pick<StrictOptions<Model>, 'debouncedFields' | 'throttledFields' | 'mode'>;
|
|
9
|
+
}): FieldState<Model>;
|
|
10
|
+
export declare function fieldHasValidation<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>>>(field: ModelKey, schema: FormSchema<Model>): boolean;
|
|
11
|
+
export declare function getFieldsStates<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ schema, payload, options, }: {
|
|
12
|
+
schema: FormSchema<Model>;
|
|
13
|
+
payload: Partial<Model>;
|
|
14
|
+
options: StrictOptions<Model>;
|
|
15
|
+
}): FieldsStates<Model>;
|
|
16
|
+
export declare function updateFieldsStates<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ fieldsStates, payload, schema, options, updateMode, }: {
|
|
17
|
+
fieldsStates: FieldsStates<Model>;
|
|
18
|
+
payload: Model;
|
|
19
|
+
schema: FormSchema<Model>;
|
|
20
|
+
options: StrictOptions<Model>;
|
|
21
|
+
updateMode?: boolean;
|
|
22
|
+
}): void;
|
|
23
|
+
export declare function updateFieldState<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, fieldState, payload, schema, options, updateMode, }: {
|
|
24
|
+
name: ModelKey;
|
|
25
|
+
fieldState: FieldState<Model>;
|
|
26
|
+
payload: Model;
|
|
27
|
+
schema: FormSchema<Model>;
|
|
28
|
+
options: FormFieldOptions<Model[ModelKey]> & StrictOptions<Model>;
|
|
29
|
+
updateMode?: boolean;
|
|
30
|
+
}): FieldState<Model>;
|
|
31
|
+
export declare function canExecuteValidation<Model extends BaseFormPayload>({ eventName, fieldState, isSubmitted, }: {
|
|
32
|
+
eventName: 'blur' | 'input';
|
|
33
|
+
fieldState: FieldState<Model>;
|
|
34
|
+
isSubmitted: boolean;
|
|
35
|
+
}): boolean;
|
|
36
|
+
export declare function handleFieldBlur<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, force, payload, fieldState, schema, isSubmitted, }: {
|
|
37
|
+
name: ModelKey;
|
|
38
|
+
payload: Model;
|
|
39
|
+
fieldState: FieldState<Model>;
|
|
40
|
+
schema: FormSchema<Model>;
|
|
41
|
+
isSubmitted: boolean;
|
|
42
|
+
force?: boolean;
|
|
43
|
+
}): Promise<void> | undefined;
|
|
44
|
+
export declare function handleFieldInput<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, payload, fieldState, schema, isSubmitted, forceValidation, }: {
|
|
45
|
+
name: ModelKey;
|
|
46
|
+
payload: Model;
|
|
47
|
+
fieldState: FieldState<Model>;
|
|
48
|
+
schema: FormSchema<Model>;
|
|
49
|
+
isSubmitted: boolean;
|
|
50
|
+
forceValidation?: boolean;
|
|
51
|
+
}): Promise<void> | undefined;
|
|
52
|
+
export declare function hasModeIncludes(modes: StrictOptions['mode'][], value?: StrictOptions['mode']): value is StrictOptions['mode'];
|
|
53
|
+
export declare function getInstance<Model extends BaseFormPayload>(composableName: string): CustomInstance<Model>;
|
|
54
|
+
export declare function getContext<Model extends BaseFormPayload>(identifier: string | symbol | InjectionKey<FormContext<Model>>, composableName: string): FormContext<Model, Extract<keyof { [K in Extract<keyof Model, string> as Model[K] extends Required<Model>[K] ? K : never]: import('./types').Validation; }, string> | Extract<keyof { [K_1 in Extract<keyof Model, string> as Model[K_1] extends Required<Model>[K_1] ? never : K_1]?: import('./types').Validation | undefined; }, string>>;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { DeepPartial } from '@maz-ui/utils/src/
|
|
2
|
-
import { BaseIssue, BaseSchema, BaseSchemaAsync, InferIssue, InferOutput, objectAsync } from 'valibot';
|
|
3
|
-
import { ComponentInternalInstance, ComponentPublicInstance, InjectionKey,
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { getValidateFunction } from './utils';
|
|
7
|
-
export type ValidationSync = BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
8
|
-
export type ValidationAsync = ValidationSync | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
9
|
-
export type Validation = ValidationAsync;
|
|
1
|
+
import { DeepPartial } from '@maz-ui/utils/src/index.js';
|
|
2
|
+
import { BaseIssue, BaseSchema, BaseSchemaAsync, InferInput, InferIssue, InferOutput, objectAsync } from 'valibot';
|
|
3
|
+
import { ComponentInternalInstance, ComponentPublicInstance, InjectionKey, Ref, TemplateRef } from 'vue';
|
|
4
|
+
import { getValidateFunction } from './validation';
|
|
5
|
+
export type Validation = BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
10
6
|
export type ValidationIssues = InferIssue<Validation>[];
|
|
11
7
|
export type ExtractModelKey<T> = Extract<keyof T, string>;
|
|
12
|
-
export type FormSchema<Model> = {
|
|
8
|
+
export type FormSchema<Model = BaseFormPayload> = {
|
|
13
9
|
[K in Extract<keyof Model, string> as Model[K] extends Required<Model>[K] ? K : never]: Validation;
|
|
14
10
|
} & {
|
|
15
11
|
[K in Extract<keyof Model, string> as Model[K] extends Required<Model>[K] ? never : K]?: Validation;
|
|
@@ -91,7 +87,7 @@ export interface FormFieldOptions<FieldType> {
|
|
|
91
87
|
* Reference to the component or HTML element to associate and trigger validation events
|
|
92
88
|
* Necessary for 'eager', 'progressive' and 'blur' validation modes
|
|
93
89
|
*/
|
|
94
|
-
ref?: Ref<HTMLElement | ComponentPublicInstance | undefined>;
|
|
90
|
+
ref?: Ref<HTMLElement | ComponentPublicInstance | undefined | null> | TemplateRef<HTMLElement | ComponentPublicInstance | undefined | null>;
|
|
95
91
|
/**
|
|
96
92
|
* Identifier for the form
|
|
97
93
|
* Useful when you have multiple forms on the same component
|
|
@@ -99,12 +95,5 @@ export interface FormFieldOptions<FieldType> {
|
|
|
99
95
|
*/
|
|
100
96
|
formIdentifier?: string | symbol;
|
|
101
97
|
}
|
|
102
|
-
export type
|
|
103
|
-
export
|
|
104
|
-
schema: MaybeRef<FormSchema<Model>>;
|
|
105
|
-
defaultValues?: MaybeRef<DeepPartial<Model> | undefined | null>;
|
|
106
|
-
model?: Ref<DeepPartial<Model> | undefined | null>;
|
|
107
|
-
options?: FormValidatorOptions<Model>;
|
|
108
|
-
}
|
|
109
|
-
export type UseFormField<FieldType extends Model[ExtractModelKey<FormSchema<Model>>], Model extends BaseFormPayload = BaseFormPayload> = typeof useFormField<FieldType, Model>;
|
|
110
|
-
export type InferSchemaFormValidator<T> = T extends Ref<infer U> ? U extends Record<string, Validation> ? InferOutput<ReturnType<typeof objectAsync<U>>> : never : T extends Record<string, Validation> ? InferOutput<ReturnType<typeof objectAsync<T>>> : never;
|
|
98
|
+
export type InferSchemaFormValidator<T> = T extends Ref<infer U> ? U extends FormSchema<BaseFormPayload> ? DeepPartial<InferInput<ReturnType<typeof objectAsync<U>>>> : never : T extends (...args: any[]) => FormSchema<BaseFormPayload> ? DeepPartial<InferInput<ReturnType<typeof objectAsync<ReturnType<T>>>>> : T extends FormSchema<BaseFormPayload> ? DeepPartial<InferInput<ReturnType<typeof objectAsync<T>>>> : never;
|
|
99
|
+
export type InferOutputSchemaFormValidator<T> = T extends Ref<infer U> ? U extends FormSchema<BaseFormPayload> ? InferOutput<ReturnType<typeof objectAsync<U>>> : never : T extends (...args: any[]) => FormSchema<BaseFormPayload> ? InferOutput<ReturnType<typeof objectAsync<ReturnType<T>>>> : T extends FormSchema<BaseFormPayload> ? InferOutput<ReturnType<typeof objectAsync<T>>> : never;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BaseFormPayload, ExtractModelKey, FieldsStates, FieldState, FormSchema, StrictOptions, ValidationIssues } from './types';
|
|
2
|
+
export declare function isEmptyValue(value: unknown): value is null | undefined | '';
|
|
3
|
+
export declare function getValibotValidationMethod<MethodName extends keyof typeof import('valibot')>(methodName: MethodName): Promise<(typeof import('valibot'))[MethodName]>;
|
|
4
|
+
export declare function getValidationSchema<Model extends BaseFormPayload>(formSchema: FormSchema<Model>): Promise<import('valibot').ObjectSchemaAsync<FormSchema<Model>, undefined>>;
|
|
5
|
+
export declare function getFieldValidationResult<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>(name: ModelKey, schema: FormSchema<Model>, value: Model[ModelKey]): Promise<{
|
|
6
|
+
result: import('valibot').SafeParseResult<FormSchema<Model>[ModelKey]>;
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function setFieldValidationState<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, fieldState, schema, payload, setError, setErrorIfInvalidAndNotEmpty, }: {
|
|
10
|
+
name: ModelKey;
|
|
11
|
+
fieldState: FieldState<Model>;
|
|
12
|
+
schema: FormSchema<Model>;
|
|
13
|
+
payload: Model;
|
|
14
|
+
setError?: boolean;
|
|
15
|
+
setErrorIfInvalidAndNotEmpty?: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
export declare function validateField<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, fieldState, payload, schema, }: {
|
|
18
|
+
name: ModelKey;
|
|
19
|
+
fieldState: FieldState<Model>;
|
|
20
|
+
payload: Model;
|
|
21
|
+
schema: FormSchema<Model>;
|
|
22
|
+
}): Promise<void> | undefined;
|
|
23
|
+
export declare function validateForm<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ fieldsStates, payload, setErrors, schema, }: {
|
|
24
|
+
fieldsStates: FieldsStates<Model>;
|
|
25
|
+
setErrors?: boolean;
|
|
26
|
+
payload: Model;
|
|
27
|
+
schema: FormSchema<Model>;
|
|
28
|
+
}): Promise<void[]>;
|
|
29
|
+
export declare function getErrorMessages<Model extends BaseFormPayload = BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>(errors: Record<ModelKey, ValidationIssues>, fieldsStates: FieldsStates<Model>): Record<ModelKey, string | undefined>;
|
|
30
|
+
export declare function getFieldsErrors<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>(fieldsStates: FieldsStates<Model>): Record<ModelKey, ValidationIssues>;
|
|
31
|
+
export declare function getValidateFunction<Model extends BaseFormPayload, ModelKey extends ExtractModelKey<FormSchema<Model>> = ExtractModelKey<FormSchema<Model>>>({ name, hasValidation, debouncedFields, throttledFields, }: {
|
|
32
|
+
name: ModelKey;
|
|
33
|
+
hasValidation: boolean;
|
|
34
|
+
debouncedFields?: StrictOptions<Model>['debouncedFields'];
|
|
35
|
+
throttledFields?: StrictOptions<Model>['throttledFields'];
|
|
36
|
+
}): ((args_0: {
|
|
37
|
+
name: ExtractModelKey<FormSchema<Model>>;
|
|
38
|
+
fieldState: FieldState<Model, Model[Extract<keyof { [K in Extract<keyof Model, string> as Model[K] extends Required<Model>[K] ? K : never]: import('./types').Validation; }, string> | Extract<keyof { [K_1 in Extract<keyof Model, string> as Model[K_1] extends Required<Model>[K_1] ? never : K_1]?: import('./types').Validation | undefined; }, string>]>;
|
|
39
|
+
schema: FormSchema<Model>;
|
|
40
|
+
payload: Model;
|
|
41
|
+
setError?: boolean;
|
|
42
|
+
setErrorIfInvalidAndNotEmpty?: boolean;
|
|
43
|
+
}) => Promise<void>) | undefined;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { DeepPartial } from '@maz-ui/utils/src/ts-helpers/DeepPartial.js';
|
|
2
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
import { BaseFormPayload, ExtractModelKey, FieldsStates, FormSchema, FormValidatorOptions, InferOutputSchemaFormValidator, InferSchemaFormValidator } from './useFormValidator/types';
|
|
4
|
+
import { scrollToError } from './useFormValidator/dom-events';
|
|
5
|
+
export declare function useFormValidator<TSchema extends MaybeRefOrGetter<FormSchema<BaseFormPayload>>>({ schema, defaultValues, model, options }: {
|
|
6
|
+
schema: TSchema;
|
|
7
|
+
defaultValues?: MaybeRefOrGetter<DeepPartial<InferSchemaFormValidator<TSchema>> | undefined | null>;
|
|
8
|
+
model?: Ref<DeepPartial<InferSchemaFormValidator<TSchema>> | undefined | null>;
|
|
9
|
+
options?: FormValidatorOptions<InferSchemaFormValidator<TSchema>>;
|
|
10
|
+
}): {
|
|
5
11
|
identifier: string | symbol;
|
|
6
12
|
isDirty: import('vue').ComputedRef<boolean>;
|
|
7
13
|
isSubmitting: Ref<boolean, boolean>;
|
|
8
14
|
isSubmitted: Ref<boolean, boolean>;
|
|
9
15
|
isValid: import('vue').ComputedRef<boolean>;
|
|
10
|
-
errors: import('vue').ComputedRef<Record<ExtractModelKey<FormSchema<
|
|
11
|
-
model: Ref<
|
|
12
|
-
fieldsStates: Ref<FieldsStates<
|
|
13
|
-
validateForm: (
|
|
16
|
+
errors: import('vue').ComputedRef<Record<ExtractModelKey<FormSchema<InferSchemaFormValidator<TSchema>>>, import('./useFormValidator/types').ValidationIssues>>;
|
|
17
|
+
model: Ref<InferSchemaFormValidator<TSchema>, InferSchemaFormValidator<TSchema>>;
|
|
18
|
+
fieldsStates: Ref<FieldsStates<InferSchemaFormValidator<TSchema>>, FieldsStates<InferSchemaFormValidator<TSchema>>>;
|
|
19
|
+
validateForm: (setErrors?: boolean) => Promise<void[]>;
|
|
14
20
|
scrollToError: typeof scrollToError;
|
|
15
|
-
handleSubmit: <Func extends (model:
|
|
16
|
-
errorMessages: import('vue').ComputedRef<Record<ExtractModelKey<FormSchema<
|
|
21
|
+
handleSubmit: <Func extends (model: InferOutputSchemaFormValidator<TSchema>) => Promise<Awaited<ReturnType<Func>>> | ReturnType<Func>>(successCallback: Func, enableScrollOrSelector?: FormValidatorOptions["scrollToError"]) => (event?: Event) => Promise<ReturnType<Func> | undefined>;
|
|
22
|
+
errorMessages: import('vue').ComputedRef<Record<ExtractModelKey<FormSchema<InferSchemaFormValidator<TSchema>>>, string | undefined>>;
|
|
17
23
|
};
|
|
@@ -11,13 +11,13 @@ interface VTooltipOptions extends Partial<Omit<MazPopoverProps, 'modelValue'>> {
|
|
|
11
11
|
html?: string;
|
|
12
12
|
/**
|
|
13
13
|
* Color variant of the tooltip
|
|
14
|
-
* @default
|
|
14
|
+
* @default contrast
|
|
15
15
|
*/
|
|
16
16
|
color?: MazPopoverProps['color'];
|
|
17
17
|
/**
|
|
18
18
|
* Position of the tooltip
|
|
19
19
|
* The preferred position is set to 'top' if no position is provided
|
|
20
|
-
* @default
|
|
20
|
+
* @default top
|
|
21
21
|
*/
|
|
22
22
|
position?: MazPopoverPosition;
|
|
23
23
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@maz-ui/utils
|
|
1
|
+
export * from '@maz-ui/utils';
|
|
@@ -3,6 +3,8 @@ import { getNumericScreensFromTailwind } from './variables/breakpoints';
|
|
|
3
3
|
export { getNumericScreensFromTailwind };
|
|
4
4
|
export declare function defineMazTailwindConfig(config?: Partial<Config> & {
|
|
5
5
|
content: Config['content'];
|
|
6
|
+
}, { utilities }?: {
|
|
7
|
+
utilities?: Record<string, any>;
|
|
6
8
|
}): {
|
|
7
9
|
content: (import('tailwindcss/types/config').ContentConfig | undefined) & import('tailwindcss/types/config').ContentConfig;
|
|
8
10
|
important?: Partial<import('tailwindcss/types/config').ImportantConfig> | undefined;
|
|
@@ -54,6 +56,9 @@ export declare function defineMazTailwindConfig(config?: Partial<Config> & {
|
|
|
54
56
|
lg: string;
|
|
55
57
|
xl: string;
|
|
56
58
|
};
|
|
59
|
+
borderColor: {
|
|
60
|
+
DEFAULT: string;
|
|
61
|
+
};
|
|
57
62
|
borderWidth: {
|
|
58
63
|
DEFAULT: string;
|
|
59
64
|
0: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maz-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.6",
|
|
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",
|
|
@@ -182,11 +182,11 @@
|
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
"dependencies": {
|
|
185
|
-
"@maz-ui/cli": "4.0.0-beta.
|
|
186
|
-
"@maz-ui/icons": "4.0.0-beta.
|
|
187
|
-
"@maz-ui/themes": "4.0.0-beta.
|
|
188
|
-
"@maz-ui/translations": "4.0.0-beta.
|
|
189
|
-
"@maz-ui/utils": "4.0.0-beta.
|
|
185
|
+
"@maz-ui/cli": "4.0.0-beta.6",
|
|
186
|
+
"@maz-ui/icons": "4.0.0-beta.6",
|
|
187
|
+
"@maz-ui/themes": "4.0.0-beta.6",
|
|
188
|
+
"@maz-ui/translations": "4.0.0-beta.6",
|
|
189
|
+
"@maz-ui/utils": "4.0.0-beta.6",
|
|
190
190
|
"chart.js": "^4.5.0",
|
|
191
191
|
"dayjs": "^1.11.13",
|
|
192
192
|
"libphonenumber-js": "^1.12.9",
|
|
@@ -194,14 +194,13 @@
|
|
|
194
194
|
"vue-chartjs": "^5.3.2"
|
|
195
195
|
},
|
|
196
196
|
"devDependencies": {
|
|
197
|
-
"@maz-ui/eslint-config": "4.0.0-beta.
|
|
197
|
+
"@maz-ui/eslint-config": "4.0.0-beta.6",
|
|
198
198
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
199
199
|
"@vitest/coverage-v8": "^3.2.4",
|
|
200
200
|
"@vue/compiler-sfc": "^3.5.16",
|
|
201
201
|
"@vue/test-utils": "^2.4.6",
|
|
202
202
|
"@vue/tsconfig": "^0.7.0",
|
|
203
203
|
"autoprefixer": "^10.4.21",
|
|
204
|
-
"chalk": "5.4.1",
|
|
205
204
|
"glob": "^11.0.3",
|
|
206
205
|
"jsdom": "^26.1.0",
|
|
207
206
|
"lightningcss": "^1.30.1",
|
|
@@ -237,5 +236,5 @@
|
|
|
237
236
|
"*.{js,ts,vue,mjs,mts,cjs,md}": "cross-env NODE_ENV=production eslint --fix",
|
|
238
237
|
"*.{vue,css,scss,postcss,pcss}": "stylelint --fix --allow-empty-input"
|
|
239
238
|
},
|
|
240
|
-
"gitHead": "
|
|
239
|
+
"gitHead": "bbff6fcfca7d47dd8f8024b69ac787b66ba0b65e"
|
|
241
240
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-accordion[data-v-3531c128]{vertical-align:top;flex-direction:column;gap:1rem;display:inline-flex;position:relative}.m-accordion__spotlight[data-v-3531c128]{width:100%}.m-accordion__header[data-v-3531c128]{text-align:start;justify-content:space-between;align-items:center;gap:1rem;width:100%;padding:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:inline-flex}.m-accordion__header .header-icon[data-v-3531c128]{transition-property:transform;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-accordion__header .header-icon.--rotate[data-v-3531c128]{transform:rotate(135deg)}.m-accordion__content[data-v-3531c128]{padding:1rem}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-checkbox[data-v-588a1122]{vertical-align:top;outline-offset:2px;outline:2px solid #0000;align-items:center;gap:.5rem;display:inline-flex;position:relative}.m-checkbox .check-icon[data-v-588a1122]{--maz-tw-scale-x:0;--maz-tw-scale-y:0;transform:translate(var(--maz-tw-translate-x),var(--maz-tw-translate-y))rotate(var(--maz-tw-rotate))skewX(var(--maz-tw-skew-x))skewY(var(--maz-tw-skew-y))scaleX(var(--maz-tw-scale-x))scaleY(var(--maz-tw-scale-y));transition-property:transform;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-checkbox .check-icon[data-v-588a1122] path{stroke-width:2.5px}.m-checkbox>span[data-v-588a1122]{border-radius:calc(var(--maz-radius) - 4px);border-width:var(--maz-border-width);--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1));justify-content:center;align-items:center;transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex;position:relative}.m-checkbox>span[data-v-588a1122]:is([class~=dark] *){--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border-400)/var(--maz-tw-border-opacity,1))}.m-checkbox input[data-v-588a1122]{display:none}.m-checkbox input:not(:checked)~span[data-v-588a1122]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1))}.m-checkbox input:not(:checked)~span[data-v-588a1122]:is([class~=dark] *){background-color:hsl(var(--maz-background-400)/.6)}.m-checkbox input:checked~span[data-v-588a1122]{border-color:var(--checkbox-selected-color);background-color:var(--checkbox-selected-color)}.m-checkbox input:checked~span .check-icon[data-v-588a1122]{--maz-tw-scale-x:1;--maz-tw-scale-y:1;transform:translate(var(--maz-tw-translate-x),var(--maz-tw-translate-y))rotate(var(--maz-tw-rotate))skewX(var(--maz-tw-skew-x))skewY(var(--maz-tw-skew-y))scaleX(var(--maz-tw-scale-x))scaleY(var(--maz-tw-scale-y))}.m-checkbox input:disabled~span[data-v-588a1122]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1))}.m-checkbox input:disabled~span[data-v-588a1122]:is([class~=dark] *){--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-300)/var(--maz-tw-bg-opacity,1))}.m-checkbox.--disabled[data-v-588a1122]{cursor:not-allowed;--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-checkbox.--disabled svg[data-v-588a1122]{--maz-tw-text-opacity:1!important;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))!important}.m-checkbox.--disabled input:checked~span[data-v-588a1122]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1))}.m-checkbox.--disabled input:checked~span .check-icon[data-v-588a1122]{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-checkbox[data-v-588a1122]:not(.--disabled){cursor:pointer}.m-checkbox:not(.--disabled):hover>span[data-v-588a1122],.m-checkbox:not(.--disabled):focus>span[data-v-588a1122]{box-shadow:0 0 0 .125rem var(--checkbox-box-shadow-color);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-checkbox__text[data-v-588a1122]{flex-direction:column;gap:0;display:flex}.m-checkbox__hint[data-v-588a1122]{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1));font-size:.875rem;line-height:1.25rem}.m-checkbox__hint.--error[data-v-588a1122]{--maz-tw-text-opacity:1;color:hsl(var(--maz-destructive-600)/var(--maz-tw-text-opacity,1))}.m-checkbox__hint.--success[data-v-588a1122]{--maz-tw-text-opacity:1;color:hsl(var(--maz-success-600)/var(--maz-tw-text-opacity,1))}.m-checkbox__hint.--warning[data-v-588a1122]{--maz-tw-text-opacity:1;color:hsl(var(--maz-warning-600)/var(--maz-tw-text-opacity,1))}.m-checkbox.--error>span[data-v-588a1122],.m-checkbox.--warning>span[data-v-588a1122],.m-checkbox.--success>span[data-v-588a1122]{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-date-picker[data-v-d69298f5]{display:inline-block;position:relative}.m-date-picker .m-date-picker__button[data-v-d69298f5]{cursor:not-allowed;background-color:#0000;justify-content:center;align-items:center;height:100%;padding-right:.25rem;display:flex}.m-date-picker .m-date-picker__button__chevron[data-v-d69298f5]{--maz-tw-text-opacity:1;color:hsl(var(--maz-foreground)/var(--maz-tw-text-opacity,1));transition-property:transform;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-date-picker.--is-open .m-date-picker__button__chevron[data-v-d69298f5]{transform:rotate(180deg)}.m-date-picker:not(.--is-disabled) .m-date-picker__button[data-v-d69298f5]{cursor:pointer}.m-date-picker:not(.--is-disabled) .m-date-picker__input[data-v-d69298f5] input{cursor:pointer!important}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-input[data-v-4583d75b]{vertical-align:top;flex-direction:column;align-items:flex-start;display:inline-flex}.m-input.--block[data-v-4583d75b]{width:100%}.m-input-top-label[data-v-4583d75b]{--maz-tw-text-opacity:1;color:hsl(var(--maz-foreground)/var(--maz-tw-text-opacity,1));margin-bottom:.5rem}.m-input-bottom-text[data-v-4583d75b]{margin-top:.25rem;font-size:.875rem;line-height:1.25rem}.m-input-wrapper[data-v-4583d75b]{z-index:1;border-width:var(--maz-border-width);--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1));border-style:solid;flex:1;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex;position:relative;overflow:hidden}.m-input-wrapper.--block[data-v-4583d75b]{width:100%}.m-input-wrapper.--default-border[data-v-4583d75b]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1))}.m-input-wrapper.--default-border[data-v-4583d75b]:is([class~=dark] *){--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border-400)/var(--maz-tw-border-opacity,1))}.m-input-wrapper-input[data-v-4583d75b]{flex:1;align-items:center;width:100%;max-width:100%;display:flex;position:relative}.m-input-wrapper-input.--xl[data-v-4583d75b]{height:calc(4rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--xl .m-input-input[data-v-4583d75b],.m-input-wrapper-input.--xl .m-input-label[data-v-4583d75b]{font-size:1.25rem;line-height:1.75rem}.m-input-wrapper-input.--lg[data-v-4583d75b]{height:calc(3.5rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--lg .m-input-input[data-v-4583d75b],.m-input-wrapper-input.--lg .m-input-label[data-v-4583d75b]{font-size:1.125rem;line-height:1.75rem}.m-input-wrapper-input.--md[data-v-4583d75b]{height:calc(3rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--sm[data-v-4583d75b]{height:calc(2.5rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--sm .m-input-input[data-v-4583d75b],.m-input-wrapper-input.--sm .m-input-label[data-v-4583d75b]{font-size:.875rem;line-height:1.25rem}.m-input-wrapper-input.--xs[data-v-4583d75b]{height:calc(2rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--xs .m-input-input[data-v-4583d75b],.m-input-wrapper-input.--xs .m-input-label[data-v-4583d75b]{font-size:.75rem;line-height:1rem}.m-input-wrapper-input.--mini[data-v-4583d75b]{height:calc(1.5rem - (var(--maz-border-width)*2))}.m-input-wrapper-input.--mini .m-input-input[data-v-4583d75b],.m-input-wrapper-input.--mini .m-input-label[data-v-4583d75b]{font-size:.75rem;line-height:1rem}.m-input-wrapper-right[data-v-4583d75b],.m-input-wrapper-left[data-v-4583d75b]{z-index:1;display:flex;position:relative}.m-input-wrapper-right[data-v-4583d75b]>:not([hidden])~:not([hidden]),.m-input-wrapper-left[data-v-4583d75b]>:not([hidden])~:not([hidden]){--maz-tw-space-x-reverse:0;margin-right:calc(.25rem*var(--maz-tw-space-x-reverse));margin-left:calc(.25rem*calc(1 - var(--maz-tw-space-x-reverse)))}.m-input-wrapper-right[data-v-4583d75b],.m-input-wrapper-left[data-v-4583d75b]{justify-content:center;align-items:center;padding-top:.25rem;padding-bottom:.25rem}.m-input-wrapper-right[data-v-4583d75b]{padding-right:.5rem}.m-input-wrapper-left[data-v-4583d75b]{padding-left:.5rem}.m-input-wrapper.--rounded-sm[data-v-4583d75b]{border-radius:calc(var(--maz-radius) - 8px)}.m-input-wrapper.--rounded-md[data-v-4583d75b]{border-radius:calc(var(--maz-radius) - 4px)}.m-input-wrapper.--rounded-lg[data-v-4583d75b]{border-radius:var(--maz-radius)}.m-input-wrapper.--rounded-xl[data-v-4583d75b]{border-radius:calc(var(--maz-radius) + 8px)}.m-input-wrapper.--rounded-full[data-v-4583d75b]{border-radius:9999px}.m-input-input[data-v-4583d75b]{appearance:none;text-overflow:ellipsis;white-space:nowrap;--maz-tw-text-opacity:1;width:100%;height:100%;color:hsl(var(--maz-foreground)/var(--maz-tw-text-opacity,1));--maz-tw-shadow:0 0 #0000;--maz-tw-shadow-colored:0 0 #0000;box-shadow:var(--maz-tw-ring-offset-shadow,0 0 #0000),var(--maz-tw-ring-shadow,0 0 #0000),var(--maz-tw-shadow);outline-offset:2px;background-color:#0000;border-style:none;outline:2px solid #0000;margin:0;padding:0 1rem;transition:padding .2s cubic-bezier(0,0,.2,1);overflow:hidden}.m-input-input[data-v-4583d75b]:-webkit-autofill{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px var(--maz-input-color)inset;transition:background-color 5000s ease-in-out}.m-input-input[data-v-4583d75b]:-webkit-autofill:hover{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px var(--maz-input-color)inset;transition:background-color 5000s ease-in-out}.m-input-input[data-v-4583d75b]:-webkit-autofill:focus{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px var(--maz-input-color)inset;transition:background-color 5000s ease-in-out}.m-input-input[data-v-4583d75b]::placeholder{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-input-label[data-v-4583d75b]{pointer-events:none;transform-origin:0 0;text-overflow:ellipsis;white-space:nowrap;text-align:start;align-items:center;width:calc(100% + 1.3rem);line-height:1.5rem;transition:transform .2s cubic-bezier(0,0,.2,1);position:absolute;left:.75rem;overflow:hidden}.m-input:not(.--should-up) .m-input-label[data-v-4583d75b]{width:calc(100% - .75rem)}.m-input.--should-up .m-input-label[data-v-4583d75b]{transform:scale(.8)translateY(-.65em)}.m-input.--should-up .m-input-input[data-v-4583d75b]{padding-top:1rem}.m-input[data-v-4583d75b]:not(.--has-state){--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-input.--has-z-2 .m-input-wrapper[data-v-4583d75b]{z-index:2}.m-input.--is-readonly .m-input-input[data-v-4583d75b]{cursor:default}.m-input.--is-disabled .m-input-wrapper[data-v-4583d75b]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-300)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-input.--is-disabled .m-input-input[data-v-4583d75b]{cursor:not-allowed;--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-input:not(.--is-disabled) .m-input-wrapper[data-v-4583d75b]:is([class~=dark] *){background-color:hsl(var(--maz-background-400)/.6)}.m-input.--is-focused .m-input-wrapper[data-v-4583d75b]{z-index:3}.m-input.--has-label .m-input-label[data-v-4583d75b]{padding-inline-end:.75rem}.m-input.--has-label .m-input-input[data-v-4583d75b]{padding-left:.75rem;padding-right:.75rem}html.dark .m-input-input[data-v-4583d75b]:-webkit-autofill{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}html.dark .m-input-input[data-v-4583d75b]:-webkit-autofill:hover{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}html.dark .m-input-input[data-v-4583d75b]:-webkit-autofill:focus{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}.m-input.dark .m-input-input[data-v-4583d75b]:-webkit-autofill{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}.m-input.dark .m-input-input[data-v-4583d75b]:-webkit-autofill:hover{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}.m-input.dark .m-input-input[data-v-4583d75b]:-webkit-autofill:focus{-webkit-text-fill-color:hsl(var(--maz-foreground));box-shadow:0 0 0 1000px hsl(var(--maz-background-400))inset;transition:background-color 5000s ease-in-out}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.maz-picker-month-switcher[data-v-f5e01456]{z-index:1;--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1));flex-direction:column;display:flex;position:absolute;inset:0}.maz-picker-month-switcher__header[data-v-f5e01456]{border-bottom-width:var(--maz-border-width);--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1));justify-content:flex-end;padding:.5rem;display:flex}.maz-picker-month-switcher__main[data-v-f5e01456]{flex:1;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:center;align-items:center;gap:.25rem;padding:.5rem;display:grid;overflow-y:auto}.maz-picker-month-switcher__main.--has-double[data-v-f5e01456]{grid-template-columns:repeat(3,minmax(0,1fr))}.maz-picker-month-switcher__main>button[data-v-f5e01456]{height:100%!important}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-popover[data-v-ea83582e]{display:inline-block}.m-popover.--block[data-v-ea83582e],.m-popover.--block .m-popover-trigger[data-v-ea83582e]{width:100%}.m-popover-trigger[data-v-ea83582e]{display:inline-block}.m-popover-panel[data-v-ea83582e]{visibility:hidden;z-index:1050;border-radius:var(--maz-radius);--maz-tw-shadow-color:hsl(var(--maz-shadow)/1);--maz-tw-shadow:var(--maz-tw-shadow-colored);outline-offset:2px;--maz-tw-drop-shadow:drop-shadow(0 4px 3px #00000012)drop-shadow(0 2px 2px #0000000f);filter:var(--maz-tw-blur)var(--maz-tw-brightness)var(--maz-tw-contrast)var(--maz-tw-grayscale)var(--maz-tw-hue-rotate)var(--maz-tw-invert)var(--maz-tw-saturate)var(--maz-tw-sepia)var(--maz-tw-drop-shadow);outline:2px solid #0000;position:absolute}.m-popover-panel.--background[data-v-ea83582e]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1))}.m-popover-panel.--background[data-v-ea83582e]:is([class~=dark] *){border-width:var(--maz-border-width);--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1))}.m-popover-panel.--primary[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-primary-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-primary)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-primary-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--secondary[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-secondary-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-secondary)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-secondary-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--success[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-success-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-success)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-success-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--warning[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-warning-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-warning)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-warning-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--destructive[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-destructive-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-destructive)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-destructive-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--info[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-info-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-info)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-info-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--accent[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-accent-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-accent)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-accent-foreground)/var(--maz-tw-text-opacity,1))}.m-popover-panel.--contrast[data-v-ea83582e]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-contrast-600)/var(--maz-tw-border-opacity,1));--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-contrast)/var(--maz-tw-bg-opacity,1));--maz-tw-text-opacity:1;color:hsl(var(--maz-contrast-foreground)/var(--maz-tw-text-opacity,1))}.maz-popover-enter-active[data-v-ea83582e],.maz-popover-leave-active[data-v-ea83582e]{transform-origin:var(--popover-origin,center);transition-property:all;transition-duration:.2s;transition-timing-function:cubic-bezier(0,0,.2,1)}.maz-popover-leave-to[data-v-ea83582e],.maz-popover-enter-from[data-v-ea83582e]{opacity:0;transform:scale(.95)translateY(-4px)}.m-popover-panel.--position-top[data-v-ea83582e],.m-popover-panel.--position-top-start[data-v-ea83582e],.m-popover-panel.--position-top-end[data-v-ea83582e]{--popover-origin:bottom center}.m-popover-panel.--position-bottom[data-v-ea83582e],.m-popover-panel.--position-bottom-start[data-v-ea83582e],.m-popover-panel.--position-bottom-end[data-v-ea83582e]{--popover-origin:top center}.m-popover-panel.--position-left[data-v-ea83582e],.m-popover-panel.--position-left-start[data-v-ea83582e],.m-popover-panel.--position-left-end[data-v-ea83582e]{--popover-origin:center right}.m-popover-panel.--position-right[data-v-ea83582e],.m-popover-panel.--position-right-start[data-v-ea83582e],.m-popover-panel.--position-right-end[data-v-ea83582e]{--popover-origin:center left}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-radio[data-v-3752b2a5]{vertical-align:top;outline-offset:2px;outline:2px solid #0000;align-items:center;gap:.5rem;display:inline-flex;position:relative}.m-radio>span[data-v-3752b2a5]{border-width:var(--maz-border-width);--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1));border-radius:9999px;justify-content:center;align-items:center;transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex;position:relative}.m-radio>span[data-v-3752b2a5]:is([class~=dark] *){--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border-400)/var(--maz-tw-border-opacity,1))}.m-radio>span[data-v-3752b2a5]{width:var(--radio-size);height:var(--radio-size)}.m-radio>span .round[data-v-3752b2a5]{--maz-tw-scale-x:0;--maz-tw-scale-y:0;width:50%;height:50%;transform:translate(var(--maz-tw-translate-x),var(--maz-tw-translate-y))rotate(var(--maz-tw-rotate))skewX(var(--maz-tw-skew-x))skewY(var(--maz-tw-skew-y))scaleX(var(--maz-tw-scale-x))scaleY(var(--maz-tw-scale-y));background-color:var(--radio-selected-color);border-radius:9999px;transition-property:transform;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.m-radio:not(.--selected)>span[data-v-3752b2a5]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1))}.m-radio:not(.--selected)>span[data-v-3752b2a5]:is([class~=dark] *){background-color:hsl(var(--maz-background-400)/.6)}.m-radio.--selected>span[data-v-3752b2a5]{border-color:var(--radio-selected-color)}.m-radio.--selected>span .round[data-v-3752b2a5]{--maz-tw-scale-x:1;--maz-tw-scale-y:1;transform:translate(var(--maz-tw-translate-x),var(--maz-tw-translate-y))rotate(var(--maz-tw-rotate))skewX(var(--maz-tw-skew-x))skewY(var(--maz-tw-skew-y))scaleX(var(--maz-tw-scale-x))scaleY(var(--maz-tw-scale-y))}.m-radio__text[data-v-3752b2a5]{flex-direction:column;gap:0;display:flex}.m-radio input[data-v-3752b2a5]{display:none}.m-radio.--disabled[data-v-3752b2a5]{cursor:not-allowed;--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-radio.--disabled>span[data-v-3752b2a5]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1))}.m-radio.--disabled>span[data-v-3752b2a5]:is([class~=dark] *){--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-300)/var(--maz-tw-bg-opacity,1))}.m-radio.--disabled.--selected>span[data-v-3752b2a5]{--maz-tw-border-opacity:1;border-color:hsl(var(--maz-border)/var(--maz-tw-border-opacity,1))}.m-radio.--disabled.--selected>span .round[data-v-3752b2a5]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-muted)/var(--maz-tw-bg-opacity,1))}.m-radio__hint[data-v-3752b2a5]{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1));font-size:.875rem;line-height:1.25rem}.m-radio__hint.--error[data-v-3752b2a5]{--maz-tw-text-opacity:1;color:hsl(var(--maz-destructive-600)/var(--maz-tw-text-opacity,1))}.m-radio__hint.--success[data-v-3752b2a5]{--maz-tw-text-opacity:1;color:hsl(var(--maz-success-600)/var(--maz-tw-text-opacity,1))}.m-radio__hint.--warning[data-v-3752b2a5]{--maz-tw-text-opacity:1;color:hsl(var(--maz-warning-600)/var(--maz-tw-text-opacity,1))}.m-radio[data-v-3752b2a5]:not(.--disabled),.m-radio[data-v-3752b2a5]:not(.--selected){cursor:pointer}.m-radio:not(.--disabled):hover>span[data-v-3752b2a5],.m-radio:not(.--disabled):focus>span[data-v-3752b2a5],.m-radio:not(.--selected):hover>span[data-v-3752b2a5],.m-radio:not(.--selected):focus>span[data-v-3752b2a5],.m-radio.--error>span[data-v-3752b2a5],.m-radio.--warning>span[data-v-3752b2a5],.m-radio.--success>span[data-v-3752b2a5]{box-shadow:0 0 0 .125rem var(--radio-box-shadow);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-select[data-v-b7f9209f]{vertical-align:top;display:inline-flex;position:relative}.m-select.--mini[data-v-b7f9209f],.m-select.--xs[data-v-b7f9209f]{font-size:.75rem;line-height:1rem}.m-select.--sm[data-v-b7f9209f]{font-size:.875rem;line-height:1.25rem}.m-select.--md[data-v-b7f9209f]{font-size:1rem;line-height:1.5rem}.m-select.--lg[data-v-b7f9209f]{font-size:1.125rem;line-height:1.75rem}.m-select.--xl[data-v-b7f9209f]{font-size:1.25rem;line-height:1.75rem}.m-select[data-v-b7f9209f]:not(.--disabled) .m-input-input{cursor:pointer}.m-select-input[data-v-b7f9209f] .m-input-input,.m-select-input.--has-label[data-v-b7f9209f] .m-input-input{padding-right:0}.m-select-input__toggle-button[data-v-b7f9209f]{background-color:#0000;justify-content:center;align-items:center;height:100%;padding-left:0;display:flex}.m-select-input[data-v-b7f9209f] input{caret-color:#0000}.m-select-chevron[data-v-b7f9209f]{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1));font-size:1.2em;transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}.m-select.--is-open .m-select-chevron[data-v-b7f9209f]{transform:rotate(180deg)}.m-select button.maz-custom[data-v-b7f9209f]{cursor:pointer;appearance:none;border-style:none}.m-select-list[data-v-b7f9209f]{z-index:1050;border-radius:var(--maz-radius);--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1));--maz-tw-shadow-color:hsl(var(--maz-shadow)/1);--maz-tw-shadow:var(--maz-tw-shadow-colored);--maz-tw-drop-shadow:drop-shadow(0 4px 3px #00000012)drop-shadow(0 2px 2px #0000000f);filter:var(--maz-tw-blur)var(--maz-tw-brightness)var(--maz-tw-contrast)var(--maz-tw-grayscale)var(--maz-tw-hue-rotate)var(--maz-tw-invert)var(--maz-tw-saturate)var(--maz-tw-sepia)var(--maz-tw-drop-shadow);flex-direction:column;gap:.25rem;padding:.5rem;display:flex;overflow:hidden}.m-select-list-optgroup[data-v-b7f9209f]{text-align:start;--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1));flex:none;padding:.125rem;font-size:.875em}.m-select-list.--mini[data-v-b7f9209f],.m-select-list.--xs[data-v-b7f9209f]{font-size:.75rem;line-height:1rem}.m-select-list.--sm[data-v-b7f9209f]{font-size:.875rem;line-height:1.25rem}.m-select-list.--md[data-v-b7f9209f]{font-size:1rem;line-height:1.5rem}.m-select-list.--lg[data-v-b7f9209f]{font-size:1.125rem;line-height:1.75rem}.m-select-list.--xl[data-v-b7f9209f]{font-size:1.25rem;line-height:1.75rem}.m-select-list[data-v-b7f9209f]{min-width:3.5rem}.m-select-list__scroll-wrapper[data-v-b7f9209f]{flex-direction:column;flex:1;gap:.25rem;display:flex;overflow:auto}.m-select-list__scroll-wrapper[data-v-b7f9209f]::-webkit-scrollbar{width:.1875rem}.m-select-list__scroll-wrapper[data-v-b7f9209f]::-webkit-scrollbar-track{background:0 0}.m-select-list__scroll-wrapper[data-v-b7f9209f]::-webkit-scrollbar-thumb{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1));border-radius:1000px}.m-select-list__scroll-wrapper[data-v-b7f9209f]::-webkit-scrollbar-thumb:hover{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-500)/var(--maz-tw-bg-opacity,1))}.m-select-list__scroll-wrapper[data-v-b7f9209f]{scrollbar-width:thin;scrollbar-color:hsl(var(--maz-background-400))transparent}.m-select-list__no-results[data-v-b7f9209f]{justify-content:center;align-items:center;padding:1rem;display:flex}.m-select-list-item[data-v-b7f9209f]{cursor:pointer;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--maz-radius);border-width:var(--maz-border-width);text-align:start;outline-offset:2px;background-color:#0000;border-style:solid;border-color:#0000;outline:2px solid #0000;align-items:center;gap:.75rem;width:100%;padding:.5rem .75rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden}.m-select-list-item[data-v-b7f9209f]:focus-within,.m-select-list-item[data-v-b7f9209f]:hover{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1))}.m-select-list-item span[data-v-b7f9209f]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.m-select-list-item.--is-none-value[data-v-b7f9209f]{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1))}.m-select-list-item.--is-selected[data-v-b7f9209f]{color:var(--selected-text-color);background-color:var(--selected-bg-color)}.m-select-list-item.--is-selected[data-v-b7f9209f]:focus{border-color:var(--selected-text-color)}.m-select-list-item.--is-selected.--transparent[data-v-b7f9209f]{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1))}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.m-switch{cursor:pointer;vertical-align:top;align-items:center;gap:.5rem;display:inline-flex;position:relative}.m-switch.--is-disabled{cursor:not-allowed}.m-switch__input{position:absolute;left:-9999px}.m-switch__toggle{width:3rem;height:1.5rem;position:relative}.m-switch__toggle:before{content:"";--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1));border-radius:9999px;width:3rem;height:1.5rem;transition:all .2s ease-in-out;display:block;position:relative;top:.125rem;left:0}.m-switch__toggle:after{content:"";--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background)/var(--maz-tw-bg-opacity,1));border-radius:9999px;width:1.25rem;height:1.25rem;transition:all .2s ease-in-out;display:block;position:absolute;top:.25rem;left:.125rem;box-shadow:0 0 4px #0003}.m-switch__input:checked+.m-switch__toggle:after{--maz-tw-translate-x:1.5rem;transform:translate(var(--maz-tw-translate-x),var(--maz-tw-translate-y))rotate(var(--maz-tw-rotate))skewX(var(--maz-tw-skew-x))skewY(var(--maz-tw-skew-y))scaleX(var(--maz-tw-scale-x))scaleY(var(--maz-tw-scale-y))}.m-switch__input:checked+.m-switch__toggle:before{background-color:var(--switch-color)}.m-switch__input:disabled+.m-switch__toggle:before{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-600)/var(--maz-tw-bg-opacity,1))}.m-switch__input:disabled+.m-switch__toggle:is([class~=dark] *):before{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-400)/var(--maz-tw-bg-opacity,1))}.m-switch__input:disabled+.m-switch__toggle:after{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-700)/var(--maz-tw-bg-opacity,1))}.m-switch__input:disabled+.m-switch__toggle:is([class~=dark] *):after{--maz-tw-bg-opacity:1;background-color:hsl(var(--maz-background-300)/var(--maz-tw-bg-opacity,1))}.m-switch__input:disabled+.m-switch__toggle:after{box-shadow:none}.m-switch__text{flex-direction:column;gap:0;display:flex}.m-switch__hint{--maz-tw-text-opacity:1;color:hsl(var(--maz-muted)/var(--maz-tw-text-opacity,1));font-size:.875rem;line-height:1.25rem}.m-switch__hint.--error{--maz-tw-text-opacity:1;color:hsl(var(--maz-destructive-600)/var(--maz-tw-text-opacity,1))}.m-switch__hint.--success{--maz-tw-text-opacity:1;color:hsl(var(--maz-success-600)/var(--maz-tw-text-opacity,1))}.m-switch__hint.--warning{--maz-tw-text-opacity:1;color:hsl(var(--maz-warning-600)/var(--maz-tw-text-opacity,1))}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { d as debounce } from "./debounce.Brzkn9pm.js";
|
|
2
|
-
class TextareaAutogrow {
|
|
3
|
-
element;
|
|
4
|
-
constructor(element) {
|
|
5
|
-
this.element = element, this.onFocus = this.onFocus.bind(this), this.autogrow = this.autogrow.bind(this), this.onResize = debounce(this.onResize.bind(this), 200), this.connect();
|
|
6
|
-
}
|
|
7
|
-
connect() {
|
|
8
|
-
this.element.addEventListener("focus", this.onFocus), this.element.style.resize = "none", this.element.style.boxSizing = "border-box";
|
|
9
|
-
}
|
|
10
|
-
disconnect() {
|
|
11
|
-
window.removeEventListener("resize", this.onResize), this.element.removeEventListener("input", this.autogrow);
|
|
12
|
-
}
|
|
13
|
-
onFocus() {
|
|
14
|
-
this.autogrow(), this.element.addEventListener("input", this.autogrow), window.addEventListener("resize", this.onResize), this.element.removeEventListener("focus", this.onFocus);
|
|
15
|
-
}
|
|
16
|
-
onResize() {
|
|
17
|
-
this.autogrow();
|
|
18
|
-
}
|
|
19
|
-
autogrow() {
|
|
20
|
-
this.element.style.height = "auto", this.element.style.overflow = "hidden", this.element.style.height = `${this.element.scrollHeight}px`;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
TextareaAutogrow as T
|
|
25
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const DEFAULT_OPTIONS = {
|
|
2
|
-
style: "currency",
|
|
3
|
-
minimumFractionDigits: 2,
|
|
4
|
-
round: !1
|
|
5
|
-
};
|
|
6
|
-
function getFormattedCurrency(number, locale, options) {
|
|
7
|
-
let numberToFormat = +number;
|
|
8
|
-
return options.round && (numberToFormat = Math.floor(numberToFormat), options.minimumFractionDigits = 0), new Intl.NumberFormat(locale, options).format(numberToFormat);
|
|
9
|
-
}
|
|
10
|
-
function validRequiredAttributes(number, locale, options) {
|
|
11
|
-
if (number === void 0)
|
|
12
|
-
throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");
|
|
13
|
-
if (locale === void 0)
|
|
14
|
-
throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");
|
|
15
|
-
if (typeof locale != "string")
|
|
16
|
-
throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");
|
|
17
|
-
if (options.currency === void 0)
|
|
18
|
-
throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.");
|
|
19
|
-
}
|
|
20
|
-
function formatCurrency(number, locale, options) {
|
|
21
|
-
const options_ = {
|
|
22
|
-
...DEFAULT_OPTIONS,
|
|
23
|
-
...options
|
|
24
|
-
};
|
|
25
|
-
validRequiredAttributes(number, locale, options_);
|
|
26
|
-
try {
|
|
27
|
-
return getFormattedCurrency(number, locale, options_);
|
|
28
|
-
} catch (error) {
|
|
29
|
-
throw new Error(`[maz-ui](FilterCurrency) ${error}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
formatCurrency as f
|
|
34
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const DEFAULT_OPTIONS = {
|
|
2
|
-
month: "short",
|
|
3
|
-
day: "numeric",
|
|
4
|
-
year: "numeric"
|
|
5
|
-
};
|
|
6
|
-
function formatDate(date, locale, options) {
|
|
7
|
-
if (locale === void 0)
|
|
8
|
-
throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");
|
|
9
|
-
if (typeof locale != "string")
|
|
10
|
-
throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");
|
|
11
|
-
const opts = options ?? DEFAULT_OPTIONS;
|
|
12
|
-
try {
|
|
13
|
-
const usedDate = date instanceof Date ? date : new Date(date);
|
|
14
|
-
return new Intl.DateTimeFormat(locale, opts).format(usedDate);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
throw new Error(`[maz-ui](FilterDate) ${error}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
formatDate as f
|
|
21
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const _supportedCodes = ["ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", "bq", "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "eu", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gb", "gb-eng", "gb-nir", "gb-sct", "gb-wls", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me", "mf", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", "ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", "tt", "tv", "tw", "tz", "ua", "ug", "um", "un", "us", "us-ak", "us-al", "us-ar", "us-az", "us-ca", "us-co", "us-ct", "us-de", "us-fl", "us-ga", "us-hi", "us-ia", "us-id", "us-il", "us-in", "us-ks", "us-ky", "us-la", "us-ma", "us-md", "us-me", "us-mi", "us-mn", "us-mo", "us-ms", "us-mt", "us-nc", "us-nd", "us-ne", "us-nh", "us-nj", "us-nm", "us-nv", "us-ny", "us-oh", "us-ok", "us-or", "us-pa", "us-ri", "us-sc", "us-sd", "us-tn", "us-tx", "us-ut", "us-va", "us-vt", "us-wa", "us-wi", "us-wv", "us-wy", "uy", "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wf", "ws", "xk", "ye", "yt", "za", "zm", "zw"];
|
|
2
|
-
function getCountryFlagUrl(countryIsoCode, size) {
|
|
3
|
-
const code = countryIsoCode.toLowerCase();
|
|
4
|
-
if (_supportedCodes.includes(code))
|
|
5
|
-
return size ? `https://flagcdn.com/${size}/${code}.png` : `https://flagcdn.com/${code}.svg`;
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
getCountryFlagUrl as g
|
|
9
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { i as isClient } from "./isClient.WI4oSt66.js";
|
|
2
|
-
class IdleTimeout {
|
|
3
|
-
constructor(callback, options) {
|
|
4
|
-
this.callback = callback, this.options = {
|
|
5
|
-
...this.defaultOptions,
|
|
6
|
-
...options
|
|
7
|
-
}, isClient() && this.start();
|
|
8
|
-
}
|
|
9
|
-
defaultOptions = {
|
|
10
|
-
element: void 0,
|
|
11
|
-
timeout: 60 * 1e3 * 5,
|
|
12
|
-
// 5 minutes
|
|
13
|
-
once: !1,
|
|
14
|
-
immediate: !0
|
|
15
|
-
};
|
|
16
|
-
options;
|
|
17
|
-
timeoutHandler;
|
|
18
|
-
isIdle = !1;
|
|
19
|
-
isDestroy = !1;
|
|
20
|
-
startTime = 0;
|
|
21
|
-
remainingTime = 0;
|
|
22
|
-
lastClientX = -1;
|
|
23
|
-
lastClientY = -1;
|
|
24
|
-
eventNames = [
|
|
25
|
-
"DOMMouseScroll",
|
|
26
|
-
"mousedown",
|
|
27
|
-
"mousemove",
|
|
28
|
-
"mousewheel",
|
|
29
|
-
"MSPointerDown",
|
|
30
|
-
"MSPointerMove",
|
|
31
|
-
"keydown",
|
|
32
|
-
"touchmove",
|
|
33
|
-
"touchstart",
|
|
34
|
-
"wheel",
|
|
35
|
-
"click"
|
|
36
|
-
];
|
|
37
|
-
get element() {
|
|
38
|
-
return this.options.element ?? document.body;
|
|
39
|
-
}
|
|
40
|
-
start() {
|
|
41
|
-
if (!isClient()) {
|
|
42
|
-
console.warn("[IdleTimeout](start) you should run this method on client side");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
for (const eventName of this.eventNames)
|
|
46
|
-
this.element.addEventListener(eventName, this.handleEvent);
|
|
47
|
-
this.resetTimeout(), this.options.immediate && this.callback({ isIdle: !1, instance: this });
|
|
48
|
-
}
|
|
49
|
-
pause() {
|
|
50
|
-
const remainingTime = this.startTime + this.options.timeout - Date.now();
|
|
51
|
-
remainingTime <= 0 || (this.remainingTime = remainingTime, this.timeoutHandler && (clearTimeout(this.timeoutHandler), this.timeoutHandler = void 0));
|
|
52
|
-
}
|
|
53
|
-
resume() {
|
|
54
|
-
this.remainingTime <= 0 || (this.resetTimeout(), this.callback({ isIdle: this.isIdle, instance: this }), this.remainingTime = 0);
|
|
55
|
-
}
|
|
56
|
-
reset() {
|
|
57
|
-
this.isDestroy = !1, this.isIdle = !1, this.remainingTime = 0, this.resetTimeout(), this.callback({ isIdle: this.isIdle, instance: this });
|
|
58
|
-
}
|
|
59
|
-
destroy() {
|
|
60
|
-
if (!isClient()) {
|
|
61
|
-
console.warn("[IdleTimeout](destroy) you should run this method on client side");
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.isDestroy = !0;
|
|
65
|
-
for (const eventName of this.eventNames)
|
|
66
|
-
this.element.removeEventListener(eventName, this.handleEvent);
|
|
67
|
-
this.timeoutHandler && clearTimeout(this.timeoutHandler);
|
|
68
|
-
}
|
|
69
|
-
resetTimeout() {
|
|
70
|
-
this.isIdle = !1, this.timeoutHandler && (clearTimeout(this.timeoutHandler), this.timeoutHandler = void 0), this.timeoutHandler = setTimeout(
|
|
71
|
-
this.handleTimeout.bind(this),
|
|
72
|
-
this.remainingTime || this.options.timeout
|
|
73
|
-
), this.startTime = Date.now();
|
|
74
|
-
}
|
|
75
|
-
handleEvent = (event) => {
|
|
76
|
-
try {
|
|
77
|
-
if (this.remainingTime > 0)
|
|
78
|
-
return;
|
|
79
|
-
if (event.type === "mousemove") {
|
|
80
|
-
const { clientX, clientY } = event;
|
|
81
|
-
if (clientX === void 0 && clientY === void 0 || clientX === this.lastClientX && clientY === this.lastClientY)
|
|
82
|
-
return;
|
|
83
|
-
this.lastClientX = clientX, this.lastClientY = clientY;
|
|
84
|
-
}
|
|
85
|
-
this.resetTimeout(), this.callback({ isIdle: this.isIdle, eventType: event.type, instance: this });
|
|
86
|
-
} catch (error) {
|
|
87
|
-
throw new Error(`[IdleTimeout](handleEvent) ${error}`);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
handleTimeout() {
|
|
91
|
-
this.isIdle = !0, this.callback({ isIdle: this.isIdle, instance: this }), this.options.once && this.destroy();
|
|
92
|
-
}
|
|
93
|
-
get destroyed() {
|
|
94
|
-
return this.isDestroy;
|
|
95
|
-
}
|
|
96
|
-
get timeout() {
|
|
97
|
-
return this.options.timeout;
|
|
98
|
-
}
|
|
99
|
-
set timeout(value) {
|
|
100
|
-
this.options.timeout = value;
|
|
101
|
-
}
|
|
102
|
-
get idle() {
|
|
103
|
-
return this.isIdle;
|
|
104
|
-
}
|
|
105
|
-
set idle(value) {
|
|
106
|
-
value ? this.handleTimeout() : this.reset(), this.callback({ isIdle: this.isIdle, instance: this });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
export {
|
|
110
|
-
IdleTimeout as I
|
|
111
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { i as isClient } from "./isClient.WI4oSt66.js";
|
|
2
|
-
function isStandaloneMode() {
|
|
3
|
-
if (!isClient())
|
|
4
|
-
return !1;
|
|
5
|
-
const nav = navigator, isStandalone = window.matchMedia("(display-mode: standalone)").matches;
|
|
6
|
-
return nav.standalone || isStandalone;
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
isStandaloneMode as i
|
|
10
|
-
};
|