@homecode/ui 4.22.2 → 4.22.3
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.
|
@@ -138,7 +138,7 @@ function Autocomplete(props) {
|
|
|
138
138
|
const optionsList = useMemo(() => {
|
|
139
139
|
if (!options.length)
|
|
140
140
|
return null;
|
|
141
|
-
return (jsx(Menu, { className: S.options, size: size, offset: { y: { before: 20, after: 20 } }, children: options.map((option, index) => (jsx(Menu.Item, { focused: focusedIndex === index, className: S.option, onClick: () => handleSelect(option), onMouseEnter: () => setFocusedIndex(index), children: option.label }, option.id))) }));
|
|
141
|
+
return (jsx(Menu, { className: S.options, size: size, offset: { y: { before: 20, after: 20 } }, children: options.map((option, index) => (jsx(Menu.Item, { focused: focusedIndex === index, className: S.option, onClick: () => handleSelect(option), onMouseEnter: () => setFocusedIndex(index), children: option.render ? option.render(option) : option.label }, option.id))) }));
|
|
142
142
|
}, [options, focusedIndex]);
|
|
143
143
|
return (jsx(Popup, { className: classes, isOpen: isOpen, focusControl: true, round: round, size: size, blur: blur, direction: "bottom", ...popupProps, trigger: jsxs("div", { className: inputWrapperClassName, children: [jsx(Input, { ref: inputRef,
|
|
144
144
|
// @ts-ignore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Autocomplete_root__86RQs{position:relative}.Autocomplete_popupContent__Aet6P{margin-top:8px;width:100%}.Autocomplete_options__NtttU{max-height:200px;overflow-y:auto}.Autocomplete_option__uBuih{cursor:pointer;padding:8px 12px}.Autocomplete_shimmer__s6rri{height:100%;left:0;position:absolute;top:0;width:100%}";
|
|
3
|
+
var css_248z = ".Autocomplete_root__86RQs{position:relative}.Autocomplete_popupContent__Aet6P{margin-top:8px;width:100%}.Autocomplete_options__NtttU{max-height:200px;overflow-y:auto}.Autocomplete_option__uBuih{cursor:pointer;padding:8px 12px}.Autocomplete_option__uBuih>span{align-items:center;display:flex}.Autocomplete_shimmer__s6rri{height:100%;left:0;position:absolute;top:0;width:100%}";
|
|
4
4
|
var S = {"root":"Autocomplete_root__86RQs","popupContent":"Autocomplete_popupContent__Aet6P","options":"Autocomplete_options__NtttU","option":"Autocomplete_option__uBuih","shimmer":"Autocomplete_shimmer__s6rri"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -4,6 +4,7 @@ import { Props as PopupProps } from 'uilib/components/Popup/Popup.types';
|
|
|
4
4
|
export type Option = {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
|
+
render?: (option: Option) => React.ReactNode;
|
|
7
8
|
};
|
|
8
9
|
export type Value = string;
|
|
9
10
|
export type Props = FormControl<Value, HTMLInputElement> & {
|