hrm_ui_lib 3.1.89 → 3.1.90

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.
@@ -4,6 +4,7 @@ type TProps = {
4
4
  setSearchValue: (value: string) => void;
5
5
  onBack: () => void;
6
6
  withSearch: boolean;
7
+ isOpen: boolean;
7
8
  };
8
- export declare const MobileTopContent: ({ onBack, setSearchValue, searchValue, withSearch }: TProps) => ReactElement;
9
+ export declare const MobileTopContent: ({ onBack, setSearchValue, searchValue, withSearch, isOpen }: TProps) => ReactElement;
9
10
  export {};
@@ -4,7 +4,7 @@ import IconChevronLeft from '../../../SVGIcons/IconChevronLeft';
4
4
  import { Input } from '../../../Input';
5
5
  import IconDismissFilled from '../../../SVGIcons/IconDismissFilled';
6
6
  import IconSearchFilled from '../../../SVGIcons/IconSearchFilled';
7
- export const MobileTopContent = ({ onBack, setSearchValue, searchValue, withSearch }) => {
7
+ export const MobileTopContent = ({ onBack, setSearchValue, searchValue, withSearch, isOpen }) => {
8
8
  const inputRef = useRef(null);
9
9
  const onSearch = (e) => {
10
10
  setSearchValue(e.target.value);
@@ -13,10 +13,10 @@ export const MobileTopContent = ({ onBack, setSearchValue, searchValue, withSear
13
13
  setSearchValue('');
14
14
  };
15
15
  useEffect(() => {
16
- if (inputRef && inputRef.current) {
16
+ if (isOpen && inputRef && inputRef.current) {
17
17
  inputRef.current.focus();
18
18
  }
19
- }, [inputRef]);
19
+ }, [inputRef.current, isOpen]);
20
20
  return (_jsxs("div", { className: "flexbox mobile_top_content", children: [_jsx(IconChevronLeft, { onClick: onBack, size: "large" }), withSearch && (_jsx(Input, { currentValue: searchValue, handleChange: onSearch, className: "ml-8", size: "small", ref: inputRef, rightIconProps: {
21
21
  Component: searchValue ? IconDismissFilled : IconSearchFilled,
22
22
  size: searchValue ? 'xsmall' : 'small',
@@ -25,7 +25,7 @@ export const SelectMobile = (props) => {
25
25
  };
26
26
  const windowHeight = window.innerHeight;
27
27
  const windowWidth = window.innerWidth;
28
- return (_jsxs(Modal, { isOpen: isOpen, onClose: closeDropdown, isMobileFullScreen: true, children: [_jsx(MobileTopContent, { searchValue: searchValue, setSearchValue: setSearchValue, onBack: closeModal, withSearch: withSearch }), _jsxs("div", { className: "mobile_options_content", children: [innerHelperText ? (_jsx(Text, { size: "xsmall", type: "secondary", className: "mobile_options_content__label", children: innerHelperText })) : null, isLoading ? (_jsx(Loading, {})) : (_jsxs("div", { "data-id": `${dataId}-options-content`, children: [filteredData.length > 0 && (_jsx(List, { height: windowHeight - 30 - 32 - 24, itemCount: filteredData.length, itemSize: ITEM_SIZE_MOBILE, width: windowWidth, style: {
28
+ return (_jsxs(Modal, { isOpen: isOpen, onClose: closeDropdown, isMobileFullScreen: true, children: [_jsx(MobileTopContent, { searchValue: searchValue, setSearchValue: setSearchValue, onBack: closeModal, withSearch: withSearch, isOpen: isOpen }), _jsxs("div", { className: "mobile_options_content", children: [innerHelperText ? (_jsx(Text, { size: "xsmall", type: "secondary", className: "mobile_options_content__label", children: innerHelperText })) : null, isLoading ? (_jsx(Loading, {})) : (_jsxs("div", { "data-id": `${dataId}-options-content`, children: [filteredData.length > 0 && (_jsx(List, { height: windowHeight - 30 - 32 - 24, itemCount: filteredData.length, itemSize: ITEM_SIZE_MOBILE, width: windowWidth, style: {
29
29
  width: '100%',
30
30
  overflowX: 'hidden',
31
31
  overflowY: 'auto',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrm_ui_lib",
3
- "version": "3.1.89",
3
+ "version": "3.1.90",
4
4
  "description": "UI library for Dino",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",