react-cron-generator
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -94,3 +94,6 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "col-md-offset-2 col-md-6 text_align_right" | ||
className: "text_align_right row", | ||
style: { | ||
width: '100%' | ||
} | ||
}, /*#__PURE__*/React.createElement("input", { | ||
@@ -107,3 +110,3 @@ type: "radio", | ||
}), /*#__PURE__*/React.createElement("span", { | ||
className: "margin-right-10 " | ||
className: "" | ||
}, translateFn('At')), /*#__PURE__*/React.createElement(Hour, { | ||
@@ -110,0 +113,0 @@ disabled: this.state.every, |
@@ -46,4 +46,10 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (this.props.value !== nextProps.value) { | ||
this.setValue(nextProps.value); | ||
if (this.props.value !== nextProps.value && this.state.value) { | ||
var newVal = ''; | ||
newVal = this.state.value.toString().replace(/,/g, ' '); | ||
newVal = newVal.replace(/!/g, ','); | ||
if (nextProps.value !== newVal) { | ||
this.setValue(nextProps.value); | ||
} | ||
} | ||
@@ -91,7 +97,10 @@ } | ||
value: function tabChanged(tab) { | ||
var _this2 = this; | ||
this.setState({ | ||
selectedTab: tab, | ||
value: this.defaultValue(tab) | ||
}, function () { | ||
return _this2.parentChange(_this2.defaultValue(tab)); | ||
}); | ||
this.parentChange(this.defaultValue(tab)); | ||
} | ||
@@ -101,3 +110,3 @@ }, { | ||
value: function getHeaders() { | ||
var _this2 = this; | ||
var _this3 = this; | ||
@@ -107,6 +116,6 @@ return this.state.headers.map(function (d, index) { | ||
key: index, | ||
className: _this2.state.selectedTab === d ? 'active' : '' | ||
className: _this3.state.selectedTab === d ? 'active' : '' | ||
}, /*#__PURE__*/React.createElement("a", { | ||
onClick: _this2.tabChanged.bind(_this2, d) | ||
}, _this2.translate(d))); | ||
onClick: _this3.tabChanged.bind(_this3, d) | ||
}, _this3.translate(d))); | ||
}); | ||
@@ -117,14 +126,18 @@ } | ||
value: function onValueChange(val) { | ||
var _this4 = this; | ||
if (val && val.length) { | ||
this.setState({ | ||
value: val | ||
}, function () { | ||
return _this4.parentChange(val); | ||
}); | ||
} else { | ||
val = ['0', '0', '00', '1/1', '*', '?', '*']; | ||
this.setState({ | ||
value: ['0', '0', '00', '1/1', '*', '?', '*'] | ||
}); | ||
val = ['0', '0', '00', '1/1', '*', '?', '*']; | ||
value: val | ||
}, function () { | ||
return _this4.parentChange(val); | ||
}); // val = ['0','0','00','1/1','*','?','*']; | ||
} | ||
this.parentChange(val); | ||
} | ||
@@ -131,0 +144,0 @@ }, { |
{ | ||
"name": "react-cron-generator", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "Simple react component to generate cron expression", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
42021
1004