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.js
CHANGED
@@ -99,14 +99,30 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
99
99
|
};
|
100
100
|
|
101
101
|
_proto.handleClickModal = function handleClickModal(e) {
|
102
|
+
var _this2 = this;
|
103
|
+
|
102
104
|
if (e.target === e.currentTarget && !this.props.disableClose) {
|
103
|
-
this.props.
|
105
|
+
if (this.props.closeMessage) {
|
106
|
+
if (window.confirmCustom) {
|
107
|
+
window.confirmCustom(this.props.closeMessage, function () {
|
108
|
+
if (result) {
|
109
|
+
_this2.props.onClose();
|
110
|
+
}
|
111
|
+
});
|
112
|
+
} else {
|
113
|
+
if (window.confirm(this.props.closeMessage)) {
|
114
|
+
this.props.onClose();
|
115
|
+
}
|
116
|
+
}
|
117
|
+
} else {
|
118
|
+
this.props.onClose();
|
119
|
+
}
|
104
120
|
}
|
105
121
|
};
|
106
122
|
|
107
123
|
_proto.render = function render() {
|
108
124
|
var _classNames,
|
109
|
-
|
125
|
+
_this3 = this;
|
110
126
|
|
111
127
|
if (!this.props.show) {
|
112
128
|
return null;
|
@@ -116,7 +132,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
116
132
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, this.props.show ? /*#__PURE__*/React__default.createElement("style", null, "body {overflow: \"hidden\" }") : null, /*#__PURE__*/React__default.createElement("div", {
|
117
133
|
className: style.modal,
|
118
134
|
onMouseDown: function onMouseDown(e) {
|
119
|
-
return
|
135
|
+
return _this3.handleClickModal(e);
|
120
136
|
}
|
121
137
|
}, /*#__PURE__*/React__default.createElement("div", {
|
122
138
|
className: modalContainerClass,
|
@@ -129,12 +145,12 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
129
145
|
}, /*#__PURE__*/React__default.createElement("div", {
|
130
146
|
className: style.modal_move,
|
131
147
|
onMouseDown: function onMouseDown(e) {
|
132
|
-
|
148
|
+
_this3.setState({
|
133
149
|
isMove: true,
|
134
|
-
xStart:
|
135
|
-
yStart:
|
150
|
+
xStart: _this3.state.xStart || e.clientX,
|
151
|
+
yStart: _this3.state.yStart || e.clientY
|
136
152
|
}, function () {
|
137
|
-
return window.addEventListener('mousemove',
|
153
|
+
return window.addEventListener('mousemove', _this3.updateMousePosition);
|
138
154
|
});
|
139
155
|
}
|
140
156
|
}, this.props.isMove ? /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
|
@@ -148,20 +164,20 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
148
164
|
}) : ''), !this.props.disableClose ? /*#__PURE__*/React__default.createElement("div", {
|
149
165
|
className: style.modal_close,
|
150
166
|
onClick: function onClick() {
|
151
|
-
if (
|
167
|
+
if (_this3.props.closeMessage) {
|
152
168
|
if (window.confirmCustom) {
|
153
|
-
window.confirmCustom(
|
169
|
+
window.confirmCustom(_this3.props.closeMessage, function () {
|
154
170
|
if (result) {
|
155
|
-
|
171
|
+
_this3.props.onClose();
|
156
172
|
}
|
157
|
-
};
|
173
|
+
});
|
158
174
|
} else {
|
159
|
-
if (window.confirm(
|
160
|
-
|
175
|
+
if (window.confirm(_this3.props.closeMessage)) {
|
176
|
+
_this3.props.onClose();
|
161
177
|
}
|
162
178
|
}
|
163
179
|
} else {
|
164
|
-
|
180
|
+
_this3.props.onClose();
|
165
181
|
}
|
166
182
|
}
|
167
183
|
}, this.props.iconClose ? this.props.iconClose : /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
|