@homecode/ui 4.22.3 → 4.22.5
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.
- package/dist/esm/index.js +1 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +3 -2
- package/dist/esm/src/components/Flex/Flex.js +8 -0
- package/dist/esm/src/components/Flex/Flex.styl.js +7 -0
- package/dist/esm/src/components/Input/Input.js +1 -0
- package/dist/esm/src/components/InputFile/InputFile.js +1 -0
- package/dist/esm/types/src/components/Autocomplete/Autocomplete.types.d.ts +2 -0
- package/dist/esm/types/src/components/Flex/Flex.d.ts +6 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { DatePickerInput } from './src/components/DatePickerInput/DatePickerInpu
|
|
|
10
10
|
export { DateTime, formatDate } from './src/components/DateTime/DateTime.js';
|
|
11
11
|
export { Draggable } from './src/components/Draggable/Draggable.js';
|
|
12
12
|
export { Expand } from './src/components/Expand/Expand.js';
|
|
13
|
+
export { Flex } from './src/components/Flex/Flex.js';
|
|
13
14
|
export { Form } from './src/components/Form/Form.js';
|
|
14
15
|
export { Gallery } from './src/components/Gallery/Gallery.js';
|
|
15
16
|
export { Heading } from './src/components/Heading/Heading.js';
|
|
@@ -33,6 +33,7 @@ import '../DatePickerInput/DatePickerInput.styl.js';
|
|
|
33
33
|
import '../../tools/queryParams.js';
|
|
34
34
|
import '../Draggable/Draggable.styl.js';
|
|
35
35
|
import '../Expand/Expand.styl.js';
|
|
36
|
+
import '../Flex/Flex.styl.js';
|
|
36
37
|
import '../Form/Form.styl.js';
|
|
37
38
|
import '../Form/Validator.js';
|
|
38
39
|
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
@@ -57,7 +58,7 @@ import '../Virtualized/List/List.styl.js';
|
|
|
57
58
|
import '../Virtualized/List/ListScroll.styl.js';
|
|
58
59
|
|
|
59
60
|
function Autocomplete(props) {
|
|
60
|
-
const { className, inputWrapperClassName, value, onChange, size = 'm', getOptions, onSelect, debounceDelay = 300, round = false, blur = false, inputProps = {}, popupProps = {}, } = props;
|
|
61
|
+
const { className, inputWrapperClassName, value, onChange, size = 'm', getOptions, onSelect, debounceDelay = 300, round = false, blur = false, inputProps = {}, popupProps = {}, menuProps = {}, } = props;
|
|
61
62
|
const isMounted = useIsMounted();
|
|
62
63
|
const [options, setOptions] = useState([]);
|
|
63
64
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -138,7 +139,7 @@ function Autocomplete(props) {
|
|
|
138
139
|
const optionsList = useMemo(() => {
|
|
139
140
|
if (!options.length)
|
|
140
141
|
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.render ? option.render(option) : option.label }, option.id))) }));
|
|
142
|
+
return (jsx(Menu, { className: S.options, size: size, offset: { y: { before: 20, after: 20 } }, ...menuProps, 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
143
|
}, [options, focusedIndex]);
|
|
143
144
|
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
145
|
// @ts-ignore
|
|
@@ -33,6 +33,7 @@ import 'moment';
|
|
|
33
33
|
import '../DatePickerInput/DatePickerInput.styl.js';
|
|
34
34
|
import '../Draggable/Draggable.styl.js';
|
|
35
35
|
import '../Expand/Expand.styl.js';
|
|
36
|
+
import '../Flex/Flex.styl.js';
|
|
36
37
|
import '../Form/Form.styl.js';
|
|
37
38
|
import '../Form/Validator.js';
|
|
38
39
|
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
@@ -36,6 +36,7 @@ import 'moment';
|
|
|
36
36
|
import '../DatePickerInput/DatePickerInput.styl.js';
|
|
37
37
|
import { Draggable } from '../Draggable/Draggable.js';
|
|
38
38
|
import '../Expand/Expand.styl.js';
|
|
39
|
+
import '../Flex/Flex.styl.js';
|
|
39
40
|
import '../Form/Form.styl.js';
|
|
40
41
|
import '../Form/Validator.js';
|
|
41
42
|
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormControl, Size } from 'uilib/types';
|
|
2
2
|
import { Props as InputProps } from 'uilib/components/Input/Input.types';
|
|
3
3
|
import { Props as PopupProps } from 'uilib/components/Popup/Popup.types';
|
|
4
|
+
import { MenuProps } from 'uilib/components/Menu/Menu.types';
|
|
4
5
|
export type Option = {
|
|
5
6
|
id: string;
|
|
6
7
|
label: string;
|
|
@@ -17,6 +18,7 @@ export type Props = FormControl<Value, HTMLInputElement> & {
|
|
|
17
18
|
debounceDelay?: number;
|
|
18
19
|
inputProps?: Partial<InputProps>;
|
|
19
20
|
popupProps?: Partial<PopupProps>;
|
|
21
|
+
menuProps?: Partial<MenuProps>;
|
|
20
22
|
round?: boolean;
|
|
21
23
|
blur?: boolean;
|
|
22
24
|
};
|
|
@@ -10,6 +10,7 @@ export * from './DatePickerInput/DatePickerInput';
|
|
|
10
10
|
export * from './DateTime/DateTime';
|
|
11
11
|
export * from './Draggable/Draggable';
|
|
12
12
|
export * from './Expand/Expand';
|
|
13
|
+
export * from './Flex/Flex';
|
|
13
14
|
export * from './Form/Form';
|
|
14
15
|
export * from './Gallery/Gallery';
|
|
15
16
|
export * from './Heading/Heading';
|