@tap-payments/os-micro-frontend-shared 0.1.390 → 0.1.391-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/ChargeStatusIcon.d.ts +11 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/ChargeStatusIcon.js +15 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/InvoiceStatusCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/InvoiceStatusCell.js +39 -59
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +2 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.js +18 -0
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/type.d.ts +2 -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/TreeDropdown/TreeDropdown.d.ts +4 -0
- package/build/components/TreeDropdown/TreeDropdown.js +53 -0
- package/build/components/TreeDropdown/TreeNodeItem/SelectionControl.d.ts +8 -0
- package/build/components/TreeDropdown/TreeNodeItem/SelectionControl.js +17 -0
- package/build/components/TreeDropdown/TreeNodeItem/TreeNodeItem.d.ts +12 -0
- package/build/components/TreeDropdown/TreeNodeItem/TreeNodeItem.js +64 -0
- package/build/components/TreeDropdown/TreeNodeItem/index.d.ts +2 -0
- package/build/components/TreeDropdown/TreeNodeItem/index.js +2 -0
- package/build/components/TreeDropdown/TreeNodeItem/style.d.ts +14 -0
- package/build/components/TreeDropdown/TreeNodeItem/style.js +46 -0
- package/build/components/TreeDropdown/TreeNodeList/List.d.ts +6 -0
- package/build/components/TreeDropdown/TreeNodeList/List.js +17 -0
- package/build/components/TreeDropdown/TreeNodeList/TreeNodeList.d.ts +17 -0
- package/build/components/TreeDropdown/TreeNodeList/TreeNodeList.js +36 -0
- package/build/components/TreeDropdown/TreeNodeList/index.d.ts +2 -0
- package/build/components/TreeDropdown/TreeNodeList/index.js +2 -0
- package/build/components/TreeDropdown/TreeNodeList/style.d.ts +7 -0
- package/build/components/TreeDropdown/TreeNodeList/style.js +60 -0
- package/build/components/TreeDropdown/context/TreeDropdownProvider.d.ts +15 -0
- package/build/components/TreeDropdown/context/TreeDropdownProvider.js +13 -0
- package/build/components/TreeDropdown/hooks/useSearch.d.ts +17 -0
- package/build/components/TreeDropdown/hooks/useSearch.js +38 -0
- package/build/components/TreeDropdown/hooks/useTreeDropdown.d.ts +12 -0
- package/build/components/TreeDropdown/hooks/useTreeDropdown.js +10 -0
- package/build/components/TreeDropdown/index.d.ts +4 -0
- package/build/components/TreeDropdown/index.js +4 -0
- package/build/components/TreeDropdown/style.d.ts +9 -0
- package/build/components/TreeDropdown/style.js +43 -0
- package/build/components/TreeDropdown/type.d.ts +83 -0
- package/build/components/TreeDropdown/type.js +6 -0
- package/build/components/TreeDropdown/utils.d.ts +21 -0
- package/build/components/TreeDropdown/utils.js +161 -0
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useScrolledTo.d.ts +13 -0
- package/build/hooks/useScrolledTo.js +45 -0
- package/package.json +3 -3
|
@@ -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<{
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { type ChargeStatus } from '../../../TableCells';
|
|
3
|
+
interface SmallChargeStatusIconProps {
|
|
4
|
+
chargeStatus?: ChargeStatus;
|
|
5
|
+
chargeTooltip?: string;
|
|
6
|
+
errorCode?: string;
|
|
7
|
+
iconStyles?: CSSProperties;
|
|
8
|
+
iconWrapperStyles?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function ChargeStatusIcon({ chargeStatus, chargeTooltip, errorCode, iconStyles, iconWrapperStyles }: Readonly<SmallChargeStatusIconProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import Tooltip from '../../../Tooltip';
|
|
5
|
+
import { statusIcons, unCapturedStatusesStyles } from '../../../TableCells/CustomCells/StatusCell/constant';
|
|
6
|
+
import { StatusIcon } from '../../../TableCells/CustomCells/style';
|
|
7
|
+
import { ErrorChip, StatusIconWrapper } from './style';
|
|
8
|
+
export function ChargeStatusIcon({ chargeStatus, chargeTooltip, errorCode, iconStyles, iconWrapperStyles }) {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
11
|
+
const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx(StatusIconWrapper, Object.assign({ style: iconWrapperStyles }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", style: Object.assign({ width: '16px', height: '16px' }, iconStyles) }) })));
|
|
12
|
+
if (!chargeStatus)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsx(Tooltip, Object.assign({ title: chargeTooltip !== null && chargeTooltip !== void 0 ? chargeTooltip : t(chargeStatus) }, { children: _jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '6px', alignItems: 'center' } }, { children: [chargeIcon, errorCode && _jsx(ErrorChip, Object.assign({ style: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color } }, { children: errorCode }))] })) })));
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function InvoiceStatusCell({ status, date, viewsCount, chargeStatus, errorCode, chargeTooltip,
|
|
1
|
+
import { InvoiceStatusCellProps } from './type';
|
|
2
|
+
export default function InvoiceStatusCell({ status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, remindedCount, ...props }: InvoiceStatusCellProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -9,81 +9,61 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
|
-
import
|
|
16
|
-
import camelCase from 'lodash/camelCase';
|
|
17
|
-
import capitalize from 'lodash/capitalize';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
18
16
|
import { useTheme } from '@mui/material/styles';
|
|
19
17
|
import StyledBadge, { BadgeVariants } from '../../../CountBadge';
|
|
20
18
|
import Tooltip from '../../../Tooltip';
|
|
21
19
|
import { TableCell } from '../../../TableCells';
|
|
22
20
|
import { formatDate } from '../../../TableCells/CustomCells/DueDateCell/utils';
|
|
23
21
|
import { chargeStatusIcons } from '../../../TableCells/CustomCells/AuthenticationStatusCell/constant';
|
|
24
|
-
import {
|
|
22
|
+
import { remindedRedIcon } from '../../../../constants/index.js';
|
|
23
|
+
import { RightLeftExpandingCenterChip } from '../../../RightLeftExpandingCenterChip';
|
|
25
24
|
import { statusIcons } from './constant';
|
|
26
|
-
import {
|
|
25
|
+
import { DateIcon } from './style';
|
|
27
26
|
import { invoiceStatusStyles } from './utils';
|
|
28
|
-
import {
|
|
27
|
+
import { ChargeStatusIcon } from './ChargeStatusIcon';
|
|
28
|
+
import { useMemo } from 'react';
|
|
29
29
|
export default function InvoiceStatusCell(_a) {
|
|
30
|
-
var { status, date, viewsCount, chargeStatus, errorCode, chargeTooltip,
|
|
31
|
-
const theme = useTheme();
|
|
30
|
+
var { status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, remindedCount = 0 } = _a, props = __rest(_a, ["status", "date", "viewsCount", "chargeStatus", "errorCode", "chargeTooltip", "remindedCount"]);
|
|
32
31
|
const { t } = useTranslation();
|
|
32
|
+
const theme = useTheme();
|
|
33
33
|
const icon = status ? statusIcons[status] : null;
|
|
34
34
|
const statusStyles = invoiceStatusStyles(status);
|
|
35
|
-
const showExpansion = viewsCount !== 0 && !!viewsCount && status === 'VIEWED';
|
|
36
35
|
const statusTooltip = `${t((status === null || status === void 0 ? void 0 : status.toLowerCase()) || '')} ${formatDate(dayjs(date).valueOf())}`;
|
|
36
|
+
const statusIcon = useMemo(() => _jsx(ChargeStatusIcon, { chargeStatus: chargeStatus, errorCode: errorCode, chargeTooltip: chargeTooltip }), [chargeStatus, errorCode, chargeTooltip]);
|
|
37
|
+
const remindedIcon = useMemo(() => (_jsx(Tooltip, Object.assign({ title: t('reminded') }, { children: _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '6px' } }, { children: [_jsx(DateIcon, { sx: {
|
|
38
|
+
width: '14px',
|
|
39
|
+
height: '14px',
|
|
40
|
+
}, src: remindedRedIcon, alt: "icon" }), _jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
|
|
41
|
+
background: theme.palette.error.main,
|
|
42
|
+
fontWeight: 600,
|
|
43
|
+
color: theme.palette.common.white,
|
|
44
|
+
} }, { children: remindedCount }))] })) }))), [remindedCount]);
|
|
45
|
+
const centerIcon = useMemo(() => {
|
|
46
|
+
if (icon) {
|
|
47
|
+
return (_jsx(Tooltip, Object.assign({ title: t(statusTooltip || '') }, { children: _jsx(DateIcon, { src: icon, alt: "status icon" }) })));
|
|
48
|
+
}
|
|
49
|
+
if (chargeStatus && chargeStatusIcons[chargeStatus])
|
|
50
|
+
return statusIcon;
|
|
51
|
+
if (remindedCount)
|
|
52
|
+
return remindedIcon;
|
|
53
|
+
return undefined;
|
|
54
|
+
}, [icon, chargeStatus, remindedCount]);
|
|
55
|
+
if (!status && !chargeStatus && !remindedCount)
|
|
56
|
+
return null;
|
|
37
57
|
return (_jsx(TableCell, Object.assign({}, props, { sx: {
|
|
38
58
|
position: 'relative',
|
|
39
59
|
overflow: 'visible',
|
|
40
|
-
} }, { children:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
animate: Object.assign({}, (showExpansion && {
|
|
50
|
-
boxShadow: theme.shadows[4],
|
|
51
|
-
})),
|
|
52
|
-
}, background: statusStyles.background }, { children: (icon || (isTextShown && status)) && (_jsxs(_Fragment, { children: [isTextShown ? (_jsx(StatusTextLabel, Object.assign({ sx: {
|
|
53
|
-
color: statusStyles.color,
|
|
54
|
-
} }, { children: capitalize(status) }))) : (icon && _jsx(DateIcon, { src: icon, alt: "icon" })), _jsx(motion.div, Object.assign({ style: {
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
justifyContent: 'center',
|
|
57
|
-
gap: '4px',
|
|
58
|
-
display: 'none',
|
|
59
|
-
width: 0,
|
|
60
|
-
}, initial: { width: 0, opacity: 0 }, transition: {
|
|
61
|
-
animate: {
|
|
62
|
-
duration: 0.5,
|
|
63
|
-
},
|
|
64
|
-
fadeIn: {
|
|
65
|
-
duration: 0.2,
|
|
66
|
-
},
|
|
67
|
-
}, variants: {
|
|
68
|
-
animate: {
|
|
69
|
-
width: 'auto',
|
|
70
|
-
display: 'flex',
|
|
71
|
-
},
|
|
72
|
-
fadeIn: {
|
|
73
|
-
transition: {
|
|
74
|
-
delay: 0.5,
|
|
75
|
-
},
|
|
76
|
-
opacity: 1,
|
|
77
|
-
},
|
|
78
|
-
} }, { children: showExpansion && (_jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
|
|
79
|
-
color: '#fff',
|
|
80
|
-
backgroundColor: statusStyles.color,
|
|
81
|
-
} }, { children: viewsCount }))) }))] })) })) })), _jsx(StatusIconWrapper, Object.assign({ sx: {
|
|
82
|
-
position: 'absolute',
|
|
83
|
-
left: isTextShown ? '88px' : '32px',
|
|
84
|
-
width: isTextShown ? '65px' : '24px',
|
|
85
|
-
} }, { children: chargeStatus && chargeStatusIcons[chargeStatus] && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: t(camelCase(chargeStatus)) }, { children: _jsx(StatusTextLabel, Object.assign({ sx: {
|
|
86
|
-
color: invoiceStatusStyles('VIEWED').color,
|
|
87
|
-
backgroundColor: `${invoiceStatusStyles('VIEWED').color}0d`,
|
|
88
|
-
} }, { children: capitalize(chargeStatus) })) }))) : (_jsx(ChargeStatusIcon, { chargeStatus: chargeStatus, errorCode: errorCode, chargeTooltip: chargeTooltip })) })) }))] })) })));
|
|
60
|
+
} }, { children: _jsx(RightLeftExpandingCenterChip, { sx: { justifyContent: 'flex-start' }, expandableCenterRight: !!viewsCount && status === 'VIEWED' && icon
|
|
61
|
+
? [
|
|
62
|
+
_jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
|
|
63
|
+
marginRight: '8px',
|
|
64
|
+
color: '#fff',
|
|
65
|
+
backgroundColor: statusStyles.color,
|
|
66
|
+
} }, { children: viewsCount })),
|
|
67
|
+
]
|
|
68
|
+
: undefined, centerIcon: centerIcon, leftIcons: !!remindedCount && icon ? [remindedIcon] : undefined, rightIcons: chargeStatus && chargeStatusIcons[chargeStatus] && icon ? [statusIcon] : undefined }) })));
|
|
89
69
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
|
|
4
3
|
hidden?: boolean | undefined;
|
|
5
4
|
color?: string | undefined;
|
|
@@ -266,3 +265,5 @@ export declare const DueDateCellContainer: import("@emotion/styled").StyledCompo
|
|
|
266
265
|
}, {}, {}>;
|
|
267
266
|
export declare const DateIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
268
267
|
export declare const StatusTextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
268
|
+
export declare const ErrorChip: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
269
|
+
export declare const StatusIconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -30,3 +30,21 @@ export const StatusTextLabel = styled('div')(() => ({
|
|
|
30
30
|
padding: '4.5px 8px',
|
|
31
31
|
borderRadius: '24px',
|
|
32
32
|
}));
|
|
33
|
+
export const ErrorChip = styled('div')(({ theme }) => ({
|
|
34
|
+
color: theme.palette.common.white,
|
|
35
|
+
background: theme.palette.error.main,
|
|
36
|
+
fontSize: '0.6rem',
|
|
37
|
+
fontWeight: 600,
|
|
38
|
+
borderRadius: '16px',
|
|
39
|
+
padding: '2px 8px',
|
|
40
|
+
display: 'flex',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
}));
|
|
44
|
+
export const StatusIconWrapper = styled('div')(() => ({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
width: '16px',
|
|
49
|
+
height: '16px',
|
|
50
|
+
}));
|
|
@@ -2,7 +2,7 @@ import { TableCellProps } from '@mui/material/TableCell';
|
|
|
2
2
|
import { statusIcons } from './constant';
|
|
3
3
|
import { ChargeStatus } from '../type';
|
|
4
4
|
export type StatusIconType = keyof typeof statusIcons;
|
|
5
|
-
export interface
|
|
5
|
+
export interface InvoiceStatusCellProps extends TableCellProps {
|
|
6
6
|
status?: StatusIconType;
|
|
7
7
|
date: Date | '';
|
|
8
8
|
viewsCount?: number;
|
|
@@ -12,4 +12,5 @@ export interface DueCellProps extends TableCellProps {
|
|
|
12
12
|
gatewayTooltip?: string;
|
|
13
13
|
errorCode?: string;
|
|
14
14
|
isTextShown?: boolean;
|
|
15
|
+
remindedCount?: number;
|
|
15
16
|
}
|
|
@@ -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,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TreeDropdownProps, TreeDropdownRef } from './type';
|
|
3
|
+
declare const TreeDropdown: import("react").ForwardRefExoticComponent<Readonly<TreeDropdownProps> & import("react").RefAttributes<TreeDropdownRef>>;
|
|
4
|
+
export default TreeDropdown;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useImperativeHandle, useMemo, useState } from 'react';
|
|
3
|
+
import { SelectedState } from './type';
|
|
4
|
+
import TreeNodeList from './TreeNodeList/TreeNodeList';
|
|
5
|
+
import { initializeTreeMapper, promoteSingleChild, TreeManager, updateSelection } from './utils';
|
|
6
|
+
import TreeDropdownProvider from './context/TreeDropdownProvider';
|
|
7
|
+
const TreeDropdown = forwardRef((props, ref) => {
|
|
8
|
+
const { anchorEl, placement = 'bottom-start', treeDefinition, sx, onChange, multiple = true, exposeOnlySelectedTree = false, IconComponent } = props;
|
|
9
|
+
const { header, footer, children: menuItems = [], searchProps, levelKey } = treeDefinition;
|
|
10
|
+
const [internalMapper, setInternalMapper] = useState(() => initializeTreeMapper(menuItems || [], multiple));
|
|
11
|
+
const formattedMenuItems = useMemo(() => promoteSingleChild(menuItems || []), [menuItems]);
|
|
12
|
+
const getFullTree = useCallback(() => TreeManager.denormalizeTree(menuItems, internalMapper), [menuItems, internalMapper]);
|
|
13
|
+
const getSelectedTree = useCallback(() => TreeManager.extractSelectedBranches(getFullTree()), [getFullTree]);
|
|
14
|
+
const handleSelect = useCallback((isChecked, targetNode) => {
|
|
15
|
+
const nextInternal = updateSelection(internalMapper, targetNode.id, isChecked, multiple);
|
|
16
|
+
setInternalMapper(nextInternal);
|
|
17
|
+
if (onChange) {
|
|
18
|
+
if (exposeOnlySelectedTree) {
|
|
19
|
+
onChange(TreeManager.extractSelectedBranches(TreeManager.denormalizeTree(menuItems, nextInternal)));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
onChange(TreeManager.denormalizeTree(menuItems, nextInternal));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, [onChange, menuItems, internalMapper, multiple, exposeOnlySelectedTree]);
|
|
26
|
+
const toggleAll = useCallback((selected) => {
|
|
27
|
+
const setStatus = (tree, isChecked) => {
|
|
28
|
+
const next = Object.assign({}, tree);
|
|
29
|
+
Object.keys(next).forEach((nodeId) => {
|
|
30
|
+
next[nodeId] = Object.assign(Object.assign({}, next[nodeId]), { status: isChecked ? SelectedState.CHECKED : SelectedState.UNCHECKED });
|
|
31
|
+
});
|
|
32
|
+
return next;
|
|
33
|
+
};
|
|
34
|
+
const nextInternal = setStatus(internalMapper, selected);
|
|
35
|
+
setInternalMapper(nextInternal);
|
|
36
|
+
if (onChange) {
|
|
37
|
+
if (exposeOnlySelectedTree) {
|
|
38
|
+
onChange(TreeManager.extractSelectedBranches(TreeManager.denormalizeTree(menuItems, nextInternal)));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
onChange(TreeManager.denormalizeTree(menuItems, nextInternal));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, [internalMapper, onChange, menuItems, exposeOnlySelectedTree]);
|
|
45
|
+
useImperativeHandle(ref, () => ({
|
|
46
|
+
state: internalMapper,
|
|
47
|
+
getFullTree,
|
|
48
|
+
getSelectedTree,
|
|
49
|
+
toggleAll,
|
|
50
|
+
}), [internalMapper, getFullTree, getSelectedTree, toggleAll]);
|
|
51
|
+
return (_jsx(TreeDropdownProvider, Object.assign({ internalMapper: internalMapper, IconComponent: IconComponent, handleSelect: handleSelect, multiple: multiple }, { children: _jsx(TreeNodeList, { anchorEl: anchorEl, sx: sx, header: header, footer: footer, menuItems: formattedMenuItems, levelKey: levelKey, searchProps: searchProps, placement: placement }) })));
|
|
52
|
+
});
|
|
53
|
+
export default TreeDropdown;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type SelectionControlProps = {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
indeterminate: boolean;
|
|
5
|
+
onSelect: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const SelectionControl: (props: SelectionControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default SelectionControl;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import useTreeDropdown from '../hooks/useTreeDropdown';
|
|
3
|
+
import { StyledCheckbox as Checkbox, StyledRadioButton as RadioButton } from './style';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
const SelectionControl = (props) => {
|
|
6
|
+
const { checked, indeterminate, onSelect } = props;
|
|
7
|
+
const { multiple } = useTreeDropdown();
|
|
8
|
+
const handleSelect = useCallback((e) => {
|
|
9
|
+
e.stopPropagation();
|
|
10
|
+
onSelect(e);
|
|
11
|
+
}, [onSelect]);
|
|
12
|
+
if (multiple) {
|
|
13
|
+
return _jsx(Checkbox, { size: "small", checked: checked, indeterminate: indeterminate, onChange: handleSelect });
|
|
14
|
+
}
|
|
15
|
+
return _jsx(RadioButton, { size: "small", checked: checked, onChange: handleSelect });
|
|
16
|
+
};
|
|
17
|
+
export default SelectionControl;
|