ui-kit-ck-consultant 0.5.206 → 0.5.207

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
@@ -3961,6 +3961,27 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
3961
3961
  var _this;
3962
3962
 
3963
3963
  _this = _React$Component.call(this, props) || this;
3964
+
3965
+ _this.onMouse = function (e, isForce) {
3966
+ if (isForce === void 0) {
3967
+ isForce = false;
3968
+ }
3969
+
3970
+ if (_this.state.isActive || isForce) {
3971
+ var currentTargetRect = e.currentTarget.getBoundingClientRect();
3972
+ var width = currentTargetRect.width;
3973
+ var positionX = e.pageX - currentTargetRect.left;
3974
+ var step = _this.props.step ? _this.props.step : 1;
3975
+ var position = positionX * 100 / width - positionX * 100 / width % step;
3976
+
3977
+ _this.setState({
3978
+ position: position
3979
+ }, function () {
3980
+ return _this.props.onChange ? _this.props.onChange(position) : null;
3981
+ });
3982
+ }
3983
+ };
3984
+
3964
3985
  _this.state = {
3965
3986
  isActive: false,
3966
3987
  position: 0
@@ -4016,21 +4037,14 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
4016
4037
  borderRadius: '8px'
4017
4038
  },
4018
4039
  onMouseMove: function onMouseMove(e) {
4019
- if (_this3.state.isActive) {
4020
- var currentTargetRect = e.currentTarget.getBoundingClientRect();
4021
- var width = currentTargetRect.width;
4022
- var positionX = e.pageX - currentTargetRect.left;
4023
- var step = _this3.props.step ? _this3.props.step : 1;
4024
- var position = positionX * 100 / width - positionX * 100 / width % step;
4025
-
4026
- _this3.setState({
4027
- position: position
4028
- }, function () {
4029
- return _this3.props.onChange ? _this3.props.onChange(position) : null;
4030
- });
4031
- }
4040
+ return _this3.onMouse(e);
4041
+ },
4042
+ onClick: function onClick(e) {
4043
+ return _this3.onMouse(e, true);
4032
4044
  },
4033
- onMouseDown: function onMouseDown() {
4045
+ onMouseDown: function onMouseDown(e) {
4046
+ e.preventDefault();
4047
+
4034
4048
  _this3.setState({
4035
4049
  isActive: true
4036
4050
  });