@signalplus/params-about 0.1.20 → 0.1.21
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 +5 -0
- package/lib/es/index.js +17 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -227,6 +227,11 @@ interface ParamMoverProps {
|
|
|
227
227
|
* */
|
|
228
228
|
targetParams: (string | number)[];
|
|
229
229
|
allParams: NonNullable<ParentSelectorProps['parentOptions']>;
|
|
230
|
+
/**
|
|
231
|
+
* 最大层级(包括参数)
|
|
232
|
+
* @default 3
|
|
233
|
+
* */
|
|
234
|
+
maxLevel?: number;
|
|
230
235
|
onSubmit?(params: NonNullable<ParentSelectorProps['parentOptions']>): any;
|
|
231
236
|
}
|
|
232
237
|
declare function initState(props: ParamMoverProps): {
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
3
|
* Generated: 2022-04-11
|
|
4
|
-
* Version: 0.1.
|
|
4
|
+
* Version: 0.1.21
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -2082,20 +2082,31 @@ var ParamGroupEditorModal = /*#__PURE__*/function () {
|
|
|
2082
2082
|
_defineProperty(ParamGroupEditorModal, "el", new ReactGlobalComp('param-group-editor-modal', ParamGroupEditorModalEl));
|
|
2083
2083
|
|
|
2084
2084
|
function genOptions(props) {
|
|
2085
|
-
var
|
|
2086
|
-
|
|
2085
|
+
var _props$maxLevel = props.maxLevel,
|
|
2086
|
+
maxLevel = _props$maxLevel === void 0 ? 3 : _props$maxLevel;
|
|
2087
|
+
|
|
2088
|
+
var filter = function filter(it, level) {
|
|
2089
|
+
return it.valueType === ParamType.ParamGroup && level < maxLevel;
|
|
2087
2090
|
};
|
|
2088
2091
|
|
|
2089
|
-
var cvt = function cvt(it) {
|
|
2092
|
+
var cvt = function cvt(it, level) {
|
|
2090
2093
|
var _it$children;
|
|
2091
2094
|
|
|
2092
2095
|
return _objectSpread2(_objectSpread2({}, it), {}, {
|
|
2093
2096
|
disabled: props.targetParams.includes(String(it.$paramId)),
|
|
2094
|
-
children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.filter(
|
|
2097
|
+
children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.filter(function ($it) {
|
|
2098
|
+
return filter($it, level + 1);
|
|
2099
|
+
}).map(function ($it) {
|
|
2100
|
+
return cvt($it, level + 1);
|
|
2101
|
+
})
|
|
2095
2102
|
});
|
|
2096
2103
|
};
|
|
2097
2104
|
|
|
2098
|
-
return props.allParams.
|
|
2105
|
+
return props.allParams.filter(function (it) {
|
|
2106
|
+
return filter(it, 1);
|
|
2107
|
+
}).map(function (it) {
|
|
2108
|
+
return cvt(it, 1);
|
|
2109
|
+
}) || [];
|
|
2099
2110
|
}
|
|
2100
2111
|
|
|
2101
2112
|
function genParamsMap(props) {
|