@tap-payments/os-micro-frontend-shared 0.0.228-test.17 → 0.0.228-test.19-test.20
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/DropdownButton/style.d.ts +1 -1
- package/build/components/DropdownMenu/DropdownMenu.d.ts +2 -1
- package/build/components/DropdownMenu/DropdownMenu.js +5 -4
- package/build/components/DropdownMenu/styles.d.ts +2 -1
- package/build/components/StatusButton/StatusButton.js +3 -10
- package/build/components/StatusButton/style.d.ts +1 -1
- package/build/components/StatusButton/type.d.ts +1 -2
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/package.json +2 -2
|
@@ -21,7 +21,7 @@ export declare const StatusIcon: import("@emotion/styled").StyledComponent<impor
|
|
|
21
21
|
variant: DropdownButtonVariants;
|
|
22
22
|
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
23
23
|
export declare const StyledFilterName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
24
|
-
export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
24
|
+
export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & React.RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
25
25
|
export declare const ChevronContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
26
26
|
export declare const ButtonContent: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
27
27
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IProps } from './type';
|
|
2
|
-
declare
|
|
3
|
+
declare const Dropdown: import("react").ForwardRefExoticComponent<IProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
4
|
export default Dropdown;
|
|
@@ -12,10 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Divider, Box, useTheme } from '@mui/material';
|
|
14
14
|
import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem, CheckboxStyled } from './styles';
|
|
15
|
-
|
|
15
|
+
import { forwardRef } from 'react';
|
|
16
|
+
const Dropdown = forwardRef((_a, ref) => {
|
|
16
17
|
var { open, menuItems, anchorEl, onClose, footer, selected, multiple, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "footer", "selected", "multiple", "allowShadows"]);
|
|
17
18
|
const theme = useTheme();
|
|
18
|
-
return (_jsxs(StyledMenu, Object.assign({ open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
|
|
19
|
+
return (_jsxs(StyledMenu, Object.assign({ ref: ref, open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
|
|
19
20
|
e.preventDefault();
|
|
20
21
|
onClose();
|
|
21
22
|
} }, props, { className: "tap-dropdown", minWidth: (anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth) || 'auto' }, { children: [menuItems.map((item, idx) => {
|
|
@@ -37,7 +38,7 @@ function Dropdown(_a) {
|
|
|
37
38
|
} }, (idx === selected && {
|
|
38
39
|
backgroundColor: 'transparent',
|
|
39
40
|
boxShadow: allowShadows ? theme.shadows[10] : 'none',
|
|
40
|
-
})), item.sx) }, { children: [
|
|
41
|
+
})), item.sx) }, { children: [multiple && _jsx(CheckboxStyled, { size: "small", checked: item.selected }), item.icon && _jsx(StyledListItemIcon, { children: item.icon }), _jsx(StyledListItemText, { children: item.label }), _jsx(Box, Object.assign({ className: item.alwaysShowRightAction ? '' : 'menu-right-action' }, { children: item.rightAction && item.rightAction }))] }))) }, `${item.label}-${idx}`));
|
|
41
42
|
}), footer] })));
|
|
42
|
-
}
|
|
43
|
+
});
|
|
43
44
|
export default Dropdown;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MenuProps } from '@mui/material';
|
|
2
3
|
export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
3
4
|
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
4
5
|
}, "disabled" | "className" | "style" | "classes" | "children" | "sx" | "autoFocus" | "tabIndex" | "selected" | "dense" | "disableGutters" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "divider"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
6
|
alwaysShowRightAction?: boolean | undefined;
|
|
6
7
|
}, {}, {}>;
|
|
7
|
-
export declare const StyledMenu: import("@emotion/styled").StyledComponent<
|
|
8
|
+
export declare const StyledMenu: import("@emotion/styled").StyledComponent<MenuProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
9
|
minWidth?: string | number | undefined;
|
|
9
10
|
}, {}, {}>;
|
|
10
11
|
export declare const StyledListItemIcon: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemIconProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -19,7 +19,7 @@ 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, multiple, onButtonBodyClick,
|
|
22
|
+
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, multiple, onButtonBodyClick, onClose } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "multiple", "onButtonBodyClick", "onClose"]);
|
|
23
23
|
const [buttonClicks, setButtonClicks] = useState(0);
|
|
24
24
|
const { t } = useTranslation();
|
|
25
25
|
const buttonRef = useRef(null);
|
|
@@ -44,7 +44,8 @@ const StatusButton = memo((props) => {
|
|
|
44
44
|
}, [isActiveVariant]);
|
|
45
45
|
const handleDropdownClose = useCallback(() => {
|
|
46
46
|
setAnchorEl(null);
|
|
47
|
-
|
|
47
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
48
|
+
}, [onClose]);
|
|
48
49
|
const handleDropdownToggle = useCallback(() => {
|
|
49
50
|
if (!hasDropdown)
|
|
50
51
|
return;
|
|
@@ -66,14 +67,6 @@ const StatusButton = memo((props) => {
|
|
|
66
67
|
setSelectedStatus(item.status);
|
|
67
68
|
handleDropdownClose();
|
|
68
69
|
}, [handleDropdownClose, multiple]);
|
|
69
|
-
const handleConfirm = useCallback(() => {
|
|
70
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm();
|
|
71
|
-
handleDropdownClose();
|
|
72
|
-
}, [onConfirm, handleDropdownClose]);
|
|
73
|
-
const handleCancel = useCallback(() => {
|
|
74
|
-
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
75
|
-
handleDropdownClose();
|
|
76
|
-
}, [onCancel, handleDropdownClose]);
|
|
77
70
|
const menuItems = useMemo(() => (dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((item) => (Object.assign(Object.assign({}, item), { onClick: handleMenuItemClick(item) })))) || [], [dropdownOptions, handleMenuItemClick]);
|
|
78
71
|
const ButtonComponent = statusButtonVariants[variant];
|
|
79
72
|
const displayLabel = selectedStatus ? t(selectedStatus) : label;
|
|
@@ -23,7 +23,7 @@ export declare const StatusIcon: import("@emotion/styled").StyledComponent<impor
|
|
|
23
23
|
icon?: "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "reversed" | "authorized" | "paidOut" | "unauthenticated" | "authenticated" | "scheduled" | "unSettled" | "search" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | undefined;
|
|
24
24
|
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
25
25
|
export declare const StyledFilterName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
26
|
-
export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
26
|
+
export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & React.RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
27
27
|
export declare const ChevronContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
28
28
|
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
29
29
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -17,8 +17,7 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
|
|
|
17
17
|
status: TableHeaderStatus;
|
|
18
18
|
}>;
|
|
19
19
|
multiple?: boolean;
|
|
20
|
-
|
|
21
|
-
onCancel?: () => void;
|
|
20
|
+
onClose?: () => void;
|
|
22
21
|
}
|
|
23
22
|
export interface ChevronIconProps {
|
|
24
23
|
isActive?: boolean;
|
|
@@ -76,7 +76,7 @@ export { default as CountryFlag } from './CountryFlag';
|
|
|
76
76
|
export { default as CurrencyIcon } from './CurrencyIcon';
|
|
77
77
|
export { default as CustomBackdrop } from './CustomBackdrop';
|
|
78
78
|
export { default as DeviceIcon } from './DeviceIcon';
|
|
79
|
-
export { default as CountBadge,
|
|
79
|
+
export { default as CountBadge, BadgeVariants, CountAnimatedBadge, type StyledBadgeProps, paymentSourceAnimation } from './CountBadge';
|
|
80
80
|
export { default as CircularProgressWithLabel } from './CircularProgressWithLabel';
|
|
81
81
|
export { default as Collapse, type CollapseProps } from './Collapse';
|
|
82
82
|
export { default as ConfirmDialog, type ConfirmDialogFunction, type ConfirmDialogProps, useConfirmDialog, ConfirmDialogContext, ConfirmDialogProvider, } from './ConfirmDialog';
|
|
@@ -76,7 +76,7 @@ export { default as CountryFlag } from './CountryFlag';
|
|
|
76
76
|
export { default as CurrencyIcon } from './CurrencyIcon';
|
|
77
77
|
export { default as CustomBackdrop } from './CustomBackdrop';
|
|
78
78
|
export { default as DeviceIcon } from './DeviceIcon';
|
|
79
|
-
export { default as CountBadge, CountAnimatedBadge, paymentSourceAnimation } from './CountBadge';
|
|
79
|
+
export { default as CountBadge, BadgeVariants, CountAnimatedBadge, paymentSourceAnimation } from './CountBadge';
|
|
80
80
|
export { default as CircularProgressWithLabel } from './CircularProgressWithLabel';
|
|
81
81
|
export { default as Collapse } from './Collapse';
|
|
82
82
|
export { default as ConfirmDialog, useConfirmDialog, ConfirmDialogContext, ConfirmDialogProvider, } from './ConfirmDialog';
|
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.0.228-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.228-test.19-test.20",
|
|
5
|
+
"testVersion": 20,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|