maz-ui 3.35.2 → 3.36.1

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.
Files changed (35) hide show
  1. package/components/MazDialog.mjs +1 -1
  2. package/components/MazDialogPromise.mjs +1 -1
  3. package/components/MazPagination.d.ts +4 -3
  4. package/components/MazPagination.mjs +1 -1
  5. package/components/assets/MazDialog.css +1 -1
  6. package/components/assets/MazDialogPromise.css +1 -1
  7. package/components/assets/MazPagination.css +1 -1
  8. package/components/assets/MazTabsBar.css +1 -1
  9. package/components/chunks/{MazBtn-CEuoZU_j.mjs → MazBtn-DE96LeuR.mjs} +2 -2
  10. package/components/chunks/{MazBtn-pY3gOUjM.mjs → MazBtn-kLavxmjX.mjs} +2 -2
  11. package/components/chunks/{MazDialog-DtQm-sV0.mjs → MazDialog-CW8YIBc1.mjs} +2 -2
  12. package/components/chunks/{MazDialogPromise-CWl8N4Af.mjs → MazDialogPromise-Cd5B1cpr.mjs} +3 -3
  13. package/components/chunks/{MazPagination-Ch7JcLI8.mjs → MazPagination-BOia4I5Z.mjs} +2 -2
  14. package/components/chunks/{MazSpinner-CB4XzJJF.mjs → MazSpinner-Bxelx5NH.mjs} +1 -1
  15. package/components/chunks/{MazSpinner-Dty6fcnV.mjs → MazSpinner-CJw_tVej.mjs} +1 -1
  16. package/components/chunks/{MazSpinner-CRYzqbIv.mjs → MazSpinner-DaehD0ZC.mjs} +1 -1
  17. package/modules/assets/index.css +1 -1
  18. package/modules/chunks/{MazBtn-C7UJhdwD.mjs → MazBtn-BQCYLwIS.mjs} +2 -2
  19. package/modules/chunks/{MazBtn-CAqBCvkl.cjs → MazBtn-DeZaei8J.cjs} +1 -1
  20. package/modules/chunks/{MazIcon-D67r-mVk.cjs → MazIcon-20EEWOoS.cjs} +1 -1
  21. package/modules/chunks/{MazIcon-Do-AT_Gw.mjs → MazIcon-aceUoSZ8.mjs} +1 -1
  22. package/modules/chunks/{MazSpinner-BGhcM5_9.mjs → MazSpinner-XnoDFuH-.mjs} +1 -1
  23. package/modules/chunks/{MazSpinner-BwqMyVx2.cjs → MazSpinner-Zd3I5gif.cjs} +1 -1
  24. package/modules/chunks/{index-BvpGBt8_.cjs → index-CDU35ONK.cjs} +2 -2
  25. package/modules/chunks/{index-Cd939Pzv.mjs → index-DKgMLGti.mjs} +415 -406
  26. package/modules/index.cjs +1 -1
  27. package/modules/index.mjs +1 -1
  28. package/nuxt/index.json +1 -1
  29. package/package.json +9 -9
  30. package/types/components/MazPagination.vue.d.ts +4 -3
  31. package/types/modules/composables/use-timer.d.ts +14 -2
  32. package/types/modules/helpers/mount-component.d.ts +1 -1
  33. package/types/modules/plugins/toaster/MazToast.vue.d.ts +54 -90
  34. package/types/modules/plugins/toaster/toaster-handler.d.ts +20 -5
  35. package/types/modules/plugins/toaster/types.d.ts +37 -7
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.1"
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.1",
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",
@@ -104,16 +104,16 @@
104
104
  "@babel/core": "^7.24.0",
105
105
  "@babel/preset-env": "^7.24.0",
106
106
  "@babel/preset-typescript": "^7.23.3",
107
- "@nuxt/kit": "^3.10.3",
108
- "@nuxt/schema": "^3.10.3",
107
+ "@nuxt/kit": "^3.11.0",
108
+ "@nuxt/schema": "^3.11.0",
109
109
  "@types/dropzone": "^5.7.8",
110
110
  "@types/google.maps": "^3.55.4",
111
111
  "@vitejs/plugin-vue": "^5.0.4",
112
- "@vitest/coverage-v8": "^1.3.1",
112
+ "@vitest/coverage-v8": "^1.4.0",
113
113
  "@vue/compiler-sfc": "^3.4.21",
114
114
  "@vue/eslint-config-prettier": "^9.0.0",
115
115
  "@vue/eslint-config-typescript": "^13.0.0",
116
- "@vue/test-utils": "^2.4.4",
116
+ "@vue/test-utils": "^2.4.5",
117
117
  "@vue/tsconfig": "^0.5.1",
118
118
  "autoprefixer": "^10.4.18",
119
119
  "c8": "^9.1.0",
@@ -129,10 +129,10 @@
129
129
  "json-templater": "^1.2.0",
130
130
  "libphonenumber-js": "^1.10.58",
131
131
  "minimist": "^1.2.8",
132
- "nuxt": "^3.10.3",
132
+ "nuxt": "^3.11.0",
133
133
  "onchange": "^7.1.0",
134
134
  "path": "^0.12.7",
135
- "postcss": "^8.4.35",
135
+ "postcss": "^8.4.36",
136
136
  "postcss-html": "^1.6.0",
137
137
  "postcss-import": "^16.0.1",
138
138
  "postcss-nested": "^6.0.0",
@@ -141,7 +141,7 @@
141
141
  "prettier-plugin-tailwindcss": "^0.5.12",
142
142
  "replace-in-file": "^7.1.0",
143
143
  "rimraf": "^5.0.5",
144
- "sass": "^1.71.1",
144
+ "sass": "^1.72.0",
145
145
  "semver": "^7.6.0",
146
146
  "sirv": "^2.0.4",
147
147
  "stylelint": "^16.2.1",
@@ -156,7 +156,7 @@
156
156
  "vite-plugin-lib-inject-css": "^2.0.0",
157
157
  "vite-plugin-static-copy": "^1.0.1",
158
158
  "vite-svg-loader": "^5.1.0",
159
- "vitest": "^1.3.1",
159
+ "vitest": "^1.4.0",
160
160
  "vitest-canvas-mock": "^0.3.3",
161
161
  "vue": "^3.4.21",
162
162
  "vue-chartjs": "^5.3.0",
@@ -1,5 +1,5 @@
1
1
  import { type Color, type Size, type Props as MazBtnProps } from './MazBtn.vue';
2
- export type Props = {
2
+ type MazPagnationProps = {
3
3
  /** @model The current page number. */
4
4
  modelValue?: number;
5
5
  /**
@@ -31,7 +31,8 @@ export type Props = {
31
31
  */
32
32
  loading?: boolean;
33
33
  };
34
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
34
+ export type { MazPagnationProps as Props };
35
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MazPagnationProps>, {
35
36
  modelValue: number;
36
37
  buttonProps: undefined;
37
38
  pageRange: number;
@@ -40,7 +41,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
40
41
  size: string;
41
42
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
42
43
  "update:model-value": (value: number) => void;
43
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
44
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MazPagnationProps>, {
44
45
  modelValue: number;
45
46
  buttonProps: undefined;
46
47
  pageRange: number;
@@ -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
+ };