argous 1.2.140 → 1.2.141
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.
|
@@ -201,6 +201,7 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
201
201
|
var ListboxFavorites = react_1.forwardRef(function (props, ref) {
|
|
202
202
|
var children = props.children, favoritePage = props.favoritePage, dados = props.dados, setDados = props.setDados, groupHeaderColor = props.groupHeaderColor, groupTitleColor = props.groupTitleColor;
|
|
203
203
|
var pageNumber = dados.pageNumber, favoritosLength = dados.favoritosLength, direction = dados.direction, slide = dados.slide;
|
|
204
|
+
console.log('Listbox', children);
|
|
204
205
|
function retornaInicio() {
|
|
205
206
|
switch (pageNumber) {
|
|
206
207
|
case 1:
|
|
@@ -315,6 +316,8 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
315
316
|
return [4 /*yield*/, api_1.serverAction(action, __assign((_a = {}, _a[busca] = valor || inputValue, _a), searchParams), true, pgCode)];
|
|
316
317
|
case 1:
|
|
317
318
|
res = _c.sent();
|
|
319
|
+
if (res)
|
|
320
|
+
console.log('Resposta busca', res);
|
|
318
321
|
if (!(((_b = res[resposta || 'result']) === null || _b === void 0 ? void 0 : _b.length) > 1)) return [3 /*break*/, 3];
|
|
319
322
|
return [4 /*yield*/, carimbaLista(res[resposta || 'result'])];
|
|
320
323
|
case 2:
|
|
@@ -335,6 +338,7 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
335
338
|
react_1.useEffect(function () { return buscar(); }, [inputValue, buscar]);
|
|
336
339
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
337
340
|
react_1.useEffect(function () { return lodash_1.isString(value) && buscar(value); }, []);
|
|
341
|
+
console.log('Lista', dados.lista);
|
|
338
342
|
return (react_1.default.createElement(lab_1.Autocomplete, __assign({}, props, { value: value, onChange: onChange }, { options: lodash_1.isObject(value) ? dados === null || dados === void 0 ? void 0 : dados.lista.filter(function (v) { return filterFunction ? filterFunction(v, value) : true || v[0] !== value[0]; }) : dados === null || dados === void 0 ? void 0 : dados.lista, getOptionLabel: getOptionLabel && (function (option) { return getOptionLabel(option, dados === null || dados === void 0 ? void 0 : dados.lista); }), noOptionsText: inputValue.length < 2 ? 'Digite para pesquisar' : 'Não Encontrado', onInputChange: function (e) { var _a; return setInputValue(((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value) || ''); }, getOptionSelected: function (o, v) { return o[0] === v; }, autoComplete: true, autoHighlight: true, openText: 'Abrir', clearText: 'Limpar', filterSelectedOptions: true, renderInput: function (params) { return (react_1.default.createElement(core_1.TextField, __assign({ margin: 'dense', variant: 'outlined', label: label }, params, textFieldProps, { InputProps: __assign(__assign(__assign({}, textFieldProps.InputProps), params.InputProps), { endAdornment: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
339
343
|
params.InputProps.endAdornment,
|
|
340
344
|
react_1.default.createElement(core_1.Fade, { in: loading },
|
|
@@ -122,6 +122,8 @@ const AutoCompleteFavorites = ({ action, busca, resposta, label, value, pgCode,
|
|
|
122
122
|
const ListboxFavorites = forwardRef((props, ref) => {
|
|
123
123
|
const { children, favoritePage, dados, setDados, groupHeaderColor, groupTitleColor } = props;
|
|
124
124
|
const { pageNumber, favoritosLength, direction, slide } = dados;
|
|
125
|
+
|
|
126
|
+
console.log('Listbox', children);
|
|
125
127
|
|
|
126
128
|
function retornaInicio() {
|
|
127
129
|
switch (pageNumber) {
|
|
@@ -242,6 +244,7 @@ const AutoCompleteFavorites = ({ action, busca, resposta, label, value, pgCode,
|
|
|
242
244
|
const buscar = useCallback(async valor => {
|
|
243
245
|
setLoading(true);
|
|
244
246
|
const res = await serverAction(action, { [busca]: valor || inputValue, ...searchParams }, true, pgCode);
|
|
247
|
+
if (res) console.log('Resposta busca', res);
|
|
245
248
|
if (res[resposta || 'result']?.length > 1) await carimbaLista(res[resposta || 'result']);
|
|
246
249
|
else if (res[resposta || 'result']) setDados({ lista: res[resposta || 'result'] || [] });
|
|
247
250
|
else setError('Erro ao tentar buscar dados.');
|
|
@@ -253,6 +256,8 @@ const AutoCompleteFavorites = ({ action, busca, resposta, label, value, pgCode,
|
|
|
253
256
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
254
257
|
useEffect(() => isString(value) && buscar(value), []);
|
|
255
258
|
|
|
259
|
+
console.log('Lista', dados.lista);
|
|
260
|
+
|
|
256
261
|
return (
|
|
257
262
|
<Autocomplete
|
|
258
263
|
{...props}
|