@dartech/arsenal-ui 1.4.73 → 1.4.75
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +14 -5
- package/package.json +1 -1
package/index.js
CHANGED
@@ -979,6 +979,10 @@ function ControlQueryAutocomplete(_a) {
|
|
979
979
|
const [inputValue, setInputValue] = useState('');
|
980
980
|
const [searchValue, setSearchValue] = useState('');
|
981
981
|
const [page, setPage] = useState(0);
|
982
|
+
const openPanel = useMemo(() => {
|
983
|
+
if (!options.length) return false;
|
984
|
+
return open;
|
985
|
+
}, [open, options]);
|
982
986
|
const {
|
983
987
|
data,
|
984
988
|
isFetching
|
@@ -1030,6 +1034,7 @@ function ControlQueryAutocomplete(_a) {
|
|
1030
1034
|
} else setSearchValue(val);
|
1031
1035
|
}, 500);
|
1032
1036
|
const handleInputChange = useCallback((_, value) => {
|
1037
|
+
setOptions([]);
|
1033
1038
|
setInputValue(value);
|
1034
1039
|
debouncedChange(value);
|
1035
1040
|
}, [debouncedChange]);
|
@@ -1080,7 +1085,7 @@ function ControlQueryAutocomplete(_a) {
|
|
1080
1085
|
onChange: handleValueChange,
|
1081
1086
|
loading: isFetching,
|
1082
1087
|
clearOnBlur: false,
|
1083
|
-
open:
|
1088
|
+
open: openPanel,
|
1084
1089
|
filterOptions: x => x,
|
1085
1090
|
onOpen: handleOpen,
|
1086
1091
|
onClose: handleClose,
|
@@ -1114,10 +1119,14 @@ function ControlQueryAutocomplete(_a) {
|
|
1114
1119
|
},
|
1115
1120
|
InputProps: Object.assign(Object.assign({}, params.InputProps), {
|
1116
1121
|
endAdornment: endAdornment ? endAdornment : jsxs(React.Fragment, {
|
1117
|
-
children: [isFetching ? jsx(
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1122
|
+
children: [isFetching ? jsx(InputAdornment, Object.assign({
|
1123
|
+
position: "end"
|
1124
|
+
}, {
|
1125
|
+
children: jsx(CircularProgress, {
|
1126
|
+
color: "inherit",
|
1127
|
+
size: 20
|
1128
|
+
})
|
1129
|
+
})) : null, params.InputProps.endAdornment]
|
1121
1130
|
}),
|
1122
1131
|
startAdornment: startAdornment ? startAdornment : params.InputProps.startAdornment
|
1123
1132
|
})
|