@tap-payments/os-micro-frontend-shared 0.0.171 → 0.0.173-alpha-15
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/Button/StyledButton/StyledButton.d.ts +1 -1
- package/build/components/Button/StyledButton/StyledButton.js +1 -1
- package/build/components/FileUpload/FileUpload.js +1 -1
- package/build/components/MultiSelectStatusButton/MultiSelectStatusButton.js +1 -1
- package/build/components/MultiSelectStatusButton/style.d.ts +1 -1
- package/build/components/MultiSelectStatusButton/style.js +1 -1
- package/build/components/StatusBar/StatusBar.d.ts +1 -1
- package/build/components/StatusBar/StatusBar.js +1 -1
- package/build/components/StatusBar/type.d.ts +5 -0
- package/build/components/StatusButton/ChevronIcon.d.ts +2 -2
- package/build/components/StatusButton/ChevronIcon.js +4 -2
- package/build/components/StatusButton/StatusButton.d.ts +3 -4
- package/build/components/StatusButton/StatusButton.js +54 -38
- package/build/components/StatusButton/style.d.ts +4 -0
- package/build/components/StatusButton/style.js +7 -0
- package/build/components/StatusButton/type.d.ts +1 -0
- package/build/components/{TableHeader_V2 → TableHeader}/index.d.ts +0 -1
- package/build/components/{TableHeader_V2 → TableHeader}/index.js +0 -1
- package/build/components/{TableHeader_V2 → TableHeader}/type.d.ts +1 -4
- package/build/components/{TableHeader_V2/components/TableView → TableView}/CustomViews.d.ts +1 -1
- package/build/components/{TableHeader_V2/components/TableView → TableView}/CustomViews.js +2 -2
- package/build/components/{TableHeader_V2/components/TableView → TableView}/DefaultViews.d.ts +1 -1
- package/build/components/{TableHeader_V2/components/TableView → TableView}/DefaultViews.js +2 -2
- package/build/components/{TableHeader_V2/components/TableView → TableView}/TableView.d.ts +1 -1
- package/build/components/{TableHeader_V2/components/TableView → TableView}/TableView.js +5 -6
- package/build/components/index.d.ts +1 -2
- package/build/components/index.js +1 -2
- package/package.json +1 -1
- package/build/components/ExportButton/ExportButton.d.ts +0 -5
- package/build/components/ExportButton/ExportButton.js +0 -13
- package/build/components/ExportButton/index.d.ts +0 -2
- package/build/components/ExportButton/index.js +0 -2
- package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.d.ts +0 -2
- package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.js +0 -18
- package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.d.ts +0 -3
- package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.js +0 -54
- package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.d.ts +0 -11
- package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.js +0 -38
- package/build/components/TableHeader_V2/components/StatusButtons/constant.d.ts +0 -21
- package/build/components/TableHeader_V2/components/StatusButtons/constant.js +0 -22
- package/build/components/TableHeader_V2/components/StatusButtons/index.d.ts +0 -3
- package/build/components/TableHeader_V2/components/StatusButtons/index.js +0 -3
- package/build/components/TableHeader_V2/components/StatusButtons/style.d.ts +0 -35
- package/build/components/TableHeader_V2/components/StatusButtons/style.js +0 -75
- package/build/components/TableHeader_V2/components/StatusButtons/type.d.ts +0 -25
- package/build/components/TableHeader_V2/components/index.d.ts +0 -2
- package/build/components/TableHeader_V2/components/index.js +0 -2
- /package/build/components/{TableHeader_V2/components/StatusButtons → StatusBar}/type.js +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/FiltersRow.d.ts +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/FiltersRow.js +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/TableHeader.d.ts +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/TableHeader.js +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/style.d.ts +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/style.js +0 -0
- /package/build/components/{TableHeader_V2 → TableHeader}/type.js +0 -0
- /package/build/components/{TableHeader_V2 → TableView}/data.d.ts +0 -0
- /package/build/components/{TableHeader_V2 → TableView}/data.js +0 -0
- /package/build/components/{TableHeader_V2/components/TableView → TableView}/index.d.ts +0 -0
- /package/build/components/{TableHeader_V2/components/TableView → TableView}/index.js +0 -0
- /package/build/components/{TableHeader_V2/components/TableView → TableView}/style.d.ts +0 -0
- /package/build/components/{TableHeader_V2/components/TableView → TableView}/style.js +0 -0
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo } from 'react';
|
|
14
|
-
import { Button } from './style';
|
|
15
14
|
import Tooltip from '../../Tooltip';
|
|
15
|
+
import { Button } from './style';
|
|
16
16
|
function StyledButton(_a) {
|
|
17
17
|
var { children, title } = _a, props = __rest(_a, ["children", "title"]);
|
|
18
18
|
return (_jsx(Tooltip, Object.assign({ title: title }, { children: _jsx(Button, Object.assign({}, props, { children: children })) })));
|
|
@@ -3,12 +3,12 @@ import { memo, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { useDropzone } from 'react-dropzone';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import Icon from '../Icon';
|
|
6
7
|
import { blueCircleCheckIcon, redVerifyIcon, trashBinIcon, uploadBlueIcon } from '../../constants/index.js';
|
|
7
8
|
import { readableFileSize } from '../../utils/index.js';
|
|
8
9
|
import { Wrapper, Title, Format, FileUploader, Content, Upload, TextWrapper, Maximum, UploadAgain, StyledButton, SendBulkContainer } from './style';
|
|
9
10
|
import CircularProgressWithLabel from '../CircularProgressWithLabel';
|
|
10
11
|
import Button from '../Button/StyledButton';
|
|
11
|
-
import Icon from '../Icon';
|
|
12
12
|
function FileUpload({ accept, footer, options, isCreateLoading, progress, error, subtitleComponent, isSuccess: isUploadSuccess, onConfirm, isSendDisabled, }) {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const [selectedFiles, setSelectedFiles] = useState([]);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { memo, useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Typography, Checkbox } from '@mui/material';
|
|
5
|
-
import { ChevronIcon } from '../
|
|
5
|
+
import { ChevronIcon } from '../StatusButton/ChevronIcon';
|
|
6
6
|
import StyledBadge, { BadgeVariants } from '../CountBadge';
|
|
7
7
|
import CountryFlag from '../CountryFlag';
|
|
8
8
|
import { formatNumber } from '../../utils/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type Theme } from '@mui/material';
|
|
3
|
-
export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown
|
|
3
|
+
export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown } from '../StatusButton/style';
|
|
4
4
|
export declare const StyledStatusButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
5
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
6
6
|
}, "disabled" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "size" | "variant" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Button } from '@mui/material';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown
|
|
3
|
+
export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown } from '../StatusButton/style';
|
|
4
4
|
const baseButtonStyle = (theme) => (Object.assign(Object.assign({}, theme.typography.subtitle1), { borderRadius: '50px', borderWidth: '1px', borderStyle: 'solid', minWidth: '135.11px', height: '32px', display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px', textTransform: 'none', transition: 'background-color 0.5s ease, color 0.3s ease', paddingInline: theme.spacing(2) }));
|
|
5
5
|
export const StyledStatusButton = styled(Button, {
|
|
6
6
|
shouldForwardProp: (prop) => prop !== 'buttonVariant',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AvailableStatus } from '../TableHeader_V2';
|
|
3
2
|
import { CurrencyOption } from '../MultiSelectStatusButton';
|
|
4
3
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
|
+
import { AvailableStatus } from './type';
|
|
5
5
|
interface StatusBarProps {
|
|
6
6
|
status?: TableHeaderStatus;
|
|
7
7
|
availableStatuses?: AvailableStatus[];
|
|
@@ -2,8 +2,8 @@ import { createElement as _createElement } from "react";
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useCallback, useState, useEffect } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { StatusButton } from '../TableHeader_V2';
|
|
6
5
|
import MultiSelectStatusButton from '../MultiSelectStatusButton';
|
|
6
|
+
import StatusButton from '../StatusButton';
|
|
7
7
|
function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, onMultiSelectChange, currencyOptions, selectedCurrencies = [], enableMultiSelectCurrency = false, }) {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
const [multiSelectValues, setMultiSelectValues] = useState(selectedCurrencies);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function ChevronIcon({ isActive }: ChevronIconProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { ChevronIconProps } from './type';
|
|
2
|
+
export declare function ChevronIcon({ isActive, disableHover }: ChevronIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
|
-
export function ChevronIcon({ isActive }) {
|
|
4
|
+
export function ChevronIcon({ isActive, disableHover }) {
|
|
5
5
|
const [isHovered, setIsHovered] = useState(false);
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
const handleMouseEnter = () => {
|
|
8
|
-
|
|
8
|
+
if (!disableHover) {
|
|
9
|
+
setIsHovered(true);
|
|
10
|
+
}
|
|
9
11
|
};
|
|
10
12
|
const handleMouseLeave = () => {
|
|
11
13
|
setIsHovered(false);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
export default _default;
|
|
2
|
+
import { type StatusButtonProps } from './type';
|
|
3
|
+
declare const StatusButton: import("react").MemoExoticComponent<(props: StatusButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
export default StatusButton;
|
|
@@ -10,49 +10,65 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useRef, useState } from 'react';
|
|
13
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import StyledBadge, { BadgeVariants } from '../CountBadge';
|
|
16
16
|
import { convertToNumber, formatNumber } from '../../utils/index.js';
|
|
17
17
|
import { ChevronIcon } from './ChevronIcon';
|
|
18
|
-
import { ChevronContainer, Label, LabelWrapper,
|
|
18
|
+
import { ChevronContainer, Label, LabelWrapper, StyledStatusIcon, StyledDropdown, statusButtonVariants } from './style';
|
|
19
19
|
import { statusButtonIcons } from './constant';
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
const [
|
|
24
|
-
const buttonRef = useRef(null);
|
|
25
|
-
const [lastActiveStatus, setLastActiveStatus] = useState((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status);
|
|
20
|
+
const StatusButton = memo((props) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick"]);
|
|
23
|
+
const [buttonClicks, setButtonClicks] = useState(0);
|
|
26
24
|
const { t } = useTranslation();
|
|
27
|
-
const
|
|
28
|
-
const
|
|
25
|
+
const buttonRef = useRef(null);
|
|
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);
|
|
28
|
+
const hasDropdown = useMemo(() => Boolean(dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.length), [dropdownOptions]);
|
|
29
|
+
const isDropdownOpen = Boolean(anchorEl) && buttonClicks > 1;
|
|
30
|
+
const isActiveVariant = variant === 'active';
|
|
31
|
+
const badgeVariant = useMemo(() => (isActiveVariant ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE), [isActiveVariant]);
|
|
32
|
+
const statusIcon = useMemo(() => (icon ? _jsx(StyledStatusIcon, { icon: icon, variant: variant, src: statusButtonIcons[icon], alt: `${icon}-icon` }) : null), [icon, variant]);
|
|
33
|
+
const statusBadge = useMemo(() => {
|
|
34
|
+
if (!badgeCount || Number.isNaN(convertToNumber(badgeCount)))
|
|
35
|
+
return null;
|
|
36
|
+
return _jsx(StyledBadge, Object.assign({ variant: badgeVariant }, { children: formatNumber(Number(badgeCount)) }));
|
|
37
|
+
}, [badgeCount, badgeVariant]);
|
|
38
|
+
const dropdownIcon = useMemo(() => (hasDropdown ? _jsx(ChevronIcon, { isActive: isActiveVariant }) : null), [hasDropdown, isActiveVariant]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!isActiveVariant) {
|
|
41
|
+
setButtonClicks(0);
|
|
42
|
+
setAnchorEl(null);
|
|
43
|
+
}
|
|
44
|
+
}, [isActiveVariant]);
|
|
45
|
+
const handleDropdownClose = useCallback(() => {
|
|
29
46
|
setAnchorEl(null);
|
|
30
|
-
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
}, []);
|
|
48
|
+
const handleDropdownToggle = useCallback(() => {
|
|
49
|
+
if (!hasDropdown)
|
|
50
|
+
return;
|
|
51
|
+
setAnchorEl(isDropdownOpen ? null : buttonRef.current);
|
|
52
|
+
}, [hasDropdown, isDropdownOpen]);
|
|
53
|
+
const handleButtonClick = useCallback((e) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
57
|
+
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(selectedStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
58
|
+
handleDropdownToggle();
|
|
59
|
+
setButtonClicks((prev) => prev + 1);
|
|
60
|
+
}, [props, onButtonBodyClick, selectedStatus, dropdownOptions, handleDropdownToggle]);
|
|
61
|
+
const handleMenuItemClick = useCallback((item) => (e) => {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
64
|
+
setSelectedStatus(item.status);
|
|
65
|
+
handleDropdownClose();
|
|
66
|
+
}, [handleDropdownClose]);
|
|
67
|
+
const menuItems = useMemo(() => (dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((item) => (Object.assign(Object.assign({}, item), { onClick: handleMenuItemClick(item) })))) || [], [dropdownOptions, handleMenuItemClick]);
|
|
68
|
+
const ButtonComponent = statusButtonVariants[variant];
|
|
69
|
+
const displayLabel = selectedStatus ? t(selectedStatus) : label;
|
|
70
|
+
return (_jsxs(_Fragment, { children: [_jsx(ButtonComponent, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: handleButtonClick, sx: Object.assign({}, (hasDropdown && {
|
|
41
71
|
paddingInlineEnd: '27px',
|
|
42
|
-
})) }, { children: _jsxs(LabelWrapper, Object.assign({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
e.stopPropagation();
|
|
47
|
-
e.preventDefault();
|
|
48
|
-
if (hasDropdown) {
|
|
49
|
-
setAnchorEl(buttonRef.current);
|
|
50
|
-
}
|
|
51
|
-
} }, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] })) })), open && !showDropdownIcon && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_c = (dropdownOptions || [])) === null || _c === void 0 ? void 0 : _c.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
52
|
-
var _a;
|
|
53
|
-
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
54
|
-
setLastActiveStatus(item.status);
|
|
55
|
-
handleClose();
|
|
56
|
-
} }))) }))] }));
|
|
57
|
-
}
|
|
58
|
-
export default memo(StatusButton);
|
|
72
|
+
})) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, displayLabel, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), isDropdownOpen && hasDropdown && (_jsx(StyledDropdown, { open: isDropdownOpen, onClose: handleDropdownClose, anchorEl: anchorEl, menuItems: menuItems }))] }));
|
|
73
|
+
});
|
|
74
|
+
export default StatusButton;
|
|
@@ -33,3 +33,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
|
|
|
33
33
|
export declare const LabelWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
34
34
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
35
35
|
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
36
|
+
export declare const StyledStatusIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
37
|
+
variant: StatusButtonVariant;
|
|
38
|
+
icon?: "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "reversed" | "authorized" | "paidOut" | "unauthenticated" | "authenticated" | "scheduled" | "unSettled" | "search" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | undefined;
|
|
39
|
+
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
@@ -72,3 +72,10 @@ export const LabelWrapper = styled(Box)(() => ({
|
|
|
72
72
|
justifyContent: 'center',
|
|
73
73
|
width: '100%',
|
|
74
74
|
}));
|
|
75
|
+
export const StyledStatusIcon = styled('img')(({ theme, variant, icon }) => {
|
|
76
|
+
var _a;
|
|
77
|
+
return (Object.assign(Object.assign({ fill: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary, color: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary }, (!(((_a = ['openFlag', 'closedFlag']) === null || _a === void 0 ? void 0 : _a.includes(icon !== null && icon !== void 0 ? icon : '')) && variant === 'inActive') &&
|
|
78
|
+
icon !== 'captured' && {
|
|
79
|
+
filter: variant === 'active' ? 'brightness(0) invert(1)' : 'brightness(0) invert(0)',
|
|
80
|
+
})), { maxWidth: '14px', maxHeight: '14px' }));
|
|
81
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import type { CalenderMode, TableHeaderStatus, ColumnViewProps } from '../../types/index.js';
|
|
3
|
-
import
|
|
3
|
+
import { AvailableStatus } from '../StatusBar/type';
|
|
4
4
|
declare const viewsOptions: {
|
|
5
5
|
default: {};
|
|
6
6
|
developer: {};
|
|
@@ -9,9 +9,6 @@ declare const viewsOptions: {
|
|
|
9
9
|
custom: {};
|
|
10
10
|
};
|
|
11
11
|
export type View = keyof typeof viewsOptions;
|
|
12
|
-
export type AvailableStatus<T = undefined> = StatusButtonProps & {
|
|
13
|
-
status: T | TableHeaderStatus | (TableHeaderStatus | T)[];
|
|
14
|
-
};
|
|
15
12
|
export interface TableHeaderProps {
|
|
16
13
|
availableStatuses?: AvailableStatus[];
|
|
17
14
|
status?: TableHeaderStatus;
|
|
@@ -6,9 +6,9 @@ import { Reorder } from 'framer-motion';
|
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
7
7
|
import Menu from '@mui/material/Menu';
|
|
8
8
|
import { useTheme } from '@mui/material/styles';
|
|
9
|
-
import { downArrowIcon } from '
|
|
9
|
+
import { downArrowIcon } from '../../constants/index.js';
|
|
10
10
|
import { ButtonStyled, ListStyled, DropdownStyled } from './style';
|
|
11
|
-
import { NestedMenuItem as MenuItem } from '
|
|
11
|
+
import { NestedMenuItem as MenuItem } from '../NestedDropdown';
|
|
12
12
|
function CustomViews({ open, onSelect, setTableViews: setColumns, tableViews, anchorEl, onClose }) {
|
|
13
13
|
const columns = tableViews || [];
|
|
14
14
|
const { t } = useTranslation();
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Popper from '@mui/material/Popper';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { downArrowIcon, checkIcon } from '
|
|
5
|
+
import { downArrowIcon, checkIcon } from '../../constants/index.js';
|
|
6
6
|
import { ButtonStyled, ListStyled, DropdownStyled, MenuItem, Space, SpaceAfter } from './style';
|
|
7
|
-
import { dummyViewList } from '
|
|
7
|
+
import { dummyViewList } from './data';
|
|
8
8
|
function DefaultViews({ open, selectedViewInfo, setSelectedViewInfo, onSelect, setViews, anchorEl }) {
|
|
9
9
|
const { t } = useTranslation();
|
|
10
10
|
return (_jsxs(DropdownStyled, Object.assign({ "data-testid": "TableView_DefaultViews" }, { children: [_jsxs(ButtonStyled, Object.assign({ onClick: (e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { TableHeaderProps } from '
|
|
2
|
+
import type { TableHeaderProps } from '../TableHeader/type';
|
|
3
3
|
interface TableViewProps {
|
|
4
4
|
onViewChange?: TableHeaderProps['onViewChange'];
|
|
5
5
|
setIsViewVisible: (visible: boolean) => void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ClickAwayListener } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import { closeXIcon, viewIcon } from '../../constants/index.js';
|
|
6
|
+
import { StyledButton } from '../Button';
|
|
7
|
+
import Icon from '../Icon';
|
|
7
8
|
import CustomViews from './CustomViews';
|
|
8
9
|
import DefaultViews from './DefaultViews';
|
|
9
10
|
import { ButtonStyled, ViewWrapper } from './style';
|
|
10
|
-
import { StyledButton } from '../../../Button';
|
|
11
|
-
import Icon from '../../../Icon';
|
|
12
11
|
function TableView({ onViewChange, setIsViewVisible, setTableViews, tableViews, resetTableViews }) {
|
|
13
12
|
const [anchorViewEl, setAnchorViewEl] = useState(null);
|
|
14
13
|
const [defaultViewEl, setDefaultViewElement] = useState(null);
|
|
@@ -37,7 +36,7 @@ function TableView({ onViewChange, setIsViewVisible, setTableViews, tableViews,
|
|
|
37
36
|
closeViewDropdown();
|
|
38
37
|
};
|
|
39
38
|
if (!anchorViewEl) {
|
|
40
|
-
return (_jsx(
|
|
39
|
+
return (_jsx(StyledButton, Object.assign({ title: t('tableView'), onClick: onViewButtonClick, "data-testid": "TableView_no_anchorViewEl_button" }, { children: _jsx(Icon, { src: viewIcon, alt: "view-icon", sx: { width: 14, height: 14 } }) })));
|
|
41
40
|
}
|
|
42
41
|
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: closeViewDropdown }, { children: _jsxs(ViewWrapper, Object.assign({ "data-testid": "TableView" }, { children: [selectedViewInfo.id === 'custom' && (_jsx(CustomViews, { tableViews: tableViews, setTableViews: setTableViews, anchorEl: customViewEl, open: Boolean(customViewEl), onSelect: (e) => {
|
|
43
42
|
setCustomViewElement(customViewEl ? null : e.currentTarget);
|
|
@@ -21,7 +21,6 @@ export { default as StatusChip } from './StatusChip';
|
|
|
21
21
|
export { default as SimpleDialog, type SimpleDialogProps } from './SimpleDialog';
|
|
22
22
|
export { default as SearchButton } from './SearchButton';
|
|
23
23
|
export { default as Loaders } from './Loaders';
|
|
24
|
-
export { default as ExportButton } from './ExportButton';
|
|
25
24
|
export { default as DropdownMenu, type IProps, type MenuItemI, StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent, } from './DropdownMenu';
|
|
26
25
|
export { default as DockButton, type DockButtonProps, type DockButtonWrapperProps } from './DockButton';
|
|
27
26
|
export { default as DateButton } from './DateButton';
|
|
@@ -91,6 +90,6 @@ export { default as Error } from './Error';
|
|
|
91
90
|
export { default as StatusBar } from './StatusBar';
|
|
92
91
|
export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
|
|
93
92
|
export * from './Chip';
|
|
94
|
-
export * from './
|
|
93
|
+
export * from './TableHeader';
|
|
95
94
|
export { default as RangeCalender } from './RangeCalender';
|
|
96
95
|
export { default as AppServices } from './AppServices';
|
|
@@ -21,7 +21,6 @@ export { default as StatusChip } from './StatusChip';
|
|
|
21
21
|
export { default as SimpleDialog } from './SimpleDialog';
|
|
22
22
|
export { default as SearchButton } from './SearchButton';
|
|
23
23
|
export { default as Loaders } from './Loaders';
|
|
24
|
-
export { default as ExportButton } from './ExportButton';
|
|
25
24
|
export { default as DropdownMenu, StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent, } from './DropdownMenu';
|
|
26
25
|
export { default as DockButton } from './DockButton';
|
|
27
26
|
export { default as DateButton } from './DateButton';
|
|
@@ -91,6 +90,6 @@ export { default as Error } from './Error';
|
|
|
91
90
|
export { default as StatusBar } from './StatusBar';
|
|
92
91
|
export { default as MultiSelectStatusButton } from './MultiSelectStatusButton';
|
|
93
92
|
export * from './Chip';
|
|
94
|
-
export * from './
|
|
93
|
+
export * from './TableHeader';
|
|
95
94
|
export { default as RangeCalender } from './RangeCalender';
|
|
96
95
|
export { default as AppServices } from './AppServices';
|
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.173-alpha-15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"module": "build/index.js",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { StatusButtonProps } from '../StatusButton/type';
|
|
3
|
-
declare function SearchButton(props: Omit<StatusButtonProps, 'variant'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare const _default: import("react").MemoExoticComponent<typeof SearchButton>;
|
|
5
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { styled } from '@mui/material';
|
|
4
|
-
import StatusButton from '../StatusButton';
|
|
5
|
-
const StyledExportButton = styled(StatusButton)(() => ({
|
|
6
|
-
minWidth: 'auto',
|
|
7
|
-
borderRadius: '4px',
|
|
8
|
-
paddingInline: '8px',
|
|
9
|
-
}));
|
|
10
|
-
function SearchButton(props) {
|
|
11
|
-
return _jsx(StyledExportButton, Object.assign({}, props, { type: "button", variant: "inActive" }));
|
|
12
|
-
}
|
|
13
|
-
export default memo(SearchButton);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { useTheme } from '@mui/material';
|
|
4
|
-
export function ChevronIcon({ isActive, disableHover }) {
|
|
5
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const handleMouseEnter = () => {
|
|
8
|
-
if (!disableHover) {
|
|
9
|
-
setIsHovered(true);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const handleMouseLeave = () => {
|
|
13
|
-
setIsHovered(false);
|
|
14
|
-
};
|
|
15
|
-
const iconColor = isActive ? theme.palette.common.white : theme.palette.grey[700];
|
|
16
|
-
const backgroundColor = isHovered ? theme.palette.common.black : 'transparent';
|
|
17
|
-
return (_jsx("svg", Object.assign({ width: "27", height: "30", viewBox: "0 0 27 32", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsxs("g", Object.assign({ id: "Group 140343" }, { children: [_jsx("path", { id: "Active", d: "M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z", fill: backgroundColor, fillOpacity: "0.1", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }), _jsx("path", { id: "Union", fillRule: "evenodd", clipRule: "evenodd", d: "M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z", fill: iconColor })] })) })));
|
|
18
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useRef, useState } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import StyledBadge, { BadgeVariants } from '../../../CountBadge';
|
|
16
|
-
import { convertToNumber, formatNumber } from '../../../../utils/index.js';
|
|
17
|
-
import { ChevronIcon } from './ChevronIcon';
|
|
18
|
-
import { ChevronContainer, Label, LabelWrapper, StyledStatusIcon, StyledDropdown, statusButtonVariants } from './style';
|
|
19
|
-
import { statusButtonIcons } from './constant';
|
|
20
|
-
export const StatusButton = memo((props) => {
|
|
21
|
-
var _a, _b;
|
|
22
|
-
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick"]);
|
|
23
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
24
|
-
const buttonRef = useRef(null);
|
|
25
|
-
const [lastActiveStatus, setLastActiveStatus] = useState((_a = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _a === void 0 ? void 0 : _a.status);
|
|
26
|
-
const { t } = useTranslation();
|
|
27
|
-
const open = Boolean(anchorEl);
|
|
28
|
-
const handleClose = () => {
|
|
29
|
-
setAnchorEl(null);
|
|
30
|
-
};
|
|
31
|
-
const Button = statusButtonVariants[variant];
|
|
32
|
-
const hasDropdown = dropdownOptions && dropdownOptions.length > 0;
|
|
33
|
-
const statusIcon = icon ? _jsx(StyledStatusIcon, { icon: icon, variant: variant, src: statusButtonIcons[icon], alt: `${icon}-icon` }) : null;
|
|
34
|
-
const statusBadge = badgeCount && !Number.isNaN(convertToNumber(badgeCount)) ? (_jsx(StyledBadge, Object.assign({ variant: variant === 'active' ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE }, { children: formatNumber(Number(badgeCount)) }))) : null;
|
|
35
|
-
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: (e) => {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
39
|
-
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
40
|
-
}, sx: Object.assign({}, (hasDropdown && {
|
|
41
|
-
paddingInlineEnd: '27px',
|
|
42
|
-
})) }, { children: _jsxs(LabelWrapper, Object.assign({ onClick: (e) => {
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
if (hasDropdown) {
|
|
46
|
-
setAnchorEl(buttonRef.current);
|
|
47
|
-
}
|
|
48
|
-
} }, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] })) })), open && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_b = (dropdownOptions || [])) === null || _b === void 0 ? void 0 : _b.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
49
|
-
var _a;
|
|
50
|
-
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
51
|
-
setLastActiveStatus(item.status);
|
|
52
|
-
handleClose();
|
|
53
|
-
} }))) }))] }));
|
|
54
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { AvailableStatus } from '../../type';
|
|
3
|
-
import { TableHeaderStatus } from '../../../../types/index.js';
|
|
4
|
-
export type StatusButtonsProps = {
|
|
5
|
-
availableStatuses: AvailableStatus[];
|
|
6
|
-
status: TableHeaderStatus;
|
|
7
|
-
onStatusChange?: (status: TableHeaderStatus) => void;
|
|
8
|
-
isFilteredIdsShown?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const _default: import("react").MemoExoticComponent<(props: StatusButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
-
export default _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createElement as _createElement } from "react";
|
|
3
|
-
import { memo, useMemo } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { StatusButton } from './StatusButton';
|
|
6
|
-
const StatusButtonItem = memo((props) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const { availableStatus, getButtonStatus, onStatusChange, status } = props;
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
if (!Array.isArray(availableStatus.status)) {
|
|
11
|
-
return (_createElement(StatusButton, Object.assign({}, availableStatus, { key: `status-button-array-${availableStatus.status}`, variant: getButtonStatus(availableStatus.status), onClick: () => {
|
|
12
|
-
if (!Array.isArray(availableStatus.status)) {
|
|
13
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(availableStatus.status);
|
|
14
|
-
}
|
|
15
|
-
} })));
|
|
16
|
-
}
|
|
17
|
-
const isCurrentStatusDropdown = (_a = availableStatus.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
|
|
18
|
-
const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
19
|
-
const statusLabel = isCurrentStatusDropdown ? status : availableStatus.status[0];
|
|
20
|
-
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, availableStatus, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
21
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(buttonStatus);
|
|
22
|
-
}, dropdownOptions: availableStatus.status.map((stat) => ({
|
|
23
|
-
label: t(stat || ''),
|
|
24
|
-
onClick: () => {
|
|
25
|
-
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(stat);
|
|
26
|
-
},
|
|
27
|
-
status: stat,
|
|
28
|
-
})) })) }));
|
|
29
|
-
});
|
|
30
|
-
const StatusButtons = (props) => {
|
|
31
|
-
const { availableStatuses, status, onStatusChange, isFilteredIdsShown } = props;
|
|
32
|
-
const getButtonStatus = useMemo(() => (buttonStatus) => buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive', [status, isFilteredIdsShown]);
|
|
33
|
-
return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((availableStatus) => {
|
|
34
|
-
var _a;
|
|
35
|
-
return (_jsx(StatusButtonItem, { availableStatus: availableStatus, getButtonStatus: getButtonStatus, onStatusChange: onStatusChange, status: status }, Array.isArray(availableStatus.status) ? (_a = availableStatus === null || availableStatus === void 0 ? void 0 : availableStatus.status) === null || _a === void 0 ? void 0 : _a[0] : `status-button-array-${availableStatus.status}`));
|
|
36
|
-
}) }));
|
|
37
|
-
};
|
|
38
|
-
export default memo(StatusButtons);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const statusButtonIcons: {
|
|
2
|
-
inProgress: string;
|
|
3
|
-
initiated: string;
|
|
4
|
-
abandoned: string;
|
|
5
|
-
cancelled: string;
|
|
6
|
-
reversed: string;
|
|
7
|
-
reports: string;
|
|
8
|
-
search: string;
|
|
9
|
-
chevronDown: string;
|
|
10
|
-
unAuthorized: string;
|
|
11
|
-
unSettled: string;
|
|
12
|
-
unCaptured: string;
|
|
13
|
-
captured: string;
|
|
14
|
-
authorized: string;
|
|
15
|
-
openFlag: string;
|
|
16
|
-
closedFlag: string;
|
|
17
|
-
unauthenticated: string;
|
|
18
|
-
authenticated: string;
|
|
19
|
-
paidOut: string;
|
|
20
|
-
scheduled: string;
|
|
21
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { initiatedIcon, abandonedIcon, cancelledIcon, reportsIcon, searchIcon, chevronDownIcon, unAuthorizedIcon, settlementInitiatedIcon, unCapturedIcon, capturedIcon, authorizedIcon, openFlagIcon, closedFlagIcon, reverseActionIcon, authenticatedIcon, unauthenticatedIcon, paidOutFilterIcon, scheduledFilterIcon, } from '../../../../constants/index.js';
|
|
2
|
-
export const statusButtonIcons = {
|
|
3
|
-
inProgress: initiatedIcon,
|
|
4
|
-
initiated: initiatedIcon,
|
|
5
|
-
abandoned: abandonedIcon,
|
|
6
|
-
cancelled: cancelledIcon,
|
|
7
|
-
reversed: reverseActionIcon,
|
|
8
|
-
reports: reportsIcon,
|
|
9
|
-
search: searchIcon,
|
|
10
|
-
chevronDown: chevronDownIcon,
|
|
11
|
-
unAuthorized: unAuthorizedIcon,
|
|
12
|
-
unSettled: settlementInitiatedIcon,
|
|
13
|
-
unCaptured: unCapturedIcon,
|
|
14
|
-
captured: capturedIcon,
|
|
15
|
-
authorized: authorizedIcon,
|
|
16
|
-
openFlag: openFlagIcon,
|
|
17
|
-
closedFlag: closedFlagIcon,
|
|
18
|
-
unauthenticated: unauthenticatedIcon,
|
|
19
|
-
authenticated: authenticatedIcon,
|
|
20
|
-
paidOut: paidOutFilterIcon,
|
|
21
|
-
scheduled: scheduledFilterIcon,
|
|
22
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { type Theme } from '@mui/material';
|
|
3
|
-
export declare const statusButtonVariants: {
|
|
4
|
-
active: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
6
|
-
}, "disabled" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "size" | "variant" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
7
|
-
icon?: string | undefined;
|
|
8
|
-
}, {}, {}>;
|
|
9
|
-
inActive: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
10
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
11
|
-
}, "disabled" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "size" | "variant" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
12
|
-
icon?: string | undefined;
|
|
13
|
-
}, {}, {}>;
|
|
14
|
-
};
|
|
15
|
-
export type StatusButtonVariant = keyof typeof statusButtonVariants;
|
|
16
|
-
export declare const CountBadge: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
|
-
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
-
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
19
|
-
variant: StatusButtonVariant;
|
|
20
|
-
}, {}, {}>;
|
|
21
|
-
export declare const StyledStatusIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
22
|
-
variant: StatusButtonVariant;
|
|
23
|
-
icon?: "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "reversed" | "authorized" | "paidOut" | "unauthenticated" | "authenticated" | "scheduled" | "unSettled" | "search" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | undefined;
|
|
24
|
-
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
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("../../..").IProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
27
|
-
export declare const ChevronContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
28
|
-
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
29
|
-
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
30
|
-
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
31
|
-
variant: StatusButtonVariant;
|
|
32
|
-
}, {}, {}>;
|
|
33
|
-
export declare const LabelWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
34
|
-
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
35
|
-
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { styled, Button, Box, alpha } from '@mui/material';
|
|
2
|
-
import Dropdown from '../../../DropdownMenu/DropdownMenu';
|
|
3
|
-
const baseButtonStyle = (theme) => (Object.assign(Object.assign({}, theme.typography.subtitle1), { borderRadius: '50px', borderWidth: '1px', borderStyle: 'solid', minWidth: '135.11px', height: '32px', display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px', textTransform: 'none', transition: 'none', paddingInline: theme.spacing(2) }));
|
|
4
|
-
const ActiveButton = styled(Button)(({ theme }) => (Object.assign(Object.assign({}, baseButtonStyle(theme)), { background: theme.palette.background.gradient.shadedBlue, color: theme.palette.common.white, '&:hover': {
|
|
5
|
-
background: theme.palette.background.gradient.shadedBlue,
|
|
6
|
-
opacity: 0.8,
|
|
7
|
-
} })));
|
|
8
|
-
const InActiveButton = styled(Button)(({ theme }) => (Object.assign(Object.assign({}, baseButtonStyle(theme)), { backgroundColor: theme.palette.common.white, borderColor: theme.palette.grey[100], color: theme.palette.text.primary, '&:hover': {
|
|
9
|
-
backgroundColor: theme.palette.common.white,
|
|
10
|
-
opacity: 0.7,
|
|
11
|
-
} })));
|
|
12
|
-
export const statusButtonVariants = {
|
|
13
|
-
active: ActiveButton,
|
|
14
|
-
inActive: InActiveButton,
|
|
15
|
-
};
|
|
16
|
-
export const CountBadge = styled(Box)(({ theme, variant }) => ({
|
|
17
|
-
borderRadius: '50px',
|
|
18
|
-
backgroundColor: variant === 'active' ? alpha(theme.palette.text.primary, 0.1) : theme.palette.grey[100],
|
|
19
|
-
display: 'flex',
|
|
20
|
-
justifyContent: 'center',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
paddingInline: theme.spacing(0.5),
|
|
23
|
-
paddingBlock: theme.spacing(0.25),
|
|
24
|
-
color: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary,
|
|
25
|
-
fontSize: '8px',
|
|
26
|
-
fontWeight: 700,
|
|
27
|
-
lineHeight: '10px',
|
|
28
|
-
}));
|
|
29
|
-
export const StyledStatusIcon = styled('img')(({ theme, variant, icon }) => {
|
|
30
|
-
var _a;
|
|
31
|
-
return (Object.assign(Object.assign({ fill: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary, color: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary }, (!(((_a = ['openFlag', 'closedFlag']) === null || _a === void 0 ? void 0 : _a.includes(icon !== null && icon !== void 0 ? icon : '')) && variant === 'inActive') &&
|
|
32
|
-
icon !== 'captured' && {
|
|
33
|
-
filter: variant === 'active' ? 'brightness(0) invert(1)' : 'brightness(0) invert(0)',
|
|
34
|
-
})), { maxWidth: '14px', maxHeight: '14px' }));
|
|
35
|
-
});
|
|
36
|
-
export const StyledFilterName = styled('p')(({ theme }) => ({
|
|
37
|
-
fontSize: '0.6875rem',
|
|
38
|
-
color: theme.palette.background.default,
|
|
39
|
-
fontStyle: 'normal',
|
|
40
|
-
margin: 'auto',
|
|
41
|
-
textTransform: 'capitalize',
|
|
42
|
-
}));
|
|
43
|
-
export const StyledDropdown = styled(Dropdown)(({ theme }) => ({
|
|
44
|
-
backgroundColor: 'white',
|
|
45
|
-
boxShadow: theme.shadows[21],
|
|
46
|
-
borderRadius: '0.25rem',
|
|
47
|
-
'& .MuiPaper-root': {
|
|
48
|
-
borderRadius: '0.25rem',
|
|
49
|
-
width: '12.5rem',
|
|
50
|
-
},
|
|
51
|
-
}));
|
|
52
|
-
export const ChevronContainer = styled('span')(() => ({
|
|
53
|
-
width: '27px',
|
|
54
|
-
height: '100%',
|
|
55
|
-
maxHeight: '100%',
|
|
56
|
-
position: 'absolute',
|
|
57
|
-
top: '0',
|
|
58
|
-
right: '0',
|
|
59
|
-
bottom: '0',
|
|
60
|
-
overflow: 'hidden',
|
|
61
|
-
transition: 'opacity 1s ease',
|
|
62
|
-
}));
|
|
63
|
-
export const Label = styled(Box)(({ variant }) => ({
|
|
64
|
-
display: 'flex',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
justifyContent: 'flex-start',
|
|
67
|
-
gap: '0.5rem',
|
|
68
|
-
fontWeight: variant === 'active' ? 700 : 400,
|
|
69
|
-
}));
|
|
70
|
-
export const LabelWrapper = styled(Box)(() => ({
|
|
71
|
-
display: 'flex',
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
justifyContent: 'center',
|
|
74
|
-
width: '100%',
|
|
75
|
-
}));
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { type ButtonProps } from '@mui/material';
|
|
3
|
-
import { TableHeaderStatus } from '../../../../types/index.js';
|
|
4
|
-
import { type StatusButtonVariant } from './style';
|
|
5
|
-
import { statusButtonIcons } from './constant';
|
|
6
|
-
import { MenuItemI } from '../../../DropdownMenu';
|
|
7
|
-
export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'children'> {
|
|
8
|
-
variant?: StatusButtonVariant;
|
|
9
|
-
badgeCount?: number | string;
|
|
10
|
-
hasDropdown?: boolean;
|
|
11
|
-
icon?: StatusButtonIcon;
|
|
12
|
-
label?: ReactNode | null;
|
|
13
|
-
totalCount?: number;
|
|
14
|
-
onButtonBodyClick?: (status: TableHeaderStatus) => void;
|
|
15
|
-
dropdownOptions?: Array<MenuItemI & {
|
|
16
|
-
status: TableHeaderStatus;
|
|
17
|
-
}>;
|
|
18
|
-
render?: (status: TableHeaderStatus) => ReactNode;
|
|
19
|
-
onMultiSelectChange?: (status: TableHeaderStatus[]) => void;
|
|
20
|
-
}
|
|
21
|
-
export interface ChevronIconProps {
|
|
22
|
-
isActive?: boolean;
|
|
23
|
-
disableHover?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export type StatusButtonIcon = keyof typeof statusButtonIcons;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|