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.
- package/dist/index.css +1 -0
- package/dist/index.js +35 -17
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +35 -17
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
@@ -342,7 +342,7 @@ var FormTextarea = /*#__PURE__*/function (_React$Component) {
|
|
342
342
|
}, this.props.title ? /*#__PURE__*/React__default.createElement("span", null, this.props.title, ' ', this.props.required ? /*#__PURE__*/React__default.createElement("span", {
|
343
343
|
className: "red"
|
344
344
|
}, "*") : '') : '', /*#__PURE__*/React__default.createElement("textarea", {
|
345
|
-
onKeyDown: this.handleKeyDown,
|
345
|
+
onKeyDown: !this.props.noResize ? this.handleKeyDown : null,
|
346
346
|
onBlur: this.props.onBlur,
|
347
347
|
rows: this.props.rows,
|
348
348
|
cols: this.props.cols,
|
@@ -3789,13 +3789,15 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
3789
3789
|
var _proto = Switch.prototype;
|
3790
3790
|
|
3791
3791
|
_proto.componentDidMount = function componentDidMount() {
|
3792
|
-
this.
|
3793
|
-
|
3794
|
-
|
3792
|
+
if (this.props.idxActive !== undefined) {
|
3793
|
+
this.setState({
|
3794
|
+
idxActive: this.props.idxActive
|
3795
|
+
});
|
3796
|
+
}
|
3795
3797
|
};
|
3796
3798
|
|
3797
3799
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
3798
|
-
if (prevProps.idxActive !== this.props.
|
3800
|
+
if (prevProps.idxActive !== undefined && prevProps.idxActive !== this.props.idxActive && this.props.idxActive !== this.state.prevProps) {
|
3799
3801
|
this.setState({
|
3800
3802
|
idxActive: this.props.idxActive
|
3801
3803
|
});
|
@@ -3849,6 +3851,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3849
3851
|
|
3850
3852
|
_this = _React$Component.call(this, props) || this;
|
3851
3853
|
_this.state = {
|
3854
|
+
isActive: false,
|
3852
3855
|
position: 0
|
3853
3856
|
};
|
3854
3857
|
return _this;
|
@@ -3857,11 +3860,19 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3857
3860
|
var _proto = Gauge.prototype;
|
3858
3861
|
|
3859
3862
|
_proto.componentDidMount = function componentDidMount() {
|
3863
|
+
var _this2 = this;
|
3864
|
+
|
3860
3865
|
if (this.props.position) {
|
3861
3866
|
this.setState({
|
3862
3867
|
position: this.props.position
|
3863
3868
|
});
|
3864
3869
|
}
|
3870
|
+
|
3871
|
+
window.addEventListener('mouseup', function () {
|
3872
|
+
_this2.setState({
|
3873
|
+
isActive: false
|
3874
|
+
});
|
3875
|
+
}, true);
|
3865
3876
|
};
|
3866
3877
|
|
3867
3878
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
@@ -3873,7 +3884,7 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3873
3884
|
};
|
3874
3885
|
|
3875
3886
|
_proto.render = function render() {
|
3876
|
-
var
|
3887
|
+
var _this3 = this;
|
3877
3888
|
|
3878
3889
|
return /*#__PURE__*/React__default.createElement("div", {
|
3879
3890
|
className: this.props.className
|
@@ -3893,17 +3904,24 @@ var Gauge = /*#__PURE__*/function (_React$Component) {
|
|
3893
3904
|
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] + ")",
|
3894
3905
|
borderRadius: '8px'
|
3895
3906
|
},
|
3896
|
-
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
3907
|
+
onMouseMove: function onMouseMove(e) {
|
3908
|
+
if (_this3.state.isActive) {
|
3909
|
+
var currentTargetRect = e.currentTarget.getBoundingClientRect();
|
3910
|
+
var width = currentTargetRect.width;
|
3911
|
+
var positionX = e.pageX - currentTargetRect.left;
|
3912
|
+
var step = _this3.props.step ? _this3.props.step : 1;
|
3913
|
+
var position = positionX * 100 / width - positionX * 100 / width % step;
|
3914
|
+
|
3915
|
+
_this3.setState({
|
3916
|
+
position: position
|
3917
|
+
}, function () {
|
3918
|
+
return _this3.props.onChange ? _this3.props.onChange(position) : null;
|
3919
|
+
});
|
3920
|
+
}
|
3921
|
+
},
|
3922
|
+
onMouseDown: function onMouseDown() {
|
3923
|
+
_this3.setState({
|
3924
|
+
isActive: true
|
3907
3925
|
});
|
3908
3926
|
}
|
3909
3927
|
}, this.props.min ? /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|