ui-kit-ck-consultant 0.5.266 → 0.5.268

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.
package/dist/index.js CHANGED
@@ -4402,6 +4402,14 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
4402
4402
 
4403
4403
  _this = _React$Component.call(this, props) || this;
4404
4404
 
4405
+ _this.eventMouseUp = function () {
4406
+ if (_this.state.isDisplay) {
4407
+ _this.setState({
4408
+ isActive: false
4409
+ });
4410
+ }
4411
+ };
4412
+
4405
4413
  _this.onMouse = function (e, isForce) {
4406
4414
  if (isForce === void 0) {
4407
4415
  isForce = false;
@@ -4423,6 +4431,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
4423
4431
  };
4424
4432
 
4425
4433
  _this.state = {
4434
+ isDisplay: true,
4426
4435
  isActive: false,
4427
4436
  position: 0
4428
4437
  };
@@ -4432,7 +4441,9 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
4432
4441
  var _proto = Gauge.prototype;
4433
4442
 
4434
4443
  _proto.componentDidMount = function componentDidMount() {
4435
- var _this2 = this;
4444
+ this.setState({
4445
+ isDisplay: true
4446
+ });
4436
4447
 
4437
4448
  if (this.props.position) {
4438
4449
  this.setState({
@@ -4440,11 +4451,17 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
4440
4451
  });
4441
4452
  }
4442
4453
 
4443
- window.addEventListener('mouseup', function () {
4444
- _this2.setState({
4445
- isActive: false
4446
- });
4447
- }, true);
4454
+ window.addEventListener('mouseup', this.eventMouseUp, true);
4455
+ };
4456
+
4457
+ _proto.componentWillUnmount = function componentWillUnmount() {
4458
+ var _this2 = this;
4459
+
4460
+ this.setState({
4461
+ isDisplay: false
4462
+ }, function () {
4463
+ window.removeEventListener('mouseup', _this2.eventMouseUp);
4464
+ });
4448
4465
  };
4449
4466
 
4450
4467
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {