@mantine/modals
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -105,10 +105,14 @@ 'use strict'; | ||
const index = state.findIndex((item) => item.id === id); | ||
const modal = state.find((item) => item.id === id); | ||
(_b = (_a2 = modal == null ? void 0 : modal.props) == null ? void 0 : _a2.onClose) == null ? void 0 : _b.call(_a2); | ||
index !== -1 && handlers.remove(index); | ||
setCurrentModal(state[state.length - 2] || { | ||
id: null, | ||
props: null, | ||
type: "content" | ||
}); | ||
if (state.length <= 1) { | ||
closeAll(); | ||
} else { | ||
const modal = state.find((item) => item.id === id); | ||
(_b = (_a2 = modal == null ? void 0 : modal.props) == null ? void 0 : _a2.onClose) == null ? void 0 : _b.call(_a2); | ||
index !== -1 && handlers.remove(index); | ||
setCurrentModal(state[state.length - 2] || { | ||
id: null, | ||
props: null, | ||
type: "content" | ||
}); | ||
} | ||
}; | ||
@@ -115,0 +119,0 @@ const ContextModal = (currentModal == null ? void 0 : currentModal.type) === "context" ? modals[currentModal == null ? void 0 : currentModal.ctx] : () => null; |
@@ -97,10 +97,14 @@ import React, { useState } from 'react'; | ||
const index = state.findIndex((item) => item.id === id); | ||
const modal = state.find((item) => item.id === id); | ||
(_b = (_a2 = modal == null ? void 0 : modal.props) == null ? void 0 : _a2.onClose) == null ? void 0 : _b.call(_a2); | ||
index !== -1 && handlers.remove(index); | ||
setCurrentModal(state[state.length - 2] || { | ||
id: null, | ||
props: null, | ||
type: "content" | ||
}); | ||
if (state.length <= 1) { | ||
closeAll(); | ||
} else { | ||
const modal = state.find((item) => item.id === id); | ||
(_b = (_a2 = modal == null ? void 0 : modal.props) == null ? void 0 : _a2.onClose) == null ? void 0 : _b.call(_a2); | ||
index !== -1 && handlers.remove(index); | ||
setCurrentModal(state[state.length - 2] || { | ||
id: null, | ||
props: null, | ||
type: "content" | ||
}); | ||
} | ||
}; | ||
@@ -107,0 +111,0 @@ const ContextModal = (currentModal == null ? void 0 : currentModal.type) === "context" ? modals[currentModal == null ? void 0 : currentModal.ctx] : () => null; |
{ | ||
"name": "@mantine/modals", | ||
"description": "Modals manager based on Mantine components", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"main": "cjs/index.js", | ||
@@ -18,4 +18,4 @@ "module": "esm/index.js", | ||
"peerDependencies": { | ||
"@mantine/core": "3.4.0", | ||
"@mantine/hooks": "3.4.0", | ||
"@mantine/core": "3.4.1", | ||
"@mantine/hooks": "3.4.1", | ||
"react": ">=16.8.0", | ||
@@ -22,0 +22,0 @@ "react-dom": ">=16.8.0" |
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
58337
524