ui-kit-ck-consultant 0.5.134 → 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.
@@ -428,6 +428,14 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
428
428
 
429
429
  _this = _React$Component.call(this, props) || this;
430
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
+
431
439
  _this.findText = function (options, value) {
432
440
  var result = options.filter(function (item) {
433
441
  return item.value.toString() === value.toString();
@@ -450,11 +458,20 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
450
458
  _this.state = {
451
459
  isOpen: false
452
460
  };
461
+ _this.refComponent = React.createRef();
453
462
  return _this;
454
463
  }
455
464
 
456
465
  var _proto = FormRange.prototype;
457
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
+
458
475
  _proto.render = function render() {
459
476
  var _this2 = this;
460
477
 
@@ -474,8 +491,10 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
474
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, {
475
492
  icon: this.state.isOpen ? faCaretUp : faCaretDown
476
493
  }))), this.state.isOpen ? /*#__PURE__*/React.createElement("div", {
494
+ ref: this.refComponent,
477
495
  className: style$4.form_range_modal
478
496
  }, /*#__PURE__*/React.createElement(FormSelect, {
497
+ type: this.props.type,
479
498
  name: this.props.name1,
480
499
  options: this.props.options1,
481
500
  value: this.props.value1,
@@ -485,6 +504,7 @@ var FormRange = /*#__PURE__*/function (_React$Component) {
485
504
  disabled: false,
486
505
  init: this.props.init1
487
506
  }), /*#__PURE__*/React.createElement(FormSelect, {
507
+ type: this.props.type,
488
508
  name: this.props.name2,
489
509
  options: this.props.options2,
490
510
  value: this.props.value2,
@@ -2422,7 +2442,7 @@ var Loader = /*#__PURE__*/function (_React$Component) {
2422
2442
  className: classNames$1(style$k.loader_element, this.props.classNameChildren)
2423
2443
  }, /*#__PURE__*/React.createElement("div", {
2424
2444
  className: style$k.loader
2425
- }, /*#__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));
2426
2446
  };
2427
2447
 
2428
2448
  return Loader;