@megha-ui/react 1.3.79 → 1.3.81
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.
|
@@ -618,9 +618,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
618
618
|
.find((item) => {
|
|
619
619
|
var _a, _b, _c;
|
|
620
620
|
return item.value ===
|
|
621
|
-
((_c = searchQueries[(_b = (_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
(((_c = searchQueries[(_b = (_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : ""]) === null || _c === void 0 ? void 0 : _c.type) ||
|
|
622
|
+
defaultSearchOperation ||
|
|
623
|
+
"contains");
|
|
624
624
|
})) === null || _59 === void 0 ? void 0 : _59.label) !== null && _60 !== void 0 ? _60 : "", withValue: true, onChange: (selected) => {
|
|
625
625
|
var _a, _b, _c;
|
|
626
626
|
const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
|
|
@@ -633,9 +633,13 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
633
633
|
left: 0,
|
|
634
634
|
background: "var(--card-bg)",
|
|
635
635
|
width: "max-content",
|
|
636
|
+
maxWidth: "24rem",
|
|
636
637
|
maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
|
|
637
638
|
overflow: "auto",
|
|
638
639
|
padding: "0.5rem 0.75rem",
|
|
640
|
+
borderRadius: "0.5rem",
|
|
641
|
+
boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
|
|
642
|
+
border: "1px solid var(--divider, #f5f5f5)",
|
|
639
643
|
}, children: getColumnData(((_65 = headerColumns.find((column) => column.key === _groupBy)) === null || _65 === void 0 ? void 0 : _65.key) || "", gridData, (_67 = (_66 = headerColumns.find((column) => column.key === _groupBy)) === null || _66 === void 0 ? void 0 : _66.dataType) !== null && _67 !== void 0 ? _67 : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []).length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { style: {
|
|
640
644
|
cursor: "pointer",
|
|
641
645
|
display: "flex",
|
|
@@ -673,6 +677,18 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
673
677
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
674
678
|
if (!column.hidden) {
|
|
675
679
|
const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
|
|
680
|
+
const colSearchOptions = searchOptions.filter((item) => (column === null || column === void 0 ? void 0 : column.dataType) === "number" || (column === null || column === void 0 ? void 0 : column.dataType) === "currency"
|
|
681
|
+
? numberTypeSearch.includes(item.value)
|
|
682
|
+
: (column === null || column === void 0 ? void 0 : column.dataType) === "date"
|
|
683
|
+
? dateTypeSearch.includes(item.value)
|
|
684
|
+
: textTypeSearch.includes(item.value));
|
|
685
|
+
console.log(colSearchOptions.find((item) => {
|
|
686
|
+
var _a, _b;
|
|
687
|
+
return item.value ===
|
|
688
|
+
(((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
|
|
689
|
+
defaultSearchOperation ||
|
|
690
|
+
"contains");
|
|
691
|
+
}));
|
|
676
692
|
return (_jsx("div", { className: `${sortable && column.sortable ? "sortable" : ""} ${column.showMenu ? "menu-true" : "menu-false"} column index-${column.key}`, style: Object.assign(Object.assign({}, cellStyle), { padding: "0.5rem", textAlign: "left", whiteSpace: "nowrap", textOverflow: "ellipsis", wordBreak: widthMode === "auto" ? "break-all" : "unset", backgroundColor: "var(--row-header-bg)", borderTop: headerTopBorder, borderBottom: headerBottomBorder, flex: widthMode === "auto" ? 1 : undefined, flexGrow: widthMode === "auto" ? 1 : 0, flexShrink: widthMode === "auto" ? 1 : 0, position: "sticky", top: 0, zIndex: 1 }), onMouseMove: (e) => handleMouseMove(e), onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, children: !actionsKey.split(",").includes(column.key) && (_jsxs(_Fragment, { children: [resizable && (_jsx("div", { style: {
|
|
677
693
|
position: "absolute",
|
|
678
694
|
width: "1px",
|
|
@@ -929,19 +945,12 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
929
945
|
var _a;
|
|
930
946
|
const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
|
|
931
947
|
handleSearchOptionSelect(column.key, value);
|
|
932
|
-
}, selectedDisplay: (_x = (_w =
|
|
933
|
-
.filter((item) => (column === null || column === void 0 ? void 0 : column.dataType) === "number" ||
|
|
934
|
-
(column === null || column === void 0 ? void 0 : column.dataType) === "currency"
|
|
935
|
-
? numberTypeSearch.includes(item.value)
|
|
936
|
-
: (column === null || column === void 0 ? void 0 : column.dataType) === "date"
|
|
937
|
-
? dateTypeSearch.includes(item.value)
|
|
938
|
-
: textTypeSearch.includes(item.value))
|
|
939
|
-
.find((item) => {
|
|
948
|
+
}, selectedDisplay: (_x = (_w = colSearchOptions.find((item) => {
|
|
940
949
|
var _a, _b;
|
|
941
950
|
return item.value ===
|
|
942
|
-
((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
|
|
943
|
-
|
|
944
|
-
|
|
951
|
+
(((_b = searchQueries[(_a = column === null || column === void 0 ? void 0 : column.key) !== null && _a !== void 0 ? _a : ""]) === null || _b === void 0 ? void 0 : _b.type) ||
|
|
952
|
+
defaultSearchOperation ||
|
|
953
|
+
"contains");
|
|
945
954
|
})) === null || _w === void 0 ? void 0 : _w.label) !== null && _x !== void 0 ? _x : "", withValue: true, searchEnabled: false, className: "flex-1", isIcon: true })] }) }), columnData.length > 0 &&
|
|
946
955
|
activeSearchColumn === ((column === null || column === void 0 ? void 0 : column.key) || "") && (_jsxs("div", { ref: activeSearchListRef, style: {
|
|
947
956
|
position: "absolute",
|
|
@@ -949,9 +958,13 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
949
958
|
left: 0,
|
|
950
959
|
background: "var(--card-bg)",
|
|
951
960
|
width: "max-content",
|
|
961
|
+
maxWidth: "24rem",
|
|
952
962
|
maxHeight: activeSearchMaxHeight !== null && activeSearchMaxHeight !== void 0 ? activeSearchMaxHeight : 300,
|
|
953
963
|
overflow: "auto",
|
|
954
964
|
padding: "0.5rem 0.75rem",
|
|
965
|
+
borderRadius: "0.5rem",
|
|
966
|
+
boxShadow: "0 0.5rem 1rem rgba(0,0,0,0.15)",
|
|
967
|
+
border: "1px solid var(--divider, #f5f5f5)",
|
|
955
968
|
}, children: [_jsxs("div", { style: {
|
|
956
969
|
cursor: "pointer",
|
|
957
970
|
display: "flex",
|
package/package.json
CHANGED