@mantine-vue/modals 3.0.0 → 3.1.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/lib/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- export { ModalsProvider } from './ModalsProvider';
1
+ export { ModalsProvider } from './components/ModalsProvider';
2
2
  export { useModals } from './use-modals';
3
- export { ConfirmModal } from './ConfirmModal';
3
+ export { ConfirmModal } from './components/ConfirmModal';
4
4
  export { modals, openModal, closeModal, closeAllModals, openConfirmModal, openContextModal, updateModal, updateContextModal, createModalsStore, modalsStore, useModalsState, openModalAction, openConfirmModalAction, openContextModalAction, closeModalAction, closeAllModalsAction, updateModalAction, updateContextModalAction, } from './modals.store';
5
5
  export { modalsReducer, handleCloseModal } from './reducer';
6
- export type { ModalsProviderProps } from './ModalsProvider';
7
- export type { ConfirmModalProps } from './ConfirmModal';
6
+ export type { ModalsProviderProps } from './components/ModalsProvider';
7
+ export type { ConfirmModalCallbacks, ConfirmModalEmits, ConfirmModalProps, } from './components/ConfirmModal';
8
8
  export type { ModalsStore } from './modals.store';
9
9
  export type { ModalsState, ModalsAction } from './reducer';
10
10
  export type { ContextModalProps, ModalSettings, ModalState, ModalsContextProps, OpenConfirmModal, OpenContextModal, ConfirmLabels, } from './context';
package/lib/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { ModalsProvider } from './ModalsProvider';
1
+ export { ModalsProvider } from './components/ModalsProvider';
2
2
  export { useModals } from './use-modals';
3
- export { ConfirmModal } from './ConfirmModal';
3
+ export { ConfirmModal } from './components/ConfirmModal';
4
4
  export { modals, openModal, closeModal, closeAllModals, openConfirmModal, openContextModal, updateModal, updateContextModal, createModalsStore, modalsStore, useModalsState, openModalAction, openConfirmModalAction, openContextModalAction, closeModalAction, closeAllModalsAction, updateModalAction, updateContextModalAction, } from './modals.store';
5
5
  export { modalsReducer, handleCloseModal } from './reducer';
6
- export type { ModalsProviderProps } from './ModalsProvider';
7
- export type { ConfirmModalProps } from './ConfirmModal';
6
+ export type { ModalsProviderProps } from './components/ModalsProvider';
7
+ export type { ConfirmModalCallbacks, ConfirmModalEmits, ConfirmModalProps, } from './components/ConfirmModal';
8
8
  export type { ModalsStore } from './modals.store';
9
9
  export type { ModalsState, ModalsAction } from './reducer';
10
10
  export type { ContextModalProps, ModalSettings, ModalState, ModalsContextProps, OpenConfirmModal, OpenContextModal, ConfirmLabels, } from './context';
@@ -18,16 +18,23 @@ export declare function updateContextModalAction(payload: {
18
18
  modalId: string;
19
19
  } & Partial<OpenContextModal<any>>, store?: ModalsStore): void;
20
20
  export declare const modals: {
21
+ /** Opens a regular modal and returns its id. */
21
22
  readonly open: (props: ModalSettings) => string;
23
+ /** Closes the modal with the given id. */
22
24
  readonly close: (id: string) => void;
25
+ /** Closes all opened modals. */
23
26
  readonly closeAll: () => void;
27
+ /** Opens a confirm modal and returns its id. */
24
28
  readonly openConfirmModal: (props: OpenConfirmModal) => string;
29
+ /** Opens a predefined context modal and returns its id. */
25
30
  readonly openContextModal: (payload: OpenContextModal & {
26
31
  modal: string;
27
32
  }) => string;
33
+ /** Dynamically updates the content and properties of a regular or confirm modal. */
28
34
  readonly updateModal: (payload: {
29
35
  modalId: string;
30
36
  } & Partial<OpenConfirmModal>) => void;
37
+ /** Dynamically updates the content and properties of a context modal. */
31
38
  readonly updateContextModal: (payload: {
32
39
  modalId: string;
33
40
  } & Partial<OpenContextModal<any>>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/modals",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Vue modals management system equivalent to @mantine/modals",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -35,8 +35,8 @@
35
35
  "vue": "^3.5.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@mantine-vue/core": "3.0.0",
39
- "@mantine-vue/store": "3.0.0",
38
+ "@mantine-vue/core": "3.1.0",
39
+ "@mantine-vue/store": "3.1.0",
40
40
  "vue": "^3.5.0"
41
41
  }
42
42
  }
