@megha-ui/react 1.2.230 → 1.2.232

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.
@@ -360,13 +360,16 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
360
360
  display: "flex",
361
361
  alignItems: "start",
362
362
  width: "100%",
363
- }, children: _jsxs("span", { style: { marginLeft: "0.5rem" }, children: ["+ Create ", searchTerm] }) })] }, String(searchTerm))) : groupedOptions.length > 0 ? (groupedOptions.map((groupOption, gIndex) => (_jsxs("div", { children: [_jsx("div", { style: { paddingLeft: "1rem" }, children: groupOption.groupedValue }), groupOption.options.map((option, index) => {
363
+ }, children: _jsxs("span", { style: { marginLeft: "0.5rem" }, children: ["+ Create ", searchTerm] }) })] }, String(searchTerm))) : groupedOptions.length > 0 ? (groupedOptions.map((groupOption, gIndex) => (_jsxs("div", { children: [_jsx("div", { style: {
364
+ paddingLeft: "1rem",
365
+ borderBottom: "1px solid var(--divider-strong, #dddddd)",
366
+ }, children: groupOption.groupedValue }), groupOption.options.map((option, index) => {
364
367
  let prevOptions = groupedOptions.filter((item, index) => index < gIndex);
365
- prevOptions = [...prevOptions.map((item) => item.options)];
368
+ prevOptions = [
369
+ ...prevOptions.map((item) => item.options),
370
+ ];
366
371
  prevOptions = prevOptions.flatMap((item) => item);
367
- const refIndex = gIndex > 0
368
- ? prevOptions.length + index
369
- : index;
372
+ const refIndex = gIndex > 0 ? prevOptions.length + index : index;
370
373
  return (_jsxs("li", { ref: (el) => {
371
374
  optionRefs.current[refIndex] = el;
372
375
  }, id: `${refIndex}`, onClick: (e) => onSelectChange
@@ -377,11 +380,11 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
377
380
  !isMultiple &&
378
381
  intermediateValues.includes(option.value)
379
382
  ? selectedItemStyle
380
- : {})), { borderBottom: refIndex === filteredOptions.length - 1
383
+ : {})), { borderBottom: refIndex === optionRefs.current.length - 1
381
384
  ? "none"
382
385
  : "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between", padding: "0.75rem 1rem 0.75rem 1.5rem" }), onMouseEnter: (e) => {
383
386
  if (!option.disabled) {
384
- setHighlightIndex(index);
387
+ setHighlightIndex(refIndex);
385
388
  }
386
389
  }, children: [isMultiple && (_jsx("div", { style: { marginRight: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues.includes(option.value), onChange: () => { }, style: { pointerEvents: "none" }, noLabel: true, wrapperClass: checkboxWrapper }) })), _jsxs("div", { style: {
387
390
  display: "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.230",
3
+ "version": "1.2.232",
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",