@megha-ui/react 1.2.57 → 1.2.58

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.
@@ -85,7 +85,7 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
85
85
  }, onClick: () => handleSelect(item, columnKey), children: [(0, jsx_runtime_1.jsx)(checkbox_1.default, { selected: (uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey])
86
86
  ? (_a = uniqueSearch === null || uniqueSearch === void 0 ? void 0 : uniqueSearch[columnKey]) === null || _a === void 0 ? void 0 : _a.includes(item)
87
87
  : true, onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }), (0, jsx_runtime_1.jsx)("span", { style: { marginLeft: "0.5rem" }, children: item })] }, item));
88
- })] }))] })), isOpen && ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { columnIndex: columnIndex, headerDropdownIndex: headerDropdownIndex || 1001, searchOptions: searchOptions, position: position
88
+ })] }))] })), isOpen && ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { combined: true, columnIndex: columnIndex, headerDropdownIndex: headerDropdownIndex || 1001, searchOptions: searchOptions, position: position
89
89
  ? {
90
90
  top: position.top,
91
91
  left: ((_d = headerDropdown === null || headerDropdown === void 0 ? void 0 : headerDropdown.current) === null || _d === void 0 ? void 0 : _d.clientWidth)
@@ -411,7 +411,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
411
411
  : "hidden",
412
412
  }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_20 = searchQueries[((_19 = headerColumns.find((column) => column.key === _groupBy)) === null || _19 === void 0 ? void 0 : _19.key) || ""]) === null || _20 === void 0 ? void 0 : _20.type) ||
413
413
  defaultSearchOperation ||
414
- "contains", checkboxWrapper: checkboxWrapper })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { columnIndex: -1, headerDropdownIndex: headerDropdownIndex, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOptions: searchOptions.filter((item) => {
414
+ "contains", checkboxWrapper: checkboxWrapper })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { columnIndex: -1, combined: false, headerDropdownIndex: headerDropdownIndex, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOptions: searchOptions.filter((item) => {
415
415
  var _a, _b;
416
416
  return ((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.dataType) === "number"
417
417
  ? numberTypeSearch.includes(item.value)
@@ -679,7 +679,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
679
679
  ? "var(--background)"
680
680
  : "var(--disabled-bg)",
681
681
  }, placeholder: "Search", value: ((_h = searchQueries[column.key]) === null || _h === void 0 ? void 0 : _h.text) ||
682
- "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) })) })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number"
682
+ "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) })) })) : ((0, jsx_runtime_1.jsx)(textFilterDropdown_1.default, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: (0, jsx_runtime_1.jsx)(gridHeaderDropdown_1.default, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number"
683
683
  ? numberTypeSearch.includes(item.value)
684
684
  : column.dataType === "date"
685
685
  ? dateTypeSearch.includes(item.value)
@@ -11,6 +11,7 @@ interface MenuPosition {
11
11
  interface GridFilterDropdownProps {
12
12
  searchOptions: DropdownOption[];
13
13
  position: MenuPosition;
14
+ combined: boolean;
14
15
  columnKey: string;
15
16
  activeSearchType: string;
16
17
  searchElement: any;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const dropdown_1 = __importDefault(require("../../dropdown"));
9
- const TextFilterDropdown = ({ headerDropdownIndex, searchOptions, position, columnKey, searchElement, activeSearchType, sortingOps, searchable, searchInput, columnIndex }) => {
9
+ const TextFilterDropdown = ({ headerDropdownIndex, searchOptions, combined, position, columnKey, searchElement, activeSearchType, sortingOps, searchable, searchInput, columnIndex, }) => {
10
10
  (0, react_1.useEffect)(() => {
11
11
  var _a;
12
12
  if (searchElement) {
@@ -21,7 +21,13 @@ const TextFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
21
21
  const clickedOption = searchOptions.find((item) => selected === item.value);
22
22
  clickedOption === null || clickedOption === void 0 ? void 0 : clickedOption.action(columnKey, selected);
23
23
  };
24
- return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({ position: "absolute", top: "calc(100% + 5px)" }, (columnIndex > 1 ? { right: 0 } : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.25rem 0", width: 230, borderRadius: "0.5rem", margin: 0 }), id: "grid-dropdown", onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput, sortingOps && sortingOps, (0, jsx_runtime_1.jsx)("div", { style: {
24
+ return ((0, jsx_runtime_1.jsxs)("div", { style: Object.assign(Object.assign({ position: "absolute", top: combined ? 0 : "calc(100% + 5px)" }, (combined
25
+ ? {
26
+ left: "100%",
27
+ }
28
+ : columnIndex > 1
29
+ ? { right: 0 }
30
+ : { left: 0 })), { zIndex: headerDropdownIndex ? headerDropdownIndex : 1000, backgroundColor: "white", boxShadow: "0px 0.5rem 1rem 0px rgba(0,0,0,0.2)", listStyleType: "none", padding: "0.25rem 0", width: 230, borderRadius: "0.5rem", margin: 0 }), id: "grid-dropdown", onClick: (e) => e.stopPropagation(), children: [searchInput && searchInput, sortingOps && sortingOps, (0, jsx_runtime_1.jsx)("div", { style: {
25
31
  padding: "0.5rem 0.75rem",
26
32
  }, children: (0, jsx_runtime_1.jsx)(dropdown_1.default, { options: searchOptions, selectedValues: [activeSearchType], onChange: (selected) => handleDropdownChange(selected[0].toString(), columnKey), searchEnabled: false, maxDropdownHeight: 350 }) }), (0, jsx_runtime_1.jsx)("div", { style: {
27
33
  padding: "0.5rem 0.75rem",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.57",
3
+ "version": "1.2.58",
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.mjs",