@panneau/element-modal 3.0.226 → 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.
Files changed (2) hide show
  1. package/es/index.js +8 -4
  2. package/package.json +6 -6
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.226",
3
+ "version": "3.0.228",
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": "^3.0.224",
55
- "@panneau/element-button": "^3.0.226",
56
- "@panneau/element-icon": "^3.0.226",
57
- "@panneau/element-label": "^3.0.224",
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",
58
58
  "classnames": "^2.5.1",
59
59
  "prop-types": "^15.7.2",
60
60
  "react-intl": "^5.15.8||^6.0.0"
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "9615a4d3021e9ad9b15be01e998dd6f366f8f705"
65
+ "gitHead": "2adf72884fb88052c6a6822e6f32169bb1dfe18b"
66
66
  }