@tap-payments/os-micro-frontend-shared 0.0.245 → 0.0.246-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/StatusButton/StatusButton.js +2 -2
- package/build/components/StatusButton/type.d.ts +1 -0
- package/build/components/TableCells/CustomCells/RefundStatusCell/RefundStatusCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/RefundStatusCell.js +2 -2
- package/build/components/TableCells/CustomCells/RefundStatusCell/components/RefundStatus.d.ts +1 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/components/RefundStatus.js +2 -2
- package/build/components/TableCells/CustomCells/RefundStatusCell/type.d.ts +1 -0
- package/package.json +2 -2
|
@@ -19,12 +19,12 @@ import { ChevronContainer, Label, LabelWrapper, StyledStatusIcon, StyledDropdown
|
|
|
19
19
|
import { statusButtonIcons } from './constant';
|
|
20
20
|
const StatusButton = memo((props) => {
|
|
21
21
|
var _a;
|
|
22
|
-
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick"]);
|
|
22
|
+
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick, defaultSelectedStatus } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick", "defaultSelectedStatus"]);
|
|
23
23
|
const [buttonClicks, setButtonClicks] = useState(0);
|
|
24
24
|
const { t } = useTranslation();
|
|
25
25
|
const buttonRef = useRef(null);
|
|
26
26
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
27
|
-
const [selectedStatus, setSelectedStatus] = useState((_a = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _a === void 0 ? void 0 : _a.status);
|
|
27
|
+
const [selectedStatus, setSelectedStatus] = useState(defaultSelectedStatus !== null && defaultSelectedStatus !== void 0 ? defaultSelectedStatus : (_a = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _a === void 0 ? void 0 : _a.status);
|
|
28
28
|
const hasDropdown = useMemo(() => Boolean(dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.length), [dropdownOptions]);
|
|
29
29
|
const isDropdownOpen = Boolean(anchorEl) && buttonClicks > 1;
|
|
30
30
|
const isActiveVariant = variant === 'active';
|
|
@@ -13,6 +13,7 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
|
|
|
13
13
|
showDropdownIcon?: boolean;
|
|
14
14
|
totalCount?: number;
|
|
15
15
|
onButtonBodyClick?: (status: TableHeaderStatus) => void;
|
|
16
|
+
defaultSelectedStatus?: TableHeaderStatus;
|
|
16
17
|
dropdownOptions?: Array<MenuItemI & {
|
|
17
18
|
status: TableHeaderStatus;
|
|
18
19
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BalanceCellProps } from './type';
|
|
2
|
-
declare function RefundStatusCell({ status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function RefundStatusCell({ status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default RefundStatusCell;
|
|
@@ -21,12 +21,12 @@ import { useRefundStyles } from './hooks/useRefundStyles';
|
|
|
21
21
|
import { TextLabel, StatusCellContainer } from '../style';
|
|
22
22
|
import { IconWrapper } from './style';
|
|
23
23
|
function RefundStatusCell(_a) {
|
|
24
|
-
var { status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone } = _a, props = __rest(_a, ["status", "date", "refundTooltip", "isTextShown", "gatewayTooltip", "acquirerTooltip", "errorCode", "acquirerCode", "gatewayCode", "unCapturedTooltip", "timezone"]);
|
|
24
|
+
var { status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel } = _a, props = __rest(_a, ["status", "date", "refundTooltip", "isTextShown", "gatewayTooltip", "acquirerTooltip", "errorCode", "acquirerCode", "gatewayCode", "unCapturedTooltip", "timezone", "refundTooltipLabel"]);
|
|
25
25
|
const { t } = useTranslation();
|
|
26
26
|
const refundStyles = useRefundStyles();
|
|
27
27
|
const formatDate = useCallback((dateMs) => dayjs(dateMs).format('MMM D, YYYY'), []);
|
|
28
28
|
return (_jsx(TableCell, Object.assign({}, props, { style: {
|
|
29
29
|
overflow: 'visible',
|
|
30
|
-
} }, { children: _jsx(StatusCellContainer, { children: _jsx(IconWrapper, Object.assign({ width: isTextShown ? 'auto' : '36px' }, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: date ? formatDate(date) : t(camelCase(status)) }, { children: _jsx(TextLabel, Object.assign({ sx: Object.assign({}, (refundStyles[status] ? refundStyles[status] : refundStyles.PENDING)) }, { children: t(camelCase(status)) })) }))) : (_jsx(RefundStatus, { status: status, refundTooltip: refundTooltip, date: date, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode, timezone: timezone })) })) }) })));
|
|
30
|
+
} }, { children: _jsx(StatusCellContainer, { children: _jsx(IconWrapper, Object.assign({ width: isTextShown ? 'auto' : '36px' }, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: date ? formatDate(date) : t(camelCase(status)) }, { children: _jsx(TextLabel, Object.assign({ sx: Object.assign({}, (refundStyles[status] ? refundStyles[status] : refundStyles.PENDING)) }, { children: t(camelCase(status)) })) }))) : (_jsx(RefundStatus, { status: status, refundTooltip: refundTooltip, date: date, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode, timezone: timezone, refundTooltipLabel: refundTooltipLabel })) })) }) })));
|
|
31
31
|
}
|
|
32
32
|
export default RefundStatusCell;
|
package/build/components/TableCells/CustomCells/RefundStatusCell/components/RefundStatus.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BalanceCellProps } from '../type';
|
|
2
|
-
export default function RefundStatus({ status, refundTooltip, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }: Partial<BalanceCellProps>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function RefundStatus({ status, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }: Partial<BalanceCellProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { changeDateTimezone } from '../../../../../utils/index.js';
|
|
|
8
8
|
import { RefundStateIcon } from './RefundStateIcon';
|
|
9
9
|
import { refundStatusLabels } from '../constant';
|
|
10
10
|
import { RefundCellContainer, PartialIcon, PercentageContainer, DateContainer } from '../style';
|
|
11
|
-
export default function RefundStatus({ status, refundTooltip, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }) {
|
|
11
|
+
export default function RefundStatus({ status, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }) {
|
|
12
12
|
const theme = useTheme();
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const formattedDate = changeDateTimezone(new Date(Number(date)), {
|
|
@@ -18,7 +18,7 @@ export default function RefundStatus({ status, refundTooltip, date, gatewayToolt
|
|
|
18
18
|
if (!['REFUNDED', 'PAID_OUT'].includes(status !== null && status !== void 0 ? status : '')) {
|
|
19
19
|
return (_jsx(RefundStateIcon, { status: status, refundTooltip: refundTooltip, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode }));
|
|
20
20
|
}
|
|
21
|
-
return (_jsx(Tooltip, Object.assign({ title: _jsxs("div", { children: [_jsx("div", { children: t(refundStatusLabels.REFUNDED) }), refundTooltip] }) }, { children: _jsxs(RefundCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: 'start', variants: Object.assign({}, (date && {
|
|
21
|
+
return (_jsx(Tooltip, Object.assign({ title: _jsxs("div", { children: [_jsx("div", { children: refundTooltipLabel !== null && refundTooltipLabel !== void 0 ? refundTooltipLabel : t(refundStatusLabels.REFUNDED) }), refundTooltip] }) }, { children: _jsxs(RefundCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: 'start', variants: Object.assign({}, (date && {
|
|
22
22
|
animate: {
|
|
23
23
|
boxShadow: theme.shadows[4],
|
|
24
24
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.0.
|
|
4
|
+
"version": "0.0.246-test.1",
|
|
5
5
|
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -131,4 +131,4 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"registry": "https://registry.npmjs.org/"
|
|
133
133
|
}
|
|
134
|
-
}
|
|
134
|
+
}
|