maz-ui 4.1.8-beta.1 → 4.1.8-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/dist/components/MazAccordion.vue.d.ts +36 -0
- package/dist/components/MazAnimatedCounter.vue.d.ts +59 -0
- package/dist/components/MazAnimatedElement.vue.d.ts +44 -0
- package/dist/components/MazAnimatedText.vue.d.ts +57 -0
- package/dist/components/MazAvatar.vue.d.ts +99 -0
- package/dist/components/MazBackdrop.vue.d.ts +91 -0
- package/dist/components/MazBadge.vue.d.ts +61 -0
- package/dist/components/MazBottomSheet.vue.d.ts +35 -0
- package/dist/components/MazBtn.vue.d.ts +105 -0
- package/dist/components/MazCard.vue.d.ts +81 -0
- package/dist/components/MazCardSpotlight.vue.d.ts +57 -0
- package/dist/components/MazCarousel.vue.d.ts +48 -0
- package/dist/components/MazChart.vue.d.ts +53 -0
- package/dist/components/MazCheckbox.vue.d.ts +55 -0
- package/dist/components/MazChecklist.vue.d.ts +87 -0
- package/dist/components/MazCircularProgressBar.vue.d.ts +106 -0
- package/dist/components/MazDatePicker/MazPickerCalendar.vue.d.ts +28 -0
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +20 -0
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +133 -0
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +142 -0
- package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.vue.d.ts +42 -0
- package/dist/components/MazDatePicker/MazPickerContainer.vue.d.ts +38 -0
- package/dist/components/MazDatePicker/MazPickerHeader.vue.d.ts +15 -0
- package/dist/components/MazDatePicker/MazPickerMonthSwitcher.vue.d.ts +44 -0
- package/dist/components/MazDatePicker/MazPickerShortcuts.vue.d.ts +16 -0
- package/dist/components/MazDatePicker/MazPickerTime.vue.d.ts +107 -0
- package/dist/components/MazDatePicker/MazPickerYearSwitcher.vue.d.ts +36 -0
- package/dist/components/MazDatePicker/types.d.ts +14 -0
- package/dist/components/MazDatePicker/utils.d.ts +61 -0
- package/dist/components/MazDatePicker.vue.d.ts +567 -0
- package/dist/components/MazDialog.vue.d.ts +247 -0
- package/dist/components/MazDialogConfirm/useMazDialogConfirm.d.ts +47 -0
- package/dist/components/MazDialogConfirm.vue.d.ts +270 -0
- package/dist/components/MazDrawer.vue.d.ts +52 -0
- package/dist/components/MazDropdown.vue.d.ts +246 -0
- package/dist/components/MazDropzone.vue.d.ts +294 -0
- package/dist/components/MazExpandAnimation.vue.d.ts +44 -0
- package/dist/components/MazFullscreenLoader.vue.d.ts +26 -0
- package/dist/components/MazGallery.vue.d.ts +85 -0
- package/dist/components/MazIcon.vue.d.ts +33 -0
- package/dist/components/MazInput.vue.d.ts +225 -0
- package/dist/components/MazInputCode.vue.d.ts +49 -0
- package/dist/components/MazInputNumber.vue.d.ts +125 -0
- package/dist/components/MazInputPhoneNumber/PhoneInput.vue.d.ts +29 -0
- package/dist/components/MazInputPhoneNumber/useLibphonenumber.d.ts +26 -0
- package/dist/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +26 -0
- package/dist/components/MazInputPhoneNumber.vue.d.ts +421 -0
- package/dist/components/MazInputPrice.vue.d.ts +48 -0
- package/dist/components/MazInputTags.vue.d.ts +51 -0
- package/dist/components/MazLazyImg.vue.d.ts +78 -0
- package/dist/components/MazLink.vue.d.ts +116 -0
- package/dist/components/MazLoadingBar.vue.d.ts +12 -0
- package/dist/components/MazPagination.vue.d.ts +83 -0
- package/dist/components/MazPopover.vue.d.ts +258 -0
- package/dist/components/MazPullToRefresh.vue.d.ts +52 -0
- package/dist/components/MazRadio.vue.d.ts +55 -0
- package/dist/components/MazRadioButtons.vue.d.ts +74 -0
- package/dist/components/MazReadingProgressBar.vue.d.ts +55 -0
- package/dist/components/MazSelect.vue.d.ts +209 -0
- package/dist/components/MazSelectCountry.vue.d.ts +171 -0
- package/dist/components/MazSlider/utils.d.ts +15 -0
- package/dist/components/MazSlider.vue.d.ts +31 -0
- package/dist/components/MazSpinner.vue.d.ts +15 -0
- package/dist/components/MazStepper.vue.d.ts +60 -0
- package/dist/components/MazSwitch.vue.d.ts +69 -0
- package/dist/components/MazTable.vue.d.ts +324 -0
- package/dist/components/MazTableCell.vue.d.ts +17 -0
- package/dist/components/MazTableRow.vue.d.ts +23 -0
- package/dist/components/MazTableTitle.vue.d.ts +17 -0
- package/dist/components/MazTabs.vue.d.ts +30 -0
- package/dist/components/MazTabsBar.vue.d.ts +96 -0
- package/dist/components/MazTabsContent.vue.d.ts +17 -0
- package/dist/components/MazTabsContentItem.vue.d.ts +31 -0
- package/dist/components/MazTextarea.vue.d.ts +88 -0
- package/dist/components/constantes.d.ts +2 -0
- package/dist/components/index.d.ts +109 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/composables/index.d.ts +22 -0
- package/dist/composables/useAos.d.ts +2 -0
- package/dist/composables/useBreakpoints.d.ts +38 -0
- package/dist/composables/useDialog.d.ts +2 -0
- package/dist/composables/useDisplayNames.d.ts +101 -0
- package/dist/composables/useDropzone.d.ts +27 -0
- package/dist/composables/useFormField.d.ts +16 -0
- package/dist/composables/useFormValidator/config.d.ts +7 -0
- package/dist/composables/useFormValidator/dom-events.d.ts +19 -0
- package/dist/composables/useFormValidator/state-management.d.ts +72 -0
- package/dist/composables/useFormValidator/types.d.ts +98 -0
- package/dist/composables/useFormValidator/validation.d.ts +37 -0
- package/dist/composables/useFormValidator.d.ts +23 -0
- package/dist/composables/useFreezeValue.d.ts +5 -0
- package/dist/composables/useIdleTimeout.d.ts +5 -0
- package/dist/composables/useInjectStrict.d.ts +2 -0
- package/dist/composables/useInstanceUniqId.d.ts +4 -0
- package/dist/composables/useMountComponent.d.ts +14 -0
- package/dist/composables/useMutationObserver.d.ts +13 -0
- package/dist/composables/useReadingTime.d.ts +25 -0
- package/dist/composables/useStringMatching.d.ts +5 -0
- package/dist/composables/useSwipe.d.ts +14 -0
- package/dist/composables/useTimer.d.ts +30 -0
- package/dist/composables/useToast.d.ts +22 -0
- package/dist/composables/useUserVisibility.d.ts +5 -0
- package/dist/composables/useWait.d.ts +2 -0
- package/dist/composables/useWindowSize.d.ts +32 -0
- package/dist/directives/index.d.ts +5 -0
- package/dist/directives/vClickOutside.d.ts +36 -0
- package/dist/directives/vFullscreenImg/MazFullscreenImg.vue.d.ts +50 -0
- package/dist/directives/vFullscreenImg/fullscreen-img.directive.d.ts +5 -0
- package/dist/directives/vFullscreenImg/fullscreen-img.handler.d.ts +36 -0
- package/dist/directives/vFullscreenImg.d.ts +11 -0
- package/dist/directives/vLazyImg/lazy-img.directive.d.ts +5 -0
- package/dist/directives/vLazyImg/lazy-img.handler.d.ts +38 -0
- package/dist/directives/vLazyImg/types.d.ts +29 -0
- package/dist/directives/vLazyImg.d.ts +12 -0
- package/dist/directives/vTooltip.d.ts +54 -0
- package/dist/directives/vZoomImg/style.d.ts +1 -0
- package/dist/directives/vZoomImg/svgs.d.ts +3 -0
- package/dist/directives/vZoomImg/zoom-img.directive.d.ts +8 -0
- package/dist/directives/vZoomImg/zoom-img.handler.d.ts +46 -0
- package/dist/directives/vZoomImg.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/plugins/aos.d.ts +81 -0
- package/dist/plugins/dialog/DialogHandler.d.ts +16 -0
- package/dist/plugins/dialog.d.ts +26 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/maz-ui.d.ts +43 -0
- package/dist/plugins/toast/MazToast.vue.d.ts +34 -0
- package/dist/plugins/toast/ToastHandler.d.ts +29 -0
- package/dist/plugins/toast/types.d.ts +104 -0
- package/dist/plugins/toast.d.ts +25 -0
- package/dist/plugins/wait.d.ts +33 -0
- package/dist/resolvers/MazComponentsResolver.d.ts +10 -0
- package/dist/resolvers/MazDirectivesResolver.d.ts +11 -0
- package/dist/resolvers/MazModulesResolver.d.ts +11 -0
- package/dist/resolvers/index.d.ts +3 -0
- package/dist/tailwindcss/index.d.ts +6 -0
- package/dist/tailwindcss/tailwind.config.d.ts +89 -0
- package/dist/tailwindcss/utils/colors.d.ts +7 -0
- package/dist/tailwindcss/variables/breakpoints.d.ts +15 -0
- package/dist/tailwindcss/variables/colors.d.ts +21 -0
- package/dist/tailwindcss/variables/design-tokens.d.ts +35 -0
- package/dist/tailwindcss/variables/utilities.d.ts +17 -0
- package/dist/tailwindcss/variables/z-indexes.d.ts +14 -0
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DeepPartial } from '@maz-ui/utils/ts-helpers/DeepPartial';
|
|
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
|
+
}): {
|
|
11
|
+
identifier: string | symbol;
|
|
12
|
+
isDirty: import('vue').ComputedRef<boolean>;
|
|
13
|
+
isSubmitting: Ref<boolean, boolean>;
|
|
14
|
+
isSubmitted: Ref<boolean, boolean>;
|
|
15
|
+
isValid: import('vue').ComputedRef<boolean>;
|
|
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>, ExtractModelKey<FormSchema<InferSchemaFormValidator<TSchema>>>>, FieldsStates<InferSchemaFormValidator<TSchema>, ExtractModelKey<FormSchema<InferSchemaFormValidator<TSchema>>>>>;
|
|
19
|
+
validateForm: (setErrors?: boolean) => Promise<void[]>;
|
|
20
|
+
scrollToError: typeof scrollToError;
|
|
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>>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { App, Component, VNodeProps, createVNode } from 'vue';
|
|
2
|
+
export declare function useMountComponent<T extends Component | string, P = Record<string, unknown>>(component: T | string, options?: {
|
|
3
|
+
props?: P & VNodeProps;
|
|
4
|
+
children?: Parameters<typeof createVNode>[2];
|
|
5
|
+
app?: App;
|
|
6
|
+
element?: HTMLElement;
|
|
7
|
+
noRender?: boolean;
|
|
8
|
+
}): {
|
|
9
|
+
vNode: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}>;
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
el: HTMLElement;
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPublicInstance, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export interface UseMutationObserverOptions extends MutationObserverInit {
|
|
3
|
+
internalWindow?: Window | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Watch for changes into DOM element.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useMutationObserver(target: MaybeRefOrGetter<HTMLElement | SVGElement | ComponentPublicInstance | undefined | null>, callback: MutationCallback, options?: UseMutationObserverOptions): {
|
|
9
|
+
isSupported: import('vue').Ref<boolean, boolean>;
|
|
10
|
+
stop: () => void;
|
|
11
|
+
takeRecords: () => MutationRecord[] | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type UseMutationObserverReturn = ReturnType<typeof useMutationObserver>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export interface ReadingTimeOptions {
|
|
3
|
+
/** Content to calculate the reading time */
|
|
4
|
+
content?: string | Ref<string>;
|
|
5
|
+
/** Selector of the content to calculate the reading time */
|
|
6
|
+
contentSelector?: string | Ref<string>;
|
|
7
|
+
/** Ref of the content to calculate the reading time */
|
|
8
|
+
contentRef?: Ref<HTMLElement | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* Words per minute
|
|
11
|
+
* @default 150
|
|
12
|
+
*/
|
|
13
|
+
velocity?: number | Ref<number>;
|
|
14
|
+
}
|
|
15
|
+
export interface ReadingTimeReturn {
|
|
16
|
+
/** Content to calculate the reading time */
|
|
17
|
+
content: ComputedRef<string | undefined | null>;
|
|
18
|
+
/** Number of words in the content */
|
|
19
|
+
wordCount: ComputedRef<number>;
|
|
20
|
+
/** Words per minute */
|
|
21
|
+
velocity: ComputedRef<number>;
|
|
22
|
+
/** Reading time in minutes */
|
|
23
|
+
duration: ComputedRef<number>;
|
|
24
|
+
}
|
|
25
|
+
export declare function useReadingTime(options: ReadingTimeOptions): ReadingTimeReturn;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export declare function useStringMatching(string1: MaybeRefOrGetter<string>, string2: MaybeRefOrGetter<string>, threshold?: MaybeRefOrGetter<number>): {
|
|
3
|
+
isMatching: import('vue').ComputedRef<boolean>;
|
|
4
|
+
score: import('vue').ComputedRef<number>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SwipeOptions } from '@maz-ui/utils/helpers/swipeHandler';
|
|
2
|
+
import { MaybeRef } from 'vue';
|
|
3
|
+
export declare function useSwipe(options: Omit<SwipeOptions, 'onValuesChanged' | 'element'> & {
|
|
4
|
+
element: MaybeRef<HTMLElement> | string | null | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
xDiff: import('vue').Ref<number | undefined, number | undefined>;
|
|
7
|
+
yDiff: import('vue').Ref<number | undefined, number | undefined>;
|
|
8
|
+
xStart: import('vue').Ref<number | undefined, number | undefined>;
|
|
9
|
+
xEnd: import('vue').Ref<number | undefined, number | undefined>;
|
|
10
|
+
yStart: import('vue').Ref<number | undefined, number | undefined>;
|
|
11
|
+
yEnd: import('vue').Ref<number | undefined, number | undefined>;
|
|
12
|
+
start: () => void;
|
|
13
|
+
stop: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface TimerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The time in milliseconds
|
|
4
|
+
* @default 1000
|
|
5
|
+
*/
|
|
6
|
+
timeout?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The callback to execute when the timer is finished
|
|
9
|
+
* @default undefined
|
|
10
|
+
*/
|
|
11
|
+
callback?: () => unknown;
|
|
12
|
+
/**
|
|
13
|
+
* The interval to update the remaining time
|
|
14
|
+
* @default 200
|
|
15
|
+
*/
|
|
16
|
+
remainingTimeUpdate?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The offset time to execute the callback
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
callbackOffsetTime?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function useTimer({ timeout, callback, remainingTimeUpdate, callbackOffsetTime }: TimerOptions): {
|
|
24
|
+
remainingTime: import('vue').Ref<number, number>;
|
|
25
|
+
start: (timeout?: number) => void;
|
|
26
|
+
pause: () => void;
|
|
27
|
+
resume: () => void;
|
|
28
|
+
stop: () => void;
|
|
29
|
+
reset: () => void;
|
|
30
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function useToast(): {
|
|
2
|
+
message: (message: string, options?: import('../plugins').ToastOptions) => {
|
|
3
|
+
destroy: () => void;
|
|
4
|
+
close: () => any;
|
|
5
|
+
};
|
|
6
|
+
success: (message: string, options?: Omit<import('../plugins').ToastOptions, "type">) => {
|
|
7
|
+
destroy: () => void;
|
|
8
|
+
close: () => any;
|
|
9
|
+
};
|
|
10
|
+
error: (message: string, options?: Omit<import('../plugins').ToastOptions, "type">) => {
|
|
11
|
+
destroy: () => void;
|
|
12
|
+
close: () => any;
|
|
13
|
+
};
|
|
14
|
+
info: (message: string, options?: Omit<import('../plugins').ToastOptions, "type">) => {
|
|
15
|
+
destroy: () => void;
|
|
16
|
+
close: () => any;
|
|
17
|
+
};
|
|
18
|
+
warning: (message: string, options?: Omit<import('../plugins').ToastOptions, "type">) => {
|
|
19
|
+
destroy: () => void;
|
|
20
|
+
close: () => any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UserVisibilyCallback, UserVisibilyOptions, UserVisibility } from '@maz-ui/utils/helpers/userVisibility';
|
|
2
|
+
export declare function useUserVisibility({ callback, options, }: {
|
|
3
|
+
callback: UserVisibilyCallback;
|
|
4
|
+
options?: UserVisibilyOptions;
|
|
5
|
+
}): UserVisibility;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface UseWindowSizeOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The window object to use
|
|
4
|
+
* @default window - in browser, undefined in SSR
|
|
5
|
+
*/
|
|
6
|
+
internalWindow?: Window | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Initial width of the window (useful in SSR)
|
|
9
|
+
* @default Number.POSITIVE_INFINITY
|
|
10
|
+
*/
|
|
11
|
+
initialWidth?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Initial height of the window (useful in SSR)
|
|
14
|
+
* @default Number.POSITIVE_INFINITY
|
|
15
|
+
*/
|
|
16
|
+
initialHeight?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Listen to window `orientationchange` event
|
|
19
|
+
*
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
listenOrientation?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the scrollbar should be included in the width and height
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
includeScrollbar?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function useWindowSize(options?: UseWindowSizeOptions): {
|
|
30
|
+
width: import('vue').Ref<number, number>;
|
|
31
|
+
height: import('vue').Ref<number, number>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ObjectDirective, Plugin } from 'vue';
|
|
2
|
+
interface VClickOutsideOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The callback function to be called when the element is clicked outside.
|
|
5
|
+
*/
|
|
6
|
+
callback: (...args: any[]) => any;
|
|
7
|
+
/**
|
|
8
|
+
* The selectors to ignore.
|
|
9
|
+
*/
|
|
10
|
+
ignore?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Whether to capture the event.
|
|
13
|
+
*/
|
|
14
|
+
capture?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to only trigger the callback once.
|
|
17
|
+
*/
|
|
18
|
+
once?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to stop event propagation.
|
|
21
|
+
*/
|
|
22
|
+
stopPropagation?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The value of the v-click-outside directive.
|
|
26
|
+
*/
|
|
27
|
+
type VClickOutsideBindingValue = ((...args: any[]) => any) | VClickOutsideOptions;
|
|
28
|
+
export type VClickOutsideDirective = ObjectDirective<HTMLElement, VClickOutsideBindingValue>;
|
|
29
|
+
declare const directive: VClickOutsideDirective;
|
|
30
|
+
declare const plugin: Plugin;
|
|
31
|
+
export { directive as vClickOutside, type VClickOutsideBindingValue, plugin as vClickOutsideInstall, type VClickOutsideOptions, };
|
|
32
|
+
declare module 'vue' {
|
|
33
|
+
interface GlobalDirectives {
|
|
34
|
+
vClickOutside: VClickOutsideDirective;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface MazFullscreenImgProps {
|
|
2
|
+
src: string;
|
|
3
|
+
clickedElementBounds?: {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
height: number;
|
|
7
|
+
width: number;
|
|
8
|
+
};
|
|
9
|
+
offset?: number;
|
|
10
|
+
animation?: {
|
|
11
|
+
duration?: number;
|
|
12
|
+
easing?: string;
|
|
13
|
+
};
|
|
14
|
+
openInstanceClass?: string;
|
|
15
|
+
clickedElement: HTMLElement;
|
|
16
|
+
destroy?: () => void;
|
|
17
|
+
alt?: string | null;
|
|
18
|
+
zoom?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: import('vue').DefineComponent<MazFullscreenImgProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
close: (...args: any[]) => void;
|
|
22
|
+
"before-close": (...args: any[]) => void;
|
|
23
|
+
next: (...args: any[]) => void;
|
|
24
|
+
previous: (...args: any[]) => void;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<MazFullscreenImgProps> & Readonly<{
|
|
26
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
"onBefore-close"?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
onNext?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
onPrevious?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
destroy: () => void;
|
|
32
|
+
offset: number;
|
|
33
|
+
animation: {
|
|
34
|
+
duration?: number;
|
|
35
|
+
easing?: string;
|
|
36
|
+
};
|
|
37
|
+
alt: string | null;
|
|
38
|
+
clickedElementBounds: {
|
|
39
|
+
top: number;
|
|
40
|
+
left: number;
|
|
41
|
+
height: number;
|
|
42
|
+
width: number;
|
|
43
|
+
};
|
|
44
|
+
openInstanceClass: string;
|
|
45
|
+
zoom: boolean;
|
|
46
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
47
|
+
FullscreenImgElement: HTMLDivElement;
|
|
48
|
+
ImgElement: HTMLImageElement;
|
|
49
|
+
}, HTMLDivElement>;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ObjectDirective } from 'vue';
|
|
2
|
+
import { VFullscreenImgBindingValue } from './fullscreen-img.handler';
|
|
3
|
+
export type VFullscreenImgDirective = ObjectDirective<HTMLElement, VFullscreenImgBindingValue>;
|
|
4
|
+
declare const directive: VFullscreenImgDirective;
|
|
5
|
+
export { directive as vFullscreenImg };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DirectiveBinding } from 'vue';
|
|
2
|
+
export interface VFullscreenImgOptions {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
scaleOnHover?: boolean;
|
|
5
|
+
blurOnHover?: boolean;
|
|
6
|
+
zoom?: boolean;
|
|
7
|
+
offset?: number;
|
|
8
|
+
animation?: {
|
|
9
|
+
duration?: number;
|
|
10
|
+
easing?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface VFullscreenImgBindingOptions extends VFullscreenImgOptions {
|
|
14
|
+
src: string;
|
|
15
|
+
alt?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export type VFullscreenImgBindingValue = string | VFullscreenImgBindingOptions | undefined;
|
|
18
|
+
export type VFullscreenImgBinding = DirectiveBinding<VFullscreenImgBindingValue>;
|
|
19
|
+
export declare class FullscreenImgHandler {
|
|
20
|
+
private options;
|
|
21
|
+
private defaultOptions;
|
|
22
|
+
private mouseEnterListener;
|
|
23
|
+
private mouseLeaveListener;
|
|
24
|
+
private renderPreviewListener;
|
|
25
|
+
private buildOptions;
|
|
26
|
+
get allInstances(): HTMLElement[];
|
|
27
|
+
private getImgSrc;
|
|
28
|
+
private getImgAlt;
|
|
29
|
+
create(el: HTMLElement, binding: VFullscreenImgBinding): void;
|
|
30
|
+
update(el: HTMLElement, binding: VFullscreenImgBinding): void;
|
|
31
|
+
remove(el: HTMLElement): void;
|
|
32
|
+
private renderPreview;
|
|
33
|
+
private mouseLeave;
|
|
34
|
+
private mouseEnter;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { VFullscreenImgDirective } from './vFullscreenImg/fullscreen-img.directive';
|
|
3
|
+
declare const plugin: Plugin;
|
|
4
|
+
export { plugin as vFullscreenImgInstall };
|
|
5
|
+
export { vFullscreenImg, type VFullscreenImgDirective } from './vFullscreenImg/fullscreen-img.directive';
|
|
6
|
+
export type { VFullscreenImgBindingValue, VFullscreenImgOptions } from './vFullscreenImg/fullscreen-img.handler';
|
|
7
|
+
declare module 'vue' {
|
|
8
|
+
interface GlobalDirectives {
|
|
9
|
+
vFullscreenImg: VFullscreenImgDirective;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ClassOptions, VLazyImgBinding, VLazyImgOptions } from './types';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export declare const DEFAULT_OPTIONS: ClassOptions;
|
|
4
|
+
export declare class LazyImg {
|
|
5
|
+
private observers;
|
|
6
|
+
private readonly defaultOptions;
|
|
7
|
+
private options;
|
|
8
|
+
private onImgLoadedCallback;
|
|
9
|
+
private onImgErrorCallback;
|
|
10
|
+
private hasImgLoaded;
|
|
11
|
+
constructor(opts?: VLazyImgOptions);
|
|
12
|
+
private loadErrorPhoto;
|
|
13
|
+
private buildOptions;
|
|
14
|
+
private removeClass;
|
|
15
|
+
private addClass;
|
|
16
|
+
private removeAllStateClasses;
|
|
17
|
+
private setBaseClass;
|
|
18
|
+
private imageIsLoading;
|
|
19
|
+
private imageIsLoaded;
|
|
20
|
+
private imageHasError;
|
|
21
|
+
private getSrc;
|
|
22
|
+
private getImageUrl;
|
|
23
|
+
private setPictureSourceUrls;
|
|
24
|
+
private hasBgImgMode;
|
|
25
|
+
private isPictureElement;
|
|
26
|
+
private getImgElement;
|
|
27
|
+
private setDefaultPhoto;
|
|
28
|
+
private addEventListenerToImg;
|
|
29
|
+
private loadImage;
|
|
30
|
+
setImgSrc(el: HTMLElement, src: string): void;
|
|
31
|
+
private handleIntersectionObserver;
|
|
32
|
+
private createObserver;
|
|
33
|
+
private imageHandler;
|
|
34
|
+
private bindUpdateHandler;
|
|
35
|
+
add(el: HTMLElement, binding: VLazyImgBinding): Promise<void>;
|
|
36
|
+
update(el: HTMLElement, binding: VLazyImgBinding): Promise<void>;
|
|
37
|
+
remove(el: HTMLElement, binding: VLazyImgBinding): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DirectiveBinding, ObjectDirective } from 'vue';
|
|
2
|
+
export interface ClassOptions {
|
|
3
|
+
baseClass: string;
|
|
4
|
+
loadingClass: string;
|
|
5
|
+
loadedClass: string;
|
|
6
|
+
errorClass: string;
|
|
7
|
+
fallbackClass: string;
|
|
8
|
+
observerOnce: boolean;
|
|
9
|
+
loadOnce: boolean;
|
|
10
|
+
observerOptions: {
|
|
11
|
+
root?: HTMLElement | null;
|
|
12
|
+
threshold: number;
|
|
13
|
+
rootMargin?: string;
|
|
14
|
+
};
|
|
15
|
+
fallbackSrc?: string | false;
|
|
16
|
+
onLoading?: (el: Element) => unknown;
|
|
17
|
+
onLoaded?: (el: Element) => unknown;
|
|
18
|
+
onError?: (el: Element) => unknown;
|
|
19
|
+
onIntersecting?: (el: Element) => unknown;
|
|
20
|
+
}
|
|
21
|
+
export type VLazyImgOptions = Partial<ClassOptions>;
|
|
22
|
+
interface VLazyImgBindingOptions extends VLazyImgOptions {
|
|
23
|
+
src?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type VLazyImgBindingValue = string | VLazyImgBindingOptions;
|
|
27
|
+
export type VLazyImgBinding = DirectiveBinding<VLazyImgBindingValue>;
|
|
28
|
+
export type VLazyImgDirective = ObjectDirective<HTMLElement, VLazyImgBinding>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { VLazyImgDirective } from './vLazyImg/lazy-img.directive';
|
|
3
|
+
import { VLazyImgOptions } from './vLazyImg/types';
|
|
4
|
+
declare const plugin: Plugin<[VLazyImgOptions?]>;
|
|
5
|
+
export { vLazyImg, type VLazyImgDirective } from './vLazyImg/lazy-img.directive';
|
|
6
|
+
export { plugin as vLazyImgInstall };
|
|
7
|
+
export type { VLazyImgBindingValue, VLazyImgOptions } from './vLazyImg/types';
|
|
8
|
+
declare module 'vue' {
|
|
9
|
+
interface GlobalDirectives {
|
|
10
|
+
vLazyImg: VLazyImgDirective;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DirectiveBinding, ObjectDirective, Plugin } from 'vue';
|
|
2
|
+
import { MazPopoverPosition, MazPopoverProps, MazPopoverTrigger } from '../components/MazPopover.vue';
|
|
3
|
+
interface VTooltipOptions extends Partial<Omit<MazPopoverProps, 'modelValue'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Text to display in the tooltip
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* HTML content (alternative to text)
|
|
10
|
+
*/
|
|
11
|
+
html?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Color variant of the tooltip
|
|
14
|
+
* @default contrast
|
|
15
|
+
*/
|
|
16
|
+
color?: MazPopoverProps['color'];
|
|
17
|
+
/**
|
|
18
|
+
* Position of the tooltip
|
|
19
|
+
* The preferred position is set to 'top' if no position is provided
|
|
20
|
+
* @default top
|
|
21
|
+
*/
|
|
22
|
+
position?: MazPopoverPosition;
|
|
23
|
+
/**
|
|
24
|
+
* Trigger of the tooltip
|
|
25
|
+
* @default hover
|
|
26
|
+
*/
|
|
27
|
+
trigger?: MazPopoverTrigger;
|
|
28
|
+
/**
|
|
29
|
+
* Close on click outside
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
closeOnClickOutside?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Close on escape
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
closeOnEscape?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Open the tooltip
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
open?: boolean;
|
|
43
|
+
}
|
|
44
|
+
type VTooltipBindingValue = string | VTooltipOptions;
|
|
45
|
+
export type TooltipBinding = DirectiveBinding<VTooltipBindingValue, NonNullable<MazPopoverProps['position']>>;
|
|
46
|
+
export type VTooltipDirective = ObjectDirective<HTMLElement, VTooltipBindingValue, NonNullable<MazPopoverProps['position']>>;
|
|
47
|
+
declare const directive: VTooltipDirective;
|
|
48
|
+
declare const plugin: Plugin<[Partial<VTooltipOptions>?]>;
|
|
49
|
+
export { directive as vTooltip, type VTooltipBindingValue, plugin as vTooltipInstall, type VTooltipOptions, };
|
|
50
|
+
declare module 'vue' {
|
|
51
|
+
interface GlobalDirectives {
|
|
52
|
+
vTooltip: VTooltipDirective;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style = "\n.maz-zoom-img {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 1rem;\n z-index: 1050;\n background-color: hsla(238, 15%, 40%, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n\n.maz-zoom-img,\n.maz-zoom-img * {\n box-sizing: border-box;\n}\n\n.maz-zoom-img .maz-zoom-img__wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 0;\n min-height: 0;\n max-width: 100%;\n max-height: 100%;\n transition: all 300ms ease-in-out;\n opacity: 0;\n transform: scale(0.5);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {\n opacity: 1;\n transform: scale(1);\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: hsla(238, 15%, 40%, 0.7);\n border-radius: 1rem;\n z-index: 2;\n min-width: 60px;\n min-height: 60px;\n}\n.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {\n display: none;\n}\n\n@-webkit-keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {\n animation: spin .6s linear infinite;\n}\n\n.maz-zoom-img img {\n max-width: 100%;\n max-height: 100%;\n min-width: 0;\n border-radius: 1rem;\n}\n\n.maz-zoom-img .maz-zoom-btn {\n margin: 0 auto;\n border: none;\n background-color: hsla(0, 0%, 7%, 0.5);\n box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);\n height: 2.2rem;\n min-height: 2.2rem;\n width: 2.2rem;\n min-width: 2.2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2.2rem;\n cursor: pointer;\n flex: 0 0 auto;\n outline: none;\n}\n\n.maz-zoom-img .maz-zoom-btn svg {\n fill: white;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {\n position: absolute;\n left: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {\n position: absolute;\n right: 0.5rem;\n z-index: 1;\n}\n\n.maz-zoom-img .maz-zoom-btn:hover {\n background-color: hsl(0, 0%, 0%);\n}";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObjectDirective } from 'vue';
|
|
2
|
+
import { VZoomImgBindingValue } from './zoom-img.handler';
|
|
3
|
+
export type VZoomImgDirective = ObjectDirective<HTMLElement, VZoomImgBindingValue>;
|
|
4
|
+
export declare const vZoomImg: {
|
|
5
|
+
created(el: HTMLElement, binding: import('vue').DirectiveBinding<VZoomImgBindingValue, string, any>): void;
|
|
6
|
+
updated(_el: HTMLElement, binding: import('vue').DirectiveBinding<VZoomImgBindingValue, string, any>): void;
|
|
7
|
+
unmounted(el: HTMLElement): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DirectiveBinding } from 'vue';
|
|
2
|
+
export interface VZoomImgOptions {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
scale?: boolean;
|
|
5
|
+
blur?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface VZoomImgBindingOptions extends VZoomImgOptions {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
}
|
|
11
|
+
export type VZoomImgBindingValue = string | VZoomImgBindingOptions;
|
|
12
|
+
export type VZoomImgBinding = DirectiveBinding<VZoomImgBindingValue>;
|
|
13
|
+
export declare class ZoomImgHandler {
|
|
14
|
+
private options;
|
|
15
|
+
private loader;
|
|
16
|
+
private wrapper;
|
|
17
|
+
private img;
|
|
18
|
+
private keydownHandler;
|
|
19
|
+
private onImgLoadedCallback;
|
|
20
|
+
private buttonsAdded;
|
|
21
|
+
private defaultOptions;
|
|
22
|
+
private mouseEnterListener;
|
|
23
|
+
private mouseLeaveListener;
|
|
24
|
+
private renderPreviewListener;
|
|
25
|
+
constructor(binding: VZoomImgBinding);
|
|
26
|
+
private buildOptions;
|
|
27
|
+
get allInstances(): HTMLElement[];
|
|
28
|
+
create(el: HTMLElement): void;
|
|
29
|
+
update(binding: VZoomImgBinding): void;
|
|
30
|
+
remove(el: HTMLElement): void;
|
|
31
|
+
private renderPreview;
|
|
32
|
+
private onImgLoaded;
|
|
33
|
+
private getLoader;
|
|
34
|
+
private mouseLeave;
|
|
35
|
+
private mouseEnter;
|
|
36
|
+
private keydownLister;
|
|
37
|
+
private getButton;
|
|
38
|
+
private closePreview;
|
|
39
|
+
private getNewInstanceIndex;
|
|
40
|
+
private nextPreviousImage;
|
|
41
|
+
private useNextInstance;
|
|
42
|
+
private addStyle;
|
|
43
|
+
private keyboardEventHandler;
|
|
44
|
+
private imgEventHandler;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { VZoomImgDirective, vZoomImg } from './vZoomImg/zoom-img.directive';
|
|
3
|
+
declare const plugin: Plugin;
|
|
4
|
+
export { vZoomImg, type VZoomImgDirective, plugin as vZoomImgInstall };
|
|
5
|
+
export type { VZoomImgBindingValue } from './vZoomImg/zoom-img.handler';
|
|
6
|
+
declare module 'vue' {
|
|
7
|
+
interface GlobalDirectives {
|
|
8
|
+
vZoomImg: VZoomImgDirective;
|
|
9
|
+
}
|
|
10
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@maz-ui/utils';
|