@signalplus/params-about 0.1.41 → 0.1.44

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/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
3
  * Generated: 2022-04-19
4
- * Version: 0.1.41
4
+ * Version: 0.1.44
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
  }
@@ -463,7 +467,7 @@ var NumCvt = /*#__PURE__*/function () {
463
467
  }, {
464
468
  key: "emit",
465
469
  value: function emit(val, isPercentage) {
466
- if (!val) return undefined;
470
+ if (!val || val === '-') return undefined;
467
471
  if (!isPercentage) return +val;
468
472
  return +Big(val).div(100);
469
473
  }
@@ -510,7 +514,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
510
514
  }, function () {
511
515
  var _this$props$onChange, _this$props;
512
516
 
513
- if ($val !== '-' && value !== _this.props.value) (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
517
+ if (value !== _this.props.value) (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
514
518
  });
515
519
  });
516
520
 
@@ -550,7 +554,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
550
554
  }], [{
551
555
  key: "getDerivedStateFromProps",
552
556
  value: function getDerivedStateFromProps(props, state) {
553
- if (props.value !== state.preProps.value && parseFloat(state.tempValue) !== props.value) {
557
+ if (props.value !== state.preProps.value && NumCvt.emit(state.tempValue, props.isPercentage) !== props.value) {
554
558
  state.tempValue = NumCvt.show(props.value, props.isPercentage);
555
559
  }
556
560
 
@@ -1189,7 +1193,7 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1189
1193
  Comp: Expiries,
1190
1194
  validator: expiriesValidator
1191
1195
  }), _defineProperty(_ParamTypeConfig, ParamType.Phone, {
1192
- name: '联系人电话',
1196
+ name: '文本列表',
1193
1197
  key: 'list',
1194
1198
  Comp: TextArray,
1195
1199
  validator: function validator($val) {