@tap-payments/os-micro-frontend-shared 0.1.236-test.1 → 0.1.236-test.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.
|
@@ -6,7 +6,7 @@ import { blueDropdownArrowIcon, closeXIcon, downArrowIcon } from '../../constant
|
|
|
6
6
|
import { HeaderWrapper, ListWrapper } from './style';
|
|
7
7
|
function SelectDropdown({ onClose, open, anchorEl, trigger, onOpen, children, disabled, listWrapperSx, hideArrow, onClear, hasValue }) {
|
|
8
8
|
const isClearButtonVisible = onClear && hasValue;
|
|
9
|
-
return (_jsxs(HeaderWrapper, Object.assign({ open: open, onClick: onOpen, "data-testid": "Dropdown", disabled: disabled }, { children: [_jsx(Box, Object.assign({ sx: { flex: 1, cursor: 'pointer' } }, { children: trigger })), !hideArrow && !isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8 } }, { children: _jsx(Box, { component: "img", src: open ? blueDropdownArrowIcon : downArrowIcon, alt: "arrow", sx: Object.assign({ width: 16, height: 16 }, (open && { width: 12, height: 12, padding: '2px' })) }) }))), isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8 } }, { children: _jsx(Box, { component: "img", src: closeXIcon, alt: "clear", onClick: onClear }) }))), _jsx(Popover, Object.assign({ open: open, anchorEl: anchorEl, sx: { width: anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth }, onClose: onClose, anchorOrigin: {
|
|
9
|
+
return (_jsxs(HeaderWrapper, Object.assign({ open: open, onClick: onOpen, "data-testid": "Dropdown", disabled: disabled }, { children: [_jsx(Box, Object.assign({ sx: { flex: 1, cursor: 'pointer' } }, { children: trigger })), !hideArrow && !isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8 } }, { children: _jsx(Box, { component: "img", src: open ? blueDropdownArrowIcon : downArrowIcon, alt: "arrow", sx: Object.assign({ width: 16, height: 16 }, (open && { width: 12, height: 12, padding: '2px' })) }) }))), isClearButtonVisible && (_jsx(Box, Object.assign({ sx: { width: 16, height: 16, display: 'flex', alignItems: 'center', position: 'absolute', right: 8, cursor: 'pointer' } }, { children: _jsx(Box, { component: "img", src: closeXIcon, alt: "clear", onClick: onClear }) }))), _jsx(Popover, Object.assign({ open: open, anchorEl: anchorEl, sx: { width: anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth }, onClose: onClose, anchorOrigin: {
|
|
10
10
|
vertical: 'bottom',
|
|
11
11
|
horizontal: 'left',
|
|
12
12
|
}, slotProps: {
|
|
@@ -32,9 +32,9 @@ function SelectWithSearch({ options, onChangeOption, selectedOption, placeholder
|
|
|
32
32
|
});
|
|
33
33
|
}, [options, searchValue]);
|
|
34
34
|
const startAdornment = useMemo(() => (_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', maxWidth: 16 } }, { children: _jsx(Box, { component: "img", src: iconUrl, alt: "icon", sx: { maxWidth: 12, height: 12 } }) }))), [iconUrl]);
|
|
35
|
-
return (_jsx(SelectDropdown, Object.assign({ disabled: disabled, open: open, anchorEl: anchorEl, onOpen: (e) => !disabled && openDropdown(e), onClose: closeDropdown, hasValue: !!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value), trigger: _jsx(InputBase, { name: "name", placeholder: "Please Select", hasError: false, label: label, sx: { cursor: 'pointer' }, value: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '', InputLabelProps: {
|
|
35
|
+
return (_jsx(SelectDropdown, Object.assign({ disabled: disabled, open: open, anchorEl: anchorEl, onOpen: (e) => !disabled && openDropdown(e), onClose: closeDropdown, hasValue: !!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value), onClear: onClearValue, trigger: _jsx(InputBase, { name: "name", placeholder: "Please Select", hasError: false, label: label, sx: { cursor: 'pointer' }, value: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '', InputLabelProps: {
|
|
36
36
|
filled: !!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label),
|
|
37
|
-
}, InputProps: Object.assign({ disableUnderline: true }, (!!iconUrl && {
|
|
37
|
+
}, disabled: disabled, InputProps: Object.assign({ disableUnderline: true }, (!!iconUrl && {
|
|
38
38
|
startAdornment,
|
|
39
39
|
})) }) }, { children: _jsxs(Container, { children: [_jsx(InputStyled, { placeholder: placeholder || 'Select', endAdornment: endAdornment, onClick: (e) => {
|
|
40
40
|
e.stopPropagation();
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.236-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.236-test.3",
|
|
5
|
+
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|