@panneau/element-modal 4.0.2 → 4.0.4
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/es/index.js +19 -14
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { useMemo, useEffect, useRef } from 'react';
|
|
|
4
4
|
import { getDisplayName } from '@panneau/core/utils';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
6
|
import { useModal } from '@panneau/core/contexts';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
import { useKeyboardKeys, KEYCODES } from '@panneau/core/hooks';
|
|
8
9
|
|
|
9
10
|
function ModalPortal(_ref) {
|
|
@@ -59,15 +60,18 @@ function Modal(_ref) {
|
|
|
59
60
|
onClose: onClose
|
|
60
61
|
};
|
|
61
62
|
}, [title, onClose]);
|
|
62
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/jsx(ModalPortal, {
|
|
63
64
|
id: finalId,
|
|
64
|
-
data: data
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
data: data,
|
|
66
|
+
children: /*#__PURE__*/jsx("div", {
|
|
67
|
+
className: classNames([styles.modal, _defineProperty({}, styles[position], position !== null)]),
|
|
68
|
+
children: /*#__PURE__*/jsx("div", {
|
|
69
|
+
className: classNames(['modal', 'fade', 'show', 'd-block', styles.inner]),
|
|
70
|
+
tabIndex: -1,
|
|
71
|
+
children: children
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
});
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
function Modals(_ref) {
|
|
@@ -98,16 +102,17 @@ function Modals(_ref) {
|
|
|
98
102
|
}
|
|
99
103
|
}, [modals]);
|
|
100
104
|
useKeyboardKeys(_defineProperty({}, KEYCODES.ESCAPE, closeLastModal));
|
|
101
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/jsx("div", {
|
|
102
106
|
className: classNames([styles.modalsContainer, _defineProperty({}, className, className !== null)]),
|
|
103
107
|
"data-bs-theme": theme !== null ? theme : undefined,
|
|
104
108
|
style: {
|
|
105
109
|
color: theme === 'dark' ? '#FFF' : undefined
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
},
|
|
111
|
+
children: /*#__PURE__*/jsx("div", {
|
|
112
|
+
className: classNames([styles.modals, _defineProperty({}, styles.hasModals, modals !== null && modals.length > 0)]),
|
|
113
|
+
ref: containerRef
|
|
114
|
+
})
|
|
115
|
+
});
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
export { Modal, ModalPortal, Modals, Modal as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/element-modal",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Modal element",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@babel/runtime": "^7.12.5",
|
|
54
|
-
"@panneau/core": "^4.0.
|
|
55
|
-
"@panneau/element-button": "^4.0.
|
|
56
|
-
"@panneau/element-icon": "^4.0.
|
|
57
|
-
"@panneau/element-label": "^4.0.
|
|
54
|
+
"@panneau/core": "^4.0.4",
|
|
55
|
+
"@panneau/element-button": "^4.0.4",
|
|
56
|
+
"@panneau/element-icon": "^4.0.4",
|
|
57
|
+
"@panneau/element-label": "^4.0.4",
|
|
58
58
|
"classnames": "^2.5.1",
|
|
59
59
|
"prop-types": "^15.7.2",
|
|
60
60
|
"react-intl": "^5.15.8 || ^6.0.0 || ^7.0.0"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
|
|
66
66
|
}
|