ui-kit-ck-consultant 0.5.156 → 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.
- package/dist/index.js +28 -12
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +28 -12
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -3848,6 +3848,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3848
3848
|
|
3849
3849
|
_this = _React$Component.call(this, props) || this;
|
3850
3850
|
_this.state = {
|
3851
|
+
isActive: false,
|
3851
3852
|
position: 0
|
3852
3853
|
};
|
3853
3854
|
return _this;
|
@@ -3856,11 +3857,19 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3856
3857
|
var _proto = Gauge.prototype;
|
3857
3858
|
|
3858
3859
|
_proto.componentDidMount = function componentDidMount() {
|
3860
|
+
var _this2 = this;
|
3861
|
+
|
3859
3862
|
if (this.props.position) {
|
3860
3863
|
this.setState({
|
3861
3864
|
position: this.props.position
|
3862
3865
|
});
|
3863
3866
|
}
|
3867
|
+
|
3868
|
+
window.addEventListener('mouseup', function () {
|
3869
|
+
_this2.setState({
|
3870
|
+
isActive: false
|
3871
|
+
});
|
3872
|
+
}, true);
|
3864
3873
|
};
|
3865
3874
|
|
3866
3875
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
@@ -3872,7 +3881,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3872
3881
|
};
|
3873
3882
|
|
3874
3883
|
_proto.render = function render() {
|
3875
|
-
var
|
3884
|
+
var _this3 = this;
|
3876
3885
|
|
3877
3886
|
return /*#__PURE__*/React.createElement("div", {
|
3878
3887
|
className: this.props.className
|
@@ -3892,17 +3901,24 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3892
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] + ")",
|
3893
3902
|
borderRadius: '8px'
|
3894
3903
|
},
|
3895
|
-
|
3896
|
-
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
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
|
3906
3922
|
});
|
3907
3923
|
}
|
3908
3924
|
}, this.props.min ? /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("span", {
|