@panneau/element-modal 3.0.224 → 3.0.228
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 +8 -4
- package/package.json +9 -7
package/es/index.js
CHANGED
|
@@ -42,10 +42,10 @@ var ModalPortal = function ModalPortal(_ref) {
|
|
|
42
42
|
}
|
|
43
43
|
return function () {
|
|
44
44
|
if (unregister !== null) {
|
|
45
|
-
unregister(finalId);
|
|
45
|
+
unregister(finalId, data);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
}, [finalId, data]);
|
|
48
|
+
}, [finalId, data, register, unregister]);
|
|
49
49
|
return container !== null ? /*#__PURE__*/ReactDOM.createPortal(children, container) : null;
|
|
50
50
|
};
|
|
51
51
|
ModalPortal.propTypes = propTypes$2;
|
|
@@ -58,16 +58,19 @@ var propTypes$1 = {
|
|
|
58
58
|
id: PropTypes.string,
|
|
59
59
|
title: PropTypes.string,
|
|
60
60
|
position: PropTypes.oneOf(['center', 'top']),
|
|
61
|
+
onClose: PropTypes.func,
|
|
61
62
|
children: PropTypes.node
|
|
62
63
|
};
|
|
63
64
|
var defaultProps$1 = {
|
|
64
65
|
id: null,
|
|
65
66
|
title: null,
|
|
66
67
|
position: 'center',
|
|
68
|
+
onClose: null,
|
|
67
69
|
children: null
|
|
68
70
|
};
|
|
69
71
|
var Modal = function Modal(_ref) {
|
|
70
72
|
var id = _ref.id,
|
|
73
|
+
onClose = _ref.onClose,
|
|
71
74
|
children = _ref.children,
|
|
72
75
|
position = _ref.position,
|
|
73
76
|
title = _ref.title;
|
|
@@ -77,9 +80,10 @@ var Modal = function Modal(_ref) {
|
|
|
77
80
|
}, [id, name]);
|
|
78
81
|
var data = useMemo(function () {
|
|
79
82
|
return {
|
|
80
|
-
title: title
|
|
83
|
+
title: title,
|
|
84
|
+
onClose: onClose
|
|
81
85
|
};
|
|
82
|
-
}, [title]);
|
|
86
|
+
}, [title, onClose]);
|
|
83
87
|
return /*#__PURE__*/React.createElement(ModalPortal$1, {
|
|
84
88
|
id: finalId,
|
|
85
89
|
data: data
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/element-modal",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.228",
|
|
4
4
|
"description": "Modal element",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -28,7 +28,9 @@
|
|
|
28
28
|
"type": "module",
|
|
29
29
|
"module": "es/index.js",
|
|
30
30
|
"exports": {
|
|
31
|
-
".": "./es/index.js"
|
|
31
|
+
".": "./es/index.js",
|
|
32
|
+
"./assets/css/styles": "./assets/css/styles.css",
|
|
33
|
+
"./assets/css/styles.css": "./assets/css/styles.css"
|
|
32
34
|
},
|
|
33
35
|
"files": [
|
|
34
36
|
"lib",
|
|
@@ -49,10 +51,10 @@
|
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
51
53
|
"@babel/runtime": "^7.12.5",
|
|
52
|
-
"@panneau/core": "^3.0.
|
|
53
|
-
"@panneau/element-button": "^3.0.
|
|
54
|
-
"@panneau/element-icon": "^3.0.
|
|
55
|
-
"@panneau/element-label": "^3.0.
|
|
54
|
+
"@panneau/core": "^3.0.228",
|
|
55
|
+
"@panneau/element-button": "^3.0.228",
|
|
56
|
+
"@panneau/element-icon": "^3.0.228",
|
|
57
|
+
"@panneau/element-label": "^3.0.228",
|
|
56
58
|
"classnames": "^2.5.1",
|
|
57
59
|
"prop-types": "^15.7.2",
|
|
58
60
|
"react-intl": "^5.15.8||^6.0.0"
|
|
@@ -60,5 +62,5 @@
|
|
|
60
62
|
"publishConfig": {
|
|
61
63
|
"access": "public"
|
|
62
64
|
},
|
|
63
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2adf72884fb88052c6a6822e6f32169bb1dfe18b"
|
|
64
66
|
}
|