@megha-ui/react 1.2.220 → 1.2.222

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,26 +360,34 @@ 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", { children: groupOption.groupedValue }), groupOption.options.map((option, index) => (_jsxs("li", { ref: (el) => {
364
- const refIndex = gIndex > 0 ? groupedOptions[gIndex - 1].options.length + index : index;
365
- optionRefs.current[refIndex] = el;
366
- }, onClick: (e) => onSelectChange
367
- ? handleItemSelect(option, option.disabled || false)
368
- : handleSelect(option.value, option.disabled || false), style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center" }), (index === highlightIndex ? listItemHoverStyle : {})), (option.disabled ? listItemDisabledStyle : {})), (index !== highlightIndex &&
369
- !isMultiple &&
370
- intermediateValues.includes(option.value)
371
- ? selectedItemStyle
372
- : {})), { borderBottom: index === filteredOptions.length - 1
373
- ? "none"
374
- : "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
375
- if (!option.disabled) {
376
- setHighlightIndex(index);
377
- }
378
- }, 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: {
379
- display: "flex",
380
- alignItems: "start",
381
- width: "100%",
382
- }, children: [option.icon && option.isDelete && !option.isDelete && (_jsx("span", { style: { margin: "0 0.5rem" }, children: option.icon })), _jsx("span", { children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value))))] })))) : (filteredOptions.map((option, index) => (_jsxs("li", { ref: (el) => {
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", { children: groupOption.groupedValue }), groupOption.options.map((option, index) => {
364
+ const refIndex = gIndex > 0
365
+ ? groupedOptions[gIndex - 1].options.length + index
366
+ : index;
367
+ return (_jsxs("li", { ref: (el) => {
368
+ optionRefs.current[refIndex] = el;
369
+ }, id: `${refIndex}`, onClick: (e) => onSelectChange
370
+ ? handleItemSelect(option, option.disabled || false)
371
+ : handleSelect(option.value, option.disabled || false), style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center" }), (refIndex === highlightIndex
372
+ ? listItemHoverStyle
373
+ : {})), (option.disabled ? listItemDisabledStyle : {})), (refIndex !== highlightIndex &&
374
+ !isMultiple &&
375
+ intermediateValues.includes(option.value)
376
+ ? selectedItemStyle
377
+ : {})), { borderBottom: refIndex === filteredOptions.length - 1
378
+ ? "none"
379
+ : "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
380
+ if (!option.disabled) {
381
+ setHighlightIndex(index);
382
+ }
383
+ }, 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: {
384
+ display: "flex",
385
+ alignItems: "start",
386
+ width: "100%",
387
+ }, children: [option.icon &&
388
+ option.isDelete &&
389
+ !option.isDelete && (_jsx("span", { style: { margin: "0 0.5rem" }, children: option.icon })), _jsx("span", { children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value)));
390
+ })] })))) : (filteredOptions.map((option, index) => (_jsxs("li", { ref: (el) => {
383
391
  optionRefs.current[index] = el;
384
392
  }, onClick: (e) => onSelectChange
385
393
  ? handleItemSelect(option, option.disabled || false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.220",
3
+ "version": "1.2.222",
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",