argous 1.2.159 → 1.2.160
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.
|
@@ -359,8 +359,6 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
359
359
|
case 3:
|
|
360
360
|
if (res[resposta || 'result'])
|
|
361
361
|
setDados(function (v) { return (__assign(__assign({}, v), { lista: res[resposta || 'result'] || [] })); });
|
|
362
|
-
else
|
|
363
|
-
api_1.setError('Erro ao tentar buscar dados.');
|
|
364
362
|
_c.label = 4;
|
|
365
363
|
case 4:
|
|
366
364
|
setLoading(false);
|
|
@@ -373,8 +371,6 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
373
371
|
react_1.useEffect(function () { return lodash_1.isString(value) && buscar(value); }, []);
|
|
374
372
|
react_1.useEffect(function () { var _a; return (value !== ((_a = dados.cursor) === null || _a === void 0 ? void 0 : _a.linha)) && setDados(function (v) { return (__assign(__assign({}, v), { cursor: { index: '', page: '' } })); }); }, [value, (_b = dados.cursor) === null || _b === void 0 ? void 0 : _b.linha]);
|
|
375
373
|
var keyDown = function (e) {
|
|
376
|
-
e.preventDefault();
|
|
377
|
-
e.stopPropagation();
|
|
378
374
|
((e.key === 'Enter' || e.key === 'Tab') && !loading) && buscar();
|
|
379
375
|
(e.key === 'ArrowDown' || e.key === 'ArrowUp') && selectListboxItem(e.key);
|
|
380
376
|
};
|
|
@@ -278,7 +278,6 @@ const AutoCompleteFavorites = ({ action, busca, resposta, autoSearch, label, val
|
|
|
278
278
|
const res = await serverAction(action, { [busca]: valor || inputValue, ...searchParams }, true, pgCode);
|
|
279
279
|
if (res[resposta || 'result']?.length > 1 && group) await carimbaLista(res[resposta || 'result']);
|
|
280
280
|
else if (res[resposta || 'result']) setDados(v => ({ ...v, lista: res[resposta || 'result'] || [] }));
|
|
281
|
-
else setError('Erro ao tentar buscar dados.');
|
|
282
281
|
setLoading(false);
|
|
283
282
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
283
|
}, [inputValue, searchParams]);
|
|
@@ -290,8 +289,6 @@ const AutoCompleteFavorites = ({ action, busca, resposta, autoSearch, label, val
|
|
|
290
289
|
useEffect(() => (value !== dados.cursor?.linha) && setDados(v => ({ ...v, cursor: { index: '', page: '' } })), [value, dados.cursor?.linha]);
|
|
291
290
|
|
|
292
291
|
const keyDown = e => {
|
|
293
|
-
e.preventDefault();
|
|
294
|
-
e.stopPropagation();
|
|
295
292
|
((e.key === 'Enter' || e.key === 'Tab') && !loading) && buscar();
|
|
296
293
|
(e.key === 'ArrowDown' || e.key === 'ArrowUp') && selectListboxItem(e.key);
|
|
297
294
|
};
|