@@ -1,106 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { ConfirmLabels } from './context';
3
- export interface ConfirmModalProps {
4
- id?: string;
5
- onCancel?: () => void;
6
- onConfirm?: () => void;
7
- closeOnConfirm?: boolean;
8
- closeOnCancel?: boolean;
9
- cancelProps?: Record<string, any>;
10
- confirmProps?: Record<string, any>;
11
- groupProps?: Record<string, any>;
12
- labels?: ConfirmLabels;
13
- }
14
- export declare const ConfirmModal: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
- id: {
16
- type: StringConstructor;
17
- default: undefined;
18
- };
19
- onCancel: {
20
- type: PropType<() => void>;
21
- default: undefined;
22
- };
23
- onConfirm: {
24
- type: PropType<() => void>;
25
- default: undefined;
26
- };
27
- closeOnConfirm: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- closeOnCancel: {
32
- type: BooleanConstructor;
33
- default: boolean;
34
- };
35
- cancelProps: {
36
- type: PropType<Record<string, any>>;
37
- default: undefined;
38
- };
39
- confirmProps: {
40
- type: PropType<Record<string, any>>;
41
- default: undefined;
42
- };
43
- groupProps: {
44
- type: PropType<Record<string, any>>;
45
- default: undefined;
46
- };
47
- labels: {
48
- type: PropType<ConfirmLabels>;
49
- default: () => {
50
- cancel: string;
51
- confirm: string;
52
- };
53
- };
54
- }>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
55
- [key: string]: any;
56
- }> | null)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
- id: {
58
- type: StringConstructor;
59
- default: undefined;
60
- };
61
- onCancel: {
62
- type: PropType<() => void>;
63
- default: undefined;
64
- };
65
- onConfirm: {
66
- type: PropType<() => void>;
67
- default: undefined;
68
- };
69
- closeOnConfirm: {
70
- type: BooleanConstructor;
71
- default: boolean;
72
- };
73
- closeOnCancel: {
74
- type: BooleanConstructor;
75
- default: boolean;
76
- };
77
- cancelProps: {
78
- type: PropType<Record<string, any>>;
79
- default: undefined;
80
- };
81
- confirmProps: {
82
- type: PropType<Record<string, any>>;
83
- default: undefined;
84
- };
85
- groupProps: {
86
- type: PropType<Record<string, any>>;
87
- default: undefined;
88
- };
89
- labels: {
90
- type: PropType<ConfirmLabels>;
91
- default: () => {
92
- cancel: string;
93
- confirm: string;
94
- };
95
- };
96
- }>> & Readonly<{}>, {
97
- onCancel: () => void;
98
- id: string;
99
- labels: ConfirmLabels;
100
- onConfirm: () => void;
101
- closeOnConfirm: boolean;
102
- closeOnCancel: boolean;
103
- cancelProps: Record<string, any>;
104
- confirmProps: Record<string, any>;
105
- groupProps: Record<string, any>;
106
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,42 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import { type ConfirmLabels, type ModalSettings } from './context';
3
- export interface ModalsProviderProps {
4
- modals?: Record<string, any>;
5
- modalProps?: ModalSettings;
6
- labels?: ConfirmLabels;
7
- }
8
- export declare const ModalsProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
- modals: {
10
- type: PropType<Record<string, any>>;
11
- default: undefined;
12
- };
13
- modalProps: {
14
- type: PropType<ModalSettings>;
15
- default: undefined;
16
- };
17
- labels: {
18
- type: PropType<ConfirmLabels>;
19
- default: undefined;
20
- };
21
- }>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
- [key: string]: any;
23
- }> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
- [key: string]: any;
25
- }>[] | undefined)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
- modals: {
27
- type: PropType<Record<string, any>>;
28
- default: undefined;
29
- };
30
- modalProps: {
31
- type: PropType<ModalSettings>;
32
- default: undefined;
33
- };
34
- labels: {
35
- type: PropType<ConfirmLabels>;
36
- default: undefined;
37
- };
38
- }>> & Readonly<{}>, {
39
- labels: ConfirmLabels;
40
- modalProps: ModalSettings;
41
- modals: Record<string, any>;
42
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;