@signalplus/params-about 0.1.7 → 0.1.10
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/index.d.ts +2 -1
- package/lib/es/index.js +11 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ interface ParamFormProps {
|
|
|
78
78
|
parentOptions: ParentSelectorProps['parentOptions'];
|
|
79
79
|
expiriesOptions: string[];
|
|
80
80
|
initialValues?: Partial<ParamFormData>;
|
|
81
|
+
groupEditable?: boolean;
|
|
81
82
|
onChange?(data: ParamFormData): void;
|
|
82
83
|
onSubmit?(data: ParamFormData): any;
|
|
83
84
|
}
|
|
@@ -282,7 +283,7 @@ declare function paramValidator(val: any, values: {
|
|
|
282
283
|
valueType: ParamType;
|
|
283
284
|
}): string;
|
|
284
285
|
declare const ParamTypeOptions: {
|
|
285
|
-
value:
|
|
286
|
+
value: number;
|
|
286
287
|
label: string;
|
|
287
288
|
name: string;
|
|
288
289
|
key?: string | undefined;
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
|
-
* Generated: 2022-04-
|
|
4
|
-
* Version: 0.1.
|
|
3
|
+
* Generated: 2022-04-10
|
|
4
|
+
* Version: 0.1.10
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -1204,7 +1204,7 @@ var ParamTypeOptions = Object.entries(ParamTypeConfig).map(function (_ref) {
|
|
|
1204
1204
|
config = _ref2[1];
|
|
1205
1205
|
|
|
1206
1206
|
return _objectSpread2(_objectSpread2({}, config), {}, {
|
|
1207
|
-
value: value,
|
|
1207
|
+
value: Number(value),
|
|
1208
1208
|
label: config.name
|
|
1209
1209
|
});
|
|
1210
1210
|
});
|
|
@@ -1309,6 +1309,7 @@ function ParentSelector(props) {
|
|
|
1309
1309
|
options = _useMemo.options;
|
|
1310
1310
|
|
|
1311
1311
|
return /*#__PURE__*/React.createElement(Cascader, {
|
|
1312
|
+
changeOnSelect: true,
|
|
1312
1313
|
style: props.style,
|
|
1313
1314
|
disabled: props.readonly,
|
|
1314
1315
|
placeholder: '请选择',
|
|
@@ -1363,7 +1364,8 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1363
1364
|
name: 'parentId',
|
|
1364
1365
|
Comp: function Comp(props) {
|
|
1365
1366
|
return /*#__PURE__*/React.createElement(ParentSelector, Object.assign({}, props, {
|
|
1366
|
-
parentOptions: _this2.props.parentOptions
|
|
1367
|
+
parentOptions: _this2.props.parentOptions,
|
|
1368
|
+
readonly: _this2.props.groupEditable
|
|
1367
1369
|
}));
|
|
1368
1370
|
},
|
|
1369
1371
|
required: true,
|
|
@@ -1392,9 +1394,9 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1392
1394
|
label: '参数类型',
|
|
1393
1395
|
name: 'valueType',
|
|
1394
1396
|
Comp: function Comp(props) {
|
|
1395
|
-
return /*#__PURE__*/React.createElement(Select, Object.assign({
|
|
1397
|
+
return /*#__PURE__*/React.createElement(Select, Object.assign({}, props, {
|
|
1396
1398
|
placeholder: '请选择'
|
|
1397
|
-
}
|
|
1399
|
+
}), ParamTypeOptions.map(function (it) {
|
|
1398
1400
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
1399
1401
|
key: it.value,
|
|
1400
1402
|
value: it.value
|
|
@@ -1409,11 +1411,11 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1409
1411
|
label: '默认值',
|
|
1410
1412
|
name: 'defaultValue',
|
|
1411
1413
|
Comp: function Comp(props) {
|
|
1412
|
-
var _this2$ref$current;
|
|
1414
|
+
var _this2$ref$current$ge, _this2$ref$current, _this2$props$initialV;
|
|
1413
1415
|
|
|
1414
1416
|
return /*#__PURE__*/React.createElement(ParamRenderer, Object.assign({}, props, {
|
|
1415
1417
|
expiriesOptions: _this2.props.expiriesOptions,
|
|
1416
|
-
valueType: (_this2$ref$current = _this2.ref.current) === null || _this2$ref$current === void 0 ? void 0 : _this2$ref$current.getFieldValue('valueType')
|
|
1418
|
+
valueType: (_this2$ref$current$ge = (_this2$ref$current = _this2.ref.current) === null || _this2$ref$current === void 0 ? void 0 : _this2$ref$current.getFieldValue('valueType')) !== null && _this2$ref$current$ge !== void 0 ? _this2$ref$current$ge : (_this2$props$initialV = _this2.props.initialValues) === null || _this2$props$initialV === void 0 ? void 0 : _this2$props$initialV.valueType
|
|
1417
1419
|
}));
|
|
1418
1420
|
},
|
|
1419
1421
|
validator: validatorCvt(paramValidator, function () {
|
|
@@ -2093,7 +2095,7 @@ function genOptions(props) {
|
|
|
2093
2095
|
});
|
|
2094
2096
|
};
|
|
2095
2097
|
|
|
2096
|
-
return props.allParams.map(cvt) || [];
|
|
2098
|
+
return props.allParams.filter(filter).map(cvt) || [];
|
|
2097
2099
|
}
|
|
2098
2100
|
|
|
2099
2101
|
function genParamsMap(props) {
|