@megha-ui/react 1.2.219 → 1.2.221
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) =>
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
?
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
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" }), (index === highlightIndex
|
|
372
|
+
? listItemHoverStyle
|
|
373
|
+
: {})), (option.disabled ? listItemDisabledStyle : {})), (index !== highlightIndex &&
|
|
374
|
+
!isMultiple &&
|
|
375
|
+
intermediateValues.includes(option.value)
|
|
376
|
+
? selectedItemStyle
|
|
377
|
+
: {})), { borderBottom: index === 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