argous 1.2.157 → 1.2.158
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/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -5
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +10 -9
- package/lib/components/ArgousComplexTable/ArgousComplexTable.d.ts +1 -5
- package/lib/components/AutoCompleteFavorites/AutoCompleteFavorites.js +3 -3
- package/package.json +1 -1
|
@@ -31,13 +31,9 @@ export interface ArgousComplexTableProps extends ArgousComplexTableBodyProps, Ar
|
|
|
31
31
|
*/
|
|
32
32
|
footerProps?: object,
|
|
33
33
|
/**
|
|
34
|
-
* Array de dados fornecido
|
|
34
|
+
* Array de dados fornecido paa a tabela
|
|
35
35
|
*/
|
|
36
36
|
dados?: Array<Array<any> | Object>,
|
|
37
|
-
/**
|
|
38
|
-
* Objeto com parâmetros para controle de paginação pelo backend
|
|
39
|
-
*/
|
|
40
|
-
paginationControl?: Object,
|
|
41
37
|
/**
|
|
42
38
|
* Número de linhas padrão por página
|
|
43
39
|
*/
|
|
@@ -240,7 +240,7 @@ var ListboxFavorites = react_1.forwardRef(function (props, ref) {
|
|
|
240
240
|
function retornaEstrutura(sectionIndex, item, itemIndex) {
|
|
241
241
|
var _a;
|
|
242
242
|
var content = react_1.default.createElement(exports.CustomTooltip, { title: item.props.children, arrow: true, enterDelay: '1000', enterNextDelay: '1000', placement: 'top-end', TransitionComponent: core_1.Fade, TransitionProps: { timeout: { enter: 100, exit: 500 } } },
|
|
243
|
-
react_1.default.createElement(core_1.ListItem, __assign({}, item.props, { id: 'listItem', key: item.key, className: clsx_1.default(classes.listItem, (_a = {}, _a[classes.hoverListItem] = cursor.index === itemIndex && cursor.page === pageNumber, _a)) }),
|
|
243
|
+
react_1.default.createElement(core_1.ListItem, __assign({}, item.props, { id: 'listItem', key: item.key, className: clsx_1.default(classes.listItem, (_a = {}, _a[classes.hoverListItem] = (cursor === null || cursor === void 0 ? void 0 : cursor.index) === itemIndex ? itemIndex : sectionIndex && (cursor === null || cursor === void 0 ? void 0 : cursor.page) === pageNumber, _a)) }),
|
|
244
244
|
react_1.default.createElement(core_1.ListItemText, { primary: item.props.children, className: classes.listItemText })));
|
|
245
245
|
if (sectionIndex === 0 && favoritePage && favoritosLength > 7) {
|
|
246
246
|
return react_1.default.createElement(core_1.Slide, { in: slide, direction: direction }, content);
|
|
@@ -295,20 +295,21 @@ var ListboxFavorites = react_1.forwardRef(function (props, ref) {
|
|
|
295
295
|
}));
|
|
296
296
|
});
|
|
297
297
|
var AutoCompleteFavorites = function (_a) {
|
|
298
|
-
var
|
|
298
|
+
var _b;
|
|
299
|
+
var action = _a.action, busca = _a.busca, resposta = _a.resposta, autoSearch = _a.autoSearch, label = _a.label, value = _a.value, pgCode = _a.pgCode, favoritePage = _a.favoritePage, group = _a.group, groupName = _a.groupName, groupHeaderColor = _a.groupHeaderColor, groupTitleColor = _a.groupTitleColor, loadingColor = _a.loadingColor, widthListBox = _a.widthListBox, filterFunction = _a.filterFunction, getOptionLabel = _a.getOptionLabel, _c = _a.onChange, onChange = _c === void 0 ? function (e) { return e; } : _c, _d = _a.textFieldProps, textFieldProps = _d === void 0 ? {} : _d, searchParams = _a.searchParams, props = __rest(_a, ["action", "busca", "resposta", "autoSearch", "label", "value", "pgCode", "favoritePage", "group", "groupName", "groupHeaderColor", "groupTitleColor", "loadingColor", "widthListBox", "filterFunction", "getOptionLabel", "onChange", "textFieldProps", "searchParams"]);
|
|
299
300
|
var classes = useStyles({ widthListBox: widthListBox });
|
|
300
|
-
var
|
|
301
|
+
var _e = react_1.useState({
|
|
301
302
|
lista: [],
|
|
302
303
|
slide: true,
|
|
303
304
|
cursor: { index: '', page: '' },
|
|
304
305
|
direction: '',
|
|
305
306
|
favoritosLength: '',
|
|
306
|
-
pageNumber: favoritePage ? 1 :
|
|
307
|
-
}), dados =
|
|
308
|
-
var
|
|
309
|
-
var
|
|
307
|
+
pageNumber: favoritePage ? 1 : undefined,
|
|
308
|
+
}), dados = _e[0], setDados = _e[1];
|
|
309
|
+
var _f = react_1.useState(false), loading = _f[0], setLoading = _f[1];
|
|
310
|
+
var _g = react_1.useState(''), inputValue = _g[0], setInputValue = _g[1];
|
|
310
311
|
var interval = react_1.useRef(null);
|
|
311
|
-
var
|
|
312
|
+
var _h = react_1.useState(1), seconds = _h[0], setSeconds = _h[1];
|
|
312
313
|
var startCounter = function () { return interval.current = setInterval(function () { return setSeconds(1); }, 1000); };
|
|
313
314
|
var stopCounter = function () {
|
|
314
315
|
clearInterval(interval.current);
|
|
@@ -368,7 +369,7 @@ var AutoCompleteFavorites = function (_a) {
|
|
|
368
369
|
react_1.useEffect(function () { return autoSearch && seconds === 1 && buscar(); }, [autoSearch, seconds, buscar]);
|
|
369
370
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
370
371
|
react_1.useEffect(function () { return lodash_1.isString(value) && buscar(value); }, []);
|
|
371
|
-
react_1.useEffect(function () { var _a; return (value === null || value === void 0 ? void 0 : value[3]) !== ((_a = dados.cursor.linha) === null ||
|
|
372
|
+
react_1.useEffect(function () { var _a, _b; return (value === null || value === void 0 ? void 0 : value[3]) !== ((_b = (_a = dados.cursor) === null || _a === void 0 ? void 0 : _a.linha) === null || _b === void 0 ? void 0 : _b[3]) && setDados(function (v) { return (__assign(__assign({}, v), { cursor: { index: '', page: '' } })); }); }, [value, (_b = dados.cursor) === null || _b === void 0 ? void 0 : _b.linha]);
|
|
372
373
|
var keyUp = function (e) {
|
|
373
374
|
e.preventDefault();
|
|
374
375
|
e.stopPropagation();
|
|
@@ -31,13 +31,9 @@ export interface ArgousComplexTableProps extends ArgousComplexTableBodyProps, Ar
|
|
|
31
31
|
*/
|
|
32
32
|
footerProps?: object,
|
|
33
33
|
/**
|
|
34
|
-
* Array de dados fornecido
|
|
34
|
+
* Array de dados fornecido paa a tabela
|
|
35
35
|
*/
|
|
36
36
|
dados?: Array<Array<any> | Object>,
|
|
37
|
-
/**
|
|
38
|
-
* Objeto com parâmetros para controle de paginação pelo backend
|
|
39
|
-
*/
|
|
40
|
-
paginationControl?: Object,
|
|
41
37
|
/**
|
|
42
38
|
* Número de linhas padrão por página
|
|
43
39
|
*/
|
|
@@ -162,7 +162,7 @@ const ListboxFavorites = forwardRef((props, ref) => {
|
|
|
162
162
|
|
|
163
163
|
function retornaEstrutura(sectionIndex, item, itemIndex) {
|
|
164
164
|
const content = <CustomTooltip title={item.props.children} arrow enterDelay='1000' enterNextDelay='1000' placement='top-end' TransitionComponent={Fade} TransitionProps={{ timeout: { enter: 100, exit: 500 } }}>
|
|
165
|
-
<ListItem {...item.props} id='listItem' key={item.key} className={clsx(classes.listItem, { [classes.hoverListItem]: cursor
|
|
165
|
+
<ListItem {...item.props} id='listItem' key={item.key} className={clsx(classes.listItem, { [classes.hoverListItem]: cursor?.index === itemIndex ? itemIndex : sectionIndex && cursor?.page === pageNumber })}>
|
|
166
166
|
<ListItemText primary={item.props.children} className={classes.listItemText} />
|
|
167
167
|
</ListItem>
|
|
168
168
|
</CustomTooltip>;
|
|
@@ -242,7 +242,7 @@ const AutoCompleteFavorites = ({ action, busca, resposta, autoSearch, label, val
|
|
|
242
242
|
cursor: { index: '', page: '' },
|
|
243
243
|
direction: '',
|
|
244
244
|
favoritosLength: '',
|
|
245
|
-
pageNumber: favoritePage ? 1 :
|
|
245
|
+
pageNumber: favoritePage ? 1 : undefined,
|
|
246
246
|
});
|
|
247
247
|
const [loading, setLoading] = useState(false);
|
|
248
248
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -288,7 +288,7 @@ const AutoCompleteFavorites = ({ action, busca, resposta, autoSearch, label, val
|
|
|
288
288
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
289
289
|
useEffect(() => isString(value) && buscar(value), []);
|
|
290
290
|
|
|
291
|
-
useEffect(() => value?.[3] !== dados.cursor
|
|
291
|
+
useEffect(() => value?.[3] !== dados.cursor?.linha?.[3] && setDados(v => ({ ...v, cursor: { index: '', page: '' } })), [value, dados.cursor?.linha]);
|
|
292
292
|
|
|
293
293
|
const keyUp = e => {
|
|
294
294
|
e.preventDefault();
|