@mantine/modals 7.1.3 → 7.1.5
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/cjs/ConfirmModal.js.map +1 -1
- package/cjs/events.js.map +1 -1
- package/esm/ConfirmModal.mjs.map +1 -1
- package/esm/events.mjs.map +1 -1
- package/lib/ConfirmModal.d.ts +2 -2
- package/lib/ConfirmModal.d.ts.map +1 -1
- package/lib/events.d.ts +7 -7
- package/lib/events.d.ts.map +1 -1
- package/package.json +3 -3
package/cjs/ConfirmModal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmModal.js","sources":["../src/ConfirmModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Group, Box, ButtonProps, GroupProps } from '@mantine/core';\nimport { ConfirmLabels } from './context';\nimport { useModals } from './use-modals/use-modals';\n\nexport interface ConfirmModalProps {\n id?: string;\n children?: React.ReactNode;\n onCancel
|
|
1
|
+
{"version":3,"file":"ConfirmModal.js","sources":["../src/ConfirmModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Group, Box, ButtonProps, GroupProps } from '@mantine/core';\nimport { ConfirmLabels } from './context';\nimport { useModals } from './use-modals/use-modals';\n\nexport interface ConfirmModalProps {\n id?: string;\n children?: React.ReactNode;\n onCancel?: () => void;\n onConfirm?: () => void;\n closeOnConfirm?: boolean;\n closeOnCancel?: boolean;\n cancelProps?: ButtonProps & React.ComponentPropsWithoutRef<'button'>;\n confirmProps?: ButtonProps & React.ComponentPropsWithoutRef<'button'>;\n groupProps?: GroupProps;\n labels?: ConfirmLabels;\n}\n\nexport function ConfirmModal({\n id,\n cancelProps,\n confirmProps,\n labels = { cancel: '', confirm: '' },\n closeOnConfirm = true,\n closeOnCancel = true,\n groupProps,\n onCancel,\n onConfirm,\n children,\n}: ConfirmModalProps) {\n const { cancel: cancelLabel, confirm: confirmLabel } = labels;\n const ctx = useModals();\n\n const handleCancel = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof cancelProps?.onClick === 'function' && cancelProps?.onClick(event);\n typeof onCancel === 'function' && onCancel();\n closeOnCancel && ctx.closeModal(id!);\n };\n\n const handleConfirm = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof confirmProps?.onClick === 'function' && confirmProps?.onClick(event);\n typeof onConfirm === 'function' && onConfirm();\n closeOnConfirm && ctx.closeModal(id!);\n };\n\n return (\n <>\n {children && <Box mb=\"md\">{children}</Box>}\n\n <Group justify=\"flex-end\" {...groupProps}>\n <Button variant=\"default\" {...cancelProps} onClick={handleCancel}>\n {cancelProps?.children || cancelLabel}\n </Button>\n\n <Button {...confirmProps} onClick={handleConfirm}>\n {confirmProps?.children || confirmLabel}\n </Button>\n </Group>\n </>\n );\n}\n"],"names":["useModals","React","Box","Group","Button"],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAA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,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC;AACvoB;;"}
|
package/cjs/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@mantine/core';\nimport {\n MantineModal,\n MantineModals,\n ModalSettings,\n OpenConfirmModal,\n OpenContextModal,\n} from './context';\n\ntype ModalsEvents = {\n openModal(payload: ModalSettings)
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@mantine/core';\nimport {\n MantineModal,\n MantineModals,\n ModalSettings,\n OpenConfirmModal,\n OpenContextModal,\n} from './context';\n\ntype ModalsEvents = {\n openModal: (payload: ModalSettings) => void;\n closeModal: (id: string) => void;\n closeContextModal: <TKey extends MantineModal>(id: TKey) => void;\n closeAllModals: () => void;\n openConfirmModal: (payload: OpenConfirmModal) => void;\n openContextModal: <TKey extends MantineModal>(\n payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { modal: TKey }\n ) => void;\n};\n\nexport const [useModalsEvents, createEvent] =\n createUseExternalEvents<ModalsEvents>('mantine-modals');\n\nexport const openModal = createEvent('openModal');\nexport const closeModal = createEvent('closeModal');\nexport const closeContextModal: ModalsEvents['closeContextModal'] = <TKey extends MantineModal>(\n id: TKey\n) => createEvent('closeContextModal')(id);\nexport const closeAllModals = createEvent('closeAllModals');\nexport const openConfirmModal = createEvent('openConfirmModal');\nexport const openContextModal: ModalsEvents['openContextModal'] = <TKey extends MantineModal>(\n payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { modal: TKey }\n) => createEvent('openContextModal')(payload);\n\nexport const modals = {\n open: openModal,\n close: closeModal,\n closeAll: closeAllModals,\n openConfirmModal,\n openContextModal,\n};\n"],"names":["createUseExternalEvents"],"mappings":";;;;;;;AACY,MAAC,CAAC,eAAe,EAAE,WAAW,CAAC,GAAGA,4BAAuB,CAAC,gBAAgB,EAAE;AAC5E,MAAC,SAAS,GAAG,WAAW,CAAC,WAAW,EAAE;AACtC,MAAC,UAAU,GAAG,WAAW,CAAC,YAAY,EAAE;AAExC,MAAC,cAAc,GAAG,WAAW,CAAC,gBAAgB,EAAE;AAChD,MAAC,gBAAgB,GAAG,WAAW,CAAC,kBAAkB,EAAE;AACpD,MAAC,gBAAgB,GAAG,CAAC,OAAO,KAAK,WAAW,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE;AAC1E,MAAC,MAAM,GAAG;AACtB,EAAE,IAAI,EAAE,SAAS;AACjB,EAAE,KAAK,EAAE,UAAU;AACnB,EAAE,QAAQ,EAAE,cAAc;AAC1B,EAAE,gBAAgB;AAClB,EAAE,gBAAgB;AAClB;;;;;;;;;"}
|
package/esm/ConfirmModal.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmModal.mjs","sources":["../src/ConfirmModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Group, Box, ButtonProps, GroupProps } from '@mantine/core';\nimport { ConfirmLabels } from './context';\nimport { useModals } from './use-modals/use-modals';\n\nexport interface ConfirmModalProps {\n id?: string;\n children?: React.ReactNode;\n onCancel
|
|
1
|
+
{"version":3,"file":"ConfirmModal.mjs","sources":["../src/ConfirmModal.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Group, Box, ButtonProps, GroupProps } from '@mantine/core';\nimport { ConfirmLabels } from './context';\nimport { useModals } from './use-modals/use-modals';\n\nexport interface ConfirmModalProps {\n id?: string;\n children?: React.ReactNode;\n onCancel?: () => void;\n onConfirm?: () => void;\n closeOnConfirm?: boolean;\n closeOnCancel?: boolean;\n cancelProps?: ButtonProps & React.ComponentPropsWithoutRef<'button'>;\n confirmProps?: ButtonProps & React.ComponentPropsWithoutRef<'button'>;\n groupProps?: GroupProps;\n labels?: ConfirmLabels;\n}\n\nexport function ConfirmModal({\n id,\n cancelProps,\n confirmProps,\n labels = { cancel: '', confirm: '' },\n closeOnConfirm = true,\n closeOnCancel = true,\n groupProps,\n onCancel,\n onConfirm,\n children,\n}: ConfirmModalProps) {\n const { cancel: cancelLabel, confirm: confirmLabel } = labels;\n const ctx = useModals();\n\n const handleCancel = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof cancelProps?.onClick === 'function' && cancelProps?.onClick(event);\n typeof onCancel === 'function' && onCancel();\n closeOnCancel && ctx.closeModal(id!);\n };\n\n const handleConfirm = (event: React.MouseEvent<HTMLButtonElement>) => {\n typeof confirmProps?.onClick === 'function' && confirmProps?.onClick(event);\n typeof onConfirm === 'function' && onConfirm();\n closeOnConfirm && ctx.closeModal(id!);\n };\n\n return (\n <>\n {children && <Box mb=\"md\">{children}</Box>}\n\n <Group justify=\"flex-end\" {...groupProps}>\n <Button variant=\"default\" {...cancelProps} onClick={handleCancel}>\n {cancelProps?.children || cancelLabel}\n </Button>\n\n <Button {...confirmProps} onClick={handleConfirm}>\n {confirmProps?.children || confirmLabel}\n </Button>\n </Group>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAA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AE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,WAAW,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,QAAQ,KAAK,WAAW,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC;AACvoB;;"}
|
package/esm/events.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.mjs","sources":["../src/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@mantine/core';\nimport {\n MantineModal,\n MantineModals,\n ModalSettings,\n OpenConfirmModal,\n OpenContextModal,\n} from './context';\n\ntype ModalsEvents = {\n openModal(payload: ModalSettings)
|
|
1
|
+
{"version":3,"file":"events.mjs","sources":["../src/events.ts"],"sourcesContent":["import { createUseExternalEvents } from '@mantine/core';\nimport {\n MantineModal,\n MantineModals,\n ModalSettings,\n OpenConfirmModal,\n OpenContextModal,\n} from './context';\n\ntype ModalsEvents = {\n openModal: (payload: ModalSettings) => void;\n closeModal: (id: string) => void;\n closeContextModal: <TKey extends MantineModal>(id: TKey) => void;\n closeAllModals: () => void;\n openConfirmModal: (payload: OpenConfirmModal) => void;\n openContextModal: <TKey extends MantineModal>(\n payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { modal: TKey }\n ) => void;\n};\n\nexport const [useModalsEvents, createEvent] =\n createUseExternalEvents<ModalsEvents>('mantine-modals');\n\nexport const openModal = createEvent('openModal');\nexport const closeModal = createEvent('closeModal');\nexport const closeContextModal: ModalsEvents['closeContextModal'] = <TKey extends MantineModal>(\n id: TKey\n) => createEvent('closeContextModal')(id);\nexport const closeAllModals = createEvent('closeAllModals');\nexport const openConfirmModal = createEvent('openConfirmModal');\nexport const openContextModal: ModalsEvents['openContextModal'] = <TKey extends MantineModal>(\n payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { modal: TKey }\n) => createEvent('openContextModal')(payload);\n\nexport const modals = {\n open: openModal,\n close: closeModal,\n closeAll: closeAllModals,\n openConfirmModal,\n openContextModal,\n};\n"],"names":[],"mappings":";;;AACY,MAAC,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,EAAE;AAC5E,MAAC,SAAS,GAAG,WAAW,CAAC,WAAW,EAAE;AACtC,MAAC,UAAU,GAAG,WAAW,CAAC,YAAY,EAAE;AAExC,MAAC,cAAc,GAAG,WAAW,CAAC,gBAAgB,EAAE;AAChD,MAAC,gBAAgB,GAAG,WAAW,CAAC,kBAAkB,EAAE;AACpD,MAAC,gBAAgB,GAAG,CAAC,OAAO,KAAK,WAAW,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE;AAC1E,MAAC,MAAM,GAAG;AACtB,EAAE,IAAI,EAAE,SAAS;AACjB,EAAE,KAAK,EAAE,UAAU;AACnB,EAAE,QAAQ,EAAE,cAAc;AAC1B,EAAE,gBAAgB;AAClB,EAAE,gBAAgB;AAClB;;"}
|
package/lib/ConfirmModal.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ConfirmLabels } from './context';
|
|
|
4
4
|
export interface ConfirmModalProps {
|
|
5
5
|
id?: string;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
onCancel
|
|
8
|
-
onConfirm
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
onConfirm?: () => void;
|
|
9
9
|
closeOnConfirm?: boolean;
|
|
10
10
|
closeOnCancel?: boolean;
|
|
11
11
|
cancelProps?: ButtonProps & React.ComponentPropsWithoutRef<'button'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmModal.d.ts","sourceRoot":"","sources":["../src/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nB"}
|
package/lib/events.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { MantineModal, MantineModals, ModalSettings, OpenConfirmModal, OpenContextModal } from './context';
|
|
2
2
|
type ModalsEvents = {
|
|
3
|
-
openModal(payload: ModalSettings)
|
|
4
|
-
closeModal(id: string)
|
|
5
|
-
closeContextModal<TKey extends MantineModal>(id: TKey)
|
|
6
|
-
closeAllModals()
|
|
7
|
-
openConfirmModal(payload: OpenConfirmModal)
|
|
8
|
-
openContextModal<TKey extends MantineModal>(payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & {
|
|
3
|
+
openModal: (payload: ModalSettings) => void;
|
|
4
|
+
closeModal: (id: string) => void;
|
|
5
|
+
closeContextModal: <TKey extends MantineModal>(id: TKey) => void;
|
|
6
|
+
closeAllModals: () => void;
|
|
7
|
+
openConfirmModal: (payload: OpenConfirmModal) => void;
|
|
8
|
+
openContextModal: <TKey extends MantineModal>(payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & {
|
|
9
9
|
modal: TKey;
|
|
10
|
-
})
|
|
10
|
+
}) => void;
|
|
11
11
|
};
|
|
12
12
|
export declare const useModalsEvents: (events: ModalsEvents) => void, createEvent: <EventKey extends keyof ModalsEvents>(event: EventKey) => (...payload: Parameters<ModalsEvents[EventKey]>[0] extends undefined ? [undefined?] : [Parameters<ModalsEvents[EventKey]>[0]]) => void;
|
|
13
13
|
export declare const openModal: (payload_0: ModalSettings) => void;
|
package/lib/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAEnB,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAEnB,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,iBAAiB,EAAE,CAAC,IAAI,SAAS,YAAY,EAAE,EAAE,EAAE,IAAI,KAAK,IAAI,CAAC;IACjE,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,gBAAgB,EAAE,CAAC,IAAI,SAAS,YAAY,EAC1C,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,KAC1F,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAO,eAAe,kCAAE,WAAW,kMACe,CAAC;AAE1D,eAAO,MAAM,SAAS,oCAA2B,CAAC;AAClD,eAAO,MAAM,UAAU,6BAA4B,CAAC;AACpD,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,mBAAmB,CAEvB,CAAC;AAC1C,eAAO,MAAM,cAAc,iCAAgC,CAAC;AAC5D,eAAO,MAAM,gBAAgB,uCAAkC,CAAC;AAChE,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,CAEjB,CAAC;AAE9C,eAAO,MAAM,MAAM;;;;;;;UAjBZ,IAAI;CAuBV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/modals",
|
|
3
3
|
"description": "Modals manager based on Mantine components",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.5",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"module": "./esm/index.mjs",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"confirm"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@mantine/core": "7.1.
|
|
45
|
-
"@mantine/hooks": "7.1.
|
|
44
|
+
"@mantine/core": "7.1.5",
|
|
45
|
+
"@mantine/hooks": "7.1.5",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-dom": "^18.2.0"
|
|
48
48
|
},
|