hrm_ui_lib 3.1.87 → 3.1.89
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.
|
@@ -117,11 +117,6 @@ export const Select = forwardRef((props, _ref) => {
|
|
|
117
117
|
useEffect(() => {
|
|
118
118
|
setCurrentSelectedLabel();
|
|
119
119
|
}, [setCurrentSelectedLabel]);
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
if (withSearch && inputRef && inputRef.current && isMobile) {
|
|
122
|
-
inputRef.current.focus();
|
|
123
|
-
}
|
|
124
|
-
}, [isMobile, inputRef.current, withSearch]);
|
|
125
120
|
return (_jsxs("div", { "data-id": `${dataId}-content`, className: classNames(`select select--${size}`, className, {
|
|
126
121
|
'select--opened': isOpen
|
|
127
122
|
}), ref: containerRef, children: [!isButtonSelect && (_jsx(Input, { onClick: disabled ? noop : onOpenOptions, size: size, dataId: dataId, hasError: hasError, className: "select__input", label: label, onChange: onSearch, required: isRequiredField, leftIconProps: leftIconProps, rightIconProps: isOpen ? selectRightIconOpenedProps : selectRightIconProps, placeholder: placeHolder, currentValue: searchValue || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label.toString()) || '', isValid: isValid, disabled: disabled, helperText: isOpen ? '' : outerHelperText, ref: inputRef, labelAddons: labelAddons, autoComplete: "false", readOnly: (isMobile && isMobileFullScreen) || !isWithSearch, onKeyDown: handleKeyDown })), isButtonSelect && (_jsx(Button, { size: size, type: "secondary", dataId: dataId, iconProps: selectRightIconProps, buttonText: placeHolder || '', onClick: disabled ? noop : openDropdown, className: "select_button" })), isMobile && isMobileFullScreen ? (_jsx(SelectMobile, Object.assign({}, rest, { isOpen: isOpen, filteredData: filteredData, closeDropdown: closeDropdown, currentSelection: currentSelection, isRequiredField: isRequiredField, onItemDeselect: onItemDeselect, onItemSelect: onItemSelect, translations: localizations, withSearch: withSearch, searchValue: searchValue, setSearchValue: setSearchValue }))) : (_jsx(SelectDesktop, Object.assign({}, rest, { onItemDeselect: onItemDeselect, onItemSelect: onItemSelect, currentSelection: currentSelection, isRequiredField: isRequiredField, filteredData: filteredData, inputRef: inputRef.current, containerRef: containerRef.current, isOpen: isOpen, closeDropdown: closeDropdown, setCurrentSelectedLabel: setCurrentSelectedLabel, searchValue: searchValue, setSearchValue: setSearchValue, translations: localizations, activeIndex: activeIndex, setActiveIndex: setActiveIndex })))] }));
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
2
3
|
import IconChevronLeft from '../../../SVGIcons/IconChevronLeft';
|
|
3
4
|
import { Input } from '../../../Input';
|
|
4
5
|
import IconDismissFilled from '../../../SVGIcons/IconDismissFilled';
|
|
5
6
|
import IconSearchFilled from '../../../SVGIcons/IconSearchFilled';
|
|
6
7
|
export const MobileTopContent = ({ onBack, setSearchValue, searchValue, withSearch }) => {
|
|
8
|
+
const inputRef = useRef(null);
|
|
7
9
|
const onSearch = (e) => {
|
|
8
10
|
setSearchValue(e.target.value);
|
|
9
11
|
};
|
|
10
12
|
const removeFilter = () => {
|
|
11
13
|
setSearchValue('');
|
|
12
14
|
};
|
|
13
|
-
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (inputRef && inputRef.current) {
|
|
17
|
+
inputRef.current.focus();
|
|
18
|
+
}
|
|
19
|
+
}, [inputRef]);
|
|
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: {
|
|
14
21
|
Component: searchValue ? IconDismissFilled : IconSearchFilled,
|
|
15
22
|
size: searchValue ? 'xsmall' : 'small',
|
|
16
23
|
onClick: removeFilter
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TSnackbarProps, TToastProps } from './types';
|
|
3
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
4
3
|
export declare const notify: (toastProps: TToastProps) => void;
|
|
5
4
|
export declare const Snackbar: (props: TSnackbarProps) => ReactElement;
|
|
@@ -4,7 +4,6 @@ import { Text } from '../Text';
|
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { DEFAULT_DURATION, ICONS_MAPPING, TYPE_MAPPING } from './consts';
|
|
6
6
|
import { IconDynamicComponent } from '../../helperComponents/IconDynamicComponent';
|
|
7
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
8
7
|
const CustomToast = ({ actionProps, toastId, type = 'information', text }) => {
|
|
9
8
|
return (_jsxs("div", { "data-id": `${type}-toast-message`, className: "snackbar", children: [_jsxs("div", { className: "snackbar__content", children: [_jsx(IconDynamicComponent, { Component: ICONS_MAPPING[type], type: TYPE_MAPPING[type], size: "medium" }), _jsx(Text, { className: "snackbar__text pl-16 pr-8", type: "primary", size: "standard", weight: "regular", lineHeight: "large", children: text })] }), actionProps ? (_jsx(Button, Object.assign({ size: "small", type: "tertiary" }, actionProps, { onClick: (e) => {
|
|
10
9
|
var _a;
|