@panneau/element-modal 3.0.118 → 3.0.126
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/lib/index.js +19 -27
- package/package.json +8 -7
package/lib/index.js
CHANGED
|
@@ -10,23 +10,15 @@ var utils = require('@panneau/core/utils');
|
|
|
10
10
|
var ReactDOM = require('react-dom');
|
|
11
11
|
var contexts = require('@panneau/core/contexts');
|
|
12
12
|
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
17
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
20
|
-
|
|
21
13
|
/* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
|
|
22
14
|
|
|
23
15
|
// import ElementPortal from '@panneau/element-portal';
|
|
24
16
|
|
|
25
17
|
var propTypes$2 = {
|
|
26
|
-
id:
|
|
27
|
-
data:
|
|
18
|
+
id: PropTypes.string,
|
|
19
|
+
data: PropTypes.object,
|
|
28
20
|
// eslint-disable-line react/forbid-prop-types
|
|
29
|
-
children:
|
|
21
|
+
children: PropTypes.node
|
|
30
22
|
};
|
|
31
23
|
var defaultProps$2 = {
|
|
32
24
|
id: null,
|
|
@@ -57,7 +49,7 @@ var ModalPortal = function ModalPortal(_ref) {
|
|
|
57
49
|
}
|
|
58
50
|
};
|
|
59
51
|
}, [finalId, data]);
|
|
60
|
-
return container !== null ? /*#__PURE__*/
|
|
52
|
+
return container !== null ? /*#__PURE__*/ReactDOM.createPortal(children, container) : null;
|
|
61
53
|
};
|
|
62
54
|
ModalPortal.propTypes = propTypes$2;
|
|
63
55
|
ModalPortal.defaultProps = defaultProps$2;
|
|
@@ -66,10 +58,10 @@ var ModalPortal$1 = ModalPortal;
|
|
|
66
58
|
var styles = {"modal":"panneau-element-modal-modal","center":"panneau-element-modal-center","inner":"panneau-element-modal-inner","top":"panneau-element-modal-top","button":"panneau-element-modal-button","modalsContainer":"panneau-element-modal-modalsContainer","modals":"panneau-element-modal-modals","hasModals":"panneau-element-modal-hasModals"};
|
|
67
59
|
|
|
68
60
|
var propTypes$1 = {
|
|
69
|
-
id:
|
|
70
|
-
title:
|
|
71
|
-
position:
|
|
72
|
-
children:
|
|
61
|
+
id: PropTypes.string,
|
|
62
|
+
title: PropTypes.string,
|
|
63
|
+
position: PropTypes.oneOf(['center', 'top']),
|
|
64
|
+
children: PropTypes.node
|
|
73
65
|
};
|
|
74
66
|
var defaultProps$1 = {
|
|
75
67
|
id: null,
|
|
@@ -91,13 +83,13 @@ var Modal = function Modal(_ref) {
|
|
|
91
83
|
title: title
|
|
92
84
|
};
|
|
93
85
|
}, [title]);
|
|
94
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/React.createElement(ModalPortal$1, {
|
|
95
87
|
id: finalId,
|
|
96
88
|
data: data
|
|
97
|
-
}, /*#__PURE__*/
|
|
98
|
-
className:
|
|
99
|
-
}, /*#__PURE__*/
|
|
100
|
-
className:
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: classNames([styles.modal, _defineProperty({}, styles[position], position !== null)])
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: classNames(['modal', 'fade', 'show', 'd-block', styles.inner]),
|
|
101
93
|
tabIndex: "-1"
|
|
102
94
|
}, children)));
|
|
103
95
|
};
|
|
@@ -106,7 +98,7 @@ Modal.defaultProps = defaultProps$1;
|
|
|
106
98
|
var Modal$1 = Modal;
|
|
107
99
|
|
|
108
100
|
var propTypes = {
|
|
109
|
-
className:
|
|
101
|
+
className: PropTypes.string
|
|
110
102
|
};
|
|
111
103
|
var defaultProps = {
|
|
112
104
|
className: null
|
|
@@ -133,10 +125,10 @@ var Modals = function Modals(_ref) {
|
|
|
133
125
|
}
|
|
134
126
|
}
|
|
135
127
|
}, [modals]);
|
|
136
|
-
return /*#__PURE__*/
|
|
137
|
-
className:
|
|
138
|
-
}, /*#__PURE__*/
|
|
139
|
-
className:
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: classNames([styles.modalsContainer, _defineProperty({}, className, className)])
|
|
130
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: classNames([styles.modals, _defineProperty({}, styles.hasModals, modals !== null && modals.length > 0)]),
|
|
140
132
|
ref: containerRef
|
|
141
133
|
}));
|
|
142
134
|
};
|
|
@@ -147,4 +139,4 @@ var Modals$1 = Modals;
|
|
|
147
139
|
exports.Modal = Modal$1;
|
|
148
140
|
exports.ModalPortal = ModalPortal$1;
|
|
149
141
|
exports.Modals = Modals$1;
|
|
150
|
-
exports
|
|
142
|
+
exports.default = Modal$1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/element-modal",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.126",
|
|
4
4
|
"description": "Modal element",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"assets"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"
|
|
36
|
+
"prepublishOnly": "npm run build",
|
|
37
|
+
"build": "../../scripts/prepare-package.sh"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -45,10 +46,10 @@
|
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@babel/runtime": "^7.12.5",
|
|
48
|
-
"@panneau/core": "^3.0.
|
|
49
|
-
"@panneau/element-button": "^3.0.
|
|
50
|
-
"@panneau/element-icon": "^3.0.
|
|
51
|
-
"@panneau/element-label": "^3.0.
|
|
49
|
+
"@panneau/core": "^3.0.126",
|
|
50
|
+
"@panneau/element-button": "^3.0.126",
|
|
51
|
+
"@panneau/element-icon": "^3.0.126",
|
|
52
|
+
"@panneau/element-label": "^3.0.126",
|
|
52
53
|
"classnames": "^2.2.6",
|
|
53
54
|
"prop-types": "^15.7.2",
|
|
54
55
|
"react-intl": "^5.15.8||^6.0.0"
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"access": "public"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "fa69ddff3f8cf22b00504093087608d5701e6f6a"
|
|
60
61
|
}
|