@megha-ui/react 1.3.66 → 1.3.68

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"
@@ -523,15 +523,31 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
523
523
  ((_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
524
  defaultSearchOperation ||
525
525
  "contains",
526
- ], onChange: (selected) => {
526
+ ], selectedDisplay: (_60 = (_59 = searchOptions
527
+ .filter((item) => {
528
+ var _a, _b, _c;
529
+ return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number" ||
530
+ ((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.dataType) === "currency"
531
+ ? numberTypeSearch.includes(item.value)
532
+ : ((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.dataType) === "date"
533
+ ? dateTypeSearch.includes(item.value)
534
+ : textTypeSearch.includes(item.value);
535
+ })
536
+ .find((item) => {
537
+ var _a, _b, _c;
538
+ return item.value ===
539
+ ((_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) ||
540
+ defaultSearchOperation ||
541
+ "contains";
542
+ })) === null || _59 === void 0 ? void 0 : _59.label) !== null && _60 !== void 0 ? _60 : "", withValue: true, onChange: (selected) => {
527
543
  var _a, _b, _c;
528
544
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
529
545
  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" })] }) }))] }, (_59 = headerColumns.find((column) => column.key === _groupBy)) === null || _59 === void 0 ? void 0 : _59.key)) }));
546
+ }, searchEnabled: false, className: "flex-1", isIcon: true })] }) }))] }, (_61 = headerColumns.find((column) => column.key === _groupBy)) === null || _61 === void 0 ? void 0 : _61.key)) }));
531
547
  }), headerColumns
532
548
  .filter((column) => !groupByKeys.includes(column.key))
533
549
  .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;
550
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
535
551
  if (!column.hidden) {
536
552
  const columnData = getColumnData(column.key, gridData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string", combinedColumns !== null && combinedColumns !== void 0 ? combinedColumns : []);
537
553
  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: {
@@ -788,7 +804,20 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
788
804
  var _a;
789
805
  const value = ((_a = selected[0]) === null || _a === void 0 ? void 0 : _a.toString()) || "";
790
806
  handleSearchOptionSelect(column.key, value);
791
- }, searchEnabled: false, className: "flex-1" })] }) }))] })) }, column.key));
807
+ }, selectedDisplay: (_x = (_w = searchOptions
808
+ .filter((item) => (column === null || column === void 0 ? void 0 : column.dataType) === "number" ||
809
+ (column === null || column === void 0 ? void 0 : column.dataType) === "currency"
810
+ ? numberTypeSearch.includes(item.value)
811
+ : (column === null || column === void 0 ? void 0 : column.dataType) === "date"
812
+ ? dateTypeSearch.includes(item.value)
813
+ : textTypeSearch.includes(item.value))
814
+ .find((item) => {
815
+ var _a, _b;
816
+ return item.value ===
817
+ ((_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) ||
818
+ defaultSearchOperation ||
819
+ "contains";
820
+ })) === 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
821
  }
793
822
  return null;
794
823
  })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.3.66",
3
+ "version": "1.3.68",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",