@tap-payments/os-micro-frontend-shared 0.1.306 → 0.1.308-test.1

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.
Files changed (61) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/Chip/style.d.ts +0 -1
  3. package/build/components/CountBadge/style.d.ts +0 -1
  4. package/build/components/Dialog/style.d.ts +0 -1
  5. package/build/components/FlippingCard/style.d.ts +0 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  7. package/build/components/JSONViewer/style.d.ts +0 -1
  8. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  9. package/build/components/PaymentSourceFilter/PaymentMethods.js +10 -8
  10. package/build/components/PaymentSourceFilter/PaymentSchemes.d.ts +1 -1
  11. package/build/components/PaymentSourceFilter/PaymentSchemes.js +8 -6
  12. package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
  13. package/build/components/SearchButton/styles.d.ts +0 -1
  14. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  15. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  16. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  17. package/build/components/StatusIcons/IssuerIcon/IssuerIcon.js +2 -1
  18. package/build/components/StatusIcons/SourceIcons/components/SourceIcon.d.ts +4 -5
  19. package/build/components/StatusIcons/SourceIcons/components/SourceIcon.js +19 -3
  20. package/build/components/StatusIcons/SourceIcons/style.d.ts +3 -3
  21. package/build/components/StatusIcons/SourceIcons/style.js +2 -6
  22. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  23. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  28. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  29. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/ProviderCell/style.js +1 -1
  39. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  40. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  41. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  42. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  43. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  44. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +0 -1
  45. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  46. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  47. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  48. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  49. package/build/components/TableReports/style.d.ts +0 -1
  50. package/build/components/VirtualTables/components/style.d.ts +0 -1
  51. package/build/constants/payment.d.ts +5 -0
  52. package/build/constants/payment.js +20 -9
  53. package/build/constants/table/cell/authenticationsTableCellWidth.d.ts +3 -3
  54. package/build/constants/table/cell/authenticationsTableCellWidth.js +3 -3
  55. package/build/types/segment.d.ts +9 -0
  56. package/build/types/segment.js +10 -1
  57. package/build/utils/index.d.ts +1 -0
  58. package/build/utils/index.js +1 -0
  59. package/build/utils/merchantSource.d.ts +32 -0
  60. package/build/utils/merchantSource.js +37 -0
  61. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type AnimatedSpinnerIconProps = {
4
3
  width?: string;
5
4
  height?: string;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { GetSourceAnimationFunction } from './type';
4
3
  export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
4
  variant?: import("./type").ChipVariant | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const FOOTER_HEIGHT = 37;
4
3
  export declare const TITLE_BAR_HEIGHT = "32px";
5
4
  export declare const VIEWER_HEIGHT = 545;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -16,9 +16,10 @@ import { rightArrow } from '../../constants/index.js';
16
16
  import PaymentMethod from './PaymentMethod';
17
17
  import { MenuItemStyled } from './style';
18
18
  export default function PaymentMethods({ paymentMethodsSource, filters, setFilters }) {
19
- var _a, _b;
19
+ var _a, _b, _c;
20
20
  const [paymentMethodsEl, setPaymentMethodsEl] = useState(null);
21
21
  const filterPaymentMethods = (_a = filters === null || filters === void 0 ? void 0 : filters.payment_methods) !== null && _a !== void 0 ? _a : [];
22
+ const isDisabled = !((_b = paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.options) === null || _b === void 0 ? void 0 : _b.length);
22
23
  const onOpen = (e) => {
23
24
  setPaymentMethodsEl(e.currentTarget);
24
25
  };
@@ -27,22 +28,23 @@ export default function PaymentMethods({ paymentMethodsSource, filters, setFilte
27
28
  };
28
29
  const paymentMethodsAll = useMemo(() => {
29
30
  var _a, _b, _c;
30
- return (_c = (_b = ((_a = paymentMethodsSource.options) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.reduce((acc, method) => {
31
+ return (_c = (_b = ((_a = paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.options) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.reduce((acc, method) => {
31
32
  var _a, _b, _c;
32
33
  acc.push(...((_c = (_b = ((_a = method.options) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.map((m) => m.type)) !== null && _c !== void 0 ? _c : []));
33
34
  return acc;
34
35
  }, [])) !== null && _c !== void 0 ? _c : [];
35
36
  }, []);
36
- const isSelected = useMemo(() => (paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length) === filterPaymentMethods.length, [filterPaymentMethods.length, paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length]);
37
- const isIndeterminate = useMemo(() => !isSelected && (paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length) !== filterPaymentMethods.length && filterPaymentMethods.length > 0, [filterPaymentMethods.length, paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length, isSelected]);
37
+ const isSelected = useMemo(() => (paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length) === filterPaymentMethods.length && filterPaymentMethods.length > 0, [filterPaymentMethods.length, paymentMethodsAll === null || paymentMethodsAll === void 0 ? void 0 : paymentMethodsAll.length]);
38
+ const isIndeterminate = useMemo(() => !isSelected && filterPaymentMethods.length > 0, [filterPaymentMethods.length, isSelected]);
38
39
  const onClick = () => {
40
+ if (isDisabled)
41
+ return;
39
42
  if (isSelected) {
40
43
  const { payment_methods } = filters, resetFilters = __rest(filters, ["payment_methods"]);
41
44
  setFilters(resetFilters);
45
+ return;
42
46
  }
43
- else {
44
- setFilters(Object.assign(Object.assign({}, filters), { payment_methods: paymentMethodsAll }));
45
- }
47
+ setFilters(Object.assign(Object.assign({}, filters), { payment_methods: paymentMethodsAll }));
46
48
  };
47
- return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(paymentMethodsEl), anchorEl: paymentMethodsEl, placement: "right-start" }, { children: (_b = paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.options) === null || _b === void 0 ? void 0 : _b.map((paymentMethod) => (_jsx(PaymentMethod, Object.assign({}, paymentMethod, { filters: filters, setFilters: setFilters }), paymentMethod.type))) }))] })));
49
+ return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(paymentMethodsEl), anchorEl: paymentMethodsEl, placement: "right-start" }, { children: (_c = paymentMethodsSource === null || paymentMethodsSource === void 0 ? void 0 : paymentMethodsSource.options) === null || _c === void 0 ? void 0 : _c.map((paymentMethod) => (_jsx(PaymentMethod, Object.assign({}, paymentMethod, { filters: filters, setFilters: setFilters }), paymentMethod.type))) }))] })));
48
50
  }
