@tap-payments/os-micro-frontend-shared 0.1.354 → 0.1.356-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 (86) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/BrandLogo/BrandLogo.d.ts +2 -1
  3. package/build/components/BrandLogo/BrandLogo.js +7 -3
  4. package/build/components/Chip/style.d.ts +0 -1
  5. package/build/components/CountBadge/style.d.ts +0 -1
  6. package/build/components/Dialog/style.d.ts +0 -1
  7. package/build/components/FlippingCard/style.d.ts +0 -1
  8. package/build/components/Icon/type.d.ts +2 -1
  9. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  10. package/build/components/JSONViewer/style.d.ts +0 -1
  11. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  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/SourceIcons/style.d.ts +0 -1
  18. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  19. package/build/components/TableCells/CustomCells/AgreementCell/AgreementCell.js +1 -2
  20. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +266 -0
  21. package/build/components/TableCells/CustomCells/AgreementCell/style.js +22 -0
  22. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  23. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  28. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  29. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  39. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  40. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  41. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  42. package/build/components/TableCells/CustomCells/SourceCell/SourceCell.d.ts +5 -3
  43. package/build/components/TableCells/CustomCells/SourceCell/SourceCell.js +24 -76
  44. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/PaymentCardNumberSource.d.ts +10 -0
  45. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/PaymentCardNumberSource.js +13 -0
  46. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/index.d.ts +1 -0
  47. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/index.js +1 -0
  48. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/style.d.ts +2 -0
  49. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentCardNumberSource/style.js +6 -0
  50. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentMethodSource/PaymentMethodSource.d.ts +3 -0
  51. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentMethodSource/PaymentMethodSource.js +11 -0
  52. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentMethodSource/index.d.ts +1 -0
  53. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentMethodSource/index.js +1 -0
  54. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentSchemeSource/PaymentSchemeSource.d.ts +5 -0
  55. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentSchemeSource/PaymentSchemeSource.js +11 -0
  56. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentSchemeSource/index.d.ts +1 -0
  57. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentSchemeSource/index.js +1 -0
  58. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentTypeSource/PaymentTypeSource.d.ts +3 -0
  59. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentTypeSource/PaymentTypeSource.js +11 -0
  60. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentTypeSource/index.d.ts +1 -0
  61. package/build/components/TableCells/CustomCells/SourceCell/components/PaymentTypeSource/index.js +1 -0
  62. package/build/components/TableCells/CustomCells/SourceCell/components/index.d.ts +4 -0
  63. package/build/components/TableCells/CustomCells/SourceCell/components/index.js +4 -0
  64. package/build/components/TableCells/CustomCells/SourceCell/constant.d.ts +4 -0
  65. package/build/components/TableCells/CustomCells/SourceCell/constant.js +11 -0
  66. package/build/components/TableCells/CustomCells/SourceCell/index.d.ts +1 -1
  67. package/build/components/TableCells/CustomCells/SourceCell/index.js +1 -1
  68. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +6 -269
  69. package/build/components/TableCells/CustomCells/SourceCell/style.js +8 -38
  70. package/build/components/TableCells/CustomCells/SourceCell/type.d.ts +17 -0
  71. package/build/components/TableCells/CustomCells/SourceCell/type.js +12 -0
  72. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  73. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  74. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  75. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  76. package/build/components/TableReports/style.d.ts +0 -1
  77. package/build/components/VirtualTables/components/style.d.ts +0 -1
  78. package/build/constants/apps.js +1 -0
  79. package/build/types/apps.d.ts +2 -1
  80. package/build/types/user.d.ts +63 -15
  81. package/build/utils/localStorage.d.ts +4 -4
  82. package/build/utils/localStorage.js +2 -3
  83. package/build/utils/segment.d.ts +2 -2
  84. package/package.json +3 -3
  85. package/build/components/TableCells/CustomCells/SourceCell/utils.d.ts +0 -1
  86. package/build/components/TableCells/CustomCells/SourceCell/utils.js +0 -8
