@tap-payments/os-micro-frontend-shared 0.1.366 → 0.1.367-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.
- package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
- package/build/components/Chip/style.d.ts +0 -1
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
- package/build/components/TableReports/style.d.ts +0 -1
- package/build/components/Toaster/Toaster.d.ts +1 -0
- package/build/components/Toaster/Toaster.js +12 -0
- package/build/components/Toaster/index.d.ts +2 -0
- package/build/components/Toaster/index.js +2 -0
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/constants/reports.d.ts +18 -1
- package/build/constants/reports.js +77 -27
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useToast.d.ts +12 -0
- package/build/hooks/useToast.js +43 -0
- package/build/types/appEvents.d.ts +3 -1
- package/build/types/appEvents.js +1 -0
- package/build/types/apps.d.ts +9 -9
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/toast.d.ts +16 -0
- package/build/types/toast.js +1 -0
- package/build/utils/navigation.d.ts +1 -1
- package/package.json +3 -3
- package/build/components/Notifications/Notifications.d.ts +0 -1
- package/build/components/Notifications/Notifications.js +0 -12
- package/build/components/Notifications/index.d.ts +0 -2
- package/build/components/Notifications/index.js +0 -2
- /package/build/components/{Notifications → Toaster}/style.d.ts +0 -0
- /package/build/components/{Notifications → Toaster}/style.js +0 -0
|
@@ -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 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 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
|
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 AgreementCellContainer: 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 StyledAgreementCardIcon: 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 CardContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, 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 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 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 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 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 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 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>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Toaster(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { Toaster as HotToaster, resolveValue } from 'react-hot-toast';
|
|
4
|
+
import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
|
|
5
|
+
import { Content } from './style';
|
|
6
|
+
const icons = {
|
|
7
|
+
success: actionSuccessIcon,
|
|
8
|
+
error: warningInfoIcon,
|
|
9
|
+
};
|
|
10
|
+
export default function Toaster() {
|
|
11
|
+
return (_jsx(HotToaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
|
|
12
|
+
}
|
|
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton, type ButtonWithDropdownProps } fr
|
|
|
50
50
|
export { default as MultiSelectWithSearch, type MultiSelectWithSearchProps, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
|
|
51
51
|
export { default as NestedDropdown, type DropdownProps, type Selected, type Placement, Dropdown, NestedMenuItem } from './NestedDropdown';
|
|
52
52
|
export { default as NoInternet } from './NoInternet';
|
|
53
|
-
export { default as
|
|
53
|
+
export { default as Toaster } from './Toaster';
|
|
54
54
|
export { default as ProgressBar } from './ProgressBar';
|
|
55
55
|
export { default as ProgressRing } from './ProgressRing';
|
|
56
56
|
export * from './InputBase';
|
|
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton } from './MultiSelectDropdownButto
|
|
|
50
50
|
export { default as MultiSelectWithSearch, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
|
|
51
51
|
export { default as NestedDropdown, Dropdown, NestedMenuItem } from './NestedDropdown';
|
|
52
52
|
export { default as NoInternet } from './NoInternet';
|
|
53
|
-
export { default as
|
|
53
|
+
export { default as Toaster } from './Toaster';
|
|
54
54
|
export { default as ProgressBar } from './ProgressBar';
|
|
55
55
|
export { default as ProgressRing } from './ProgressRing';
|
|
56
56
|
export * from './InputBase';
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Maps report **source codes** (app or service)
|
|
3
|
+
* to the corresponding **backend report filter types**.
|
|
4
|
+
*
|
|
5
|
+
* Used as a translation layer between UI report grouping
|
|
6
|
+
* and backend report filtering.
|
|
7
|
+
*
|
|
8
|
+
* - Key: App code or service code
|
|
9
|
+
* - Value: One or more backend filter types
|
|
10
|
+
*/
|
|
11
|
+
export declare const reportFilterTypesMap: {
|
|
2
12
|
[x: string]: string[];
|
|
3
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Reports apps
|
|
16
|
+
*
|
|
17
|
+
* Defines apps shown in the reports app, with each service linked
|
|
18
|
+
* to its backend filter type (REPORT_FILTER_TYPES).
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
4
21
|
export declare const REPORTS_APPS: {
|
|
5
22
|
code: string;
|
|
6
23
|
name: string;
|
|
@@ -1,39 +1,89 @@
|
|
|
1
1
|
import { APP_CODES } from './apps';
|
|
2
2
|
import { acceptanceAppIcon, billingAppIcon, payoutsAppIcon, walletAppIcon } from './assets';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Backend report filter types (used by reports APIs)
|
|
5
|
+
*
|
|
6
|
+
* Maps frontend report identifiers to the backend API filter types.
|
|
7
|
+
* Acts as the source of truth for all report types across apps/services
|
|
8
|
+
*/
|
|
9
|
+
const REPORT_FILTER_TYPES = {
|
|
10
|
+
// Acceptance
|
|
11
|
+
CHARGE: 'CHARGE',
|
|
12
|
+
AUTHORIZE: 'AUTHORIZE',
|
|
13
|
+
REFUND: 'REFUND',
|
|
14
|
+
CHARGEBACKS: 'CHARGEBACKS',
|
|
15
|
+
DESTINATIONS: 'DESTINATIONS',
|
|
16
|
+
// Wallet
|
|
17
|
+
STATEMENT: 'STATEMENT',
|
|
18
|
+
STATEMENT_SUMMARY: 'STATEMENT_SUMMARY',
|
|
19
|
+
// Billing
|
|
20
|
+
INVOICE: 'INVOICE',
|
|
21
|
+
// Payouts
|
|
22
|
+
PAYOUT: 'PAYOUT',
|
|
23
|
+
MERCHANT_PAYOUT: 'MERCHANT_PAYOUT',
|
|
24
|
+
RETAILER_PAYOUT: 'RETAILER_PAYOUT',
|
|
19
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Maps report **source codes** (app or service)
|
|
28
|
+
* to the corresponding **backend report filter types**.
|
|
29
|
+
*
|
|
30
|
+
* Used as a translation layer between UI report grouping
|
|
31
|
+
* and backend report filtering.
|
|
32
|
+
*
|
|
33
|
+
* - Key: App code or service code
|
|
34
|
+
* - Value: One or more backend filter types
|
|
35
|
+
*/
|
|
36
|
+
export const reportFilterTypesMap = {
|
|
37
|
+
// Acceptance
|
|
38
|
+
[APP_CODES.acceptance.services.charges.code]: [REPORT_FILTER_TYPES.CHARGE],
|
|
39
|
+
[APP_CODES.acceptance.services.authorization.code]: [REPORT_FILTER_TYPES.AUTHORIZE],
|
|
40
|
+
[APP_CODES.acceptance.services.refunds.code]: [REPORT_FILTER_TYPES.REFUND],
|
|
41
|
+
[APP_CODES.acceptance.services.chargeback.code]: [REPORT_FILTER_TYPES.CHARGEBACKS],
|
|
42
|
+
[APP_CODES.acceptance.services.destinations.code]: [REPORT_FILTER_TYPES.DESTINATIONS],
|
|
43
|
+
[APP_CODES.acceptance.code]: [
|
|
44
|
+
REPORT_FILTER_TYPES.CHARGE,
|
|
45
|
+
REPORT_FILTER_TYPES.AUTHORIZE,
|
|
46
|
+
REPORT_FILTER_TYPES.REFUND,
|
|
47
|
+
REPORT_FILTER_TYPES.CHARGEBACKS,
|
|
48
|
+
REPORT_FILTER_TYPES.DESTINATIONS,
|
|
49
|
+
],
|
|
50
|
+
// Wallet
|
|
51
|
+
[APP_CODES.wallet.services.merchants.functions.statement.code]: [REPORT_FILTER_TYPES.STATEMENT],
|
|
52
|
+
[APP_CODES.wallet.services.merchants.functions.summary.code]: [REPORT_FILTER_TYPES.STATEMENT_SUMMARY],
|
|
53
|
+
[APP_CODES.wallet.code]: [REPORT_FILTER_TYPES.STATEMENT, REPORT_FILTER_TYPES.STATEMENT_SUMMARY],
|
|
54
|
+
// Billing
|
|
55
|
+
[APP_CODES.billing.services.invoices.code]: [REPORT_FILTER_TYPES.INVOICE],
|
|
56
|
+
[APP_CODES.billing.code]: [REPORT_FILTER_TYPES.INVOICE],
|
|
57
|
+
// Payouts
|
|
58
|
+
[APP_CODES.payouts.services.payouts.code]: [REPORT_FILTER_TYPES.PAYOUT],
|
|
59
|
+
[APP_CODES.payouts.services.merchantPayout.code]: [REPORT_FILTER_TYPES.MERCHANT_PAYOUT],
|
|
60
|
+
[APP_CODES.payouts.services.retailerPayout.code]: [REPORT_FILTER_TYPES.RETAILER_PAYOUT],
|
|
61
|
+
[APP_CODES.payouts.code]: [REPORT_FILTER_TYPES.PAYOUT, REPORT_FILTER_TYPES.MERCHANT_PAYOUT, REPORT_FILTER_TYPES.RETAILER_PAYOUT],
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Reports apps
|
|
65
|
+
*
|
|
66
|
+
* Defines apps shown in the reports app, with each service linked
|
|
67
|
+
* to its backend filter type (REPORT_FILTER_TYPES).
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
20
70
|
export const REPORTS_APPS = [
|
|
21
71
|
{
|
|
22
72
|
code: APP_CODES.billing.code,
|
|
23
73
|
name: 'Billing',
|
|
24
74
|
icon: billingAppIcon,
|
|
25
|
-
services: [{ name: 'Invoices', code:
|
|
75
|
+
services: [{ name: 'Invoices', code: REPORT_FILTER_TYPES.INVOICE }],
|
|
26
76
|
},
|
|
27
77
|
{
|
|
28
78
|
code: APP_CODES.acceptance.code,
|
|
29
79
|
name: 'Acceptance',
|
|
30
80
|
icon: acceptanceAppIcon,
|
|
31
81
|
services: [
|
|
32
|
-
{ name: 'Authorisations', code:
|
|
33
|
-
{ name: 'Charges', code:
|
|
34
|
-
{ name: 'Refunds', code:
|
|
35
|
-
{ name: 'Chargebacks', code:
|
|
36
|
-
{ name: 'Destinations', code:
|
|
82
|
+
{ name: 'Authorisations', code: REPORT_FILTER_TYPES.AUTHORIZE },
|
|
83
|
+
{ name: 'Charges', code: REPORT_FILTER_TYPES.CHARGE },
|
|
84
|
+
{ name: 'Refunds', code: REPORT_FILTER_TYPES.REFUND },
|
|
85
|
+
{ name: 'Chargebacks', code: REPORT_FILTER_TYPES.CHARGEBACKS },
|
|
86
|
+
{ name: 'Destinations', code: REPORT_FILTER_TYPES.DESTINATIONS },
|
|
37
87
|
],
|
|
38
88
|
},
|
|
39
89
|
{
|
|
@@ -41,8 +91,8 @@ export const REPORTS_APPS = [
|
|
|
41
91
|
name: 'Wallet',
|
|
42
92
|
icon: walletAppIcon,
|
|
43
93
|
services: [
|
|
44
|
-
{ name: 'Aggregated Statement', code:
|
|
45
|
-
{ name: 'Detailed Statement', code:
|
|
94
|
+
{ name: 'Aggregated Statement', code: REPORT_FILTER_TYPES.STATEMENT_SUMMARY },
|
|
95
|
+
{ name: 'Detailed Statement', code: REPORT_FILTER_TYPES.STATEMENT },
|
|
46
96
|
],
|
|
47
97
|
},
|
|
48
98
|
{
|
|
@@ -50,9 +100,9 @@ export const REPORTS_APPS = [
|
|
|
50
100
|
name: 'Payouts',
|
|
51
101
|
icon: payoutsAppIcon,
|
|
52
102
|
services: [
|
|
53
|
-
{ name: 'Payouts', code:
|
|
54
|
-
{ name: 'Merchant Payouts', code:
|
|
55
|
-
{ name: 'Retailer Payouts', code:
|
|
103
|
+
{ name: 'Payouts', code: REPORT_FILTER_TYPES.PAYOUT },
|
|
104
|
+
{ name: 'Merchant Payouts', code: REPORT_FILTER_TYPES.MERCHANT_PAYOUT },
|
|
105
|
+
{ name: 'Retailer Payouts', code: REPORT_FILTER_TYPES.RETAILER_PAYOUT },
|
|
56
106
|
],
|
|
57
107
|
},
|
|
58
108
|
];
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ToastMessage } from '../types/index.js';
|
|
2
|
+
import type { ToastOptions } from 'react-hot-toast';
|
|
3
|
+
export interface ToastFunction {
|
|
4
|
+
(message: ToastMessage, options?: ToastOptions): string;
|
|
5
|
+
success: (message: ToastMessage, options?: ToastOptions) => string;
|
|
6
|
+
error: (message: ToastMessage, options?: ToastOptions) => string;
|
|
7
|
+
loading: (message: ToastMessage, options?: ToastOptions) => string;
|
|
8
|
+
custom: (message: ToastMessage, options?: ToastOptions) => string;
|
|
9
|
+
dismiss: (toastId?: string) => void;
|
|
10
|
+
remove: (toastId?: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useToast(): ToastFunction;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useAppEventPublisher } from './index.js';
|
|
2
|
+
import { AppEvent } from '../types/index.js';
|
|
3
|
+
export function useToast() {
|
|
4
|
+
const publish = useAppEventPublisher(AppEvent.OnToast);
|
|
5
|
+
const generateToastId = () => crypto.randomUUID();
|
|
6
|
+
const base = ((message, options) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
9
|
+
publish({ action: 'show', variant: 'default', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
10
|
+
return id;
|
|
11
|
+
});
|
|
12
|
+
base.success = (message, options) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
15
|
+
publish({ action: 'show', variant: 'success', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
16
|
+
return id;
|
|
17
|
+
};
|
|
18
|
+
base.error = (message, options) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
21
|
+
publish({ action: 'show', variant: 'error', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
22
|
+
return id;
|
|
23
|
+
};
|
|
24
|
+
base.loading = (message, options) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
27
|
+
publish({ action: 'show', variant: 'loading', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
28
|
+
return id;
|
|
29
|
+
};
|
|
30
|
+
base.custom = (message, options) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
|
|
33
|
+
publish({ action: 'show', variant: 'custom', message, options: Object.assign(Object.assign({}, options), { id }) });
|
|
34
|
+
return id;
|
|
35
|
+
};
|
|
36
|
+
base.dismiss = (toastId) => {
|
|
37
|
+
publish({ action: 'dismiss', variant: 'dismiss', toastId });
|
|
38
|
+
};
|
|
39
|
+
base.remove = (toastId) => {
|
|
40
|
+
publish({ action: 'remove', variant: 'remove', toastId });
|
|
41
|
+
};
|
|
42
|
+
return base;
|
|
43
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalenderMode, NavigateFunction, TableMode, Timezone } from './index.js';
|
|
1
|
+
import { CalenderMode, NavigateFunction, TableMode, Timezone, ToastEventPayload } from './index.js';
|
|
2
2
|
import { DragControls } from 'framer-motion';
|
|
3
3
|
export declare enum AppEvent {
|
|
4
4
|
OnClickTableAction = "on-click-table-action",
|
|
@@ -10,6 +10,7 @@ export declare enum AppEvent {
|
|
|
10
10
|
OnNavigate = "on-navigate",
|
|
11
11
|
OnStartDrag = "on-start-drag",
|
|
12
12
|
OnChangeAppToolbar = "on-change-app-toolbar",
|
|
13
|
+
OnToast = "on-toast",
|
|
13
14
|
OnModifyRemotePayload = "on-modify-remote-payload"
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -46,4 +47,5 @@ export type AppEventMap = {
|
|
|
46
47
|
windowId: string;
|
|
47
48
|
payload: object;
|
|
48
49
|
}) => void;
|
|
50
|
+
[AppEvent.OnToast]: (params: ToastEventPayload) => void;
|
|
49
51
|
};
|
package/build/types/appEvents.js
CHANGED
|
@@ -10,6 +10,7 @@ export var AppEvent;
|
|
|
10
10
|
AppEvent["OnNavigate"] = "on-navigate";
|
|
11
11
|
AppEvent["OnStartDrag"] = "on-start-drag";
|
|
12
12
|
AppEvent["OnChangeAppToolbar"] = "on-change-app-toolbar";
|
|
13
|
+
AppEvent["OnToast"] = "on-toast";
|
|
13
14
|
// Remote Events
|
|
14
15
|
AppEvent["OnModifyRemotePayload"] = "on-modify-remote-payload";
|
|
15
16
|
})(AppEvent || (AppEvent = {}));
|
package/build/types/apps.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ColumnsView } from './column';
|
|
2
2
|
import { Segment, SegmentCountry, SegmentUser, SelectedBrand, SelectedCountry, User } from './user';
|
|
3
|
-
import { BusinessMerchant } from './merchant';
|
|
4
3
|
import type { i18n } from 'i18next';
|
|
5
4
|
import { Theme } from '@mui/material';
|
|
6
5
|
import { CalenderMode } from './theme';
|
|
7
6
|
import { Timezone } from './appConfig';
|
|
8
7
|
import { Brand, Entity, TableMode } from './index.js';
|
|
9
8
|
import { TextAndLang } from './common';
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export interface
|
|
9
|
+
export type AppPayload<TServiceCodes extends string = string> = {
|
|
10
|
+
services: {
|
|
11
|
+
[key in TServiceCodes]?: ServicePayload;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export interface ServicePayload {
|
|
16
15
|
columnFilters?: Record<string, any>;
|
|
17
16
|
filteredIds?: string[];
|
|
18
17
|
dateRange?: [Date, Date];
|
|
@@ -21,6 +20,7 @@ export interface AppPayload extends Partial<AccountAppPayload> {
|
|
|
21
20
|
isTextShown?: boolean;
|
|
22
21
|
tableViews?: ColumnsView[];
|
|
23
22
|
calendarTimezone?: number;
|
|
23
|
+
reportTypes?: string[];
|
|
24
24
|
}
|
|
25
25
|
export interface AppDetails {
|
|
26
26
|
id: string;
|
|
@@ -43,7 +43,7 @@ export interface AppDetails {
|
|
|
43
43
|
minWidth: number | string;
|
|
44
44
|
minHeight: number | string;
|
|
45
45
|
};
|
|
46
|
-
payload?: Record<string, any> &
|
|
46
|
+
payload?: Record<string, any> & ServicePayload;
|
|
47
47
|
toolbarIconUrl?: string;
|
|
48
48
|
hideMaximizedApp?: boolean;
|
|
49
49
|
hideMinimizeApp?: boolean;
|
|
@@ -99,7 +99,7 @@ export type MFWidgetBaseProps = {
|
|
|
99
99
|
hasHeader: boolean;
|
|
100
100
|
sandboxMode: boolean;
|
|
101
101
|
initialServiceCode?: string;
|
|
102
|
-
|
|
102
|
+
initialAppPayload?: AppPayload;
|
|
103
103
|
};
|
|
104
104
|
user: User;
|
|
105
105
|
segment: {
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ToastOptions, ValueOrFunction, Renderable, Toast } from 'react-hot-toast';
|
|
2
|
+
export type ToastMessage = ValueOrFunction<Renderable, Toast>;
|
|
3
|
+
export type ToastEventPayload = {
|
|
4
|
+
action: 'show';
|
|
5
|
+
variant: 'default' | 'success' | 'error' | 'loading' | 'custom';
|
|
6
|
+
message: ToastMessage;
|
|
7
|
+
options?: ToastOptions;
|
|
8
|
+
} | {
|
|
9
|
+
variant: 'dismiss';
|
|
10
|
+
action: 'dismiss';
|
|
11
|
+
toastId?: string;
|
|
12
|
+
} | {
|
|
13
|
+
variant: 'remove';
|
|
14
|
+
action: 'remove';
|
|
15
|
+
toastId?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export declare const openNewAppAttrs: ({ appCode, serviceCode, sandboxMode, payl
|
|
|
6
6
|
numberOfOpenedApps: number;
|
|
7
7
|
segmentId: string;
|
|
8
8
|
}) => {
|
|
9
|
-
payload?: (Record<string, any> & import("../types/index.js").
|
|
9
|
+
payload?: (Record<string, any> & import("../types/index.js").ServicePayload) | undefined;
|
|
10
10
|
segmentId: string;
|
|
11
11
|
appCode: string;
|
|
12
12
|
serviceCode: string;
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.367-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 default function Notifications(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from '@mui/material/Box';
|
|
3
|
-
import { Toaster, resolveValue } from 'react-hot-toast';
|
|
4
|
-
import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
|
|
5
|
-
import { Content } from './style';
|
|
6
|
-
const icons = {
|
|
7
|
-
success: actionSuccessIcon,
|
|
8
|
-
error: warningInfoIcon,
|
|
9
|
-
};
|
|
10
|
-
export default function Notifications() {
|
|
11
|
-
return (_jsx(Toaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
|
|
12
|
-
}
|
|
File without changes
|
|
File without changes
|