@@ -1,5 +1,5 @@
1
- import { Filters } from './type';
2
1
  import { SourceFilter } from '../../types/index.js';
2
+ import { Filters } from './type';
3
3
  interface PaymentSchemesProps extends Filters {
4
4
  paymentSchemesSource: SourceFilter;
5
5
  }
@@ -15,27 +15,29 @@ import { Menu } from '../index.js';
15
15
  import { rightArrow } from '../../constants/index.js';
16
16
  import { MenuItemStyled } from './style';
17
17
  export default function PaymentSchemes({ paymentSchemesSource, filters, setFilters }) {
18
- var _a, _b, _c;
18
+ var _a, _b, _c, _d;
19
19
  const [anchorEl, setAnchorEl] = useState(null);
20
20
  const paymentScheme = (_a = filters === null || filters === void 0 ? void 0 : filters.payment_scheme) !== null && _a !== void 0 ? _a : [];
21
+ const isDisabled = !((_b = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _b === void 0 ? void 0 : _b.length);
21
22
  const onOpen = (e) => {
22
23
  setAnchorEl(e.currentTarget);
23
24
  };
24
25
  const onClose = () => {
25
26
  setAnchorEl(null);
26
27
  };
27
- const isSelected = useMemo(() => { var _a; return paymentScheme.length === ((_a = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _a === void 0 ? void 0 : _a.length); }, [paymentScheme.length, (_b = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _b === void 0 ? void 0 : _b.length]);
28
+ const isSelected = useMemo(() => { var _a; return paymentScheme.length === ((_a = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _a === void 0 ? void 0 : _a.length) && paymentScheme.length > 0; }, [paymentScheme.length, (_c = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _c === void 0 ? void 0 : _c.length]);
28
29
  const isIndeterminate = useMemo(() => !isSelected && paymentScheme.length > 0, [paymentScheme.length, isSelected]);
29
30
  const isSelectedPaymentScheme = useCallback((selectedPaymentScheme) => { var _a; return (_a = paymentScheme.includes(selectedPaymentScheme)) !== null && _a !== void 0 ? _a : false; }, [paymentScheme]);
30
31
  const onClick = () => {
31
32
  var _a, _b;
33
+ if (isDisabled)
34
+ return;
32
35
  if (isSelected) {
33
36
  const { payment_scheme } = filters, resetFilters = __rest(filters, ["payment_scheme"]);
34
37
  setFilters(resetFilters);
38
+ return;
35
39
  }
36
- else {
37
- setFilters(Object.assign(Object.assign({}, filters), { payment_scheme: (_b = (_a = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _a === void 0 ? void 0 : _a.map((paymentSchemeItem) => paymentSchemeItem.type)) !== null && _b !== void 0 ? _b : [] }));
38
- }
40
+ setFilters(Object.assign(Object.assign({}, filters), { payment_scheme: (_b = (_a = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _a === void 0 ? void 0 : _a.map((paymentSchemeItem) => paymentSchemeItem.type)) !== null && _b !== void 0 ? _b : [] }));
39
41
  };
40
42
  const onClickPaymentScheme = (e, selectedPaymentScheme) => {
41
43
  var _a, _b;
@@ -47,5 +49,5 @@ export default function PaymentSchemes({ paymentSchemesSource, filters, setFilte
47
49
  setFilters(Object.assign(Object.assign({}, filters), { payment_scheme: [...((_b = filters === null || filters === void 0 ? void 0 : filters.payment_scheme) !== null && _b !== void 0 ? _b : []), selectedPaymentScheme] }));
48
50
  }
49
51
  };
50
- return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_c = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _c === void 0 ? void 0 : _c.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx("img", { src: scheme.icon, alt: scheme === null || scheme === void 0 ? void 0 : scheme.name, style: { height: 24 } }) }), scheme.type))) }))] })));
52
+ return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick, sx: Object.assign({}, (isDisabled && { opacity: 0.5, pointerEvents: 'none' })) }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.name })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: Boolean(anchorEl), anchorEl: anchorEl, placement: "right-start" }, { children: (_d = paymentSchemesSource === null || paymentSchemesSource === void 0 ? void 0 : paymentSchemesSource.options) === null || _d === void 0 ? void 0 : _d.map((scheme) => (_jsx(MenuItemStyled, Object.assign({ isSelected: isSelectedPaymentScheme(scheme.type), onClick: (e) => onClickPaymentScheme(e, scheme.type) }, { children: _jsx("img", { src: scheme.icon, alt: scheme === null || scheme === void 0 ? void 0 : scheme.name, style: { height: 24 } }) }), scheme.type))) }))] })));
51
53
  }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -5,5 +5,6 @@ import Tooltip from '../../Tooltip';
