argous 1.2.146 → 1.2.149
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.js +4 -4
- package/dist/components/BarraFerramentas/BarraFerramentas.js +7 -2
- package/lib/components/ArgousComplexTable/ArgousComplexTable.js +2 -1
- package/lib/components/BarraFerramentas/BarraFerramentas.js +7 -2
- package/package.json +1 -1
|
@@ -165,13 +165,13 @@ var initialState = function (defaultRowsPerPage) { return ({
|
|
|
165
165
|
loading: false
|
|
166
166
|
}); };
|
|
167
167
|
var ArgousComplexTable = react_1.forwardRef(function (_a, ref) {
|
|
168
|
-
var _b = _a.ToolbarComponent, ToolbarComponent = _b === void 0 ? __1.ArgousComplexTableToolbar : _b, _c = _a.HeadComponent, HeadComponent = _c === void 0 ? __1.ArgousComplexTableHead : _c, _d = _a.BodyComponent, BodyComponent = _d === void 0 ? __1.ArgousComplexTableBody : _d, _e = _a.PaginationComponent, PaginationComponent = _e === void 0 ? __1.ArgousComplexPagination : _e, _f = _a.FooterComponent, FooterComponent =
|
|
168
|
+
var _b = _a.ToolbarComponent, ToolbarComponent = _b === void 0 ? __1.ArgousComplexTableToolbar : _b, _c = _a.HeadComponent, HeadComponent = _c === void 0 ? __1.ArgousComplexTableHead : _c, _d = _a.BodyComponent, BodyComponent = _d === void 0 ? __1.ArgousComplexTableBody : _d, _e = _a.PaginationComponent, PaginationComponent = _e === void 0 ? __1.ArgousComplexPagination : _e, _f = _a.paginationControl, paginationControl = _f === void 0 ? {} : _f, _g = _a.FooterComponent, FooterComponent = _g === void 0 ? undefined : _g, footerProps = _a.footerProps, dados = _a.dados, _h = _a.head, head = _h === void 0 ? [] : _h, _j = _a.line, line = _j === void 0 ? function (i) { return i; } : _j, actions = _a.actions, title = _a.title, _k = _a.defaultRowsPerPage, defaultRowsPerPage = _k === void 0 ? 10 : _k, _l = _a.rowsPerPageOptions, rowsPerPageOptions = _l === void 0 ? [10, 25, 50] : _l, checkEnabled = _a.enableCheck, disableCheckIf = _a.disableCheckIf, showCount = _a.showCount, lineStyle = _a.lineStyle, _m = _a.lineClass, lineClass = _m === void 0 ? function () { return undefined; } : _m, onClick = _a.onClick, onDoubleClick = _a.onDoubleClick, _o = _a.children, children = _o === void 0 ? undefined : _o, style = _a.style, className = _a.className, columnStyles = _a.columnStyles, headerColumnStyles = _a.headerColumnStyles, columnOptions = _a.columnOptions, disableFilter = _a.disableFilter, _p = _a.filterLabel, filterLabel = _p === void 0 ? 'Filtro' : _p, _q = _a.indexToSelect, indexToSelect = _q === void 0 ? 0 : _q, _r = _a.disableSorting, disableSorting = _r === void 0 ? [] : _r, _s = _a.size, size = _s === void 0 ? 'small' : _s, onOpen = _a.onOpen, lineTitle = _a.lineTitle, onClose = _a.onClose, method = _a.method, methodPrms = _a.methodPrms, _t = _a.methodResultList, methodResultList = _t === void 0 ? 'lista' : _t, onMethodResponse = _a.onMethodResponse, field = _a.field, fixedToolbar = _a.fixedToolbar, onSelect = _a.onSelect, customKey = _a.customKey, _u = _a.columnProps, columnProps = _u === void 0 ? function () { return ''; } : _u, _v = _a.rowProps, rowProps = _v === void 0 ? function () { return ''; } : _v, _w = _a.savedState, savedState = _w === void 0 ? {} : _w, containerProps = _a.containerProps, _x = _a.onClickAway, onClickAway = _x === void 0 ? function () { return undefined; } : _x, enableCheckIfSelected = _a.enableCheckIfSelected, enableDrag = _a.enableDrag, onDrop = _a.onDrop, tableProps = _a.tableProps, toolbarProps = _a.toolbarProps;
|
|
169
169
|
var classes = useStyles();
|
|
170
|
-
var
|
|
170
|
+
var _y = react_1.useReducer(reducer, initialState(defaultRowsPerPage)), state = _y[0], dispatch = _y[1];
|
|
171
171
|
var memoState = react_1.useMemo(function () { return (__assign(__assign({}, state), { dispatch: dispatch })); }, [state, dispatch]);
|
|
172
172
|
var selected = memoState.selected, page = memoState.page, rowsPerPage = memoState.rowsPerPage, order = memoState.order, orderBy = memoState.orderBy, filter = memoState.filter, open = memoState.open;
|
|
173
|
-
var
|
|
174
|
-
var
|
|
173
|
+
var _z = react_1.useState(dados /*.map(linha => isArray(linha) ? linha : Object.values(linha))*/ || []), lista = _z[0], setLista = _z[1];
|
|
174
|
+
var _0 = react_1.useState(__assign(__assign({}, paginationControl), { qtRegs: defaultRowsPerPage, pgAtl: 1 })), ctrlPgn = _0[0], setCtrlPgn = _0[1];
|
|
175
175
|
var qtRegs = ctrlPgn.qtRegs, pgAtl = ctrlPgn.pgAtl, ordCols = ctrlPgn.ordCols;
|
|
176
176
|
var enableCheck = checkEnabled || (enableCheckIfSelected && !!selected.length);
|
|
177
177
|
react_1.useEffect(function () {
|
|
@@ -53,13 +53,18 @@ var useStyles = core_1.makeStyles(function (theme) { return ({
|
|
|
53
53
|
paddingRight: theme.spacing(2),
|
|
54
54
|
paddingLeft: theme.spacing(2),
|
|
55
55
|
'&::-webkit-scrollbar': {
|
|
56
|
-
|
|
56
|
+
height: 5
|
|
57
57
|
},
|
|
58
58
|
'&::-webkit-scrollbar-track': {
|
|
59
59
|
background: '#0000'
|
|
60
60
|
},
|
|
61
61
|
'&::-webkit-scrollbar-thumb': {
|
|
62
|
-
background:
|
|
62
|
+
background: '#0000'
|
|
63
|
+
},
|
|
64
|
+
'&:hover': {
|
|
65
|
+
'&::-webkit-scrollbar-thumb': {
|
|
66
|
+
background: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
},
|
|
65
70
|
menuButton: {
|
|
@@ -125,6 +125,7 @@ const ArgousComplexTable = forwardRef(({
|
|
|
125
125
|
HeadComponent = ArgousComplexTableHead,
|
|
126
126
|
BodyComponent = ArgousComplexTableBody,
|
|
127
127
|
PaginationComponent = ArgousComplexPagination,
|
|
128
|
+
paginationControl = {},
|
|
128
129
|
FooterComponent = undefined,
|
|
129
130
|
footerProps,
|
|
130
131
|
dados,
|
|
@@ -180,7 +181,7 @@ const ArgousComplexTable = forwardRef(({
|
|
|
180
181
|
const { selected, page, rowsPerPage, order, orderBy, filter, open } = memoState;
|
|
181
182
|
|
|
182
183
|
const [lista, setLista] = useState(dados/*.map(linha => isArray(linha) ? linha : Object.values(linha))*/ || []);
|
|
183
|
-
const [ctrlPgn, setCtrlPgn] = useState({ qtRegs: defaultRowsPerPage, pgAtl: 1 });
|
|
184
|
+
const [ctrlPgn, setCtrlPgn] = useState({ ...paginationControl, qtRegs: defaultRowsPerPage, pgAtl: 1 });
|
|
184
185
|
const { qtRegs, pgAtl, ordCols } = ctrlPgn;
|
|
185
186
|
|
|
186
187
|
const enableCheck = checkEnabled || (enableCheckIfSelected && !!selected.length);
|
|
@@ -19,13 +19,18 @@ const useStyles = makeStyles(theme => ({
|
|
|
19
19
|
paddingRight: theme.spacing(2),
|
|
20
20
|
paddingLeft: theme.spacing(2),
|
|
21
21
|
'&::-webkit-scrollbar': {
|
|
22
|
-
|
|
22
|
+
height: 5
|
|
23
23
|
},
|
|
24
24
|
'&::-webkit-scrollbar-track': {
|
|
25
25
|
background: '#0000'
|
|
26
26
|
},
|
|
27
27
|
'&::-webkit-scrollbar-thumb': {
|
|
28
|
-
background:
|
|
28
|
+
background: '#0000'
|
|
29
|
+
},
|
|
30
|
+
'&:hover': {
|
|
31
|
+
'&::-webkit-scrollbar-thumb': {
|
|
32
|
+
background: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
},
|
|
31
36
|
menuButton: {
|