ui-kit-ck-consultant 0.5.308 → 0.5.310
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +30 -14
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +30 -14
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -96,14 +96,30 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
96
96
|
};
|
97
97
|
|
98
98
|
_proto.handleClickModal = function handleClickModal(e) {
|
99
|
+
var _this2 = this;
|
100
|
+
|
99
101
|
if (e.target === e.currentTarget && !this.props.disableClose) {
|
100
|
-
this.props.
|
102
|
+
if (this.props.closeMessage) {
|
103
|
+
if (window.confirmCustom) {
|
104
|
+
window.confirmCustom(this.props.closeMessage, function () {
|
105
|
+
if (result) {
|
106
|
+
_this2.props.onClose();
|
107
|
+
}
|
108
|
+
});
|
109
|
+
} else {
|
110
|
+
if (window.confirm(this.props.closeMessage)) {
|
111
|
+
this.props.onClose();
|
112
|
+
}
|
113
|
+
}
|
114
|
+
} else {
|
115
|
+
this.props.onClose();
|
116
|
+
}
|
101
117
|
}
|
102
118
|
};
|
103
119
|
|
104
120
|
_proto.render = function render() {
|
105
121
|
var _classNames,
|
106
|
-
|
122
|
+
_this3 = this;
|
107
123
|
|
108
124
|
if (!this.props.show) {
|
109
125
|
return null;
|
@@ -113,7 +129,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
113
129
|
return /*#__PURE__*/React.createElement(Fragment$1, null, this.props.show ? /*#__PURE__*/React.createElement("style", null, "body {overflow: \"hidden\" }") : null, /*#__PURE__*/React.createElement("div", {
|
114
130
|
className: style.modal,
|
115
131
|
onMouseDown: function onMouseDown(e) {
|
116
|
-
return
|
132
|
+
return _this3.handleClickModal(e);
|
117
133
|
}
|
118
134
|
}, /*#__PURE__*/React.createElement("div", {
|
119
135
|
className: modalContainerClass,
|
@@ -126,12 +142,12 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
126
142
|
}, /*#__PURE__*/React.createElement("div", {
|
127
143
|
className: style.modal_move,
|
128
144
|
onMouseDown: function onMouseDown(e) {
|
129
|
-
|
145
|
+
_this3.setState({
|
130
146
|
isMove: true,
|
131
|
-
xStart:
|
132
|
-
yStart:
|
147
|
+
xStart: _this3.state.xStart || e.clientX,
|
148
|
+
yStart: _this3.state.yStart || e.clientY
|
133
149
|
}, function () {
|
134
|
-
return window.addEventListener('mousemove',
|
150
|
+
return window.addEventListener('mousemove', _this3.updateMousePosition);
|
135
151
|
});
|
136
152
|
}
|
137
153
|
}, this.props.isMove ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
@@ -145,20 +161,20 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
145
161
|
}) : ''), !this.props.disableClose ? /*#__PURE__*/React.createElement("div", {
|
146
162
|
className: style.modal_close,
|
147
163
|
onClick: function onClick() {
|
148
|
-
if (
|
164
|
+
if (_this3.props.closeMessage) {
|
149
165
|
if (window.confirmCustom) {
|
150
|
-
window.confirmCustom(
|
166
|
+
window.confirmCustom(_this3.props.closeMessage, function () {
|
151
167
|
if (result) {
|
152
|
-
|
168
|
+
_this3.props.onClose();
|
153
169
|
}
|
154
|
-
};
|
170
|
+
});
|
155
171
|
} else {
|
156
|
-
if (window.confirm(
|
157
|
-
|
172
|
+
if (window.confirm(_this3.props.closeMessage)) {
|
173
|
+
_this3.props.onClose();
|
158
174
|
}
|
159
175
|
}
|
160
176
|
} else {
|
161
|
-
|
177
|
+
_this3.props.onClose();
|
162
178
|
}
|
163
179
|
}
|
164
180
|
}, this.props.iconClose ? this.props.iconClose : /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|