ui-kit-ck-consultant 0.5.131 → 0.5.135

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.
@@ -79,7 +79,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
79
79
  var modalContainerClass = classNames$1((_classNames = {}, _classNames[style.large] = !!this.props.large, _classNames), style.modal_container, this.props.className);
80
80
  return /*#__PURE__*/React.createElement("div", {
81
81
  className: style.modal,
82
- onClick: function onClick(e) {
82
+ onMouseDown: function onMouseDown(e) {
83
83
  return _this.handleClickModal(e);
84
84
  }
85
85
  }, /*#__PURE__*/React.createElement("div", {
@@ -264,7 +264,8 @@ var FormInput = /*#__PURE__*/function (_React$Component) {
264
264
  _proto.render = function render() {
265
265
  if (this.props.children) {
266
266
  return /*#__PURE__*/React.createElement("div", {
267
- className: classNames$1(style$2.form_input_container, this.props.className)
267
+ className: classNames$1(style$2.form_input_container, this.props.className),
268
+ style: this.props.style
268
269
  }, this.props.title ? /*#__PURE__*/React.createElement("span", {
269
270
  className: this.props.classNameTitle
270
271
  }, this.props.title, ' ', this.props.required ? /*#__PURE__*/React.createElement("span", {
@@ -288,10 +289,13 @@ var FormInput = /*#__PURE__*/function (_React$Component) {
288
289
  }, this.props.error) : '');
289
290
  } else {
290
291
  return /*#__PURE__*/React.createElement("div", {
291
- className: classNames$1(style$2.form_input_container, this.props.className)
292
+ className: classNames$1(style$2.form_input_container, this.props.className),
293
+ style: this.props.style
292
294
  }, this.props.title ? /*#__PURE__*/React.createElement("span", {
293
295
  className: this.props.classNameTitle
294
- }, this.props.title) : '', /*#__PURE__*/React.createElement("input", {
296
+ }, this.props.title, ' ', this.props.required ? /*#__PURE__*/React.createElement("span", {
297
+ className: "red"
298
+ }, "*") : '') : '', /*#__PURE__*/React.createElement("input", {
295
299
  className: style$2.form_input,
296
300
  type: this.props.type,
297
301
  placeholder: this.props.placeholder,
@@ -424,6 +428,14 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
424
428
 
425
429
  _this = _React$Component.call(this, props) || this;
426
430
 
431
+ _this.handleClickOutside = function (event) {
432
+ if (_this.refComponent && _this.refComponent.current && !_this.refComponent.current.contains(event.target)) {
433
+ _this.setState({
434
+ isOpen: false
435
+ });
436
+ }
437
+ };
438
+
427
439
  _this.findText = function (options, value) {
428
440
  var result = options.filter(function (item) {
429
441
  return item.value.toString() === value.toString();
@@ -446,11 +458,20 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
446
458
  _this.state = {
447
459
  isOpen: false
448
460
  };
461
+ _this.refComponent = React.createRef();
449
462
  return _this;
450
463
  }
451
464
 
452
465
  var _proto = FormRange.prototype;
453
466
 
467
+ _proto.componentDidMount = function componentDidMount() {
468
+ document.addEventListener('mousedown', this.handleClickOutside);
469
+ };
470
+
471
+ _proto.componentWillUnmount = function componentWillUnmount() {
472
+ document.removeEventListener('mousedown', this.handleClickOutside);
473
+ };
474
+
454
475
  _proto.render = function render() {
455
476
  var _this2 = this;
456
477
 
@@ -470,8 +491,10 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
470
491
  }, /*#__PURE__*/React.createElement("span", null, this.getLabel(this.props.value1, this.props.value2, this.props.options1, this.props.options2)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
471
492
  icon: this.state.isOpen ? faCaretUp : faCaretDown
472
493
  }))), this.state.isOpen ? /*#__PURE__*/React.createElement("div", {
494
+ ref: this.refComponent,
473
495
  className: style$4.form_range_modal
474
496
  }, /*#__PURE__*/React.createElement(FormSelect, {
497
+ type: this.props.type,
475
498
  name: this.props.name1,
476
499
  options: this.props.options1,
477
500
  value: this.props.value1,
@@ -481,6 +504,7 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
481
504
  disabled: false,
482
505
  init: this.props.init1
483
506
  }), /*#__PURE__*/React.createElement(FormSelect, {
507
+ type: this.props.type,
484
508
  name: this.props.name2,
485
509
  options: this.props.options2,
486
510
  value: this.props.value2,
@@ -2418,7 +2442,7 @@ var Loader = /*#__PURE__*/function (_React$Component) {
2418
2442
  className: classNames$1(style$k.loader_element, this.props.classNameChildren)
2419
2443
  }, /*#__PURE__*/React.createElement("div", {
2420
2444
  className: style$k.loader
2421
- }, /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null))));
2445
+ }, /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null)), this.props.message ? /*#__PURE__*/React.createElement("p", null, this.props.message) : null));
2422
2446
  };
2423
2447
 
2424
2448
  return Loader;