@tap-payments/os-micro-frontend-shared 0.1.220 → 0.1.221

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.
@@ -21,7 +21,7 @@ export declare const CountBadge: import("@emotion/styled").StyledComponent<impor
21
21
  }, {}, {}>;
22
22
  export declare const StatusIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
23
23
  variant: StatusButtonVariant;
24
- icon?: "search" | "scheduled" | "paidOut" | "reversed" | "checked" | "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "authorized" | "unauthenticated" | "authenticated" | "unSettled" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | "dashedChecked" | "deactivated" | undefined;
24
+ icon?: "search" | "scheduled" | "paidOut" | "reversed" | "checked" | "inProgress" | "initiated" | "abandoned" | "cancelled" | "reports" | "chevronDown" | "unAuthorized" | "unSettled" | "unCaptured" | "captured" | "authorized" | "openFlag" | "closedFlag" | "unauthenticated" | "authenticated" | "dashedChecked" | "deactivated" | undefined;
25
25
  }, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
26
26
  export declare const StyledFilterName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
27
27
  export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
@@ -80,15 +80,18 @@ export const ActionCell = memo((_a) => {
80
80
  pointerEvents: 'none',
81
81
  })) }, { children: [_jsx(TransparentButton, Object.assign({ onClick: handleClick, "data-testid": "ActionCell_ActionsIconContainer_TransparentButton", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
82
82
  pointerEvents: 'none',
83
- })) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), renderDropdown ? (renderDropdown(anchorEl, setAnchorEl)) : (_jsxs(_Fragment, { children: [dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => (Object.assign(Object.assign({}, action), { onClick: (e) => {
84
- var _a;
85
- (_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
86
- if (!action.hasActionMenu) {
83
+ })) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), renderDropdown ? (renderDropdown(anchorEl, setAnchorEl)) : (_jsxs(_Fragment, { children: [dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => {
84
+ var _a;
85
+ return (Object.assign(Object.assign({}, action), { onClick: (e) => {
86
+ var _a;
87
+ (_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
88
+ if (!action.hasActionMenu) {
89
+ handleClose();
90
+ }
91
+ }, onRightClick: (e) => {
92
+ var _a;
93
+ (_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
87
94
  handleClose();
88
- }
89
- }, onRightClick: (e) => {
90
- var _a;
91
- (_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
92
- handleClose();
93
- }, icon: (_jsx(ActionIcon, { icon: action.icon, src: actionIcons[action.icon], initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }))) }))] }))] }))] }))] })) })));
95
+ }, icon: action.customIcon || (_jsx(ActionIcon, { icon: action.icon, src: (_a = action.iconSrc) !== null && _a !== void 0 ? _a : (action.icon && actionIcons[action.icon]), initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }));
96
+ }) }))] }))] }))] }))] })) })));
94
97
  });
@@ -33,16 +33,19 @@ function ActionIconColumn(_a) {
33
33
  pointerEvents: 'none',
34
34
  })) }, { children: [_jsx(TransparentButton, Object.assign({ onClick: handleClick, "data-testid": "ActionIconColumn_ActionsIconContainer_TransparentButton", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
35
35
  pointerEvents: 'none',
36
- })) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), renderDropdown ? (renderDropdown(anchorEl, setAnchorEl)) : (_jsxs(_Fragment, { children: [dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => (Object.assign(Object.assign({}, action), { onClick: (e) => {
37
- var _a;
38
- (_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
39
- if (!action.hasActionMenu) {
36
+ })) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), renderDropdown ? (renderDropdown(anchorEl, setAnchorEl)) : (_jsxs(_Fragment, { children: [dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => {
37
+ var _a;
38
+ return (Object.assign(Object.assign({}, action), { onClick: (e) => {
39
+ var _a;
40
+ (_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
41
+ if (!action.hasActionMenu) {
42
+ handleClose();
43
+ }
44
+ }, onRightClick: (e) => {
45
+ var _a;
46
+ (_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
40
47
  handleClose();
41
- }
42
- }, onRightClick: (e) => {
43
- var _a;
44
- (_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
45
- handleClose();
46
- }, icon: (_jsx(ActionIcon, { icon: action.icon, src: actionIcons[action.icon], initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }))) }))] }))] })) })) })));
48
+ }, icon: action.customIcon || (_jsx(ActionIcon, { icon: action.icon, src: (_a = action.iconSrc) !== null && _a !== void 0 ? _a : (action.icon && actionIcons[action.icon]), initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }));
49
+ }) }))] }))] })) })) })));
47
50
  }
