@tap-payments/os-micro-frontend-shared 0.1.435-test.2 → 0.1.435-test.6
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/PaymentSourceFilter/AuthenticationMode.d.ts +3 -3
- package/build/components/PaymentSourceFilter/AuthenticationMode.js +8 -8
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/constant.js +2 -2
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/AuthenticationMode.d.ts +2 -2
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/AuthenticationMode.js +2 -3
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/index.js +0 -1
- package/build/constants/authentication.d.ts +5 -0
- package/build/constants/authentication.js +9 -0
- package/package.json +2 -2
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.d.ts +0 -5
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.js +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthenticationModeType } from '../../constants/index.js';
|
|
2
2
|
import { Filters } from './type';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const AUTHENTICATION_MODES: {
|
|
4
4
|
label: string;
|
|
5
|
-
value:
|
|
5
|
+
value: AuthenticationModeType;
|
|
6
6
|
}[];
|
|
7
7
|
export declare const AuthenticationMode: ({ filters, setFilters }: Filters) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,14 +11,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useMemo, useState } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { AuthenticationModeBadge } from '../TableCells';
|
|
15
15
|
import Menu from '../Menu';
|
|
16
|
-
import { rightArrow } from '../../constants/index.js';
|
|
16
|
+
import { AUTHENTICATION_LABEL, AuthenticationModeType, rightArrow } from '../../constants/index.js';
|
|
17
17
|
import MenuItem from '../MenuItem';
|
|
18
18
|
import { MenuItemStyled } from './style';
|
|
19
|
-
export const
|
|
20
|
-
{ label: AUTHENTICATION_LABEL[
|
|
21
|
-
{ label: AUTHENTICATION_LABEL[
|
|
19
|
+
export const AUTHENTICATION_MODES = [
|
|
20
|
+
{ label: AUTHENTICATION_LABEL[AuthenticationModeType.Challenge], value: AuthenticationModeType.Challenge },
|
|
21
|
+
{ label: AUTHENTICATION_LABEL[AuthenticationModeType.Frictionless], value: AuthenticationModeType.Frictionless },
|
|
22
22
|
];
|
|
23
23
|
export const AuthenticationMode = ({ filters, setFilters }) => {
|
|
24
24
|
var _a;
|
|
@@ -33,8 +33,8 @@ export const AuthenticationMode = ({ filters, setFilters }) => {
|
|
|
33
33
|
if (open)
|
|
34
34
|
setAuthenticationModeEl(null);
|
|
35
35
|
};
|
|
36
|
-
const authModeAll = useMemo(() =>
|
|
37
|
-
const isSelected = useMemo(() =>
|
|
36
|
+
const authModeAll = useMemo(() => AUTHENTICATION_MODES.map((mode) => mode.value), []);
|
|
37
|
+
const isSelected = useMemo(() => AUTHENTICATION_MODES.length === filterAuthMode.length && filterAuthMode.length > 0, [filterAuthMode.length, authModeAll === null || authModeAll === void 0 ? void 0 : authModeAll.length]);
|
|
38
38
|
const isIndeterminate = useMemo(() => !isSelected && filterAuthMode.length > 0, [filterAuthMode.length, isSelected]);
|
|
39
39
|
const onClick = () => {
|
|
40
40
|
if (isSelected) {
|
|
@@ -55,5 +55,5 @@ export const AuthenticationMode = ({ filters, setFilters }) => {
|
|
|
55
55
|
setFilters(Object.assign(Object.assign({}, filters), { auth_mode: [...(filterAuthMode !== null && filterAuthMode !== void 0 ? filterAuthMode : []), selectedAuthMode] }));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("span", Object.assign({ className:
|
|
58
|
+
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: "Authentication Mode" })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: open, anchorEl: authenticationModeEl, placement: "right-start" }, { children: AUTHENTICATION_MODES.map((mode) => (_jsxs(MenuItem, Object.assign({ isSelected: isSelectedAuthMode(mode.value), onClick: (e) => onClickAuthMode(e, mode.value) }, { children: [_jsx(AuthenticationModeBadge, { mode: mode.value }), mode.label] }), mode.value))) }))] })));
|
|
59
59
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authenticationAttemptedIcon, authenticationFailedIcon, authenticationPendingIcon, authenticationUnavailableIcon, authenticationExemptedWithTransactionIcon, authenticationExemptedWithoutTransactionIcon, authenticationWithTransactionIcon,
|
|
1
|
+
import { authenticationAttemptedIcon, authenticationFailedIcon, authenticationPendingIcon, authenticationUnavailableIcon, authenticationExemptedWithTransactionIcon, authenticationExemptedWithoutTransactionIcon, authenticationWithTransactionIcon, authenticatedSuccessIcon, authenticationDeclinedIcon, authenticationUndeterminedIcon, authenticationNoAuthIcon, } from '../../../../constants/index.js';
|
|
2
2
|
import { statusIcons } from '../../../TableCells/CustomCells/StatusCell/constant';
|
|
3
3
|
export const authenticationStatusIcons = {
|
|
4
4
|
FAILED: authenticationFailedIcon,
|
|
@@ -14,7 +14,7 @@ export const authenticationStatusIcons = {
|
|
|
14
14
|
SUCCESS: authenticatedSuccessIcon,
|
|
15
15
|
AUTHENTICATED: authenticationWithTransactionIcon,
|
|
16
16
|
AUTHENTICATED_WITH_TRANSACTION: authenticationWithTransactionIcon,
|
|
17
|
-
AUTHENTICATED_WITHOUT_TRANSACTION:
|
|
17
|
+
AUTHENTICATED_WITHOUT_TRANSACTION: authenticationWithTransactionIcon,
|
|
18
18
|
AUTHENTICATED_AUTHORIZE_FAILED: authenticationFailedIcon,
|
|
19
19
|
};
|
|
20
20
|
export const chargeStatusIcons = statusIcons;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthenticationModeType } from '../../../../../../constants/index.js';
|
|
2
2
|
interface AuthenticationModeBadgeProps {
|
|
3
|
-
mode:
|
|
3
|
+
mode: AuthenticationModeType;
|
|
4
4
|
}
|
|
5
5
|
export declare const AuthenticationModeBadge: ({ mode }: AuthenticationModeBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import Tooltip from '../../../../../Tooltip';
|
|
4
|
-
import { ChallengeIcon, FrictionlessIcon } from '../../../../../../constants/index.js';
|
|
5
|
-
import { AuthenticationModeTypes, AUTHENTICATION_LABEL } from './constant';
|
|
4
|
+
import { ChallengeIcon, FrictionlessIcon, AuthenticationModeType, AUTHENTICATION_LABEL } from '../../../../../../constants/index.js';
|
|
6
5
|
export const AuthenticationModeBadge = ({ mode }) => {
|
|
7
6
|
if (!mode)
|
|
8
7
|
return null;
|
|
9
|
-
return (_jsx(Tooltip, Object.assign({ title: AUTHENTICATION_LABEL[mode] }, { children: _jsx(Box, { component: "img", src: mode ===
|
|
8
|
+
return (_jsx(Tooltip, Object.assign({ title: AUTHENTICATION_LABEL[mode] }, { children: _jsx(Box, { component: "img", src: mode === AuthenticationModeType.Challenge ? ChallengeIcon : FrictionlessIcon }) })));
|
|
10
9
|
};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const unAuthenticatedStatuses: string[];
|
|
2
2
|
export declare const allAuthenticationStatuses: string[];
|
|
3
|
+
export declare enum AuthenticationModeType {
|
|
4
|
+
Challenge = "C",
|
|
5
|
+
Frictionless = "F"
|
|
6
|
+
}
|
|
7
|
+
export declare const AUTHENTICATION_LABEL: Record<AuthenticationModeType, string>;
|
|
@@ -12,3 +12,12 @@ export const unAuthenticatedStatuses = [
|
|
|
12
12
|
'INITIATED',
|
|
13
13
|
];
|
|
14
14
|
export const allAuthenticationStatuses = [...authenticationStatuses, ...unAuthenticatedStatuses];
|
|
15
|
+
export var AuthenticationModeType;
|
|
16
|
+
(function (AuthenticationModeType) {
|
|
17
|
+
AuthenticationModeType["Challenge"] = "C";
|
|
18
|
+
AuthenticationModeType["Frictionless"] = "F";
|
|
19
|
+
})(AuthenticationModeType || (AuthenticationModeType = {}));
|
|
20
|
+
export const AUTHENTICATION_LABEL = {
|
|
21
|
+
[AuthenticationModeType.Challenge]: 'Challenge',
|
|
22
|
+
[AuthenticationModeType.Frictionless]: 'Frictionless',
|
|
23
|
+
};
|
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.435-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.435-test.6",
|
|
5
|
+
"testVersion": 6,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export var AuthenticationModeTypes;
|
|
2
|
-
(function (AuthenticationModeTypes) {
|
|
3
|
-
AuthenticationModeTypes["Challenge"] = "C";
|
|
4
|
-
AuthenticationModeTypes["Frictionless"] = "F";
|
|
5
|
-
})(AuthenticationModeTypes || (AuthenticationModeTypes = {}));
|
|
6
|
-
export const AUTHENTICATION_LABEL = {
|
|
7
|
-
[AuthenticationModeTypes.Challenge]: 'Challenge',
|
|
8
|
-
[AuthenticationModeTypes.Frictionless]: 'Frictionless',
|
|
9
|
-
};
|