5
5
  export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName, tableMode }) {
6
6
  const firstFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(0, 4);
7
7
  const lastFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(-4);
8
- return (_jsxs(IssuerIconContainer, Object.assign({ tableMode: tableMode }, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), _jsx(Tooltip, Object.assign({ title: `${bankName ? `Issuer - ${bankName}` : ''}` }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))] })));
8
+ return (_jsxs(IssuerIconContainer, Object.assign({ tableMode: tableMode }, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), firstFourDigits ||
9
+ (lastFourDigits && (_jsx(Tooltip, Object.assign({ title: `${bankName ? `Issuer - ${bankName}` : ''}` }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))))] })));
9
10
  }
@@ -1,9 +1,8 @@
1
- type SourceIconProps = {
1
+ import { BoxProps } from '@mui/material/Box';
2
+ interface SourceIconProps extends BoxProps {
2
3
  source: string;
3
4
  isTextShown?: boolean;
4
5
  title?: string;
5
- width?: number | string;
6
- height?: number | string;
7
- };
8
- export declare function SourceIcon({ source, isTextShown, title, width, height }: SourceIconProps): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export declare function SourceIcon({ source, isTextShown, title, ...props }: SourceIconProps): import("react/jsx-runtime").JSX.Element;
9
8
  export {};
@@ -1,13 +1,29 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import camelCase from 'lodash/camelCase';
3
14
  import { useTranslation } from 'react-i18next';
15
+ import Box from '@mui/material/Box';
4
16
  import Tooltip from '../../../Tooltip';
5
17
  import { getPaymentMethodsIcon } from '../../../../constants/index.js';
6
- import { StyledBadgeTextWrapper, StyledSourceImage, TextLabel } from '../style';
7
- export function SourceIcon({ source, isTextShown, title, width, height }) {
18
+ import { StyledBadgeTextWrapper, TextLabel } from '../style';
19
+ export function SourceIcon(_a) {
20
+ var { source, isTextShown, title } = _a, props = __rest(_a, ["source", "isTextShown", "title"]);
8
21
  const { t } = useTranslation();
9
22
  const ImageSrc = getPaymentMethodsIcon(source);
10
- return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) }))) : (_jsx(StyledSourceImage, { src: ImageSrc, alt: source, width: width, height: height, onError: (e) => {
23
+ if (isTextShown) {
24
+ return (_jsx(Tooltip, Object.assign({ title: title }, { children: _jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, props, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) })) })));
25
+ }
26
+ return (_jsx(Tooltip, Object.assign({ title: title }, { children: _jsx(Box, Object.assign({}, props, { component: "img", src: ImageSrc, alt: source, onError: (e) => {
11
27
  e.currentTarget.src = getPaymentMethodsIcon('card');
12
28
  } })) })));
