@signalplus/params-about 0.1.40 → 0.1.43
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 +27 -13
- 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
3
|
* Generated: 2022-04-19
|
|
4
|
-
* Version: 0.1.
|
|
4
|
+
* Version: 0.1.43
|
|
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, '
|
|
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(
|
|
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 (
|
|
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
|
|
|
@@ -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
|
}, "%"));
|
|
@@ -549,7 +554,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
|
|
|
549
554
|
}], [{
|
|
550
555
|
key: "getDerivedStateFromProps",
|
|
551
556
|
value: function getDerivedStateFromProps(props, state) {
|
|
552
|
-
if (props.value !== state.preProps.value &&
|
|
557
|
+
if (props.value !== state.preProps.value && NumCvt.emit(state.tempValue, props.isPercentage) !== props.value) {
|
|
553
558
|
state.tempValue = NumCvt.show(props.value, props.isPercentage);
|
|
554
559
|
}
|
|
555
560
|
|
|
@@ -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, {
|
|
@@ -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
|
}], [{
|
|
@@ -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) {
|