@@ -1,42 +1,12 @@
1
- import { styled } from '@mui/material';
2
- import { motion } from 'framer-motion';
3
- export const StyledSourceCell = styled('span')(({ theme }) => ({
1
+ import Box from '@mui/material/Box';
2
+ import { styled } from '@mui/material/styles';
3
+ export const ExpandableCenterRight = styled(Box)(() => ({
4
+ marginRight: '8px',
4
5
  display: 'flex',
5
6
  alignItems: 'center',
6
- justifyContent: 'flex-start',
7
- gap: theme.spacing(1),
7
+ gap: '4px',
8
8
  }));
9
- export const StyledSourceImage = styled('img')(() => ({
10
- maxWidth: '36px',
11
- maxHeight: '24px',
12
- }));
13
- export const PaymentSourcesContainer = styled(motion.span)(({ theme, sourcesCount }) => ({
14
- display: 'flex',
15
- alignItems: 'center',
16
- justifyContent: 'flex-start',
17
- position: 'absolute',
18
- minWidth: `${sourcesCount * 6 + 36}px `,
19
- minHeight: '24px',
20
- cursor: 'pointer',
21
- backgroundColor: theme.palette.background.paper,
22
- borderRadius: '16px',
23
- }));
24
- export const TextLabel = styled('span')(({ theme }) => ({
25
- fontSize: '11px',
26
- overflow: 'hidden',
27
- textOverflow: 'ellipsis',
28
- whiteSpace: 'nowrap',
29
- padding: '2px 0',
30
- color: theme.palette.text.primary,
31
- }));
32
- export const BadgeTextWrapper = styled('div')(() => ({
33
- display: 'flex',
34
- alignItems: 'center',
35
- justifyContent: 'center',
36
- paddingInline: '8px',
37
- textAlign: 'center',
38
- width: '100%',
39
- overflow: 'hidden',
40
- textOverflow: 'ellipsis',
41
- whiteSpace: 'nowrap',
9
+ export const ExpandableCenterLeft = styled(Box)(() => ({
10
+ marginLeft: '8px',
11
+ width: 20,
42
12
  }));
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { CENTER_ICON_PRIORITY } from './constant';
3
+ export declare enum CENTER_ICON_KEY {
4
+ PAYMENT_METHOD = "paymentMethod",
5
+ PAYMENT_TYPE = "paymentType",
6
+ PAYMENT_SCHEME = "paymentScheme",
7
+ PAYMENT_CARD_NUMBER = "paymentCardNumber",
8
+ PAYMENT_ISSUER = "paymentIssuer",
9
+ PAYMENT_INITIATED = "paymentInitiated",
10
+ PAYMENT_DEVICE = "paymentDevice",
11
+ PAYMENT_AUTH = "paymentAuth",
12
+ PAYMENT_AGREEMENT = "paymentAgreement"
13
+ }
14
+ export type CenterIconPropName = (typeof CENTER_ICON_PRIORITY)[number];
15
+ export type StatusCellProps = {
16
+ [K in CenterIconPropName]?: React.ReactNode;
17
+ };
@@ -0,0 +1,12 @@
1
+ export var CENTER_ICON_KEY;
2
+ (function (CENTER_ICON_KEY) {
3
+ CENTER_ICON_KEY["PAYMENT_METHOD"] = "paymentMethod";
4
+ CENTER_ICON_KEY["PAYMENT_TYPE"] = "paymentType";
5
+ CENTER_ICON_KEY["PAYMENT_SCHEME"] = "paymentScheme";
6
+ CENTER_ICON_KEY["PAYMENT_CARD_NUMBER"] = "paymentCardNumber";
7
+ CENTER_ICON_KEY["PAYMENT_ISSUER"] = "paymentIssuer";
8
+ CENTER_ICON_KEY["PAYMENT_INITIATED"] = "paymentInitiated";
9
+ CENTER_ICON_KEY["PAYMENT_DEVICE"] = "paymentDevice";
10
+ CENTER_ICON_KEY["PAYMENT_AUTH"] = "paymentAuth";
11
+ CENTER_ICON_KEY["PAYMENT_AGREEMENT"] = "paymentAgreement";
12
+ })(CENTER_ICON_KEY || (CENTER_ICON_KEY = {}));
@@ -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
  }
@@ -488,4 +488,5 @@ export const MF_APPS_MAPPER = new Set([
488
488
  APP_CODES.business.code,
489
489
  APP_CODES.payouts.code,
490
490
  APP_CODES.reports.code,
491
+ APP_CODES.leads.code,
491
492
  ]);
@@ -1,5 +1,5 @@
1
1
  import { ColumnsView } from './column';
2
- import { Segment, SegmentCountry, SegmentUser, SelectedBrand, SelectedCountry } from './user';
2
+ import { Segment, SegmentCountry, SegmentUser, SelectedBrand, SelectedCountry, User } from './user';
3
3
  import { BusinessMerchant } from './merchant';
4
4
  import type { i18n } from 'i18next';
5
5
  import { Theme } from '@mui/material';
@@ -101,6 +101,7 @@ export type MFWidgetBaseProps = {
101
101
  initialServiceCode?: string;
102
102
  initialPayload?: Record<string, any> & AppPayload;
103
103
  };
104
+ user: User;
104
105
  segment: {
105
106
  code: string;
106
107
  type: string;
@@ -99,18 +99,19 @@ export interface SegmentDetails {
99
99
  interface SegmentEntity {
100
100
  id: string;
101
101
  }
102
+ export interface Contact {
103
+ email: string;
104
+ phone: {
105
+ country_code: string;
106
+ number: string;
107
+ };
108
+ }
102
109
  export interface SegmentUser {
103
110
  id: string;
104
111
  created: number;
105
112
  individual_id: string;
106
- name: Record<string, SegmentUserName>;
107
- contact: {
108
- email: string;
109
- phone: {
110
- country_code: string;
111
- number: string;
112
- };
113
- };
113
+ name: SegmentUserName;
114
+ contact: Contact;
114
115
  birth: {
115
116
  date: number;
116
117
  };
@@ -124,13 +125,7 @@ export interface SegmentUser {
124
125
  export interface IndividualSegmentDetails {
125
126
  individual: {
126
127
  name: UserName[];
127
- contact: {
128
- email: string;
129
- phone: {
130
- country_code: string;
131
- number: string;
132
- };
133
- };
128
+ contact: Contact;
134
129
  };
135
130
  segment: Segment;
136
131
  }
@@ -211,4 +206,57 @@ export interface UserFormI {
211
206
  is_authorized?: boolean;
212
207
  }
213
208
  export type GeographyVariant = 'G' | 'L' | 'R';
209
+ export interface BrandReference {
210
+ id: string;
211
+ }
212
+ export interface CountryReference {
213
+ id: string;
214
+ entities: EntityReference[];
215
+ }
216
+ export interface EntityReference {
217
+ id: string;
218
+ }
219
+ export interface UserReference {
220
+ id: string;
221
+ }
222
+ export interface DeveloperReference {
223
+ id: string;
224
+ }
225
+ export interface CustomerReference {
226
+ id: string;
227
+ }
228
+ export interface SelectedSegment {
229
+ id: string;
230
+ brands: BrandReference[];
231
+ countries: CountryReference[];
232
+ users: UserReference[];
233
+ developers: DeveloperReference[];
234
+ customers: CustomerReference[];
235
+ }
236
+ export interface UserNameLocale {
237
+ lang: string;
238
+ first: string;
239
+ last: string;
240
+ }
241
+ export interface Individual {
242
+ id: string;
243
+ contact: Contact;
244
+ name: UserNameLocale[];
245
+ }
246
+ export interface User {
247
+ individual: Individual;
248
+ authentication_id: string;
249
+ individual_id: string;
250
+ is_active: boolean;
251
+ bi: string;
252
+ count: number;
253
+ has_more: boolean;
254
+ live_mode: boolean;
255
+ force_logout: boolean;
256
+ segments: Segment[];
257
+ active_segment_id: string;
258
+ active_segments: SelectedSegment[];
259
+ created_at: string;
260
+ updated_at: string;
261
+ }
214
262
  export {};
@@ -1,4 +1,4 @@
1
- import { AppDetails, WindowPreview, Segment, TableMode, Timezone } from '../types/index.js';
1
+ import { AppDetails, WindowPreview, Segment, TableMode, Timezone, User, SelectedSegment } from '../types/index.js';
2
2
  import { SheetViewColumnsData } from './columnResizeStorage';
3
3
  export declare function setSecretKey(): void;
4
4
  export declare function getSecretKey(): string | null;
@@ -11,10 +11,10 @@ export declare const setLoggedInUserJwtToken: (token: string) => void;
11
11
  export declare const getLoggedInUserJwtToken: () => string | null;
12
12
  export declare const removeLoggedInUserJwtToken: () => void;
13
13
  export declare const removeLoggedInUserData: () => void;
14
- export declare const setLoggedInUserData: (data: any) => void;
15
- export declare const getLoggedInUserData: () => Record<string, any> | null;
14
+ export declare const setLoggedInUserData: (data: User) => void;
15
+ export declare const getLoggedInUserData: () => User | null;
16
16
  export declare const getLoggedInUserSegment: () => Segment | null;
17
- export declare const getLoggedInUserActiveSegment: () => Segment | null;
17
+ export declare const getLoggedInUserActiveSegment: () => SelectedSegment | null;
18
18
  export declare const isJwtTokenExpired: () => boolean;
19
19
  export declare const isUserLoggedInAndJwtTokenExistsAndNotExpired: () => boolean;
20
20
  export declare const setReportRecord: (key: string, reportId: string) => void;
@@ -63,11 +63,9 @@ export const removeLoggedInUserJwtToken = () => {
63
63
  export const removeLoggedInUserData = () => {
64
64
  localStorage.removeItem(USER_DATA_KEY);
65
65
  };
66
- // eslint-disable-next-line
67
66
  export const setLoggedInUserData = (data) => {
68
67
  localStorage.setItem(USER_DATA_KEY, JSON.stringify(data));
69
68
  };
70
- // eslint-disable-next-line
71
69
  export const getLoggedInUserData = () => {
72
70
  const data = localStorage.getItem(USER_DATA_KEY);
73
71
  if (!data)
@@ -87,10 +85,11 @@ export const getLoggedInUserSegment = () => {
87
85
  return getSegmentData(userData === null || userData === void 0 ? void 0 : userData.segments, userData === null || userData === void 0 ? void 0 : userData.active_segment_id, userData === null || userData === void 0 ? void 0 : userData.active_segments);
88
86
  };
89
87
  export const getLoggedInUserActiveSegment = () => {
88
+ var _a;
90
89
  const userData = getLoggedInUserData();
91
90
  if (!userData)
92
91
  return null;
93
- return userData === null || userData === void 0 ? void 0 : userData.active_segments.find((segment) => segment.id === userData.active_segment_id);
92
+ return (_a = userData === null || userData === void 0 ? void 0 : userData.active_segments.find((segment) => segment.id === userData.active_segment_id)) !== null && _a !== void 0 ? _a : null;
94
93
  };
95
94
  export const isJwtTokenExpired = () => {
96
95
  const token = getLoggedInUserJwtToken();
@@ -1,5 +1,5 @@
1
- import { Segment, SegmentData } from '../types/index.js';
2
- export declare const getSegmentData: (segments: Segment[], activeSegmentId: string, activeSegments: Segment[]) => SegmentData;
1
+ import { SelectedSegment, Segment, SegmentData } from '../types/index.js';
2
+ export declare const getSegmentData: (segments: Segment[], activeSegmentId: string, activeSegments: SelectedSegment[]) => SegmentData;
3
3
  export declare const getBusinessSegmentConfig: ({ merchantsIds, options }: {
4
4
  merchantsIds: string[];
5
5
  options?: Record<string, unknown> | undefined;
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.354",
5
- "testVersion": 0,
4
+ "version": "0.1.356-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
+ }
@@ -1 +0,0 @@
1
- export declare const getPaymentMethodKey: (method?: string) => string | undefined;
@@ -1,8 +0,0 @@
1
- const paymentMethodMap = {
2
- american_express: 'AMEX',
3
- debit: 'card',
4
- credit: 'card',
5
- };
6
- export const getPaymentMethodKey = (method) => {
7
- return paymentMethodMap[(method === null || method === void 0 ? void 0 : method.toLowerCase()) || ''] || method;
8
- };