@signalplus/params-about 0.1.39 → 0.1.42

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 +29 -15
  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-04-18
4
- * Version: 0.1.39
3
+ * Generated: 2022-04-19
4
+ * Version: 0.1.42
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -281,9 +281,11 @@ function numRangeValidator(val, enableEmpty) {
281
281
  return val.min > val.max ? 'Max should bigger than Min' : '';
282
282
  }
283
283
  function expiryValidator(val, enableEmpty) {
284
+ var _val$match;
285
+
284
286
  var error = emptyValidator(val, enableEmpty);
285
287
  if (error) return error;
286
- var $val = dayjs(val, 'DDMMMYY').format('DDMMMYY').toUpperCase();
288
+ var $val = dayjs(((_val$match = val.match(/\d+|[a-zA-Z]+/g)) === null || _val$match === void 0 ? void 0 : _val$match.slice(0, 3).join('-')) || '', 'D-MMM-YY').format('DMMMYY').toUpperCase();
287
289
  if ($val !== val) return 'Out of format';
288
290
  return '';
289
291
  }
@@ -316,9 +318,11 @@ function keyValidator(val, allKeys) {
316
318
  return '';
317
319
  }
318
320
  function isExpired(val) {
321
+ var _val$match2;
322
+
319
323
  if (!val) return false;
320
324
  var now = dayjs();
321
- var expiry = dayjs("".concat(val), 'DDMMMYY');
325
+ var expiry = dayjs(((_val$match2 = val.match(/\d+|[a-zA-Z]+/g)) === null || _val$match2 === void 0 ? void 0 : _val$match2.slice(0, 3).join('-')) || '', 'D-MMM-YY');
322
326
  var expireTime = dayjs("".concat(expiry.format('YYYY-MM-DD'), "T08:00Z"));
323
327
  return now >= expireTime;
324
328
  }
@@ -541,7 +545,8 @@ var Num = /*#__PURE__*/function (_PureComponent) {
541
545
  placeholder: this.props.placeholder || 'Value',
542
546
  value: this.state.tempValue || '',
543
547
  onChange: this.onChange,
544
- onBlur: this.onBlur
548
+ onBlur: this.onBlur,
549
+ autoComplete: "off"
545
550
  }), this.props.isPercentage && /*#__PURE__*/React.createElement("span", {
546
551
  className: "param-number-suffix"
547
552
  }, "%"));
@@ -721,7 +726,8 @@ var TextArray = /*#__PURE__*/function (_PureComponent) {
721
726
  placeholder: "Phone",
722
727
  value: it,
723
728
  onChange: _this2.onChange.bind(null, i),
724
- onBlur: _this2.props.onBlur
729
+ onBlur: _this2.props.onBlur,
730
+ autoComplete: "off"
725
731
  }), /*#__PURE__*/React.createElement("div", {
726
732
  className: "param-arr-ops"
727
733
  }, /*#__PURE__*/React.createElement(PlusOutlined, {
@@ -957,9 +963,9 @@ var ExpiriesLimit = /*#__PURE__*/function (_PureComponent) {
957
963
  key: i
958
964
  }, it.expiry, /*#__PURE__*/React.createElement("span", {
959
965
  className: "param-expiries-limit-val-sep"
960
- }, "/"), it.minAumPercentage && it.maxAumPercentage ? "(".concat(NumCvt.show(it.minAumPercentage, true), "%, ").concat(NumCvt.show(it.maxAumPercentage, true), "%)") : '-', /*#__PURE__*/React.createElement("span", {
966
+ }, "/"), !isNullLike(it.minAumPercentage) && !isNullLike(it.maxAumPercentage) ? "(".concat(NumCvt.show(it.minAumPercentage, true), "%, ").concat(NumCvt.show(it.maxAumPercentage, true), "%)") : '-', /*#__PURE__*/React.createElement("span", {
961
967
  className: "param-expiries-limit-val-sep"
962
- }, "/"), it.minAbs && it.maxAbs ? "(".concat(it.minAbs, ", ").concat(it.maxAbs, ")") : '-');
968
+ }, "/"), !isNullLike(it.minAbs) && !isNullLike(it.maxAbs) ? "(".concat(it.minAbs, ", ").concat(it.maxAbs, ")") : '-');
963
969
  }) : '-' : /*#__PURE__*/React.createElement("div", {
964
970
  className: "param-expiries-limit-inputs"
965
971
  }, /*#__PURE__*/React.createElement("div", {
@@ -1085,7 +1091,8 @@ var Text = /*#__PURE__*/function (_PureComponent) {
1085
1091
  placeholder: this.props.placeholder || 'Text',
1086
1092
  value: this.props.value || '',
1087
1093
  onChange: this.onChange,
1088
- onBlur: this.onBlur
1094
+ onBlur: this.onBlur,
1095
+ autoComplete: "off"
1089
1096
  }));
1090
1097
  }
1091
1098
  }], [{
@@ -1167,10 +1174,10 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1167
1174
  return "The ".concat(i + 1, "th item: at least one parameter must be specified between AUM and ABS");
1168
1175
  }
1169
1176
 
1170
- if (val.minAbs > val.maxAbs) // return { [i]: { minAbs: 'Min ABS should smaller than Max ABS' } }
1177
+ if (val.minAbs >= val.maxAbs) // return { [i]: { minAbs: 'Min ABS should smaller than Max ABS' } }
1171
1178
  return "The ".concat(i + 1, "th item: Min ABS should smaller than Max ABS");
1172
1179
 
1173
- if (val.minAumPercentage > val.maxAumPercentage) {
1180
+ if (val.minAumPercentage >= val.maxAumPercentage) {
1174
1181
  // return {
1175
1182
  // [i]: { minAumPercentage: 'Min AUM should smaller than Max AUM' },
1176
1183
  // }
@@ -1388,7 +1395,9 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1388
1395
  Comp: function Comp(props) {
1389
1396
  return /*#__PURE__*/React.createElement(Input, Object.assign({
1390
1397
  placeholder: '请输入'
1391
- }, props));
1398
+ }, props, {
1399
+ autoComplete: "off"
1400
+ }));
1392
1401
  },
1393
1402
  required: true,
1394
1403
  validator: validatorCvt(function (val) {
@@ -1400,7 +1409,9 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1400
1409
  Comp: function Comp(props) {
1401
1410
  return /*#__PURE__*/React.createElement(Input, Object.assign({
1402
1411
  placeholder: '请输入'
1403
- }, props));
1412
+ }, props, {
1413
+ autoComplete: "off"
1414
+ }));
1404
1415
  }
1405
1416
  }, {
1406
1417
  label: '参数类型',
@@ -1442,7 +1453,9 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1442
1453
  Comp: function Comp(props) {
1443
1454
  return /*#__PURE__*/React.createElement(Input.TextArea, Object.assign({
1444
1455
  placeholder: '请输入'
1445
- }, props));
1456
+ }, props, {
1457
+ autoComplete: "off"
1458
+ }));
1446
1459
  }
1447
1460
  }];
1448
1461
  }
@@ -1917,7 +1930,8 @@ var ParamGroupEditor = /*#__PURE__*/function (_PureComponent) {
1917
1930
  name: 'name',
1918
1931
  Comp: function Comp(props) {
1919
1932
  return /*#__PURE__*/React.createElement(Input, Object.assign({}, props, {
1920
- placeholder: '请输入'
1933
+ placeholder: '请输入',
1934
+ autoComplete: "off"
1921
1935
  }));
1922
1936
  },
1923
1937
  validator: validatorCvt(function (val) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "0.1.39",
3
+ "version": "0.1.42",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",