authscape 1.0.261 → 1.0.264
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/index.js +24 -6
- package/package.json +1 -1
- package/src/components/EditableDatagrid.js +17 -5
- package/src/components/FileUploader.js +1 -1
package/index.js
CHANGED
|
@@ -976,6 +976,8 @@ var EditableDatagrid = function EditableDatagrid(_ref) {
|
|
|
976
976
|
_isCellEditable = _ref$isCellEditable === void 0 ? null : _ref$isCellEditable,
|
|
977
977
|
_ref$onCellEdited = _ref.onCellEdited,
|
|
978
978
|
onCellEdited = _ref$onCellEdited === void 0 ? null : _ref$onCellEdited,
|
|
979
|
+
_ref$params = _ref.params,
|
|
980
|
+
params = _ref$params === void 0 ? null : _ref$params,
|
|
979
981
|
_ref$sx = _ref.sx,
|
|
980
982
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
981
983
|
_ref$height = _ref.height,
|
|
@@ -1014,28 +1016,43 @@ var EditableDatagrid = function EditableDatagrid(_ref) {
|
|
|
1014
1016
|
while (1) switch (_context.prev = _context.next) {
|
|
1015
1017
|
case 0:
|
|
1016
1018
|
if (!(url != null)) {
|
|
1017
|
-
_context.next =
|
|
1019
|
+
_context.next = 16;
|
|
1018
1020
|
break;
|
|
1019
1021
|
}
|
|
1020
|
-
|
|
1022
|
+
response = null;
|
|
1023
|
+
if (!(params == null)) {
|
|
1024
|
+
_context.next = 8;
|
|
1025
|
+
break;
|
|
1026
|
+
}
|
|
1027
|
+
_context.next = 5;
|
|
1021
1028
|
return apiService().post(url, {
|
|
1022
1029
|
offset: offset,
|
|
1023
1030
|
length: pageSize
|
|
1024
1031
|
});
|
|
1025
|
-
case
|
|
1032
|
+
case 5:
|
|
1033
|
+
response = _context.sent;
|
|
1034
|
+
_context.next = 13;
|
|
1035
|
+
break;
|
|
1036
|
+
case 8:
|
|
1037
|
+
params.offset = offset;
|
|
1038
|
+
params.length = pageSize;
|
|
1039
|
+
_context.next = 12;
|
|
1040
|
+
return apiService().post(url, params);
|
|
1041
|
+
case 12:
|
|
1026
1042
|
response = _context.sent;
|
|
1043
|
+
case 13:
|
|
1027
1044
|
if (response != null && response.status == 200) {
|
|
1028
1045
|
setTotalRows(response.data.recordsTotal);
|
|
1029
1046
|
setRows(response.data.data);
|
|
1030
1047
|
}
|
|
1031
|
-
_context.next =
|
|
1048
|
+
_context.next = 17;
|
|
1032
1049
|
break;
|
|
1033
|
-
case
|
|
1050
|
+
case 16:
|
|
1034
1051
|
if (rows != null) {
|
|
1035
1052
|
setTotalRows(eRows.length);
|
|
1036
1053
|
setRows(eRows);
|
|
1037
1054
|
}
|
|
1038
|
-
case
|
|
1055
|
+
case 17:
|
|
1039
1056
|
case "end":
|
|
1040
1057
|
return _context.stop();
|
|
1041
1058
|
}
|
|
@@ -1360,6 +1377,7 @@ var FileUploader = function FileUploader(_ref) {
|
|
|
1360
1377
|
display: "none"
|
|
1361
1378
|
}
|
|
1362
1379
|
}), variant == "custom" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
1380
|
+
ref: refOveride,
|
|
1363
1381
|
onClick: function onClick() {
|
|
1364
1382
|
handleUploadFileInput();
|
|
1365
1383
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React, {useEffect, useState} from 'react';
|
|
|
2
2
|
import { DataGrid, GridActionsCellItem } from "@mui/x-data-grid";
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
|
|
5
|
-
export const EditableDatagrid = ({loadedUser, url = null, eRows = null, columns, isCellEditable = null, onCellEdited = null, sx = {}, height="50vh", pageSize = 50, rowsPerPage = [25, 50, 100], rowHeight = 70, key = null, onRowClick = null}) => {
|
|
5
|
+
export const EditableDatagrid = ({loadedUser, url = null, eRows = null, columns, isCellEditable = null, onCellEdited = null, params = null, sx = {}, height="50vh", pageSize = 50, rowsPerPage = [25, 50, 100], rowHeight = 70, key = null, onRowClick = null}) => {
|
|
6
6
|
|
|
7
7
|
const [rows, setRows] = useState([]);
|
|
8
8
|
const [totalRows, setTotalRows] = useState(0);
|
|
@@ -22,11 +22,23 @@ export const EditableDatagrid = ({loadedUser, url = null, eRows = null, columns,
|
|
|
22
22
|
|
|
23
23
|
if (url != null)
|
|
24
24
|
{
|
|
25
|
-
let response =
|
|
25
|
+
let response = null;
|
|
26
|
+
if (params == null)
|
|
26
27
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
response = await apiService().post(url,
|
|
29
|
+
{
|
|
30
|
+
offset: offset,
|
|
31
|
+
length: pageSize
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else
|
|
35
|
+
{
|
|
36
|
+
params.offset = offset;
|
|
37
|
+
params.length = pageSize;
|
|
38
|
+
|
|
39
|
+
response = await apiService().post(url, params);
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
|
|
31
43
|
if (response != null && response.status == 200)
|
|
32
44
|
{
|