ui-kit-ck-consultant 0.5.307 → 0.5.309

Sign up to get free protection for your applications and to get access to all the features.
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.onClose(e);
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
- _this2 = this;
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 _this2.handleClickModal(e);
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
- _this2.setState({
148
+ _this3.setState({
133
149
  isMove: true,
134
- xStart: _this2.state.xStart || e.clientX,
135
- yStart: _this2.state.yStart || e.clientY
150
+ xStart: _this3.state.xStart || e.clientX,
151
+ yStart: _this3.state.yStart || e.clientY
136
152
  }, function () {
137
- return window.addEventListener('mousemove', _this2.updateMousePosition);
153
+ return window.addEventListener('mousemove', _this3.updateMousePosition);
138
154
  });
139
155
  }
140
156
  }, this.props.isMove ? /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
@@ -147,7 +163,23 @@ var Modal = /*#__PURE__*/function (_React$Component) {
147
163
  icon: freeSolidSvgIcons.faCheck
148
164
  }) : ''), !this.props.disableClose ? /*#__PURE__*/React__default.createElement("div", {
149
165
  className: style.modal_close,
150
- onClick: this.props.onClose
166
+ onClick: function onClick() {
167
+ if (_this3.props.closeMessage) {
168
+ if (window.confirmCustom) {
169
+ window.confirmCustom(_this3.props.closeMessage), function () {
170
+ if (result) {
171
+ _this3.props.onClose();
172
+ }
173
+ };
174
+ } else {
175
+ if (window.confirm(_this3.props.closeMessage)) {
176
+ _this3.props.onClose();
177
+ }
178
+ }
179
+ } else {
180
+ _this3.props.onClose();
181
+ }
182
+ }
151
183
  }, this.props.iconClose ? this.props.iconClose : /*#__PURE__*/React__default.createElement(reactFontawesome.FontAwesomeIcon, {
152
184
  icon: freeSolidSvgIcons.faTimes
153
185
  })) : null), /*#__PURE__*/React__default.createElement("div", {