@megha-ui/react 1.3.0 → 1.3.2

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.
@@ -414,7 +414,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
414
414
  display: "flex",
415
415
  alignItems: "start",
416
416
  width: "100%",
417
- }, children: _jsx("span", { children: "Select All" }) })] })), _jsx("div", { style: { maxHeight: (maxDropdownHeight !== null && maxDropdownHeight !== void 0 ? maxDropdownHeight : height > 0) ? `${height}px` : "", overflowY: "auto" }, children: isLoading ? (_jsxs(Block, { as: "div", className: "flex items-center justify-between", children: [_jsx(Text, { as: "span", children: "Loading options" }), _jsx(Loader, { size: 12 })] })) : isCreatable && filteredOptions.length < 1 && searchTerm ? (_jsxs("li", { onClick: (e) => onCreate(searchTerm), style: Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), children: [isMultiple && (_jsx(Checkbox, { selected: intermediateValues.includes(searchTerm), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper })), _jsx("div", { style: {
417
+ }, children: _jsx("span", { children: "Select All" }) })] })), _jsx("div", { className: `${maxDropdownHeight} height: ${height > 0 ? `${height}px` : ""}`, style: { maxHeight: (maxDropdownHeight !== null && maxDropdownHeight !== void 0 ? maxDropdownHeight : height > 0) ? `${height}px` : "", overflowY: "auto" }, children: isLoading ? (_jsxs(Block, { as: "div", className: "flex items-center justify-between", children: [_jsx(Text, { as: "span", children: "Loading options" }), _jsx(Loader, { size: 12 })] })) : isCreatable && filteredOptions.length < 1 && searchTerm ? (_jsxs("li", { onClick: (e) => onCreate(searchTerm), style: Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), children: [isMultiple && (_jsx(Checkbox, { selected: intermediateValues.includes(searchTerm), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper })), _jsx("div", { style: {
418
418
  display: "flex",
419
419
  alignItems: "start",
420
420
  width: "100%",
@@ -497,15 +497,15 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
497
497
  toggleDropdown(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "");
498
498
  }
499
499
  }, onChange: (e) => {
500
- var _a, _b, _c;
501
- let searchType = ((_b = searchQueries[((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || ""]) === null || _b === void 0 ? void 0 : _b.type) || "contains";
500
+ var _a;
501
+ let searchType = "contains";
502
502
  if (e.target.value.includes("to")) {
503
503
  searchType = "between";
504
504
  }
505
505
  else if (searchType === "between") {
506
506
  searchType = "contains";
507
507
  }
508
- onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
508
+ onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", e.target.value, searchType);
509
509
  }, value: ((_55 = searchQueries[((_54 = headerColumns.find((column) => column.key === _groupBy)) === null || _54 === void 0 ? void 0 : _54.key) || ""]) === null || _55 === void 0 ? void 0 : _55.text) || "", disabled: !((_56 = headerColumns.find((column) => column.key === _groupBy)) === null || _56 === void 0 ? void 0 : _56.search), extraWrapperStyle: {
510
510
  background: ((_57 = headerColumns.find((column) => column.key === _groupBy)) === null || _57 === void 0 ? void 0 : _57.search)
511
511
  ? "var(--background)"
@@ -745,8 +745,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
745
745
  pointerEvents: search && column.search ? "auto" : "none",
746
746
  cursor: search && column.search ? "default" : "not-allowed",
747
747
  }, children: _jsx(TextInput, { onChange: (e) => {
748
- var _a;
749
- let searchType = ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) || "contains";
748
+ let searchType = "contains";
750
749
  if (e.target.value.includes("to")) {
751
750
  searchType = "between";
752
751
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
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",