@mantine/modals
Advanced tools
Comparing version 7.14.1 to 7.14.2-alpha.0
@@ -40,2 +40,8 @@ import { ReactNode } from 'react'; | ||
closeAll: () => void; | ||
updateModal: (payload: { | ||
modalId: string; | ||
} & Partial<ModalSettings>) => void; | ||
updateContextModal: (payload: { | ||
modalId: string; | ||
} & Partial<OpenContextModal<any>>) => void; | ||
} | ||
@@ -42,0 +48,0 @@ export interface MantineModalsOverride { |
import { MantineModal, MantineModals, ModalSettings, OpenConfirmModal, OpenContextModal } from './context'; | ||
type ModalsEvents = { | ||
openModal: (payload: ModalSettings) => void; | ||
openModal: (payload: ModalSettings) => string; | ||
openConfirmModal: (payload: OpenConfirmModal) => string; | ||
openContextModal: <TKey extends MantineModal>(payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { | ||
modal: TKey; | ||
}) => string; | ||
closeModal: (id: string) => void; | ||
closeContextModal: <TKey extends MantineModal>(id: TKey) => void; | ||
closeAllModals: () => void; | ||
openConfirmModal: (payload: OpenConfirmModal) => void; | ||
openContextModal: <TKey extends MantineModal>(payload: OpenContextModal<Parameters<MantineModals[TKey]>[0]['innerProps']> & { | ||
modal: TKey; | ||
}) => void; | ||
updateModal: (payload: { | ||
modalId: string; | ||
} & Partial<ModalSettings>) => void; | ||
updateContextModal: (payload: { | ||
modalId: string; | ||
} & Partial<OpenContextModal<any>>) => void; | ||
}; | ||
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; | ||
export declare const openModal: (payload_0: ModalSettings) => void; | ||
export declare const openModal: ModalsEvents['openModal']; | ||
export declare const openConfirmModal: ModalsEvents['openConfirmModal']; | ||
export declare const openContextModal: ModalsEvents['openContextModal']; | ||
export declare const closeModal: (payload_0: string) => void; | ||
export declare const closeContextModal: ModalsEvents['closeContextModal']; | ||
export declare const closeAllModals: (payload_0?: undefined) => void; | ||
export declare const openConfirmModal: (payload_0: OpenConfirmModal) => void; | ||
export declare const openContextModal: ModalsEvents['openContextModal']; | ||
export declare const updateModal: (payload: { | ||
modalId: string; | ||
} & Partial<ModalSettings>) => void; | ||
export declare const updateContextModal: (payload: { | ||
modalId: string; | ||
} & Partial<OpenContextModal<any>>) => void; | ||
export declare const modals: { | ||
@@ -25,3 +37,5 @@ open: ModalsEvents['openModal']; | ||
openContextModal: ModalsEvents['openContextModal']; | ||
updateModal: ModalsEvents['updateModal']; | ||
updateContextModal: ModalsEvents['updateContextModal']; | ||
}; | ||
export {}; |
export { ModalsProvider } from './ModalsProvider'; | ||
export { useModals } from './use-modals/use-modals'; | ||
export { openModal, closeModal, closeAllModals, openConfirmModal, openContextModal, modals, } from './events'; | ||
export { openModal, closeModal, closeAllModals, openConfirmModal, openContextModal, updateModal, updateContextModal, modals, } from './events'; | ||
export type { ModalsProviderProps } from './ModalsProvider'; | ||
export type { ContextModalProps, MantineModalsOverride, MantineModals, MantineModal, } from './context'; |
@@ -1,2 +0,2 @@ | ||
import { ModalState } from './context'; | ||
import { ModalSettings, ModalState } from './context'; | ||
interface ModalsState { | ||
@@ -23,3 +23,8 @@ modals: ModalState[]; | ||
} | ||
export declare function modalsReducer(state: ModalsState, action: OpenAction | CloseAction | CloseAllAction): ModalsState; | ||
interface UpdateAction { | ||
type: 'UPDATE'; | ||
modalId: string; | ||
newProps: Partial<ModalSettings>; | ||
} | ||
export declare function modalsReducer(state: ModalsState, action: OpenAction | CloseAction | CloseAllAction | UpdateAction): ModalsState; | ||
export {}; |
{ | ||
"name": "@mantine/modals", | ||
"version": "7.14.1", | ||
"version": "7.14.2-alpha.0", | ||
"description": "Modals manager based on Mantine components", | ||
@@ -42,4 +42,4 @@ "homepage": "https://mantine.dev/x/modals/", | ||
"peerDependencies": { | ||
"@mantine/core": "7.14.1", | ||
"@mantine/hooks": "7.14.1", | ||
"@mantine/core": "7.14.2-alpha.0", | ||
"@mantine/hooks": "7.14.2-alpha.0", | ||
"react": "^18.x || ^19.x", | ||
@@ -46,0 +46,0 @@ "react-dom": "^18.x || ^19.x" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
149174
946
1