@megha-ui/react 1.2.698 → 1.2.700
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 +29 -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;
|
|
@@ -426,6 +433,7 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
426
433
|
});
|
|
427
434
|
let value = "";
|
|
428
435
|
const column = gridColumns.find((item) => item.key === columnKey);
|
|
436
|
+
console.log({ filteredValues });
|
|
429
437
|
const nonEmptyValues = filteredValues
|
|
430
438
|
.filter((item) => item.toString() !== "")
|
|
431
439
|
.sort((a, b) => {
|
|
@@ -1445,21 +1453,24 @@ withCard = false, cardClassName, cardHeader, title, headerLeft, headerRight, sub
|
|
|
1445
1453
|
}, children: [_jsx("div", { title: "Clear All Groups", onClick: () => {
|
|
1446
1454
|
// setChanged((prev) => [...prev, "groupBy"]);
|
|
1447
1455
|
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
|
-
|
|
1456
|
+
}, style: { cursor: "pointer", marginRight: "0.5rem" }, children: _jsx(MdGroupOff, { size: 18 }) }), gridGroupBy.split(",").map((chip) => {
|
|
1457
|
+
const column = columns.find(item => item.key === chip);
|
|
1458
|
+
return (_jsxs("div", { style: {
|
|
1459
|
+
display: "inline-flex",
|
|
1460
|
+
alignItems: "center",
|
|
1461
|
+
padding: "0.25rem",
|
|
1462
|
+
borderRadius: "0.25rem",
|
|
1463
|
+
margin: "0 0.25rem",
|
|
1464
|
+
backgroundColor: chipColor,
|
|
1465
|
+
}, children: [_jsx("span", { children: column === null || column === void 0 ? void 0 : column.label }), _jsx("span", { style: {
|
|
1466
|
+
display: "inline-block",
|
|
1467
|
+
cursor: "pointer",
|
|
1468
|
+
marginLeft: "0.5rem",
|
|
1469
|
+
}, onClick: () => setGridGroupBy((prev) => prev
|
|
1470
|
+
.split(",")
|
|
1471
|
+
.filter((item) => item !== chip)
|
|
1472
|
+
.join(",")), children: "\u00D7" })] }, chip));
|
|
1473
|
+
})] }))] }), _jsxs("div", { id: `grid-content`, style: {
|
|
1463
1474
|
display: "block",
|
|
1464
1475
|
border: gridBorder ? "1px solid #f0f0f0" : "none",
|
|
1465
1476
|
overflow: calculateVisible && gridGroupBy ? "visible" : "auto",
|
package/package.json
CHANGED