@tap-payments/os-micro-frontend-shared 0.1.95 → 0.1.96-test.2
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.d.ts +4 -2
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.js +9 -4
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +2 -1
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +2 -2
- package/build/components/StatusIcons/DestinationIcon/DestinationIcon.d.ts +5 -2
- package/build/components/StatusIcons/DestinationIcon/DestinationIcon.js +13 -5
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.d.ts +5 -1
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.js +8 -3
- package/build/components/StatusIcons/RefundIcon/RefundIcon.d.ts +5 -1
- package/build/components/StatusIcons/RefundIcon/RefundIcon.js +18 -10
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.d.ts +4 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js +6 -4
- package/build/components/VirtualTables/components/style.js +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/authorizationTableCellWidth.js +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.js +1 -1
- package/build/constants/table/cell/destinationsTableCellWidth.d.ts +67 -7
- package/build/constants/table/cell/destinationsTableCellWidth.js +67 -7
- package/build/utils/style.js +0 -4
- package/build/utils/table.d.ts +5 -0
- package/build/utils/table.js +32 -0
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AuthorizedStatusType } from '../../TableCells';
|
|
3
|
-
import { TableMode } from '../../../types/index.js';
|
|
3
|
+
import { SelectionProps, TableMode } from '../../../types/index.js';
|
|
4
4
|
type AuthorizedIconProps = {
|
|
5
5
|
iconStyles?: React.CSSProperties;
|
|
6
6
|
authorizedStatus?: AuthorizedStatusType;
|
|
7
7
|
isTextShown?: boolean;
|
|
8
8
|
tableMode?: TableMode;
|
|
9
|
+
chipIndex?: number;
|
|
10
|
+
selectionProps?: SelectionProps;
|
|
9
11
|
};
|
|
10
|
-
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex, selectionProps }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -6,10 +6,15 @@ import Tooltip from '../../Tooltip';
|
|
|
6
6
|
import { authorizedStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
7
7
|
import Icon from '../../Icon';
|
|
8
8
|
import { TextLabel } from '../../TableCells/CustomCells/style';
|
|
9
|
-
|
|
9
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
10
|
+
export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex = 0, selectionProps = {} }) => {
|
|
10
11
|
const { t } = useTranslation();
|
|
11
12
|
const theme = useTheme();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const status = t(camelCase(authorizedStatus));
|
|
14
|
+
if (tableMode === 'sheet') {
|
|
15
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ copyText: status, chipIndex: chipIndex, selectionProps: selectionProps }, { children: status })));
|
|
16
|
+
}
|
|
17
|
+
return (_jsx(Tooltip, Object.assign({ title: status }, { children: isTextShown ? (_jsx(TextLabel, Object.assign({ "data-testid": "StatusCell_AuthorizedStatusLabel", sx: {
|
|
18
|
+
color: theme.palette.info.dark,
|
|
19
|
+
} }, { children: status }))) : (_jsx(Icon, { src: authorizedStatusIcons[authorizedStatus], alt: "authorized-icon", "data-testid": "StatusCell_AuthorizedStatusIcon", sx: iconStyles })) })));
|
|
15
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { SelectionProps } from '../../../types/index.js';
|
|
3
3
|
import { type ChargeStatus } from '../../TableCells';
|
|
4
|
-
export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, }: Readonly<{
|
|
4
|
+
export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, chipIndex, }: Readonly<{
|
|
5
5
|
chargeStatus?: ChargeStatus;
|
|
6
6
|
gatewayTooltip?: string;
|
|
7
7
|
showAuthorizedStatus?: boolean;
|
|
@@ -20,4 +20,5 @@ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquire
|
|
|
20
20
|
showBadge?: boolean;
|
|
21
21
|
isSheetViewShown?: boolean;
|
|
22
22
|
selectionProps?: SelectionProps;
|
|
23
|
+
chipIndex?: number;
|
|
23
24
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
|
8
8
|
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
9
9
|
import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
|
|
10
10
|
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
|
|
11
|
-
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, }) {
|
|
11
|
+
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, chipIndex = 0, }) {
|
|
12
12
|
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
13
13
|
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
14
|
const theme = useTheme();
|
|
@@ -18,7 +18,7 @@ export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip
|
|
|
18
18
|
const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
|
|
19
19
|
const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx("div", Object.assign({ "data-testid": "ChargeStatusIcon_ChargeIcon", style: Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '16px', height: '16px', borderRadius: unCapturedStatusStyle ? '50%' : '' }, iconWrapperStyles) }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", "data-testid": "ChargeStatusIcon_StatusIcon", style: Object.assign({ borderRadius: unCapturedStatusStyle ? '50%' : '', width: '16px', height: '16px' }, iconStyles) }) })));
|
|
20
20
|
if (isSheetViewShown) {
|
|
21
|
-
return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex:
|
|
21
|
+
return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex: chipIndex, selectionProps: selectionProps }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Gateway", chipIndex: 1, selectionProps: selectionProps }, { children: ["Gateway ", gatewayCode] }))), acquirerCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Acquirer", chipIndex: 2, selectionProps: selectionProps }, { children: ["Acquirer ", acquirerCode] })))] }))] }));
|
|
22
22
|
}
|
|
23
23
|
if (isTextShown) {
|
|
24
24
|
return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { DestinationStatus } from '../../../types/index.js';
|
|
2
|
-
export declare function DestinationIcon({ status, isTextShown, }: Readonly<{
|
|
1
|
+
import { DestinationStatus, SelectionProps } from '../../../types/index.js';
|
|
2
|
+
export declare function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex, selectionProps, }: Readonly<{
|
|
3
3
|
status: DestinationStatus;
|
|
4
4
|
isTextShown?: boolean;
|
|
5
|
+
isSheetViewShown?: boolean;
|
|
6
|
+
chipIndex?: number;
|
|
7
|
+
selectionProps?: SelectionProps;
|
|
5
8
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,10 +5,18 @@ import Tooltip from '../../Tooltip';
|
|
|
5
5
|
import { camelCase } from 'lodash';
|
|
6
6
|
import { useTheme } from '@mui/material';
|
|
7
7
|
import { t } from 'i18next';
|
|
8
|
-
|
|
8
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
9
|
+
export function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) {
|
|
9
10
|
const theme = useTheme();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const statusText = t(camelCase(status));
|
|
12
|
+
if (isSheetViewShown && destinationStatusIcons[status]) {
|
|
13
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ copyText: statusText, chipIndex: chipIndex, selectionProps: selectionProps }, { children: statusText })));
|
|
14
|
+
}
|
|
15
|
+
if (isTextShown && destinationStatusIcons[status]) {
|
|
16
|
+
return (_jsx(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(status), sx: {
|
|
17
|
+
background: '#1F88D00D',
|
|
18
|
+
color: status === 'PROCESSED' ? theme.palette.info.dark : theme.palette.common.black,
|
|
19
|
+
} }, { children: statusText })));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx(StatusIconWrapper, Object.assign({ className: "destination-status" }, { children: status && destinationStatusIcons[status] && (_jsx(Tooltip, Object.assign({ title: t(camelCase(status)) }, { children: _jsx(StatusIcon, { src: destinationStatusIcons[status], alt: "destination-icon" }) }))) })));
|
|
14
22
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PayoutStatusType } from '../../TableCells';
|
|
3
|
+
import { SelectionProps } from '../../../types/index.js';
|
|
3
4
|
type PayoutIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
payoutStatus?: PayoutStatusType;
|
|
6
7
|
payoutTooltip?: React.ReactNode;
|
|
7
8
|
isTextShown?: boolean;
|
|
9
|
+
isSheetViewShown?: boolean;
|
|
10
|
+
chipIndex?: number;
|
|
11
|
+
selectionProps?: SelectionProps;
|
|
8
12
|
};
|
|
9
|
-
export declare const PayoutIcon: ({ payoutStatus, isTextShown, payoutTooltip, iconStyles }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const PayoutIcon: ({ payoutStatus, isTextShown, payoutTooltip, iconStyles, isSheetViewShown, chipIndex, selectionProps, }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export {};
|
|
@@ -5,8 +5,13 @@ import Tooltip from '../../Tooltip';
|
|
|
5
5
|
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
6
6
|
import { StatusTextLabel } from '../../TableCells/CustomCells/InvoiceStatusCell/style';
|
|
7
7
|
import { payoutStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
8
|
-
|
|
8
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
9
|
+
export const PayoutIcon = ({ payoutStatus = 'PENDING', isTextShown, payoutTooltip, iconStyles, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) => {
|
|
9
10
|
const { t } = useTranslation();
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const statusText = t(camelCase(payoutStatus));
|
|
12
|
+
const title = payoutTooltip ? payoutTooltip : statusText;
|
|
13
|
+
if (isSheetViewShown) {
|
|
14
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: statusText, selectionProps: selectionProps }, { children: statusText })));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_PayoutStatusLabel" }, { children: statusText }))) : (_jsx(StatusIcon, { src: payoutStatusIcons[payoutStatus], alt: "settled-icon", "data-testid": "StatusCell_PayoutStatusIcon", style: iconStyles })) })));
|
|
12
17
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type RefundStatusType } from '../../TableCells';
|
|
3
|
+
import { SelectionProps } from '../../../types/index.js';
|
|
3
4
|
type RefundIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
refundStatus?: RefundStatusType;
|
|
6
7
|
refundTooltip?: React.ReactNode;
|
|
7
8
|
refundCount?: number;
|
|
8
9
|
isTextShown?: boolean;
|
|
10
|
+
isSheetViewShown?: boolean;
|
|
11
|
+
chipIndex?: number;
|
|
12
|
+
selectionProps?: SelectionProps;
|
|
9
13
|
};
|
|
10
|
-
declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles, isSheetViewShown, chipIndex, selectionProps, }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export default RefundIcon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import camelCase from 'lodash/camelCase';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Tooltip from '../../Tooltip';
|
|
@@ -8,9 +8,15 @@ import { MultiRefundContainer, MultiRefundIcon, RefundsCountBadge } from '../../
|
|
|
8
8
|
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
9
9
|
import { StatusTextLabel } from '../../TableCells/CustomCells/InvoiceStatusCell/style';
|
|
10
10
|
import { refundStatusIcons, refundStyles } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
11
|
-
|
|
11
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
12
|
+
const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '', refundCount, iconStyles, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) => {
|
|
12
13
|
const { t } = useTranslation();
|
|
13
14
|
const theme = useTheme();
|
|
15
|
+
const refundCountShown = (refundCount || 0) > 1;
|
|
16
|
+
const status = t(camelCase(refundStatus));
|
|
17
|
+
if (isSheetViewShown) {
|
|
18
|
+
return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, selectionProps: selectionProps, copyText: status }, { children: [status, " ", refundCountShown ? `${refundCount}x` : null] })));
|
|
19
|
+
}
|
|
14
20
|
const refundCountBadge = (_jsxs(RefundsCountBadge, Object.assign({ "data-testid": "StatusCell_RefundsCountBadge", initial: { width: 0, opacity: 0, padding: '0px' }, transition: {
|
|
15
21
|
animate: {
|
|
16
22
|
duration: 0.5,
|
|
@@ -31,8 +37,8 @@ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '',
|
|
|
31
37
|
opacity: 1,
|
|
32
38
|
},
|
|
33
39
|
} }, { children: [refundCount, "x"] })));
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
if (isTextShown) {
|
|
41
|
+
return (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: _jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_RefundStatusLabel", sx: {
|
|
36
42
|
color: refundStyles[refundStatus].color,
|
|
37
43
|
backgroundColor: refundStyles[refundStatus].backgroundColor,
|
|
38
44
|
width: '90px',
|
|
@@ -41,11 +47,13 @@ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '',
|
|
|
41
47
|
boxShadow: theme.shadows[4],
|
|
42
48
|
gap: theme.spacing(0.5),
|
|
43
49
|
},
|
|
44
|
-
} }, { children: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
} }, { children: [status, " ", refundCountShown ? refundCountBadge : null] })) })) })));
|
|
51
|
+
}
|
|
52
|
+
return (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: refundCountShown ? (_jsxs(MultiRefundContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", variants: {
|
|
53
|
+
animate: {
|
|
54
|
+
boxShadow: theme.shadows[4],
|
|
55
|
+
gap: theme.spacing(0.5),
|
|
56
|
+
},
|
|
57
|
+
} }, { children: [_jsx(MultiRefundIcon, { src: refundSettledIcon, alt: "multi-refunded-icon", "data-testid": "StatusCell_MultiRefundIcon" }), refundCountBadge] }))) : (_jsx(StatusIcon, { src: refundStatusIcons[refundStatus], alt: "refunded-icon", "data-testid": "StatusCell_RefundStatusIcon", style: iconStyles })) })));
|
|
50
58
|
};
|
|
51
59
|
export default RefundIcon;
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.d.ts
CHANGED
|
@@ -7,7 +7,10 @@ interface ISheetViewTableLoadingProps {
|
|
|
7
7
|
isLoading?: boolean;
|
|
8
8
|
rowsCount?: number;
|
|
9
9
|
isPinned?: boolean;
|
|
10
|
+
tableType?: string;
|
|
11
|
+
containerHeight?: number;
|
|
12
|
+
isCompact?: boolean;
|
|
10
13
|
}
|
|
11
|
-
declare function SheetViewTableLoading({ columns, isLoaded, animationType, isLoading, rowsCount, isPinned, }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SheetViewTableLoading({ columns, isLoaded, animationType, isLoading, rowsCount, isPinned, tableType, containerHeight, isCompact, }: ISheetViewTableLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
12
15
|
declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableLoading>;
|
|
13
16
|
export default _default;
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import uniqueId from 'lodash/uniqueId';
|
|
5
|
-
import {
|
|
5
|
+
import { calculateSheetViewMaxRows, getSheetViewRowHeight } from '../../../../utils/index.js';
|
|
6
6
|
import SheetViewTableRowLoading from './SheetViewTableRowLoading';
|
|
7
7
|
const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
|
|
8
8
|
overflow: 'hidden',
|
|
@@ -11,9 +11,11 @@ const Wrapper = styled('section')(({ isLoaded = false, isPinned = false }) => ({
|
|
|
11
11
|
filter: isLoaded && !isPinned ? 'blur(8px)' : 'none',
|
|
12
12
|
marginTop: isLoaded && !isPinned ? '1rem' : '0',
|
|
13
13
|
}));
|
|
14
|
-
function SheetViewTableLoading({ columns, isLoaded = false, animationType, isLoading = false, rowsCount, isPinned = false, }) {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function SheetViewTableLoading({ columns, isLoaded = false, animationType, isLoading = false, rowsCount, isPinned = false, tableType = 'default', containerHeight, isCompact = false, }) {
|
|
15
|
+
const availableHeight = containerHeight || window.innerHeight * 0.8;
|
|
16
|
+
const rowHeight = getSheetViewRowHeight();
|
|
17
|
+
const maxAllowedRows = calculateSheetViewMaxRows(availableHeight, rowHeight);
|
|
18
|
+
console.log({ maxAllowedRows, availableHeight, rowHeight, tableType, isCompact, containerHeight });
|
|
17
19
|
return (_jsx(Wrapper, Object.assign({ isLoaded: isLoaded, isPinned: isPinned, "data-testid": "SheetViewTableLoading" }, { children: [...Array(maxAllowedRows)].map((_, index) => (_jsx(SheetViewTableRowLoading, { columns: columns, animationType: animationType, rowIndex: index, useTableBackground: !isPinned }, `i-${uniqueId('SheetViewTableLoadingRow_')}`))) })));
|
|
18
20
|
}
|
|
19
21
|
export default memo(SheetViewTableLoading);
|
|
@@ -146,7 +146,7 @@ export const SheetViewTableContainer = styled(Box)(() => ({
|
|
|
146
146
|
position: 'relative',
|
|
147
147
|
display: 'flex',
|
|
148
148
|
flexDirection: 'column',
|
|
149
|
-
height: '
|
|
149
|
+
height: '100%',
|
|
150
150
|
paddingInline: '28px',
|
|
151
151
|
borderRadius: '8px',
|
|
152
152
|
marginBottom: '16px !important',
|
|
@@ -12,12 +12,12 @@ export declare const destinationsTableCellWidth: {
|
|
|
12
12
|
readonly created: {
|
|
13
13
|
readonly default: "170px";
|
|
14
14
|
readonly text: "170px";
|
|
15
|
-
readonly sheet: "
|
|
15
|
+
readonly sheet: "130px";
|
|
16
16
|
};
|
|
17
17
|
readonly receipt: {
|
|
18
18
|
readonly default: "85px";
|
|
19
19
|
readonly text: "150px";
|
|
20
|
-
readonly sheet: "
|
|
20
|
+
readonly sheet: "165px";
|
|
21
21
|
};
|
|
22
22
|
readonly reference: {
|
|
23
23
|
readonly default: "95px";
|
|
@@ -47,7 +47,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
47
47
|
readonly device: {
|
|
48
48
|
readonly default: "150px";
|
|
49
49
|
readonly text: "250px";
|
|
50
|
-
readonly sheet: "
|
|
50
|
+
readonly sheet: "235px";
|
|
51
51
|
};
|
|
52
52
|
readonly source: {
|
|
53
53
|
readonly default: "114px";
|
|
@@ -62,7 +62,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
62
62
|
readonly payment_agreement: {
|
|
63
63
|
readonly default: "50px";
|
|
64
64
|
readonly text: "250px";
|
|
65
|
-
readonly sheet: "
|
|
65
|
+
readonly sheet: "165px";
|
|
66
66
|
};
|
|
67
67
|
readonly amount: {
|
|
68
68
|
readonly default: "195px";
|
|
@@ -81,13 +81,13 @@ export declare const destinationsTableCellWidth: {
|
|
|
81
81
|
};
|
|
82
82
|
readonly merchant: {
|
|
83
83
|
readonly default: "100px";
|
|
84
|
-
readonly text: "
|
|
85
|
-
readonly sheet: "
|
|
84
|
+
readonly text: "150px";
|
|
85
|
+
readonly sheet: "215px";
|
|
86
86
|
};
|
|
87
87
|
readonly actions: {
|
|
88
88
|
readonly default: "100px";
|
|
89
89
|
readonly text: "100px";
|
|
90
|
-
readonly sheet: "
|
|
90
|
+
readonly sheet: "85px";
|
|
91
91
|
};
|
|
92
92
|
readonly destination: {
|
|
93
93
|
readonly default: "100px";
|
|
@@ -109,4 +109,64 @@ export declare const destinationsTableCellWidth: {
|
|
|
109
109
|
readonly text: "116px";
|
|
110
110
|
readonly sheet: "116px";
|
|
111
111
|
};
|
|
112
|
+
readonly payment_initiated: {
|
|
113
|
+
readonly default: "150px";
|
|
114
|
+
readonly text: "150px";
|
|
115
|
+
readonly sheet: "150px";
|
|
116
|
+
};
|
|
117
|
+
readonly payment_issuers: {
|
|
118
|
+
readonly default: "150px";
|
|
119
|
+
readonly text: "150px";
|
|
120
|
+
readonly sheet: "350px";
|
|
121
|
+
};
|
|
122
|
+
readonly card_number: {
|
|
123
|
+
readonly default: "120px";
|
|
124
|
+
readonly text: "120px";
|
|
125
|
+
readonly sheet: "155px";
|
|
126
|
+
};
|
|
127
|
+
readonly card_no: {
|
|
128
|
+
readonly default: "120px";
|
|
129
|
+
readonly text: "120px";
|
|
130
|
+
readonly sheet: "200px";
|
|
131
|
+
};
|
|
132
|
+
readonly payment_type: {
|
|
133
|
+
readonly default: "150px";
|
|
134
|
+
readonly text: "150px";
|
|
135
|
+
readonly sheet: "120px";
|
|
136
|
+
};
|
|
137
|
+
readonly payment_method: {
|
|
138
|
+
readonly default: "150px";
|
|
139
|
+
readonly text: "150px";
|
|
140
|
+
readonly sheet: "145px";
|
|
141
|
+
};
|
|
142
|
+
readonly payment_scheme: {
|
|
143
|
+
readonly default: "150px";
|
|
144
|
+
readonly text: "150px";
|
|
145
|
+
readonly sheet: "145px";
|
|
146
|
+
};
|
|
147
|
+
readonly auth_status: {
|
|
148
|
+
readonly default: "150px";
|
|
149
|
+
readonly text: "150px";
|
|
150
|
+
readonly sheet: "165px";
|
|
151
|
+
};
|
|
152
|
+
readonly auth_type: {
|
|
153
|
+
readonly default: "150px";
|
|
154
|
+
readonly text: "150px";
|
|
155
|
+
readonly sheet: "155px";
|
|
156
|
+
};
|
|
157
|
+
readonly eci: {
|
|
158
|
+
readonly default: "150px";
|
|
159
|
+
readonly text: "150px";
|
|
160
|
+
readonly sheet: "100px";
|
|
161
|
+
};
|
|
162
|
+
readonly payout_status: {
|
|
163
|
+
readonly default: "120px";
|
|
164
|
+
readonly text: "120px";
|
|
165
|
+
readonly sheet: "120px";
|
|
166
|
+
};
|
|
167
|
+
readonly reference_transfer: {
|
|
168
|
+
readonly default: "350px";
|
|
169
|
+
readonly text: "350px";
|
|
170
|
+
readonly sheet: "350px";
|
|
171
|
+
};
|
|
112
172
|
};
|
|
@@ -12,12 +12,12 @@ export const destinationsTableCellWidth = {
|
|
|
12
12
|
created: {
|
|
13
13
|
default: '170px',
|
|
14
14
|
text: '170px',
|
|
15
|
-
sheet: '
|
|
15
|
+
sheet: '130px',
|
|
16
16
|
},
|
|
17
17
|
receipt: {
|
|
18
18
|
default: '85px',
|
|
19
19
|
text: '150px',
|
|
20
|
-
sheet: '
|
|
20
|
+
sheet: '165px',
|
|
21
21
|
},
|
|
22
22
|
reference: {
|
|
23
23
|
default: '95px',
|
|
@@ -47,7 +47,7 @@ export const destinationsTableCellWidth = {
|
|
|
47
47
|
device: {
|
|
48
48
|
default: '150px',
|
|
49
49
|
text: '250px',
|
|
50
|
-
sheet: '
|
|
50
|
+
sheet: '235px',
|
|
51
51
|
},
|
|
52
52
|
source: {
|
|
53
53
|
default: '114px',
|
|
@@ -62,7 +62,7 @@ export const destinationsTableCellWidth = {
|
|
|
62
62
|
payment_agreement: {
|
|
63
63
|
default: '50px',
|
|
64
64
|
text: '250px',
|
|
65
|
-
sheet: '
|
|
65
|
+
sheet: '165px',
|
|
66
66
|
},
|
|
67
67
|
amount: {
|
|
68
68
|
default: '195px',
|
|
@@ -81,13 +81,13 @@ export const destinationsTableCellWidth = {
|
|
|
81
81
|
},
|
|
82
82
|
merchant: {
|
|
83
83
|
default: '100px',
|
|
84
|
-
text: '
|
|
85
|
-
sheet: '
|
|
84
|
+
text: '150px',
|
|
85
|
+
sheet: '215px',
|
|
86
86
|
},
|
|
87
87
|
actions: {
|
|
88
88
|
default: '100px',
|
|
89
89
|
text: '100px',
|
|
90
|
-
sheet: '
|
|
90
|
+
sheet: '85px',
|
|
91
91
|
},
|
|
92
92
|
destination: {
|
|
93
93
|
default: '100px',
|
|
@@ -109,4 +109,64 @@ export const destinationsTableCellWidth = {
|
|
|
109
109
|
text: '116px',
|
|
110
110
|
sheet: '116px',
|
|
111
111
|
},
|
|
112
|
+
payment_initiated: {
|
|
113
|
+
default: '150px',
|
|
114
|
+
text: '150px',
|
|
115
|
+
sheet: '150px',
|
|
116
|
+
},
|
|
117
|
+
payment_issuers: {
|
|
118
|
+
default: '150px',
|
|
119
|
+
text: '150px',
|
|
120
|
+
sheet: '350px',
|
|
121
|
+
},
|
|
122
|
+
card_number: {
|
|
123
|
+
default: '120px',
|
|
124
|
+
text: '120px',
|
|
125
|
+
sheet: '155px',
|
|
126
|
+
},
|
|
127
|
+
card_no: {
|
|
128
|
+
default: '120px',
|
|
129
|
+
text: '120px',
|
|
130
|
+
sheet: '200px',
|
|
131
|
+
},
|
|
132
|
+
payment_type: {
|
|
133
|
+
default: '150px',
|
|
134
|
+
text: '150px',
|
|
135
|
+
sheet: '120px',
|
|
136
|
+
},
|
|
137
|
+
payment_method: {
|
|
138
|
+
default: '150px',
|
|
139
|
+
text: '150px',
|
|
140
|
+
sheet: '145px',
|
|
141
|
+
},
|
|
142
|
+
payment_scheme: {
|
|
143
|
+
default: '150px',
|
|
144
|
+
text: '150px',
|
|
145
|
+
sheet: '145px',
|
|
146
|
+
},
|
|
147
|
+
auth_status: {
|
|
148
|
+
default: '150px',
|
|
149
|
+
text: '150px',
|
|
150
|
+
sheet: '165px',
|
|
151
|
+
},
|
|
152
|
+
auth_type: {
|
|
153
|
+
default: '150px',
|
|
154
|
+
text: '150px',
|
|
155
|
+
sheet: '155px',
|
|
156
|
+
},
|
|
157
|
+
eci: {
|
|
158
|
+
default: '150px',
|
|
159
|
+
text: '150px',
|
|
160
|
+
sheet: '100px',
|
|
161
|
+
},
|
|
162
|
+
payout_status: {
|
|
163
|
+
default: '120px',
|
|
164
|
+
text: '120px',
|
|
165
|
+
sheet: '120px',
|
|
166
|
+
},
|
|
167
|
+
reference_transfer: {
|
|
168
|
+
default: '350px',
|
|
169
|
+
text: '350px',
|
|
170
|
+
sheet: '350px',
|
|
171
|
+
},
|
|
112
172
|
};
|
package/build/utils/style.js
CHANGED
|
@@ -31,10 +31,6 @@ export const getSelectionStyles = ({ isSelected, isCellSelected, isColumnSelecte
|
|
|
31
31
|
const getRowSelectionStyles = () => ({
|
|
32
32
|
backgroundColor: SELECTION_COLORS.background,
|
|
33
33
|
color: SELECTION_COLORS.primary,
|
|
34
|
-
border: 'none',
|
|
35
|
-
'&:before': {
|
|
36
|
-
border: 'none',
|
|
37
|
-
},
|
|
38
34
|
});
|
|
39
35
|
const getSingleCellSelectionStyles = () => ({
|
|
40
36
|
border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
|
package/build/utils/table.d.ts
CHANGED
|
@@ -6,4 +6,9 @@ export declare const getColumnWidthPercentage: (widthInPx: number, options?: {
|
|
|
6
6
|
export declare const getCellWidth: ({ table, cellID, tableMode }: TableCellWidthProps) => string;
|
|
7
7
|
export declare const calculateMaxAllowedRows: (isLoaded: boolean, isLoading: boolean) => number;
|
|
8
8
|
export declare const isHeightNotFullyFilledByRows: (totalRows: number) => boolean;
|
|
9
|
+
export declare const calculateSheetViewHeight: (totalRows: number, rowHeight?: number) => number;
|
|
10
|
+
export declare const calculateSheetViewMaxRows: (availableHeight: number, rowHeight?: number) => number;
|
|
11
|
+
export declare const isSheetViewScrollable: (totalRows: number, containerHeight: number, rowHeight?: number) => boolean;
|
|
12
|
+
export declare const getSheetViewRowHeight: () => number;
|
|
13
|
+
export declare const calculateSheetViewOptimalHeight: (totalRows: number, tableType: string, maxHeightPercentage?: number) => number;
|
|
9
14
|
export declare const isTableDefaultMode: (tableMode?: TableMode) => boolean;
|
package/build/utils/table.js
CHANGED
|
@@ -73,6 +73,38 @@ export const isHeightNotFullyFilledByRows = (totalRows) => {
|
|
|
73
73
|
const allowedRows = maxRowsThatFit();
|
|
74
74
|
return totalRows < allowedRows + 1;
|
|
75
75
|
};
|
|
76
|
+
export const calculateSheetViewHeight = (totalRows, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
77
|
+
const headerHeight = 56;
|
|
78
|
+
const padding = 16;
|
|
79
|
+
const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
|
|
80
|
+
const minHeight = 200;
|
|
81
|
+
const maxHeight = window.innerHeight * 0.8;
|
|
82
|
+
return Math.max(minHeight, Math.min(calculatedHeight, maxHeight));
|
|
83
|
+
};
|
|
84
|
+
export const calculateSheetViewMaxRows = (availableHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
85
|
+
const headerHeight = 56;
|
|
86
|
+
const padding = 16;
|
|
87
|
+
const availableContentHeight = availableHeight - headerHeight - padding;
|
|
88
|
+
return Math.floor(availableContentHeight / rowHeight);
|
|
89
|
+
};
|
|
90
|
+
export const isSheetViewScrollable = (totalRows, containerHeight, rowHeight = TABLE_CONTENT_ROW_HEIGHT) => {
|
|
91
|
+
const headerHeight = 56;
|
|
92
|
+
const padding = 16;
|
|
93
|
+
const contentHeight = headerHeight + totalRows * rowHeight + padding;
|
|
94
|
+
return contentHeight > containerHeight;
|
|
95
|
+
};
|
|
96
|
+
export const getSheetViewRowHeight = () => {
|
|
97
|
+
const baseRowHeight = TABLE_CONTENT_ROW_HEIGHT;
|
|
98
|
+
return baseRowHeight * 0.8;
|
|
99
|
+
};
|
|
100
|
+
export const calculateSheetViewOptimalHeight = (totalRows, tableType, maxHeightPercentage = 0.8) => {
|
|
101
|
+
const rowHeight = getSheetViewRowHeight();
|
|
102
|
+
const headerHeight = 56;
|
|
103
|
+
const padding = 16;
|
|
104
|
+
const calculatedHeight = headerHeight + totalRows * rowHeight + padding;
|
|
105
|
+
const maxHeight = window.innerHeight * maxHeightPercentage;
|
|
106
|
+
return Math.min(calculatedHeight, maxHeight);
|
|
107
|
+
};
|
|
76
108
|
export const isTableDefaultMode = (tableMode = 'default') => {
|
|
77
109
|
return tableMode === 'default';
|
|
78
110
|
};
|
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.96-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|