48
51
  export default memo(ActionIconColumn);
@@ -13,12 +13,14 @@ export declare function useActionCell({ actions, isDropdownShown, onCloseDropdow
13
13
  label: string;
14
14
  onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
15
15
  onRightClick?: ((e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void) | undefined;
16
- icon: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | "viewApi" | "viewReceipt";
16
+ icon?: "brand" | "users" | "cancel" | "reverse" | "refund" | "destination" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | "viewApi" | "viewReceipt" | undefined;
17
17
  isLoading?: boolean | undefined;
18
18
  isError?: boolean | undefined;
19
19
  isSuccess?: boolean | undefined;
20
20
  isShown?: boolean | undefined;
21
21
  hasActionMenu?: boolean | undefined;
22
+ iconSrc?: string | undefined;
23
+ customIcon?: React.ReactNode;
22
24
  }[];
23
25
  isAnyActionLoading: boolean;
24
26
  isAnyActionHasError: boolean;
@@ -39,12 +39,14 @@ export interface ActionCellProps extends TableCellProps {
39
39
  label: string;
40
40
  onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
41
41
  onRightClick?: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
42
- icon: ActionType;
42
+ icon?: ActionType;
43
43
  isLoading?: boolean;
44
44
  isError?: boolean;
45
45
  isSuccess?: boolean;
46
46
  isShown?: boolean;
47
47
  hasActionMenu?: boolean;
48
+ iconSrc?: string;
49
+ customIcon?: React.ReactNode;
48
50
  }>;
49
51
  flagTooltip?: React.ReactNode;
50
52
  flagsCount?: number;
@@ -555,3 +555,4 @@ export declare const activeGreenIcon: string;
555
555
  export declare const inActiveGreyIcon: string;
556
556
  export declare const terminalLinkVideo: string;
557
557
  export declare const bluePlusIcon: string;
558
+ export declare const blackSettingsVariant2Icon: string;
@@ -563,3 +563,4 @@ export const activeGreenIcon = `${lightUrl}/activeGreenIcon.svg`;
563
563
  export const inActiveGreyIcon = `${lightUrl}/inActiveGreyIcon.svg`;
564
564
  export const terminalLinkVideo = `${videosUrl}/terminal_link.mp4`;
565
565
  export const bluePlusIcon = `${lightUrl}/bluePlusIcon.svg`;
566
+ export const blackSettingsVariant2Icon = `${lightUrl}/blackSettingsVariant2Icon.svg`;
@@ -5,6 +5,7 @@ import { TableHeadProps } from '@mui/material/TableHead';
5
5
  import { TableRowProps } from '@mui/material/TableRow';
6
6
  import { DragControls } from 'framer-motion';
7
7
  import { CustomColumnFilterProps } from '../components/VirtualTables';
8
+ import { ActionCellProps } from '../components/index.js';
8
9
  import { Country } from './appConfig';
9
10
  import { SortingOrder } from './sort';
10
11
  export interface TableFilters<T> {
@@ -152,3 +153,11 @@ export type IColumnFilter = ({
152
153
  isOnlyOneFilter?: boolean;
153
154
  wrapperSx?: SxProps;
154
155
  } & (IColumnFilterList | IColumnFilterInputs | IColumnFilterCustom));
156
+ type ActionCellActionProps = Exclude<ActionCellProps['actions'], undefined>[number];
157
+ export interface TableNavigation {
158
+ label: string;
159
+ onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
160
+ onRightClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
161
+ icon?: ActionCellActionProps['icon'];
162
+ }
163
+ export {};
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.1.220",
4
+ "version": "0.1.221",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",