@megha-ui/react 1.2.698 → 1.2.699
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/grid/index.js +28 -18
- package/package.json +1 -1
|
@@ -399,7 +399,10 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
399
399
|
const { groupedKey, groupedValue } = grouped;
|
|
400
400
|
const filterValue = _groupedKeys.length > 1 ? groupedValue : "";
|
|
401
401
|
const filterSegments = filterValue
|
|
402
|
-
? filterValue
|
|
402
|
+
? filterValue
|
|
403
|
+
.split(">")
|
|
404
|
+
.map((v) => v.trim())
|
|
405
|
+
.filter((v) => v)
|
|
403
406
|
: [];
|
|
404
407
|
const matchesGroup = (item, group) => {
|
|
405
408
|
var _a, _b;
|
|
@@ -417,8 +420,12 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
417
420
|
const filteredValues = filteredData
|
|
418
421
|
.filter((item) => filterValue
|
|
419
422
|
? filterSegments.length > 1
|
|
420
|
-
? groupedKey
|
|
421
|
-
|
|
423
|
+
? groupedKey
|
|
424
|
+
.split(">")
|
|
425
|
+
.every((group) => matchesGroup(item, group))
|
|
426
|
+
: groupedKey
|
|
427
|
+
.split(">")
|
|
428
|
+
.some((group) => matchesGroup(item, group))
|
|
422
429
|
: true)
|
|
423
430
|
.map((item) => {
|
|
424
431
|
var _a;
|
|
@@ -1445,21 +1452,24 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1445
1452
|
}, children: [_jsx("div", { title: "Clear All Groups", onClick: () => {
|
|
1446
1453
|
// setChanged((prev) => [...prev, "groupBy"]);
|
|
1447
1454
|
setGridGroupBy("");
|
|
1448
|
-
}, style: { cursor: "pointer", marginRight: "0.5rem" }, children: _jsx(MdGroupOff, { size: 18 }) }), gridGroupBy.split(",").map((chip) =>
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1455
|
+
}, style: { cursor: "pointer", marginRight: "0.5rem" }, children: _jsx(MdGroupOff, { size: 18 }) }), gridGroupBy.split(",").map((chip) => {
|
|
1456
|
+
const column = columns.find(item => item.key === chip);
|
|
1457
|
+
return (_jsxs("div", { style: {
|
|
1458
|
+
display: "inline-flex",
|
|
1459
|
+
alignItems: "center",
|
|
1460
|
+
padding: "0.25rem",
|
|
1461
|
+
borderRadius: "0.25rem",
|
|
1462
|
+
margin: "0 0.25rem",
|
|
1463
|
+
backgroundColor: chipColor,
|
|
1464
|
+
}, children: [_jsx("span", { children: column === null || column === void 0 ? void 0 : column.label }), _jsx("span", { style: {
|
|
1465
|
+
display: "inline-block",
|
|
1466
|
+
cursor: "pointer",
|
|
1467
|
+
marginLeft: "0.5rem",
|
|
1468
|
+
}, onClick: () => setGridGroupBy((prev) => prev
|
|
1469
|
+
.split(",")
|
|
1470
|
+
.filter((item) => item !== chip)
|
|
1471
|
+
.join(",")), children: "\u00D7" })] }, chip));
|
|
1472
|
+
})] }))] }), _jsxs("div", { id: `grid-content`, style: {
|
|
1463
1473
|
display: "block",
|
|
1464
1474
|
border: gridBorder ? "1px solid #f0f0f0" : "none",
|
|
1465
1475
|
overflow: calculateVisible && gridGroupBy ? "visible" : "auto",
|
package/package.json
CHANGED