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.
@@ -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.onClose(e);
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
- _this2 = this;
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 _this2.handleClickModal(e);
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
- _this2.setState({
145
+ _this3.setState({
130
146
  isMove: true,
131
- xStart: _this2.state.xStart || e.clientX,
132
- yStart: _this2.state.yStart || e.clientY
147
+ xStart: _this3.state.xStart || e.clientX,
148
+ yStart: _this3.state.yStart || e.clientY
133
149
  }, function () {
134
- return window.addEventListener('mousemove', _this2.updateMousePosition);
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 (_this2.props.closeMessage) {
164
+ if (_this3.props.closeMessage) {
149
165
  if (window.confirmCustom) {
150
- window.confirmCustom(_this2.props.closeMessage), function () {
166
+ window.confirmCustom(_this3.props.closeMessage, function () {
151
167
  if (result) {
152
- _this2.props.onClose();
168
+ _this3.props.onClose();
153
169
  }
154
- };
170
+ });
155
171
  } else {
156
- if (window.confirm(_this2.props.closeMessage)) {
157
- _this2.props.onClose();
172
+ if (window.confirm(_this3.props.closeMessage)) {
173
+ _this3.props.onClose();
158
174
  }
159
175
  }
160
176
  } else {
161
- _this2.props.onClose();
177
+ _this3.props.onClose();
162
178
  }
163
179
  }
164
180
  }, this.props.iconClose ? this.props.iconClose : /*#__PURE__*/React.createElement(FontAwesomeIcon, {