argous 1.2.238 → 1.2.240
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.
|
@@ -199,10 +199,12 @@ var ArgousComplexTable = react_1.forwardRef(function (_a, ref) {
|
|
|
199
199
|
return newArray;
|
|
200
200
|
}, [head, rowsPerPage]);
|
|
201
201
|
var dadosMostrados = react_1.useMemo(function () {
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
if (page > -1) {
|
|
203
|
+
if (method || externalCtrlPgn)
|
|
204
|
+
return (usePagination) ? fillListToKeepHeight(lista || []) : (lista || []);
|
|
205
|
+
return (usePagination) ? fillListToKeepHeight(cortaDados(dadosNaoCortados) || []) : (cortaDados(dadosNaoCortados) || []);
|
|
206
|
+
}
|
|
207
|
+
}, [page, lista, dadosNaoCortados, usePagination, method, externalCtrlPgn, cortaDados, fillListToKeepHeight]);
|
|
206
208
|
react_1.useEffect(function () {
|
|
207
209
|
dispatch({ type: 'mount', value: savedState.current });
|
|
208
210
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -230,9 +232,9 @@ var ArgousComplexTable = react_1.forwardRef(function (_a, ref) {
|
|
|
230
232
|
}, [ctrlPgn.recordCount]);
|
|
231
233
|
var buscaMetodo = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
232
234
|
var res;
|
|
233
|
-
var _a, _b;
|
|
234
|
-
return __generator(this, function (
|
|
235
|
-
switch (
|
|
235
|
+
var _a, _b, _c;
|
|
236
|
+
return __generator(this, function (_d) {
|
|
237
|
+
switch (_d.label) {
|
|
236
238
|
case 0:
|
|
237
239
|
if (!method || !allowMethodRequest)
|
|
238
240
|
return [2 /*return*/];
|
|
@@ -244,10 +246,12 @@ var ArgousComplexTable = react_1.forwardRef(function (_a, ref) {
|
|
|
244
246
|
indOrdem: orderBy >= 0 ? orderBy : undefined
|
|
245
247
|
} }, methodPrms), code, handleMethodError, token)];
|
|
246
248
|
case 1:
|
|
247
|
-
res =
|
|
249
|
+
res = _d.sent();
|
|
248
250
|
onMethodResponse && onMethodResponse(res);
|
|
249
251
|
if (res.status) {
|
|
250
|
-
|
|
252
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.ctrlPgn) === null || _a === void 0 ? void 0 : _a.pgAtl)
|
|
253
|
+
dispatch({ type: 'setPage', value: (res.ctrlPgn.pgAtl - 1) });
|
|
254
|
+
setCtrlPgn(__assign(__assign({}, res.ctrlPgn), { recordCount: (((_b = res.ctrlPgn) === null || _b === void 0 ? void 0 : _b.qtPaginas) * ((_c = res.ctrlPgn) === null || _c === void 0 ? void 0 : _c.qtRegs)) }));
|
|
251
255
|
setLista(res[methodResultList] || []);
|
|
252
256
|
}
|
|
253
257
|
dispatch({ type: 'setLoading', value: false });
|
|
@@ -320,6 +324,8 @@ var ArgousComplexTable = react_1.forwardRef(function (_a, ref) {
|
|
|
320
324
|
var fullCtrlPgn = getFullCtrlPgn(true);
|
|
321
325
|
var fullExternalCtrlPgn = getFullCtrlPgn();
|
|
322
326
|
if (!lodash_1.isEqual(fullExternalCtrlPgn, fullCtrlPgn)) {
|
|
327
|
+
if (externalCtrlPgn === null || externalCtrlPgn === void 0 ? void 0 : externalCtrlPgn.pgAtl)
|
|
328
|
+
dispatch({ type: 'setPage', value: (externalCtrlPgn.pgAtl - 1) });
|
|
323
329
|
setCtrlPgn(__assign(__assign({}, fullExternalCtrlPgn), { recordCount: ((externalCtrlPgn === null || externalCtrlPgn === void 0 ? void 0 : externalCtrlPgn.qtPaginas) * (externalCtrlPgn === null || externalCtrlPgn === void 0 ? void 0 : externalCtrlPgn.qtRegs)) }));
|
|
324
330
|
setBounced(true);
|
|
325
331
|
}
|
|
@@ -91,6 +91,6 @@ var UtilTextField = function (_a) {
|
|
|
91
91
|
newValue = standard.valueHandler(newValue);
|
|
92
92
|
onChange(event, newValue);
|
|
93
93
|
};
|
|
94
|
-
return (react_1.default.createElement(core_1.TextField, __assign({}, props, { label: (props === null || props === void 0 ? void 0 : props.label) || standard.label, InputProps: __assign(__assign({}, standard.InputProps), ((props === null || props === void 0 ? void 0 : props.InputProps) || {})), onChange: handleOnChange })));
|
|
94
|
+
return (react_1.default.createElement(core_1.TextField, __assign({}, props, { label: ((props === null || props === void 0 ? void 0 : props.label) === false) ? '' : (props === null || props === void 0 ? void 0 : props.label) ? props === null || props === void 0 ? void 0 : props.label : standard.label, InputProps: __assign(__assign({}, standard.InputProps), ((props === null || props === void 0 ? void 0 : props.InputProps) || {})), onChange: handleOnChange })));
|
|
95
95
|
};
|
|
96
96
|
exports.default = UtilTextField;
|
|
@@ -216,9 +216,11 @@ const ArgousComplexTable = forwardRef(({
|
|
|
216
216
|
}, [head, rowsPerPage]);
|
|
217
217
|
|
|
218
218
|
const dadosMostrados = useMemo(() => {
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
if (page > -1) {
|
|
220
|
+
if (method || externalCtrlPgn) return (usePagination) ? fillListToKeepHeight(lista || []) : (lista || []);
|
|
221
|
+
return (usePagination) ? fillListToKeepHeight(cortaDados(dadosNaoCortados) || []) : (cortaDados(dadosNaoCortados) || []);
|
|
222
|
+
}
|
|
223
|
+
}, [page, lista, dadosNaoCortados, usePagination, method, externalCtrlPgn, cortaDados, fillListToKeepHeight]);
|
|
222
224
|
|
|
223
225
|
useEffect(() => {
|
|
224
226
|
dispatch({ type: 'mount', value: savedState.current });
|
|
@@ -256,6 +258,7 @@ const ArgousComplexTable = forwardRef(({
|
|
|
256
258
|
}, code, handleMethodError, token);
|
|
257
259
|
onMethodResponse && onMethodResponse(res);
|
|
258
260
|
if (res.status) {
|
|
261
|
+
if (res?.ctrlPgn?.pgAtl) dispatch({ type: 'setPage', value: (res.ctrlPgn.pgAtl - 1) });
|
|
259
262
|
setCtrlPgn({ ...res.ctrlPgn, recordCount: (res.ctrlPgn?.qtPaginas * res.ctrlPgn?.qtRegs) });
|
|
260
263
|
setLista(res[methodResultList] || []);
|
|
261
264
|
}
|
|
@@ -339,6 +342,7 @@ const ArgousComplexTable = forwardRef(({
|
|
|
339
342
|
const fullCtrlPgn = getFullCtrlPgn(true);
|
|
340
343
|
const fullExternalCtrlPgn = getFullCtrlPgn();
|
|
341
344
|
if (!isEqual(fullExternalCtrlPgn, fullCtrlPgn)) {
|
|
345
|
+
if (externalCtrlPgn?.pgAtl) dispatch({ type: 'setPage', value: (externalCtrlPgn.pgAtl - 1) });
|
|
342
346
|
setCtrlPgn({ ...fullExternalCtrlPgn, recordCount: (externalCtrlPgn?.qtPaginas * externalCtrlPgn?.qtRegs) });
|
|
343
347
|
setBounced(true);
|
|
344
348
|
}
|
|
@@ -58,7 +58,7 @@ const UtilTextField = ({ type, onChange, ...props }) => {
|
|
|
58
58
|
return (
|
|
59
59
|
<TextField
|
|
60
60
|
{...props}
|
|
61
|
-
label={props?.label
|
|
61
|
+
label={(props?.label === false) ? '' : (props?.label) ? props?.label : standard.label}
|
|
62
62
|
InputProps={{ ...standard.InputProps, ...(props?.InputProps || {}) }}
|
|
63
63
|
onChange={handleOnChange}
|
|
64
64
|
/>
|