@tap-payments/os-micro-frontend-shared 0.1.123-test.1 → 0.1.123
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/build/components/InputBase/PhoneInputBase/CountriesList/CountriesList.js +9 -10
- package/build/components/TableCells/CustomCells/MarketPlaceCell/MarketPlaceCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/MarketPlaceCell/MarketPlaceCell.js +4 -6
- package/build/components/TableCells/CustomCells/MarketPlaceCell/type.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SegmentsCell/SegmentsCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/SegmentsCell.js +9 -7
- package/build/components/TableCells/CustomCells/SegmentsCell/type.d.ts +5 -3
- package/package.json +3 -3
|
@@ -5,7 +5,6 @@ import Skeleton from '@mui/material/Skeleton';
|
|
|
5
5
|
import CustomBackdrop from '../../../CustomBackdrop';
|
|
6
6
|
import { downArrowIcon, searchIcon } from '../../../../constants/index.js';
|
|
7
7
|
import { CountryStyled, CountriesWrapper, CountriesListStyled, InputStyled, CountryButton, Required } from './style';
|
|
8
|
-
import { ClickAwayListener } from '@mui/material';
|
|
9
8
|
function CountriesList({ isLoading, countries, value: countryValue, onCountryChange, required, disabled }) {
|
|
10
9
|
const [selectedCountry, setSelectedCountry] = useState();
|
|
11
10
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -51,15 +50,15 @@ function CountriesList({ isLoading, countries, value: countryValue, onCountryCha
|
|
|
51
50
|
border: 'none',
|
|
52
51
|
height: 34,
|
|
53
52
|
paddingInlineStart: '8px',
|
|
54
|
-
} }, { children: isLoading ? (_jsx(Skeleton, { variant: "rectangular", width: 56.5, height: 20, sx: { borderRadius: '4px' } })) : (_jsxs(_Fragment, { children: [selectedCountry && (_jsxs(_Fragment, { children: [_jsx("img", { src: selectedCountry.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.idd_prefix}` })] })), required && _jsx(Required, Object.assign({ component: "span" }, { children: "*" })), _jsx(Box, { component: "img", src: downArrowIcon, alt: "d", className: "arrow", sx: Object.assign({}, (open && { transform: 'rotate(180deg)' })) })] })) })), open && _jsx(CustomBackdrop, { onClick: closeDropdown }), open && (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
} }, { children: isLoading ? (_jsx(Skeleton, { variant: "rectangular", width: 56.5, height: 20, sx: { borderRadius: '4px' } })) : (_jsxs(_Fragment, { children: [selectedCountry && (_jsxs(_Fragment, { children: [_jsx("img", { src: selectedCountry.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.idd_prefix}` })] })), required && _jsx(Required, Object.assign({ component: "span" }, { children: "*" })), _jsx(Box, { component: "img", src: downArrowIcon, alt: "d", className: "arrow", sx: Object.assign({}, (open && { transform: 'rotate(180deg)' })) })] })) })), open && _jsx(CustomBackdrop, { onClick: closeDropdown }), open && (_jsxs(CountriesWrapper, Object.assign({ id: "CountriesList_CountriesWrapper", open: open, anchorEl: anchorEl, "data-testid": "CountriesList_CountriesWrapper", placement: "bottom-start" }, { children: [_jsx(InputStyled, { endAdornment: _jsx("img", { src: searchIcon, alt: "arrow" }), onChange: handleSearch, hideArrows: true, "data-testid": "CountriesList_InputStyled", value: searchValue }), _jsx(CountriesListStyled, Object.assign({ "data-testid": "CountriesList_CountriesListStyled" }, { children: filteredCountries.map((country) => {
|
|
54
|
+
const isSelected = (selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.countryId) === country.countryId;
|
|
55
|
+
return (_jsxs(CountryStyled, Object.assign({ onClick: () => {
|
|
56
|
+
handleOnCountryChange(country);
|
|
57
|
+
}, sx: {
|
|
58
|
+
backgroundColor: isSelected ? '#F9F9F9' : 'transparent',
|
|
59
|
+
color: isSelected ? '#000' : '#8D8D94',
|
|
60
|
+
} }, { children: [_jsx("img", { src: country.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${country.idd_prefix}` })] }), `country-code-${country.countryId}`));
|
|
61
|
+
}) }))] })))] })));
|
|
63
62
|
}
|
|
64
63
|
CountriesList.displayName = 'CountriesList';
|
|
65
64
|
export default memo(CountriesList);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MarketPlaceCellProps } from './type';
|
|
2
|
-
export default function MarketPlaceCell({ marketPlaceIcon, marketPlaceName, ...props }: MarketPlaceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MarketPlaceCell({ marketPlaceIcon, marketPlaceName, isTextShown, ...props }: MarketPlaceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,12 +14,10 @@ import Tooltip from '../../../Tooltip';
|
|
|
14
14
|
import TableCell from '../../TableCell';
|
|
15
15
|
import { Box } from '@mui/material';
|
|
16
16
|
import { marketPlaceBlueIcon } from '../../../../constants/index.js';
|
|
17
|
+
import { TextLabel } from '../style';
|
|
17
18
|
export default function MarketPlaceCell(_a) {
|
|
18
|
-
var { marketPlaceIcon, marketPlaceName } = _a, props = __rest(_a, ["marketPlaceIcon", "marketPlaceName"]);
|
|
19
|
-
|
|
20
|
-
e.currentTarget.src = marketPlaceBlueIcon;
|
|
21
|
-
} }));
|
|
22
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: 1 } }, { children: _jsx(Tooltip, Object.assign({ title: marketPlaceName }, { children: _jsx(Box, Object.assign({ sx: {
|
|
19
|
+
var { marketPlaceIcon, marketPlaceName, isTextShown } = _a, props = __rest(_a, ["marketPlaceIcon", "marketPlaceName", "isTextShown"]);
|
|
20
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: marketPlaceName }, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: 1 } }, { children: isTextShown ? (_jsx(TextLabel, { children: marketPlaceName })) : (_jsx(Box, Object.assign({ sx: {
|
|
23
21
|
width: '24px',
|
|
24
22
|
height: '24px',
|
|
25
23
|
border: '1px solid #F2F2F2',
|
|
@@ -27,5 +25,5 @@ export default function MarketPlaceCell(_a) {
|
|
|
27
25
|
display: 'flex',
|
|
28
26
|
alignItems: 'center',
|
|
29
27
|
justifyContent: 'center',
|
|
30
|
-
} }, { children:
|
|
28
|
+
} }, { children: _jsx("img", { src: marketPlaceIcon || marketPlaceBlueIcon, alt: "marketplace", style: { maxWidth: '18px', maxHeight: '18px', objectFit: 'cover' } }) }))) })) })) })));
|
|
31
29
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SegmentsCellProps } from './type';
|
|
2
|
-
declare function SegmentsCell({ isTextShown,
|
|
2
|
+
declare function SegmentsCell({ isTextShown, ...props }: SegmentsCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default SegmentsCell;
|
|
@@ -20,23 +20,25 @@ import { segmentsIcons } from './constant';
|
|
|
20
20
|
import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, referenceSourceAnimation } from './style';
|
|
21
21
|
import IconWithBadge from '../../../IconWithBadge';
|
|
22
22
|
function SegmentsCell(_a) {
|
|
23
|
-
var { isTextShown
|
|
23
|
+
var { isTextShown } = _a, props = __rest(_a, ["isTextShown"]);
|
|
24
24
|
const [isTooltipOpen, setIsTooltipOpen] = useState(false);
|
|
25
25
|
const theme = useTheme();
|
|
26
|
+
const segments = useMemo(() => Object.keys(segmentsIcons).filter((key) => { var _a; return !!((_a = props[key]) === null || _a === void 0 ? void 0 : _a.name); }), [props]);
|
|
26
27
|
const ReferenceSources = useMemo(() => segments.map((segment, index) => {
|
|
27
|
-
const prefixKey = ['technology', 'institution'].includes(segment
|
|
28
|
-
const
|
|
28
|
+
const prefixKey = ['technology', 'institution'].includes(segment) ? 'Payment' : '';
|
|
29
|
+
const segmentData = props[segment];
|
|
30
|
+
const sourceTooltip = `${prefixKey} ${startCase(segment)} - ${segmentData === null || segmentData === void 0 ? void 0 : segmentData.name}`;
|
|
29
31
|
return (_jsx(Tooltip, Object.assign({ onOpen: () => {
|
|
30
32
|
setIsTooltipOpen(true);
|
|
31
33
|
}, onClose: () => {
|
|
32
34
|
setIsTooltipOpen(false);
|
|
33
35
|
}, title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: referenceSourceAnimation(index, theme.shadows[4], isTextShown ? 83 : 0), sx: {
|
|
34
36
|
width: isTextShown ? '79px' : '36px',
|
|
35
|
-
} }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment
|
|
36
|
-
e.currentTarget.src = segmentsIcons[segment
|
|
37
|
+
} }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment) }) })) : (_jsx(IconWithBadge, { mainIcon: (segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) || segmentsIcons[segment], mainIconSize: segment === 'order' ? 11.82 : 16, containerSize: segment === 'order' ? 11.82 : 16, sx: Object.assign({}, ((segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) ? { borderRadius: '40px' } : { borderRadius: '0px' })), onError: (e) => {
|
|
38
|
+
e.currentTarget.src = segmentsIcons[segment];
|
|
37
39
|
e.currentTarget.style.borderRadius = '0px';
|
|
38
|
-
}, borderColor: "transparent" })) })) }), `${segment
|
|
39
|
-
}), [segments, isTextShown, theme]);
|
|
40
|
+
}, borderColor: "transparent" })) })) }), `${segment}-${index}`));
|
|
41
|
+
}), [props, segments, isTextShown, theme]);
|
|
40
42
|
const referenceSourcesCount = (ReferenceSources === null || ReferenceSources === void 0 ? void 0 : ReferenceSources.length) || 0;
|
|
41
43
|
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, { children: referenceSourcesCount > 0 ? (_jsx(ReferenceSourcesContainer, Object.assign({ layout: true, className: "reference-sources-container", whileHover: "animate", animate: isTooltipOpen ? 'animate' : 'start', sourcesCount: referenceSourcesCount, variants: { animate: { width: referenceSourcesCount * (6 + 32) } }, style: {
|
|
42
44
|
zIndex: 29,
|
|
@@ -4,10 +4,12 @@ export type SegmentsType = keyof typeof segmentsIcons;
|
|
|
4
4
|
export interface SegmentInfo {
|
|
5
5
|
name?: string;
|
|
6
6
|
icon?: string;
|
|
7
|
-
type: SegmentsType;
|
|
8
|
-
tooltip?: string;
|
|
9
7
|
}
|
|
10
8
|
export interface SegmentsCellProps extends TableCellProps {
|
|
9
|
+
technology?: SegmentInfo;
|
|
10
|
+
institution?: SegmentInfo;
|
|
11
|
+
payment?: SegmentInfo;
|
|
12
|
+
developmentHouse?: SegmentInfo;
|
|
13
|
+
platform?: SegmentInfo;
|
|
11
14
|
isTextShown?: boolean;
|
|
12
|
-
segments: SegmentInfo[];
|
|
13
15
|
}
|
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.123
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.123",
|
|
5
|
+
"testVersion": 0,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
"publishConfig": {
|
|
137
137
|
"registry": "https://registry.npmjs.org/"
|
|
138
138
|
}
|
|
139
|
-
}
|
|
139
|
+
}
|