13
29
  }
@@ -1,7 +1,5 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
- export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
3
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
6
4
  hidden?: boolean | undefined;
7
5
  color?: string | undefined;
@@ -267,6 +265,8 @@ export declare const PaymentSourcesContainer: import("@emotion/styled").StyledCo
267
265
  sourcesCount: number;
268
266
  }, {}, {}>;
269
267
  export declare const TextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
270
- export declare const StyledBadgeTextWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
268
+ export declare const StyledBadgeTextWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
269
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
270
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
271
271
  export declare const SourceIconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
272
272
  export declare const CardNumber: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +1,4 @@
1
- import { styled } from '@mui/material';
1
+ import { Box, styled } from '@mui/material';
2
2
  import { motion } from 'framer-motion';
3
3
  export const StyledSourceCell = styled('span')(({ theme }) => ({
4
4
  display: 'flex',
@@ -6,10 +6,6 @@ export const StyledSourceCell = styled('span')(({ theme }) => ({
6
6
  justifyContent: 'flex-start',
7
7
  gap: theme.spacing(1),
8
8
  }));
9
- export const StyledSourceImage = styled('img')(() => ({
10
- maxWidth: '24px',
11
- maxHeight: '16px',
12
- }));
13
9
  export const PaymentSourcesContainer = styled(motion.span)(({ theme, sourcesCount }) => ({
14
10
  display: 'flex',
15
11
  alignItems: 'center',
@@ -29,7 +25,7 @@ export const TextLabel = styled('span')(({ theme }) => ({
29
25
  padding: '2px 0',
30
26
  color: theme.palette.text.primary,
31
27
  }));
32
- export const StyledBadgeTextWrapper = styled('div')(() => ({
28
+ export const StyledBadgeTextWrapper = styled(Box)(() => ({
33
29
  display: 'flex',
34
30
  alignItems: 'center',
35
31
  justifyContent: 'center',
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { TableMode } from '../../../../types/index.js';
4
3
  export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
5
4
  tableMode?: TableMode | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
3
  export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
3
  isTextShown?: boolean | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -4,7 +4,7 @@ export const ProviderChip = styled(Box)(({ theme }) => ({
4
4
  display: 'flex',
5
5
  alignItems: 'center',
6
6
  justifyContent: 'center',
7
- width: '86px',
7
+ width: '100%',
8
8
  height: '24px',
9
9
  gap: '8px',
10
10
  padding: '4px 8px',
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
3
  variant?: "Global" | "Regional" | "Local" | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type ExportButtonProps = {
4
3
  notificationState?: {
5
4
  success: boolean;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  interface TableWrapperProps {
4
3
  showNoDataView?: boolean;
5
4
  }
@@ -1,8 +1,13 @@
1
+ export declare const PAYMENT_TYPES_ICONS: {
2
+ [key: string]: string;
3
+ };
1
4
  export declare const PAYMENT_TYPES: {
2
5
  name: string;
3
6
  label: string;
4
7
  icon: string;
5
8
  }[];
9
+ export declare const PAYMENT_INITIATED_CUSTOMER_KEY = "customer";
10
+ export declare const PAYMENT_INITIATED_MERCHANT_KEY = "merchant";
6
11
  export declare const PAYMENT_INITIATED_OPTIONS: {
7
12
  key: string;
8
13
  value: string;
@@ -1,42 +1,53 @@
1
1
  import { lightUrl } from './assets';
2
+ export const PAYMENT_TYPES_ICONS = {
3
+ DEVICE: `${lightUrl}/device.svg`,
4
+ CARD: `${lightUrl}/payment-method/card.svg`,
5
+ PASS_THRU_WALLET: `${lightUrl}/passThruWallet.svg`,
6
+ EXPRESS_CHECKOUT: `${lightUrl}/express_checkout.svg`,
7
+ STORED_VALUE_WALLET: `${lightUrl}/storedValueWallet.svg`,
8
+ CASH_WALLET: `${lightUrl}/cash.svg`,
9
+ BUY_NOW_PAY_LATER: `${lightUrl}/buyNowPayLater.svg`,
10
+ };
2
11
  export const PAYMENT_TYPES = [
3
12
  {
4
13
  name: 'CARD',
5
14
  label: 'Card',
6
- icon: `${lightUrl}/payment-method/card.svg`,
15
+ icon: PAYMENT_TYPES_ICONS.CARD,
7
16
  },
8
17
  {
9
18
  name: 'EXPRESS',
10
19
  label: 'Express Checkout',
11
- icon: `${lightUrl}/express_checkout.svg`,
20
+ icon: PAYMENT_TYPES_ICONS.EXPRESS_CHECKOUT,
12
21
  },
13
22
  {
14
23
  name: 'DEVICE',
15
24
  label: 'Device',
16
- icon: `${lightUrl}/device.svg`,
25
+ icon: PAYMENT_TYPES_ICONS.DEVICE,
17
26
  },
18
27
  {
19
28
  name: 'PT_WALLET',
20
29
  label: 'Pass-Thru Wallet',
21
- icon: `${lightUrl}/passThruWallet.svg`,
30
+ icon: PAYMENT_TYPES_ICONS.PASS_THRU_WALLET,
22
31
  },
23
32
  {
24
33
  name: 'SV_WALLET',
25
34
  label: 'Stored Value Wallet',
26
- icon: `${lightUrl}/storedValueWallet.svg`,
35
+ icon: PAYMENT_TYPES_ICONS.STORED_VALUE_WALLET,
27
36
  },
28
37
  {
29
38
  name: 'BNPL',
30
39
  label: 'Buy Now Pay Later',
31
- icon: `${lightUrl}/buyNowPayLater.svg`,
40
+ icon: PAYMENT_TYPES_ICONS.BUY_NOW_PAY_LATER,
32
41
  },
33
42
  {
34
43
  name: 'CASH',
35
44
  label: 'Cash Wallet',
36
- icon: `${lightUrl}/cash.svg`,
45
+ icon: PAYMENT_TYPES_ICONS.CASH_WALLET,
37
46
  },
38
47
  ];
48
+ export const PAYMENT_INITIATED_CUSTOMER_KEY = 'customer';
49
+ export const PAYMENT_INITIATED_MERCHANT_KEY = 'merchant';
39
50
  export const PAYMENT_INITIATED_OPTIONS = [
40
- { key: 'customer', value: 'true', label: 'Customer' },
41
- { key: 'merchant', value: 'false', label: 'Merchant' },
51
+ { key: PAYMENT_INITIATED_CUSTOMER_KEY, value: 'true', label: 'Customer' },
52
+ { key: PAYMENT_INITIATED_MERCHANT_KEY, value: 'false', label: 'Merchant' },
42
53
  ];
@@ -15,9 +15,9 @@ export declare const authenticationsTableCellWidth: {
15
15
  readonly sheet: "250px";
16
16
  };
17
17
  readonly provider: {
18
- readonly default: "102";
19
- readonly text: "102";
20
- readonly sheet: "102";
18
+ readonly default: "102px";
19
+ readonly text: "102px";
20
+ readonly sheet: "102px";
21
21
  };
22
22
  readonly purpose: {
23
23
  readonly default: "126px";
@@ -15,9 +15,9 @@ export const authenticationsTableCellWidth = {
15
15
  sheet: '250px',
16
16
  },
17
17
  provider: {
18
- default: '102',
19
- text: '102',
20
- sheet: '102',
18
+ default: '102px',
19
+ text: '102px',
20
+ sheet: '102px',
21
21
  },
22
22
  purpose: {
23
23
  default: '126px',
@@ -4,3 +4,12 @@ export interface SegmentData extends Segment {
4
4
  defaultCountry?: SegmentCountry;
5
5
  defaultEntity?: Entity;
6
6
  }
7
+ export declare enum SEGMENT_CODE {
8
+ BUSINESS = "BUSINESS",
9
+ PLATFORM = "PLATFORM",
10
+ DEVELOPMENT = "DEVELOPMENT",
11
+ PAYMENT_TECHNOLOGY = "PAYMENT_TECHNOLOGY",
12
+ PAYMENT_FACILITATOR = "PAYMENT_FACILITATOR",
13
+ PAYMENT_ACQUIRER = "PAYMENT_ACQUIRER",
14
+ PAYMENT_GATEWAY = "PAYMENT_GATEWAY"
15
+ }
@@ -1 +1,10 @@
1
- export {};
1
+ export var SEGMENT_CODE;
2
+ (function (SEGMENT_CODE) {
3
+ SEGMENT_CODE["BUSINESS"] = "BUSINESS";
4
+ SEGMENT_CODE["PLATFORM"] = "PLATFORM";
5
+ SEGMENT_CODE["DEVELOPMENT"] = "DEVELOPMENT";
6
+ SEGMENT_CODE["PAYMENT_TECHNOLOGY"] = "PAYMENT_TECHNOLOGY";
7
+ SEGMENT_CODE["PAYMENT_FACILITATOR"] = "PAYMENT_FACILITATOR";
8
+ SEGMENT_CODE["PAYMENT_ACQUIRER"] = "PAYMENT_ACQUIRER";
9
+ SEGMENT_CODE["PAYMENT_GATEWAY"] = "PAYMENT_GATEWAY";
10
+ })(SEGMENT_CODE || (SEGMENT_CODE = {}));
@@ -44,3 +44,4 @@ export * from './style';
44
44
  export * from './boolean';
45
45
  export * from './columnResizeStorage';
46
46
  export * from './timezone';
47
+ export * from './merchantSource';
@@ -44,3 +44,4 @@ export * from './style';
44
44
  export * from './boolean';
45
45
  export * from './columnResizeStorage';
46
46
  export * from './timezone';
47
+ export * from './merchantSource';
@@ -0,0 +1,32 @@
1
+ import { TextAndLang } from '../types/index.js';
2
+ interface Source {
3
+ code: string;
4
+ name: TextAndLang[];
5
+ }
6
+ interface PaymentMethod extends Source {
7
+ payment_methods: Source[];
8
+ }
9
+ export declare function transformPaymentMethodsData(data?: PaymentMethod[]): {
10
+ name: string;
11
+ type: string;
12
+ options: {
13
+ name: string;
14
+ type: string;
15
+ icon: string;
16
+ options: {
17
+ name: string | undefined;
18
+ type: string;
19
+ icon: string;
20
+ }[];
21
+ }[] | undefined;
22
+ };
23
+ export declare function transformPaymentSchemesData(data?: Source[]): {
24
+ name: string;
25
+ type: string;
26
+ options: {
27
+ name: string | undefined;
28
+ type: string;
29
+ icon: string;
30
+ }[];
31
+ };
32
+ export {};
@@ -0,0 +1,37 @@
1
+ import capitalize from 'lodash/capitalize';
2
+ import { lightUrl, PAYMENT_TYPES_ICONS } from '../constants/index.js';
3
+ import { getNameText } from './language';
4
+ export function transformPaymentMethodsData(data) {
5
+ return {
6
+ name: 'Payment Methods',
7
+ type: 'payment_methods',
8
+ options: data === null || data === void 0 ? void 0 : data.map((category) => {
9
+ var _a;
10
+ return {
11
+ name: capitalize(getNameText(category === null || category === void 0 ? void 0 : category.name)),
12
+ type: category === null || category === void 0 ? void 0 : category.code,
13
+ icon: PAYMENT_TYPES_ICONS[category.code],
14
+ options: (_a = category.payment_methods) === null || _a === void 0 ? void 0 : _a.map((method) => ({
15
+ name: getNameText(method.name),
16
+ type: method.code,
17
+ icon: `${lightUrl}/payment-method/${method.code}.svg`,
18
+ })),
19
+ };
20
+ }),
21
+ };
22
+ }
23
+ export function transformPaymentSchemesData(data = []) {
24
+ return {
25
+ name: 'Payment Schemes',
26
+ type: 'payment_scheme',
27
+ options: data
28
+ .filter((scheme) => scheme.code)
29
+ .map((scheme) => {
30
+ return {
31
+ name: getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name),
32
+ type: scheme === null || scheme === void 0 ? void 0 : scheme.code,
33
+ icon: `${lightUrl}/payment-method/${scheme.code}.svg`,
34
+ };
35
+ }),
36
+ };
37
+ }
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.306",
5
- "testVersion": 0,
4
+ "version": "0.1.308-test.1",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -164,4 +164,4 @@
164
164
  "publishConfig": {
165
165
  "registry": "https://registry.npmjs.org/"
166
166
  }
167
- }
167
+ }