hrm_ui_lib 3.1.86 → 3.1.87
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/components/Copy/Copy.js
CHANGED
|
@@ -10,7 +10,7 @@ export const Copy = ({ textAfterCopy, className = '', text, dataId }) => {
|
|
|
10
10
|
e.stopPropagation();
|
|
11
11
|
navigator.clipboard.writeText(text);
|
|
12
12
|
setTooltipVisibility(true);
|
|
13
|
-
setTimeout(() => setTooltipVisibility(false),
|
|
13
|
+
setTimeout(() => setTooltipVisibility(false), 1000);
|
|
14
14
|
};
|
|
15
15
|
return (_jsxs("div", { ref: copyIconRef, className: "copy-icon", children: [_jsx(Button, { dataId: dataId, type: "tertiary", iconProps: { Component: IconCopy }, size: "small", className: className, onClick: copy }), isTooltipVisible ? (_jsx(Popover, { clicked: true, elemRef: copyIconRef.current, text: textAfterCopy || 'Copied', position: 'top-center' })) : null] }));
|
|
16
16
|
};
|
|
@@ -117,6 +117,11 @@ 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]);
|
|
120
125
|
return (_jsxs("div", { "data-id": `${dataId}-content`, className: classNames(`select select--${size}`, className, {
|
|
121
126
|
'select--opened': isOpen
|
|
122
127
|
}), 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 })))] }));
|