@zgfe/business-lib 1.1.73-beta.0 → 1.1.73-beta.2
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.
|
@@ -23,7 +23,7 @@ var StringList = function StringList(props) {
|
|
|
23
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
24
|
current = _useState2[0],
|
|
25
25
|
setCurrent = _useState2[1];
|
|
26
|
-
var _useState3 = useState(),
|
|
26
|
+
var _useState3 = useState([]),
|
|
27
27
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
28
28
|
options = _useState4[0],
|
|
29
29
|
setOptions = _useState4[1];
|
|
@@ -39,6 +39,10 @@ var StringList = function StringList(props) {
|
|
|
39
39
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
40
40
|
timer = _useState10[0],
|
|
41
41
|
setTimer = _useState10[1];
|
|
42
|
+
var _useState11 = useState(false),
|
|
43
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
44
|
+
focus = _useState12[0],
|
|
45
|
+
setFocus = _useState12[1];
|
|
42
46
|
useEffect(function () {
|
|
43
47
|
setSearchValue('');
|
|
44
48
|
if (props.value && Object.keys(props.value).length > 0) {
|
|
@@ -55,7 +59,6 @@ var StringList = function StringList(props) {
|
|
|
55
59
|
}, [props.value]);
|
|
56
60
|
useEffect(function () {
|
|
57
61
|
if (searchValue) setSearchValue('');
|
|
58
|
-
fetchValues();
|
|
59
62
|
if (isFirst) {
|
|
60
63
|
setIsFirst(false);
|
|
61
64
|
} else {
|
|
@@ -69,8 +72,15 @@ var StringList = function StringList(props) {
|
|
|
69
72
|
}
|
|
70
73
|
}, [props.operate]);
|
|
71
74
|
useEffect(function () {
|
|
75
|
+
if (!focus && !searchValue) return;
|
|
72
76
|
fetchValues();
|
|
73
77
|
}, [searchValue]);
|
|
78
|
+
var onVisibleChange = function onVisibleChange(flag) {
|
|
79
|
+
if (flag) {
|
|
80
|
+
fetchValues();
|
|
81
|
+
}
|
|
82
|
+
setFocus(flag);
|
|
83
|
+
};
|
|
74
84
|
var fetchValues = /*#__PURE__*/function () {
|
|
75
85
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
76
86
|
var fetch;
|
|
@@ -135,7 +145,7 @@ var StringList = function StringList(props) {
|
|
|
135
145
|
});
|
|
136
146
|
if (props.onChange) props.onChange(resData);
|
|
137
147
|
};
|
|
138
|
-
if (!
|
|
148
|
+
if (!props.attr) {
|
|
139
149
|
return /*#__PURE__*/React.createElement(BizSelect, {
|
|
140
150
|
multiple: true,
|
|
141
151
|
enableCreate: true,
|
|
@@ -161,6 +171,7 @@ var StringList = function StringList(props) {
|
|
|
161
171
|
options: options,
|
|
162
172
|
onChange: onChange,
|
|
163
173
|
onSearch: setSearchValue,
|
|
174
|
+
onVisibleChange: onVisibleChange,
|
|
164
175
|
placeholder: "\u8BF7\u9009\u62E9"
|
|
165
176
|
});
|
|
166
177
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.73-beta.
|
|
3
|
+
"version": "1.1.73-beta.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "^16.12.0 || ^17.0.0",
|
|
59
59
|
"yorkie": "^2.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "b1c514087cea5c722c4070e358ffa095e903fc67"
|
|
62
62
|
}
|