ui-kit-ck-consultant 0.5.153 → 0.5.157

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.
@@ -339,7 +339,7 @@ var FormTextarea = /*#__PURE__*/function (_React$Component) {
339
339
  }, this.props.title ? /*#__PURE__*/React.createElement("span", null, this.props.title, ' ', this.props.required ? /*#__PURE__*/React.createElement("span", {
340
340
  className: "red"
341
341
  }, "*") : '') : '', /*#__PURE__*/React.createElement("textarea", {
342
- onKeyDown: this.handleKeyDown,
342
+ onKeyDown: !this.props.noResize ? this.handleKeyDown : null,
343
343
  onBlur: this.props.onBlur,
344
344
  rows: this.props.rows,
345
345
  cols: this.props.cols,
@@ -3786,13 +3786,15 @@ var Switch = /*#__PURE__*/function (_React$Component) {
3786
3786
  var _proto = Switch.prototype;
3787
3787
 
3788
3788
  _proto.componentDidMount = function componentDidMount() {
3789
- this.setState({
3790
- idxActive: this.props.idxActive
3791
- });
3789
+ if (this.props.idxActive !== undefined) {
3790
+ this.setState({
3791
+ idxActive: this.props.idxActive
3792
+ });
3793
+ }
3792
3794
  };
3793
3795
 
3794
3796
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
3795
- if (prevProps.idxActive !== this.props.prevProps && this.props.idxActive !== this.state.prevProps) {
3797
+ if (prevProps.idxActive !== undefined && prevProps.idxActive !== this.props.idxActive && this.props.idxActive !== this.state.prevProps) {
3796
3798
  this.setState({
3797
3799
  idxActive: this.props.idxActive
3798
3800
  });
@@ -3846,6 +3848,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
3846
3848
 
3847
3849
  _this = _React$Component.call(this, props) || this;
3848
3850
  _this.state = {
3851
+ isActive: false,
3849
3852
  position: 0
3850
3853
  };
3851
3854
  return _this;
@@ -3854,11 +3857,19 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
3854
3857
  var _proto = Gauge.prototype;
3855
3858
 
3856
3859
  _proto.componentDidMount = function componentDidMount() {
3860
+ var _this2 = this;
3861
+
3857
3862
  if (this.props.position) {
3858
3863
  this.setState({
3859
3864
  position: this.props.position
3860
3865
  });
3861
3866
  }
3867
+
3868
+ window.addEventListener('mouseup', function () {
3869
+ _this2.setState({
3870
+ isActive: false
3871
+ });
3872
+ }, true);
3862
3873
  };
3863
3874
 
3864
3875
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
@@ -3870,7 +3881,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
3870
3881
  };
3871
3882
 
3872
3883
  _proto.render = function render() {
3873
- var _this2 = this;
3884
+ var _this3 = this;
3874
3885
 
3875
3886
  return /*#__PURE__*/React.createElement("div", {
3876
3887
  className: this.props.className
@@ -3890,17 +3901,24 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
3890
3901
  backgroundImage: this.props.colors.length === 3 ? "linear-gradient(to right, " + this.props.colors[0] + " 0%, " + this.props.colors[1] + " 50%, " + this.props.colors[2] + " 100%)" : "linear-gradient(to right, " + this.props.colors[0] + ", " + this.props.colors[1] + ")",
3891
3902
  borderRadius: '8px'
3892
3903
  },
3893
- onClick: function onClick(e) {
3894
- var currentTargetRect = e.currentTarget.getBoundingClientRect();
3895
- var width = currentTargetRect.width;
3896
- var positionX = e.pageX - currentTargetRect.left;
3897
- var step = _this2.props.step ? _this2.props.step : 1;
3898
- var position = positionX * 100 / width - positionX * 100 / width % step;
3899
-
3900
- _this2.setState({
3901
- position: position
3902
- }, function () {
3903
- return _this2.props.onChange ? _this2.props.onChange(position) : null;
3904
+ onMouseMove: function onMouseMove(e) {
3905
+ if (_this3.state.isActive) {
3906
+ var currentTargetRect = e.currentTarget.getBoundingClientRect();
3907
+ var width = currentTargetRect.width;
3908
+ var positionX = e.pageX - currentTargetRect.left;
3909
+ var step = _this3.props.step ? _this3.props.step : 1;
3910
+ var position = positionX * 100 / width - positionX * 100 / width % step;
3911
+
3912
+ _this3.setState({
3913
+ position: position
3914
+ }, function () {
3915
+ return _this3.props.onChange ? _this3.props.onChange(position) : null;
3916
+ });
3917
+ }
3918
+ },
3919
+ onMouseDown: function onMouseDown() {
3920
+ _this3.setState({
3921
+ isActive: true
3904
3922
  });
3905
3923
  }
3906
3924
  }, this.props.min ? /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("span", {