@signalplus/params-about 0.1.14 → 0.1.17
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 +10 -16
- 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-10
|
|
4
|
-
* Version: 0.1.
|
|
4
|
+
* Version: 0.1.17
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -2081,24 +2081,16 @@ var ParamGroupEditorModal = /*#__PURE__*/function () {
|
|
|
2081
2081
|
|
|
2082
2082
|
_defineProperty(ParamGroupEditorModal, "el", new ReactGlobalComp('param-group-editor-modal', ParamGroupEditorModalEl));
|
|
2083
2083
|
|
|
2084
|
-
function genOptions(props
|
|
2084
|
+
function genOptions(props) {
|
|
2085
2085
|
var filter = function filter(it) {
|
|
2086
2086
|
return it.valueType === ParamType.ParamGroup;
|
|
2087
2087
|
};
|
|
2088
2088
|
|
|
2089
|
-
var paramsAndParent = props.targetParams.flatMap(function (id) {
|
|
2090
|
-
var _paramsMap$id;
|
|
2091
|
-
|
|
2092
|
-
return [id, (_paramsMap$id = paramsMap[id]) === null || _paramsMap$id === void 0 ? void 0 : _paramsMap$id.parentId];
|
|
2093
|
-
}).filter(function (it) {
|
|
2094
|
-
return it !== undefined;
|
|
2095
|
-
}).map(String);
|
|
2096
|
-
|
|
2097
2089
|
var cvt = function cvt(it) {
|
|
2098
2090
|
var _it$children;
|
|
2099
2091
|
|
|
2100
2092
|
return _objectSpread2(_objectSpread2({}, it), {}, {
|
|
2101
|
-
disabled:
|
|
2093
|
+
disabled: props.targetParams.includes(String(it.$paramId)),
|
|
2102
2094
|
children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.filter(filter).map(cvt)
|
|
2103
2095
|
});
|
|
2104
2096
|
};
|
|
@@ -2126,7 +2118,7 @@ function initState(props) {
|
|
|
2126
2118
|
var paramsMap = genParamsMap(props);
|
|
2127
2119
|
return {
|
|
2128
2120
|
preProps: props,
|
|
2129
|
-
options: genOptions(props
|
|
2121
|
+
options: genOptions(props),
|
|
2130
2122
|
paramsMap: paramsMap
|
|
2131
2123
|
};
|
|
2132
2124
|
}
|
|
@@ -2162,16 +2154,18 @@ var ParamMover = /*#__PURE__*/function (_PureComponent) {
|
|
|
2162
2154
|
var _getFieldsValue = this.ref.current.getFieldsValue(),
|
|
2163
2155
|
parentId = _getFieldsValue.parentId;
|
|
2164
2156
|
|
|
2157
|
+
var targetParams = this.props.targetParams.map(String);
|
|
2158
|
+
|
|
2165
2159
|
var filter = function filter(it) {
|
|
2166
|
-
return !
|
|
2160
|
+
return !targetParams.includes(String(it.$paramId));
|
|
2167
2161
|
};
|
|
2168
2162
|
|
|
2169
2163
|
var map = function map(it) {
|
|
2170
2164
|
var _it$children3;
|
|
2171
2165
|
|
|
2172
|
-
if (it.$paramId === parentId) {
|
|
2166
|
+
if (String(it.$paramId) === String(parentId)) {
|
|
2173
2167
|
return _objectSpread2(_objectSpread2({}, it), {}, {
|
|
2174
|
-
children: (it.children || []).concat(_this2.props.targetParams.map(function ($paramId) {
|
|
2168
|
+
children: (it.children || []).filter(filter).concat(_this2.props.targetParams.map(function ($paramId) {
|
|
2175
2169
|
return _objectSpread2(_objectSpread2({}, _this2.state.paramsMap[$paramId]), {}, {
|
|
2176
2170
|
parentId: it.$paramId
|
|
2177
2171
|
});
|
|
@@ -2235,7 +2229,7 @@ var ParamMover = /*#__PURE__*/function (_PureComponent) {
|
|
|
2235
2229
|
state.paramsMap = genParamsMap(props);
|
|
2236
2230
|
|
|
2237
2231
|
if (props.targetParams !== state.preProps.targetParams) {
|
|
2238
|
-
state.options = genOptions(props
|
|
2232
|
+
state.options = genOptions(props);
|
|
2239
2233
|
}
|
|
2240
2234
|
}
|
|
2241
2235
|
|