awing-library 2.1.173-dev → 2.1.174-dev
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.
|
@@ -36,7 +36,7 @@ var constants_1 = require("../../constants");
|
|
|
36
36
|
var lodash_1 = require("lodash");
|
|
37
37
|
function GroupTable(props) {
|
|
38
38
|
var headCells = props.headCells, filters = props.filters, onGetData = props.onGetData, customRow = props.customRow, onRowClicked = props.onRowClicked;
|
|
39
|
-
var row = customRow || CustomRow_1.default;
|
|
39
|
+
var row = (0, react_1.useMemo)(function () { return customRow || CustomRow_1.default; }, [customRow]);
|
|
40
40
|
var _a = (0, react_1.useState)([]), data = _a[0], setData = _a[1];
|
|
41
41
|
var _b = (0, react_1.useState)(0), groupPageIndex = _b[0], setGroupPageIndex = _b[1];
|
|
42
42
|
var _c = (0, react_1.useState)(constants_1.PAGE_SIZE_DEFAULT), groupPageSize = _c[0], setGroupPageSize = _c[1];
|
|
@@ -72,7 +72,7 @@ function GroupTable(props) {
|
|
|
72
72
|
field: groupKeys[filters.length],
|
|
73
73
|
value: dt[groupKeys[filters.length]],
|
|
74
74
|
},
|
|
75
|
-
], false), displayData: __assign(__assign({}, dt), { groupIndex: groupPageIndex * groupPageSize + index }), onGetData: onGetData, onRowClicked: onRowClicked }, index)); }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.map(function (dt, index) {
|
|
75
|
+
], false), displayData: __assign(__assign({}, dt), { groupIndex: groupPageIndex * groupPageSize + index }), onGetData: onGetData, onRowClicked: onRowClicked, customRow: row }, index)); }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.map(function (dt, index) {
|
|
76
76
|
var CustomRow = row;
|
|
77
77
|
return ((0, jsx_runtime_1.jsx)(CustomRow, __assign({}, row.props, { info: __assign(__assign({}, dt), { rowIndex: groupPageIndex * groupPageSize + index }), headCells: headCells, onRowClicked: onRowClicked }), index));
|
|
78
78
|
}) })), data.length === 0 ? ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells.length + 1, padding: "none", style: { borderBottom: "1px solid #a3a3a345" }, children: (0, jsx_runtime_1.jsx)(NoData_1.default, {}) }) })) : ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: headCells.length + 1, padding: "none", style: {
|
|
@@ -9,7 +9,7 @@ var material_1 = require("@mui/material");
|
|
|
9
9
|
var icons_material_1 = require("@mui/icons-material");
|
|
10
10
|
var GroupTable_1 = __importDefault(require("./GroupTable"));
|
|
11
11
|
function GroupComponent(props) {
|
|
12
|
-
var headCells = props.headCells, filters = props.filters, displayData = props.displayData, onGetData = props.onGetData, onRowClicked = props.onRowClicked;
|
|
12
|
+
var headCells = props.headCells, filters = props.filters, displayData = props.displayData, onGetData = props.onGetData, onRowClicked = props.onRowClicked, customRow = props.customRow;
|
|
13
13
|
var _a = (0, react_1.useState)(false), open = _a[0], setOpen = _a[1];
|
|
14
14
|
var handleOpen = function () {
|
|
15
15
|
setOpen(!open);
|
|
@@ -47,6 +47,6 @@ function GroupComponent(props) {
|
|
|
47
47
|
} }, ind));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
})] }, "group-header-filters.length-".concat(filters.length)), open && ((0, jsx_runtime_1.jsx)(GroupTable_1.default, { headCells: headCells, filters: filters, onGetData: onGetData, onRowClicked: onRowClicked }))] }));
|
|
50
|
+
})] }, "group-header-filters.length-".concat(filters.length)), open && ((0, jsx_runtime_1.jsx)(GroupTable_1.default, { headCells: headCells, filters: filters, onGetData: onGetData, onRowClicked: onRowClicked, customRow: customRow }))] }));
|
|
51
51
|
}
|
|
52
52
|
exports.default = GroupComponent;
|