@signalplus/params-about 1.0.1 → 1.0.4

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.
Files changed (2) hide show
  1. package/lib/es/index.js +17 -13
  2. package/package.json +1 -1
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2022-05-09
4
- * Version: 1.0.1
3
+ * Generated: 2022-08-15
4
+ * Version: 1.0.4
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -278,7 +278,7 @@ function numRangeValidator(val, enableEmpty) {
278
278
  return "Max: ".concat(error);
279
279
  }
280
280
 
281
- return val.min > val.max ? 'Max should bigger than Min' : '';
281
+ return +val.min > +val.max ? 'Max should bigger than Min' : '';
282
282
  }
283
283
  function expiryValidator(val, enableEmpty) {
284
284
  var error = emptyValidator(val, enableEmpty);
@@ -769,9 +769,13 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
769
769
  });
770
770
 
771
771
  _defineProperty(_assertThisInitialized(_this), "onChange", function (val) {
772
- var _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
772
+ var _this$props$value, _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
773
+
774
+ var value = _toConsumableArray(((_this$props$value = _this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (item) {
775
+ var _this$props$options;
773
776
 
774
- var value = _toConsumableArray(_this.props.value || []);
777
+ return (_this$props$options = _this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.includes(item);
778
+ })) || []);
775
779
 
776
780
  if (_this.props.multiple !== false) {
777
781
  var index = value.findIndex(function (it) {
@@ -793,10 +797,10 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
793
797
  _createClass(Expiries, [{
794
798
  key: "renderValue",
795
799
  value: function renderValue() {
796
- var _this$props$value,
800
+ var _this$props$value2,
797
801
  _this2 = this;
798
802
 
799
- var value = (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (it) {
803
+ var value = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.filter(function (it) {
800
804
  return it && !isExpired(it);
801
805
  });
802
806
 
@@ -811,9 +815,9 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
811
815
  }, "Choose");
812
816
 
813
817
  if (this.props.multiple === false) {
814
- var _this$props$value2;
818
+ var _this$props$value3;
815
819
 
816
- var _val = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2[0];
820
+ var _val = (_this$props$value3 = this.props.value) === null || _this$props$value3 === void 0 ? void 0 : _this$props$value3[0];
817
821
 
818
822
  return !_val || isExpired(_val) ? placeholder : /*#__PURE__*/React.createElement("span", {
819
823
  className: "param-expiries-val"
@@ -836,7 +840,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
836
840
  }, {
837
841
  key: "render",
838
842
  value: function render() {
839
- var _this$props$options,
843
+ var _this$props$options2,
840
844
  _this3 = this;
841
845
 
842
846
  return /*#__PURE__*/React.createElement(Popover, {
@@ -845,7 +849,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
845
849
  placement: 'bottomLeft',
846
850
  visible: !this.props.readonly && this.state.visible,
847
851
  onVisibleChange: this.handleVisibleChange,
848
- content: (_this$props$options = this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.map(function (it) {
852
+ content: (_this$props$options2 = this.props.options) === null || _this$props$options2 === void 0 ? void 0 : _this$props$options2.map(function (it) {
849
853
  var _this3$props$value, _this3$props$calcDisa, _this3$props, _this3$onChange;
850
854
 
851
855
  var checked = (_this3$props$value = _this3.props.value) === null || _this3$props$value === void 0 ? void 0 : _this3$props$value.includes(it);
@@ -1172,10 +1176,10 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1172
1176
  return "The ".concat(i + 1, "th item: at least one parameter must be specified between AUM and ABS");
1173
1177
  }
1174
1178
 
1175
- if ((!isNullLike(val === null || val === void 0 ? void 0 : val.minAbs) || !isNullLike(val === null || val === void 0 ? void 0 : val.maxAbs)) && val.minAbs >= val.maxAbs) // return { [i]: { minAbs: 'Min ABS should smaller than Max ABS' } }
1179
+ if ((!isNullLike(val === null || val === void 0 ? void 0 : val.minAbs) || !isNullLike(val === null || val === void 0 ? void 0 : val.maxAbs)) && +val.minAbs >= +val.maxAbs) // return { [i]: { minAbs: 'Min ABS should smaller than Max ABS' } }
1176
1180
  return "The ".concat(i + 1, "th item: Min ABS should smaller than Max ABS");
1177
1181
 
1178
- if ((!isNullLike(val === null || val === void 0 ? void 0 : val.minAumPercentage) || !isNullLike(val === null || val === void 0 ? void 0 : val.maxAumPercentage)) && val.minAumPercentage >= val.maxAumPercentage) {
1182
+ if ((!isNullLike(val === null || val === void 0 ? void 0 : val.minAumPercentage) || !isNullLike(val === null || val === void 0 ? void 0 : val.maxAumPercentage)) && +val.minAumPercentage >= +val.maxAumPercentage) {
1179
1183
  // return {
1180
1184
  // [i]: { minAumPercentage: 'Min AUM should smaller than Max AUM' },
1181
1185
  // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",