maz-ui 3.35.2 → 3.36.0

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/modules/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-BvpGBt8_.cjs");exports.AosHandler=e.AosHandler;exports.IdleTimeout=e.IdleTimeout;exports.ScriptLoader=e.ScriptLoader;exports.Swipe=e.Swipe;exports.ToasterHandler=e.ToasterHandler;exports.UserVisibility=e.UserVisibility;exports.WaitHandler=e.WaitHandler;Object.defineProperty(exports,"aosInstance",{enumerable:!0,get:()=>e.instance$1});exports.capitalize=e.capitalize;exports.countryCodeToUnicodeFlag=e.countryCodeToUnicodeFlag;exports.currency=e.currency;exports.date=e.date;exports.debounce=e.debounce;exports.injectStrict=e.injectStrict;exports.installAos=e.plugin$5;exports.installDirectives=e.installDirectives;exports.installFilters=e.installFilters;exports.installToaster=e.installToaster;exports.installWait=e.plugin$4;exports.isClient=e.isClient;exports.mount=e.mount;exports.number=e.number;exports.sleep=e.sleep;exports.throttle=e.throttle;Object.defineProperty(exports,"toastInstance",{enumerable:!0,get:()=>e.toastInstance});exports.truthyFilter=e.truthyFilter;exports.useAos=e.useAos;exports.useBreakpoints=e.useBreakpoints;exports.useIdleTimeout=e.useIdleTimeout;exports.useInstanceUniqId=e.useInstanceUniqId;exports.useReadingTime=e.useReadingTime;exports.useSwipe=e.useSwipe;exports.useThemeHandler=e.useThemeHandler;exports.useTimer=e.useTimer;exports.useToast=e.useToast;exports.useUserVisibility=e.useUserVisibility;exports.useWait=e.useWait;exports.useWindowSize=e.useWindowSize;exports.vClickOutside=e.directive;exports.vClickOutsideInstall=e.plugin;exports.vClosable=e.directive$1;exports.vClosableInstall=e.plugin$3;exports.vFullscreenImg=e.vFullscreenImg;exports.vFullscreenImgInstall=e.vFullscreenImgInstall;exports.vLazyImg=e.vLazyImg;exports.vLazyImgInstall=e.plugin$1;exports.vZoomImg=e.vZoomImg;exports.vZoomImgInstall=e.plugin$2;exports.waitInstance=e.instance;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CDU35ONK.cjs");exports.AosHandler=e.AosHandler;exports.IdleTimeout=e.IdleTimeout;exports.ScriptLoader=e.ScriptLoader;exports.Swipe=e.Swipe;exports.ToasterHandler=e.ToasterHandler;exports.UserVisibility=e.UserVisibility;exports.WaitHandler=e.WaitHandler;Object.defineProperty(exports,"aosInstance",{enumerable:!0,get:()=>e.instance$1});exports.capitalize=e.capitalize;exports.countryCodeToUnicodeFlag=e.countryCodeToUnicodeFlag;exports.currency=e.currency;exports.date=e.date;exports.debounce=e.debounce;exports.injectStrict=e.injectStrict;exports.installAos=e.plugin$5;exports.installDirectives=e.installDirectives;exports.installFilters=e.installFilters;exports.installToaster=e.installToaster;exports.installWait=e.plugin$4;exports.isClient=e.isClient;exports.mount=e.mount;exports.number=e.number;exports.sleep=e.sleep;exports.throttle=e.throttle;Object.defineProperty(exports,"toastInstance",{enumerable:!0,get:()=>e.toastInstance});exports.truthyFilter=e.truthyFilter;exports.useAos=e.useAos;exports.useBreakpoints=e.useBreakpoints;exports.useIdleTimeout=e.useIdleTimeout;exports.useInstanceUniqId=e.useInstanceUniqId;exports.useReadingTime=e.useReadingTime;exports.useSwipe=e.useSwipe;exports.useThemeHandler=e.useThemeHandler;exports.useTimer=e.useTimer;exports.useToast=e.useToast;exports.useUserVisibility=e.useUserVisibility;exports.useWait=e.useWait;exports.useWindowSize=e.useWindowSize;exports.vClickOutside=e.directive;exports.vClickOutsideInstall=e.plugin;exports.vClosable=e.directive$1;exports.vClosableInstall=e.plugin$3;exports.vFullscreenImg=e.vFullscreenImg;exports.vFullscreenImgInstall=e.vFullscreenImgInstall;exports.vLazyImg=e.vLazyImg;exports.vLazyImgInstall=e.plugin$1;exports.vZoomImg=e.vZoomImg;exports.vZoomImgInstall=e.plugin$2;exports.waitInstance=e.instance;
package/modules/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { D as e, I as t, S as l, b as i, T as n, U as o, W as r, F as u, u as c, c as I, w as d, x as m, d as v, i as T, E as g, f as p, r as y, z as b, B as C, a as F, m as S, y as w, s as z, e as H, A as U, t as W, J as h, P as k, M as A, H as L, V as O, R as V, G as f, O as j, L as q, N as x, K as B, Q as D, g as R, p as Z, o as E, q as G, l as J, n as K, v as M, h as N, j as P, k as Q, C as X } from "./chunks/index-Cd939Pzv.mjs";
1
+ import { D as e, I as t, S as l, b as i, T as n, U as o, W as r, F as u, u as c, c as I, w as d, x as m, d as v, i as T, E as g, f as p, r as y, z as b, B as C, a as F, m as S, y as w, s as z, e as H, A as U, t as W, J as h, P as k, M as A, H as L, V as O, R as V, G as f, O as j, L as q, N as x, K as B, Q as D, g as R, p as Z, o as E, q as G, l as J, n as K, v as M, h as N, j as P, k as Q, C as X } from "./chunks/index-DKgMLGti.mjs";
2
2
  export {
3
3
  e as AosHandler,
4
4
  t as IdleTimeout,
package/nuxt/index.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "3.35.2"
7
+ "version": "3.36.0"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maz-ui",
3
- "version": "3.35.2",
3
+ "version": "3.36.0",
4
4
  "description": "A standalone components library for Vue.Js 3 & Nuxt.Js 3",
5
5
  "author": "Louis Mazel <me@loicmazuel.com>",
6
6
  "main": "./modules/index.cjs",
@@ -1,11 +1,23 @@
1
1
  export interface TimerOptions {
2
- timeout: number;
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
+ */
3
11
  callback?: () => unknown;
12
+ /**
13
+ * The interval to update the remaining time
14
+ * @default 200
15
+ */
4
16
  remainingTimeUpdate?: number;
5
17
  }
6
18
  export declare const useTimer: ({ timeout, callback, remainingTimeUpdate }: TimerOptions) => {
7
19
  remainingTime: import("vue").Ref<number>;
8
- start: () => void;
20
+ start: (timeout?: number) => void;
9
21
  pause: () => void;
10
22
  resume: () => void;
11
23
  stop: () => void;
@@ -1,5 +1,5 @@
1
1
  import { type App, type Component } from 'vue';
2
- export declare function mount(component: Component, options?: {
2
+ export declare function mount<T extends Component>(component: T, options?: {
3
3
  props?: Record<string, unknown>;
4
4
  children?: unknown;
5
5
  app?: App;
@@ -1,104 +1,68 @@
1
- import { type PropType } from 'vue';
1
+ import type { LocalToasterOptions } from './toaster-handler';
2
2
  import type { ToasterPosition, ToasterAction, ToasterLink } from './types';
3
- declare const _default: import("vue").DefineComponent<{
4
- position: {
5
- type: PropType<ToasterPosition>;
6
- default: string;
7
- };
8
- maxToasts: {
9
- type: (BooleanConstructor | NumberConstructor)[];
10
- default: boolean;
11
- };
12
- timeout: {
13
- type: NumberConstructor;
14
- default: number;
15
- };
16
- queue: {
17
- type: BooleanConstructor;
18
- default: boolean;
19
- };
20
- noPauseOnHover: {
21
- type: BooleanConstructor;
22
- default: boolean;
23
- };
24
- type: {
25
- type: PropType<"success" | "info" | "warning" | "danger" | "theme">;
26
- default: string;
27
- };
28
- message: {
29
- type: StringConstructor;
30
- required: true;
31
- };
32
- link: {
33
- type: PropType<ToasterLink>;
34
- default: undefined;
35
- };
36
- action: {
37
- type: PropType<ToasterAction>;
38
- default: undefined;
39
- };
40
- persistent: {
41
- type: BooleanConstructor;
42
- default: boolean;
43
- };
44
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ export type Props = {
4
+ message: string;
5
+ position?: ToasterPosition;
6
+ maxToasts?: number | boolean;
7
+ timeout?: number | boolean;
8
+ queue?: boolean;
9
+ noPauseOnHover?: boolean;
10
+ type?: LocalToasterOptions['type'];
11
+ link?: ToasterLink;
12
+ action?: ToasterAction;
13
+ persistent?: boolean;
14
+ };
15
+ declare function close(): void;
16
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
17
+ position: string;
18
+ maxToasts: boolean;
19
+ timeout: number;
20
+ type: string;
21
+ message: undefined;
22
+ link: undefined;
23
+ action: undefined;
24
+ }>, {
25
+ close: typeof close;
26
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
27
  click: (...args: any[]) => void;
46
28
  close: (...args: any[]) => void;
47
29
  open: (...args: any[]) => void;
48
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
49
- position: {
50
- type: PropType<ToasterPosition>;
51
- default: string;
52
- };
53
- maxToasts: {
54
- type: (BooleanConstructor | NumberConstructor)[];
55
- default: boolean;
56
- };
57
- timeout: {
58
- type: NumberConstructor;
59
- default: number;
60
- };
61
- queue: {
62
- type: BooleanConstructor;
63
- default: boolean;
64
- };
65
- noPauseOnHover: {
66
- type: BooleanConstructor;
67
- default: boolean;
68
- };
69
- type: {
70
- type: PropType<"success" | "info" | "warning" | "danger" | "theme">;
71
- default: string;
72
- };
73
- message: {
74
- type: StringConstructor;
75
- required: true;
76
- };
77
- link: {
78
- type: PropType<ToasterLink>;
79
- default: undefined;
80
- };
81
- action: {
82
- type: PropType<ToasterAction>;
83
- default: undefined;
84
- };
85
- persistent: {
86
- type: BooleanConstructor;
87
- default: boolean;
88
- };
89
- }>> & {
30
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
31
+ position: string;
32
+ maxToasts: boolean;
33
+ timeout: number;
34
+ type: string;
35
+ message: undefined;
36
+ link: undefined;
37
+ action: undefined;
38
+ }>>> & {
90
39
  onClose?: ((...args: any[]) => any) | undefined;
91
40
  onClick?: ((...args: any[]) => any) | undefined;
92
41
  onOpen?: ((...args: any[]) => any) | undefined;
93
42
  }, {
94
43
  link: ToasterLink;
95
- timeout: number;
44
+ timeout: number | boolean;
96
45
  type: "success" | "info" | "warning" | "danger" | "theme";
46
+ message: string;
97
47
  position: ToasterPosition;
98
- persistent: boolean;
99
- action: ToasterAction;
100
48
  maxToasts: number | boolean;
101
- queue: boolean;
102
- noPauseOnHover: boolean;
49
+ action: ToasterAction;
103
50
  }, {}>;
104
51
  export default _default;
52
+ type __VLS_WithDefaults<P, D> = {
53
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
54
+ default: D[K];
55
+ }> : P[K];
56
+ };
57
+ type __VLS_Prettify<T> = {
58
+ [K in keyof T]: T[K];
59
+ } & {};
60
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
61
+ type __VLS_TypePropsToOption<T> = {
62
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
63
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
64
+ } : {
65
+ type: import('vue').PropType<T[K]>;
66
+ required: true;
67
+ };
68
+ };
@@ -9,9 +9,24 @@ export declare class ToasterHandler {
9
9
  constructor(app: App, globalOptions?: ToasterOptions | undefined);
10
10
  private show;
11
11
  private getLocalOptions;
12
- message(message: string, options?: ToasterOptions): void;
13
- success(message: string, options?: ToasterOptions): void;
14
- error(message: string, options?: ToasterOptions): void;
15
- info(message: string, options?: ToasterOptions): void;
16
- warning(message: string, options?: ToasterOptions): void;
12
+ message(message: string, options?: ToasterOptions): {
13
+ destroy: () => void;
14
+ close: () => any;
15
+ };
16
+ success(message: string, options?: ToasterOptions): {
17
+ destroy: () => void;
18
+ close: () => any;
19
+ };
20
+ error(message: string, options?: ToasterOptions): {
21
+ destroy: () => void;
22
+ close: () => any;
23
+ };
24
+ info(message: string, options?: ToasterOptions): {
25
+ destroy: () => void;
26
+ close: () => any;
27
+ };
28
+ warning(message: string, options?: ToasterOptions): {
29
+ destroy: () => void;
30
+ close: () => any;
31
+ };
17
32
  }
@@ -1,12 +1,5 @@
1
1
  export type ToasterPosition = 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left';
2
2
  export type ToasterPositions = ToasterPosition;
3
- export type ToasterOptions = {
4
- position?: ToasterPosition;
5
- timeout?: number;
6
- persistent?: boolean;
7
- action?: ToasterAction;
8
- link?: ToasterLink;
9
- };
10
3
  export type ToasterLink = {
11
4
  href: string;
12
5
  text?: string;
@@ -19,3 +12,40 @@ export type ToasterAction = {
19
12
  text: string;
20
13
  closeToast?: boolean;
21
14
  };
15
+ export type ToasterOptions = {
16
+ /**
17
+ * The position of the toast on the screen
18
+ * @default 'bottom-right'
19
+ */
20
+ position?: ToasterPosition;
21
+ /**
22
+ * The timeout is in ms, it's the time before the toast is automatically closed
23
+ * if set to `false`, the toast will not be closed automatically
24
+ * @default 10000
25
+ */
26
+ timeout?: number | boolean;
27
+ /**
28
+ * If the toast is persistent, it can't be closed by user interaction (only on timeout or programmatically)
29
+ * @default false
30
+ */
31
+ persistent?: boolean;
32
+ /**
33
+ * The link will be displayed as a button in the toast
34
+ * @default undefined
35
+ */
36
+ link?: {
37
+ href: string;
38
+ text?: string;
39
+ target?: string;
40
+ closeToast?: boolean;
41
+ };
42
+ /**
43
+ * The action will be displayed as a button in the toast
44
+ * @default undefined
45
+ */
46
+ action?: {
47
+ func: (..._arguments: unknown[]) => unknown;
48
+ text: string;
49
+ closeToast?: boolean;
50
+ };
51
+ };