@megha-ui/react 1.3.67 → 1.3.69
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.
|
@@ -253,7 +253,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
253
253
|
width: "100%",
|
|
254
254
|
height: "100%",
|
|
255
255
|
}, children: _jsx(Checkbox, { selected: allRowsSelected, onChange: () => toggleSelectAll(), noLabel: true, wrapperClass: checkboxWrapper }) }) })), groupByKeys.map((_groupBy) => {
|
|
256
|
-
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, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59;
|
|
256
|
+
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, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61;
|
|
257
257
|
return (_jsx(_Fragment, { children: headerColumns.find((column) => column.key === _groupBy) && (_jsxs("div", { className: `${sortable &&
|
|
258
258
|
((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.sortable)
|
|
259
259
|
? "sortable"
|
|
@@ -511,6 +511,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
511
511
|
background: ((_52 = headerColumns.find((column) => column.key === _groupBy)) === null || _52 === void 0 ? void 0 : _52.search)
|
|
512
512
|
? "var(--background)"
|
|
513
513
|
: "var(--disabled-bg)",
|
|
514
|
+
borderRight: "none",
|
|
515
|
+
borderTopRightRadius: 0,
|
|
516
|
+
borderBottomRightRadius: 0,
|
|
514
517
|
}, value: ((_54 = searchQueries[((_53 = headerColumns.find((column) => column.key === _groupBy)) === null || _53 === void 0 ? void 0 : _53.key) || ""]) === null || _54 === void 0 ? void 0 : _54.text) || "", disabled: !((_55 = headerColumns.find((column) => column.key === _groupBy)) === null || _55 === void 0 ? void 0 : _55.search), height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => {
|
|
515
518
|
var _a, _b, _c;
|
|
516
519
|
return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
|
|
@@ -523,15 +526,31 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
523
526
|
((_58 = searchQueries[(_57 = (_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.key) !== null && _57 !== void 0 ? _57 : ""]) === null || _58 === void 0 ? void 0 : _58.type) ||
|
|
524
527
|
defaultSearchOperation ||
|
|
525
528
|
"contains",
|
|
526
|
-
],
|
|
529
|
+
], selectedDisplay: (_60 = (_59 = searchOptions
|
|
530
|
+
.filter((item) => {
|
|
531
|
+
var _a, _b, _c;
|
|
532
|
+
return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
|
|
533
|
+
((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
|
|
534
|
+
? numberTypeSearch.includes(item.value)
|
|
535
|
+
: ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
|
|
536
|
+
? dateTypeSearch.includes(item.value)
|
|
537
|
+
: textTypeSearch.includes(item.value);
|
|
538
|
+
})
|
|
539
|
+
.find((item) => {
|
|
540
|
+
var _a, _b, _c;
|
|
541
|
+
return item.value ===
|
|
542
|
+
((_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) ||
|
|
543
|
+
defaultSearchOperation ||
|
|
544
|
+
"contains";
|
|
545
|
+
})) === null || _59 === void 0 ? void 0 : _59.label) !== null && _60 !== void 0 ? _60 : "", withValue: true, onChange: (selected) => {
|
|
527
546
|
var _a, _b, _c;
|
|
528
547
|
const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
|
|
529
548
|
handleSearchOptionSelect((_c = (_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : "", value);
|
|
530
|
-
}, searchEnabled: false, className: "flex-1", isIcon: true })] }) }))] }, (
|
|
549
|
+
}, searchEnabled: false, className: "flex-1", isIcon: true })] }) }))] }, (_61 = headerColumns.find((column) => column.key === _groupBy)) === null || _61 === void 0 ? void 0 : _61.key)) }));
|
|
531
550
|
}), headerColumns
|
|
532
551
|
.filter((column) => !groupByKeys.includes(column.key))
|
|
533
552
|
.map((column, colIndex) => {
|
|
534
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
553
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
535
554
|
if (!column.hidden) {
|
|
536
555
|
const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
|
|
537
556
|
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: {
|
|
@@ -775,6 +794,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
775
794
|
background: column.search
|
|
776
795
|
? "var(--background)"
|
|
777
796
|
: "var(--disabled-bg)",
|
|
797
|
+
borderRight: "none",
|
|
798
|
+
borderTopRightRadius: 0,
|
|
799
|
+
borderBottomRightRadius: 0,
|
|
778
800
|
}, value: ((_u = searchQueries[column.key]) === null || _u === void 0 ? void 0 : _u.text) || "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }), _jsx(Dropdown, { options: searchOptions.filter((item) => column.dataType === "number" ||
|
|
779
801
|
column.dataType === "currency"
|
|
780
802
|
? numberTypeSearch.includes(item.value)
|
|
@@ -788,7 +810,20 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
|
|
|
788
810
|
var _a;
|
|
789
811
|
const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
|
|
790
812
|
handleSearchOptionSelect(column.key, value);
|
|
791
|
-
},
|
|
813
|
+
}, selectedDisplay: (_x = (_w = searchOptions
|
|
814
|
+
.filter((item) => (column === null || column === void 0 ? void 0 : column.dataType) === "number" ||
|
|
815
|
+
(column === null || column === void 0 ? void 0 : column.dataType) === "currency"
|
|
816
|
+
? numberTypeSearch.includes(item.value)
|
|
817
|
+
: (column === null || column === void 0 ? void 0 : column.dataType) === "date"
|
|
818
|
+
? dateTypeSearch.includes(item.value)
|
|
819
|
+
: textTypeSearch.includes(item.value))
|
|
820
|
+
.find((item) => {
|
|
821
|
+
var _a, _b;
|
|
822
|
+
return item.value ===
|
|
823
|
+
((_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) ||
|
|
824
|
+
defaultSearchOperation ||
|
|
825
|
+
"contains";
|
|
826
|
+
})) === null || _w === void 0 ? void 0 : _w.label) !== null && _x !== void 0 ? _x : "", withValue: true, searchEnabled: false, className: "flex-1", isIcon: true })] }) }))] })) }, column.key));
|
|
792
827
|
}
|
|
793
828
|
return null;
|
|
794
829
|
})] }));
|
package/package.json
CHANGED