@signalplus/params-about 0.1.6 → 0.1.9
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 +3 -2
- package/lib/es/index.js +12 -10
- 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
|
}
|
|
@@ -180,7 +181,7 @@ interface ParamGroupEditorProps extends Required<Pick<ImageUploadProps, 'getSign
|
|
|
180
181
|
/**
|
|
181
182
|
* 传了表示为有父级
|
|
182
183
|
* */
|
|
183
|
-
|
|
184
|
+
parentOptions?: ParentSelectorProps['parentOptions'];
|
|
184
185
|
initialValues?: Partial<ParamGroupEditorData>;
|
|
185
186
|
onChange?(data: ParamGroupEditorData): void;
|
|
186
187
|
onSubmit?(data: ParamGroupEditorData): any;
|
|
@@ -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-09
|
|
4
|
+
* Version: 0.1.9
|
|
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 () {
|
|
@@ -1887,7 +1889,7 @@ var ParamGroupEditor = /*#__PURE__*/function (_PureComponent) {
|
|
|
1887
1889
|
var _this$props$initialVa,
|
|
1888
1890
|
_this2 = this;
|
|
1889
1891
|
|
|
1890
|
-
var isFirstLevel = !this.props.
|
|
1892
|
+
var isFirstLevel = !this.props.parentOptions && !((_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.parentId);
|
|
1891
1893
|
var items = [{
|
|
1892
1894
|
label: '参数组名称',
|
|
1893
1895
|
name: 'name',
|
|
@@ -1919,7 +1921,7 @@ var ParamGroupEditor = /*#__PURE__*/function (_PureComponent) {
|
|
|
1919
1921
|
name: 'parentId',
|
|
1920
1922
|
Comp: function Comp(props) {
|
|
1921
1923
|
return /*#__PURE__*/React.createElement(ParentSelector, Object.assign({}, props, {
|
|
1922
|
-
parentOptions: _this2.props.
|
|
1924
|
+
parentOptions: _this2.props.parentOptions
|
|
1923
1925
|
}));
|
|
1924
1926
|
}
|
|
1925
1927
|
});
|