@megha-ui/react 1.2.743 → 1.2.746
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.
|
@@ -40,7 +40,9 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
40
40
|
console.log("Update fixed filter values not implemented", fixedFilterValues);
|
|
41
41
|
}, locale, formatOptions, exportOptions,
|
|
42
42
|
// Card wrapper props
|
|
43
|
-
withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, subHeader, cardFooter,
|
|
43
|
+
withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, subHeader, cardFooter, getCurrentPage = (page) => {
|
|
44
|
+
console.log("Current page:", page);
|
|
45
|
+
}, }) => {
|
|
44
46
|
var _a, _b, _c, _d;
|
|
45
47
|
const [searchQueries, setSearchQueries] = useState({});
|
|
46
48
|
const [chips, setChips] = useState([]);
|
|
@@ -90,9 +92,6 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
90
92
|
return gridColumns.filter((col) => col.fixedFilter && col.fixedFilter !== "");
|
|
91
93
|
}, [gridColumns]);
|
|
92
94
|
const [fixedFilterValues, setFixedFilterValues] = useState({});
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
updateGroupBy && updateGroupBy(gridGroupBy);
|
|
95
|
-
}, [gridGroupBy]);
|
|
96
95
|
useEffect(() => {
|
|
97
96
|
setSummariseAvailable(isSummarise);
|
|
98
97
|
}, [isSummarise]);
|
|
@@ -535,6 +534,9 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
535
534
|
};
|
|
536
535
|
const { sortedData, handleSort, sortQueries, setSortQueries } = useSort(filteredData, gridColumns, uniqueSearch, multiSorting, withAscii);
|
|
537
536
|
const { paginatedData, currentPage, handleChangePage, handleChangeRowsPerPage, rowsPerPage, } = usePagination(sortedData, defaultRowsPerPage);
|
|
537
|
+
useEffect(() => {
|
|
538
|
+
getCurrentPage(currentPage);
|
|
539
|
+
}, [currentPage]);
|
|
538
540
|
useEffect(() => {
|
|
539
541
|
const keys = Object.keys(summariseKeys);
|
|
540
542
|
if (keys.length > 0 && summariseAvailable) {
|
|
@@ -1473,6 +1475,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1473
1475
|
}, children: [_jsx("div", { title: "Clear All Groups", onClick: () => {
|
|
1474
1476
|
// setChanged((prev) => [...prev, "groupBy"]);
|
|
1475
1477
|
setGridGroupBy("");
|
|
1478
|
+
updateGroupBy && updateGroupBy("");
|
|
1476
1479
|
}, style: { cursor: "pointer", marginRight: "0.5rem" }, children: _jsx(MdGroupOff, { size: 18 }) }), gridGroupBy.split(",").map((chip) => {
|
|
1477
1480
|
const column = columns.find((item) => item.key === chip);
|
|
1478
1481
|
return (_jsxs("div", { style: {
|
|
@@ -1486,10 +1489,17 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1486
1489
|
display: "inline-block",
|
|
1487
1490
|
cursor: "pointer",
|
|
1488
1491
|
marginLeft: "0.5rem",
|
|
1489
|
-
}, onClick: () =>
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1492
|
+
}, onClick: () => {
|
|
1493
|
+
setGridGroupBy(gridGroupBy
|
|
1494
|
+
.split(",")
|
|
1495
|
+
.filter((item) => item !== chip)
|
|
1496
|
+
.join(","));
|
|
1497
|
+
updateGroupBy &&
|
|
1498
|
+
updateGroupBy(gridGroupBy
|
|
1499
|
+
.split(",")
|
|
1500
|
+
.filter((item) => item !== chip)
|
|
1501
|
+
.join(","));
|
|
1502
|
+
}, children: "\u00D7" })] }, chip));
|
|
1493
1503
|
})] }))] }), _jsxs("div", { id: `grid-content`, style: {
|
|
1494
1504
|
display: "block",
|
|
1495
1505
|
border: gridBorder ? "1px solid #f0f0f0" : "none",
|
|
@@ -1506,6 +1516,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1506
1516
|
.join(",")
|
|
1507
1517
|
: [..._gridGroupBy.split(",").filter((item) => item), value].join(",");
|
|
1508
1518
|
setGridGroupBy(_gridGroupBy);
|
|
1519
|
+
updateGroupBy && updateGroupBy(_gridGroupBy);
|
|
1509
1520
|
}, headerDropdownIndex: headerDropdownIndex, updateGridColumns: updateGridColumns, setGridColumns: setGridColumns, widthUnits: widthUnits, gridData: filteredData, checkboxWrapper: checkboxWrapper, onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, hugColumnWidths: columnWidths, menuVisible: menuVisible, setMenuVisible: setMenuVisible, dropdownVisible: dropdownVisible, actionsKey: actionsKey, setDropdownVisible: setDropdownVisible, columnSearchOutside: columnSearchOutside, locale: locale, formatOptions: formatOptions }), hugLoading && (_jsx("div", { style: {
|
|
1510
1521
|
position: "sticky",
|
|
1511
1522
|
width: "100%",
|
package/package.json
CHANGED