@panneau/element-modal 2.0.59 → 2.0.67
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 +11 -1
- package/lib/index.js +11 -1
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -84,7 +84,8 @@ var Modal = function Modal(_ref) {
|
|
|
84
84
|
}, /*#__PURE__*/React.createElement("div", {
|
|
85
85
|
className: classNames([styles.modal, _defineProperty({}, styles[position], position !== null)])
|
|
86
86
|
}, /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
className: styles.inner
|
|
87
|
+
className: classNames(['modal', 'fade', 'show', 'd-block', styles.inner]),
|
|
88
|
+
tabIndex: "-1"
|
|
88
89
|
}, children)));
|
|
89
90
|
};
|
|
90
91
|
Modal.propTypes = propTypes$1;
|
|
@@ -109,6 +110,15 @@ var Modals = function Modals(_ref) {
|
|
|
109
110
|
setContainer(containerRef.current);
|
|
110
111
|
}
|
|
111
112
|
}, [setContainer]);
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (document.body) {
|
|
115
|
+
if (modals !== null && modals.length > 0) {
|
|
116
|
+
document.body.className = 'modal-open';
|
|
117
|
+
} else {
|
|
118
|
+
document.body.className = '';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, [modals]);
|
|
112
122
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
123
|
className: classNames([styles.modalsContainer, _defineProperty({}, className, className)])
|
|
114
124
|
}, /*#__PURE__*/React.createElement("div", {
|
package/lib/index.js
CHANGED
|
@@ -96,7 +96,8 @@ var Modal = function Modal(_ref) {
|
|
|
96
96
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
97
97
|
className: classNames__default["default"]([styles.modal, _defineProperty__default["default"]({}, styles[position], position !== null)])
|
|
98
98
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
99
|
-
className: styles.inner
|
|
99
|
+
className: classNames__default["default"](['modal', 'fade', 'show', 'd-block', styles.inner]),
|
|
100
|
+
tabIndex: "-1"
|
|
100
101
|
}, children)));
|
|
101
102
|
};
|
|
102
103
|
Modal.propTypes = propTypes$1;
|
|
@@ -121,6 +122,15 @@ var Modals = function Modals(_ref) {
|
|
|
121
122
|
setContainer(containerRef.current);
|
|
122
123
|
}
|
|
123
124
|
}, [setContainer]);
|
|
125
|
+
React.useEffect(function () {
|
|
126
|
+
if (document.body) {
|
|
127
|
+
if (modals !== null && modals.length > 0) {
|
|
128
|
+
document.body.className = 'modal-open';
|
|
129
|
+
} else {
|
|
130
|
+
document.body.className = '';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, [modals]);
|
|
124
134
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
125
135
|
className: classNames__default["default"]([styles.modalsContainer, _defineProperty__default["default"]({}, className, className)])
|
|
126
136
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/element-modal",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.67",
|
|
4
4
|
"description": "Modal element",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "ac972a8e66c405de1c4d4606d347f3a3f1e839e8"
|
|
60
60
|
}
|