@tap-payments/os-micro-frontend-shared 0.0.233-test.25 → 0.0.234-test.19
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/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/build/components/DropdownMenu/DropdownMenu.js +22 -22
- package/build/components/DropdownMenu/styles.d.ts +1 -0
- package/build/components/DropdownMenu/styles.js +16 -1
- package/build/components/DropdownMenu/type.d.ts +6 -1
- package/build/components/MultiSelectStatusButton/MultiSelectStatusButton.js +23 -15
- package/build/components/MultiSelectStatusButton/type.d.ts +0 -2
- package/build/components/StatusBar/StatusBar.d.ts +6 -12
- package/build/components/StatusBar/StatusBar.js +45 -60
- package/build/components/StatusBar/index.d.ts +1 -0
- package/build/components/StatusBar/type.d.ts +9 -2
- package/build/components/index.d.ts +2 -2
- package/build/components/index.js +1 -1
- package/build/constants/assets.d.ts +6 -0
- package/build/constants/assets.js +6 -0
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IProps } from './type';
|
|
2
|
-
declare function Dropdown({ open, menuItems, anchorEl, onClose, selected, allowShadows, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function Dropdown({ open, menuItems, anchorEl, onClose, footer, selected, multiple, allowShadows, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Dropdown;
|
|
@@ -11,33 +11,33 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Divider, Box, useTheme } from '@mui/material';
|
|
14
|
-
import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem } from './styles';
|
|
14
|
+
import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem, CheckboxStyled } from './styles';
|
|
15
15
|
function Dropdown(_a) {
|
|
16
|
-
var { open, menuItems, anchorEl, onClose, selected, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "selected", "allowShadows"]);
|
|
16
|
+
var { open, menuItems, anchorEl, onClose, footer, selected, multiple, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "footer", "selected", "multiple", "allowShadows"]);
|
|
17
17
|
const theme = useTheme();
|
|
18
|
-
return (
|
|
18
|
+
return (_jsxs(StyledMenu, Object.assign({ open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
|
|
19
19
|
e.preventDefault();
|
|
20
20
|
onClose();
|
|
21
|
-
} }, props, { className: "tap-dropdown", minWidth: (anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth) || 'auto' }, { children: menuItems.map((item, idx) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
} }, props, { className: "tap-dropdown", minWidth: (anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth) || 'auto' }, { children: [menuItems.map((item, idx) => {
|
|
22
|
+
if (item.name === 'divider') {
|
|
23
|
+
return _jsx(Divider, { sx: { margin: '0 !important' } }, `${item.label}-${idx}`);
|
|
24
|
+
}
|
|
25
|
+
return (_jsx("div", { children: item.label && (_jsxs(StyledMenuItem, Object.assign({ alwaysShowRightAction: item.alwaysShowRightAction, onClick: (e) => {
|
|
26
|
+
if (item.onClick)
|
|
27
|
+
item.onClick(e);
|
|
28
|
+
}, onContextMenu: item.onRightClick, selected: item.selected, sx: Object.assign(Object.assign({ '&:hover': {
|
|
29
|
+
backgroundColor: 'transparent',
|
|
30
|
+
boxShadow: allowShadows ? theme.shadows[10] : 'none',
|
|
31
|
+
'& .sandbox-Icon': {
|
|
32
|
+
display: 'none',
|
|
33
|
+
},
|
|
34
|
+
'& .close-Icon': {
|
|
35
|
+
display: 'block !important',
|
|
36
|
+
},
|
|
37
|
+
} }, (idx === selected && {
|
|
29
38
|
backgroundColor: 'transparent',
|
|
30
39
|
boxShadow: allowShadows ? theme.shadows[10] : 'none',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
'& .close-Icon': {
|
|
35
|
-
display: 'block !important',
|
|
36
|
-
},
|
|
37
|
-
} }, (idx === selected && {
|
|
38
|
-
backgroundColor: 'transparent',
|
|
39
|
-
boxShadow: allowShadows ? theme.shadows[10] : 'none',
|
|
40
|
-
})) }, { children: [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
|
-
}) })));
|
|
40
|
+
})), 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
|
+
}), footer] })));
|
|
42
42
|
}
|
|
43
43
|
export default Dropdown;
|
|
@@ -16,3 +16,4 @@ export declare const StyledOption: import("@emotion/styled").StyledComponent<imp
|
|
|
16
16
|
export declare const StyledSelectComponent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
17
17
|
export declare const StyledMenuTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
18
18
|
export declare const StyledIconForDropDown: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
19
|
+
export declare const CheckboxStyled: import("@emotion/styled").StyledComponent<import("@mui/material").CheckboxProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Checkbox from '../Checkbox';
|
|
2
|
+
import { ListItemText, Menu, MenuItem, styled, ListItemIcon, Select, alpha } from '@mui/material';
|
|
2
3
|
export const StyledMenuItem = styled(MenuItem, {
|
|
3
4
|
shouldForwardProp: (prop) => prop !== 'alwaysShowRightAction',
|
|
4
5
|
})(({ theme, alwaysShowRightAction }) => ({
|
|
@@ -141,3 +142,17 @@ export const StyledIconForDropDown = styled('img')(() => ({
|
|
|
141
142
|
verticalAlign: 'middle',
|
|
142
143
|
boxSizing: 'border-box',
|
|
143
144
|
}));
|
|
145
|
+
export const CheckboxStyled = styled(Checkbox)(({ theme }) => ({
|
|
146
|
+
padding: 0,
|
|
147
|
+
paddingRight: '4px',
|
|
148
|
+
width: '14px !important',
|
|
149
|
+
svg: {
|
|
150
|
+
width: '12px !important',
|
|
151
|
+
height: '12px !important',
|
|
152
|
+
},
|
|
153
|
+
'&.Mui-disabled': {
|
|
154
|
+
'[data-testid="IndeterminateCheckBoxIcon"]': {
|
|
155
|
+
fill: alpha(theme.palette.common.black, 0.26),
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
}));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { type SxProps, type Theme } from '@mui/material/styles';
|
|
3
|
+
import { StyledMenu } from './styles';
|
|
2
4
|
export interface MenuItemI {
|
|
3
5
|
label?: string | null | ReactNode;
|
|
4
6
|
name?: string;
|
|
@@ -9,8 +11,9 @@ export interface MenuItemI {
|
|
|
9
11
|
selected?: boolean;
|
|
10
12
|
rightAction?: ReactNode;
|
|
11
13
|
alwaysShowRightAction?: boolean;
|
|
14
|
+
sx?: SxProps<Theme>;
|
|
12
15
|
}
|
|
13
|
-
export interface IProps {
|
|
16
|
+
export interface IProps extends React.ComponentProps<typeof StyledMenu> {
|
|
14
17
|
open: boolean;
|
|
15
18
|
onClose: () => void;
|
|
16
19
|
menuItems: MenuItemI[];
|
|
@@ -18,4 +21,6 @@ export interface IProps {
|
|
|
18
21
|
style?: CSSProperties;
|
|
19
22
|
selected?: number;
|
|
20
23
|
allowShadows?: boolean;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
footer?: React.ReactNode;
|
|
21
26
|
}
|
|
@@ -4,8 +4,9 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import { Typography, Checkbox } from '@mui/material';
|
|
5
5
|
import { ChevronIcon } from '../StatusButton/ChevronIcon';
|
|
6
6
|
import StyledBadge, { BadgeVariants } from '../CountBadge';
|
|
7
|
+
import CountryFlag from '../CountryFlag';
|
|
7
8
|
import { formatNumber } from '../../utils/index.js';
|
|
8
|
-
import { closeXIcon } from '../../constants/index.js';
|
|
9
|
+
import { closeXIcon, SUPPORTED_CURRENCY_DETAILS } from '../../constants/index.js';
|
|
9
10
|
import { ChevronContainer, Label, LabelWrapper, StyledDropdown, MenuItemContainer, CheckboxStyles, StyledStatusButton, ClearIcon, ChevronIconWrapper, } from './style';
|
|
10
11
|
function MultiSelectStatusButton({ options = [], selectedValues, onSelectionChange, label, variant = 'inActive' }) {
|
|
11
12
|
const { t } = useTranslation();
|
|
@@ -56,9 +57,13 @@ function MultiSelectStatusButton({ options = [], selectedValues, onSelectionChan
|
|
|
56
57
|
: [...internalSelectedValues, optionStatus];
|
|
57
58
|
setInternalSelectedValues(newSelection);
|
|
58
59
|
};
|
|
60
|
+
const getDisplayLabel = () => {
|
|
61
|
+
return (_jsx(Typography, Object.assign({ fontWeight: 400, fontSize: "11px", variant: "inherit" }, { children: t('Currencies') })));
|
|
62
|
+
};
|
|
63
|
+
const countBadge = (_jsx(StyledBadge, Object.assign({ pointer: true, variant: variant === 'active' ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE }, { children: formatNumber(selectedValues.length > 0 ? selectedValues.length : options.length) })));
|
|
59
64
|
return (_jsxs(_Fragment, { children: [_jsx(StyledStatusButton, Object.assign({ buttonVariant: variant, ref: buttonRef, sx: {
|
|
60
65
|
paddingInlineEnd: '27px',
|
|
61
|
-
}, "data-testid": "MultiSelectStatusButton", onClick: handleDropdownClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), disabled: !options.length }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [
|
|
66
|
+
}, "data-testid": "MultiSelectStatusButton", onClick: handleDropdownClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), disabled: !options.length }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [getDisplayLabel(), countBadge] })), _jsxs(ChevronContainer, Object.assign({ onClick: isHovered && internalSelectedValues.length > 0 ? handleClearAll : undefined, sx: {
|
|
62
67
|
'&:hover': {
|
|
63
68
|
backgroundColor: 'transparent',
|
|
64
69
|
},
|
|
@@ -75,18 +80,21 @@ function MultiSelectStatusButton({ options = [], selectedValues, onSelectionChan
|
|
|
75
80
|
'&:hover': {
|
|
76
81
|
boxShadow: 'none !important',
|
|
77
82
|
},
|
|
78
|
-
}, menuItems: options.map((option) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
e
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
}, menuItems: options.map((option) => {
|
|
84
|
+
var _a;
|
|
85
|
+
return ({
|
|
86
|
+
label: (_jsxs(MenuItemContainer, { children: [_jsx(Checkbox, { checked: internalSelectedValues.includes(option.status), size: "small", sx: CheckboxStyles, onClick: (e) => {
|
|
87
|
+
var _a;
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
handleOptionToggle((_a = option.status) !== null && _a !== void 0 ? _a : '', e);
|
|
90
|
+
} }), _jsx(CountryFlag, { code: ((_a = SUPPORTED_CURRENCY_DETAILS[option.code]) === null || _a === void 0 ? void 0 : _a.country) || '', sx: { border: '1px solid white', borderRadius: '3px' } }), _jsx(Typography, Object.assign({ variant: "body2" }, { children: option.name }))] })),
|
|
91
|
+
onClick: (e) => {
|
|
92
|
+
var _a;
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
handleOptionToggle((_a = option.status) !== null && _a !== void 0 ? _a : '', e);
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}) }))] }));
|
|
91
99
|
}
|
|
92
100
|
export default memo(MultiSelectStatusButton);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
3
2
|
export interface CurrencyOption {
|
|
4
3
|
code: string;
|
|
5
4
|
name: string;
|
|
6
5
|
flagCode?: string;
|
|
7
6
|
status: TableHeaderStatus;
|
|
8
|
-
render?: () => JSX.Element;
|
|
9
7
|
}
|
|
10
8
|
export interface MultiSelectStatusButtonProps {
|
|
11
9
|
options: CurrencyOption[];
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CurrencyOption } from '../MultiSelectStatusButton';
|
|
3
1
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
2
|
import { AvailableStatus } from './type';
|
|
5
|
-
interface StatusBarProps {
|
|
6
|
-
status?:
|
|
7
|
-
availableStatuses?: AvailableStatus[];
|
|
3
|
+
interface StatusBarProps<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined> {
|
|
4
|
+
status?: IStatus;
|
|
5
|
+
availableStatuses?: AvailableStatus<IStatus>[];
|
|
8
6
|
isFilteredIdsShown?: boolean;
|
|
9
|
-
onStatusChange?: (status
|
|
10
|
-
onMultiSelectChange?: (status: TableHeaderStatus[]) => void;
|
|
11
|
-
currencyOptions?: CurrencyOption[];
|
|
12
|
-
selectedCurrencies?: TableHeaderStatus[];
|
|
13
|
-
enableMultiSelectCurrency?: boolean;
|
|
7
|
+
onStatusChange?: (status?: IStatus) => void;
|
|
14
8
|
}
|
|
15
|
-
declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status,
|
|
16
|
-
declare const _default:
|
|
9
|
+
declare function StatusBar<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }: StatusBarProps<IStatus>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const _default: typeof StatusBar;
|
|
17
11
|
export default _default;
|
|
@@ -1,68 +1,53 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { createElement as _createElement } from "react";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment
|
|
3
|
-
import { memo, useCallback,
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment, memo, useCallback, useMemo } from 'react';
|
|
4
15
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import MultiSelectStatusButton from '../MultiSelectStatusButton';
|
|
6
16
|
import StatusButton from '../StatusButton';
|
|
7
|
-
function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status,
|
|
17
|
+
function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }) {
|
|
8
18
|
const { t } = useTranslation();
|
|
9
|
-
const
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (status && multiSelectValues.length > 0) {
|
|
12
|
-
setMultiSelectValues([]);
|
|
13
|
-
}
|
|
14
|
-
}, [status, multiSelectValues.length]);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (!status) {
|
|
17
|
-
setMultiSelectValues(selectedCurrencies);
|
|
18
|
-
}
|
|
19
|
-
}, [selectedCurrencies, status]);
|
|
19
|
+
const isMultiSelection = useMemo(() => Array.isArray(status), [status]);
|
|
20
20
|
const getButtonStatus = useCallback((buttonStatus) => {
|
|
21
|
-
if (multiSelectValues.length > 0) {
|
|
22
|
-
return 'inActive';
|
|
23
|
-
}
|
|
24
21
|
return buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive';
|
|
25
|
-
}, [status, isFilteredIdsShown
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const variant = multiSelectValues.length > 0 ? 'inActive' : isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
56
|
-
const statusLabel = isCurrentStatusDropdown ? status : s.status[0];
|
|
57
|
-
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
58
|
-
handleStatusChange(buttonStatus);
|
|
59
|
-
}, dropdownOptions: s.status.map((stat) => ({
|
|
60
|
-
label: t(stat || ''),
|
|
61
|
-
onClick: () => {
|
|
62
|
-
handleStatusChange(stat);
|
|
63
|
-
},
|
|
64
|
-
status: stat,
|
|
65
|
-
})) })) }, (_b = s === null || s === void 0 ? void 0 : s.status) === null || _b === void 0 ? void 0 : _b[0]));
|
|
66
|
-
})] }));
|
|
22
|
+
}, [status, isFilteredIdsShown]);
|
|
23
|
+
const handleStatusChange = useCallback((selected) => {
|
|
24
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(selected);
|
|
25
|
+
}, [onStatusChange]);
|
|
26
|
+
return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((_a, index) => {
|
|
27
|
+
var _b, _c;
|
|
28
|
+
var { render } = _a, s = __rest(_a, ["render"]);
|
|
29
|
+
if (render) {
|
|
30
|
+
return (_jsx(Fragment, { children: render({ status: status, onChange: handleStatusChange }, Object.assign(Object.assign({}, s), { index })) }, `custom-status-slot-${index}`));
|
|
31
|
+
}
|
|
32
|
+
if (!Array.isArray(s.status)) {
|
|
33
|
+
return (_createElement(StatusButton, Object.assign({}, s, { key: `status-button-array-${s.status}`, variant: getButtonStatus(s.status), onClick: () => {
|
|
34
|
+
if (!Array.isArray(s.status)) {
|
|
35
|
+
handleStatusChange(s.status);
|
|
36
|
+
}
|
|
37
|
+
} })));
|
|
38
|
+
}
|
|
39
|
+
const isCurrentStatusDropdown = !isMultiSelection && ((_b = s.status) === null || _b === void 0 ? void 0 : _b.includes(status || ''));
|
|
40
|
+
const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
41
|
+
const statusLabel = isCurrentStatusDropdown && !isMultiSelection ? status : s.status[0];
|
|
42
|
+
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
43
|
+
handleStatusChange(buttonStatus);
|
|
44
|
+
}, dropdownOptions: s.status.map((stat) => ({
|
|
45
|
+
label: t(stat || ''),
|
|
46
|
+
onClick: () => {
|
|
47
|
+
handleStatusChange(stat);
|
|
48
|
+
},
|
|
49
|
+
status: stat,
|
|
50
|
+
})) })) }, (_c = s === null || s === void 0 ? void 0 : s.status) === null || _c === void 0 ? void 0 : _c[0]));
|
|
51
|
+
}) }));
|
|
67
52
|
}
|
|
68
53
|
export default memo(StatusBar);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { StatusButtonProps } from '../StatusButton';
|
|
2
3
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
3
|
-
export type AvailableStatus<T = undefined> = StatusButtonProps & {
|
|
4
|
-
status
|
|
4
|
+
export type AvailableStatus<T extends TableHeaderStatus | TableHeaderStatus[] = undefined> = StatusButtonProps & {
|
|
5
|
+
status?: T;
|
|
6
|
+
render?: <IStatus extends T>(controls: {
|
|
7
|
+
status: IStatus;
|
|
8
|
+
onChange: (selected?: AvailableStatus<T>['status']) => void;
|
|
9
|
+
}, options?: Omit<AvailableStatus<T>, 'render'> & {
|
|
10
|
+
index: number;
|
|
11
|
+
}) => React.ReactNode;
|
|
5
12
|
};
|
|
@@ -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';
|
|
@@ -87,7 +87,7 @@ export { default as OTPInput } from './OTPInput';
|
|
|
87
87
|
export { default as FlagDetails } from './FlagDetails';
|
|
88
88
|
export { default as TapLoader } from './Loaders';
|
|
89
89
|
export { default as Error } from './Error';
|
|
90
|
-
export { default as StatusBar } from './StatusBar';
|
|
90
|
+
export { default as StatusBar, type AvailableStatus } from './StatusBar';
|
|
91
91
|
export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
|
|
92
92
|
export * from './Chip';
|
|
93
93
|
export * from './StatusGroupChips';
|
|
@@ -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';
|
|
@@ -505,3 +505,9 @@ export declare const payoutServiceIcon: string;
|
|
|
505
505
|
export declare const refundsServiceIcon: string;
|
|
506
506
|
export declare const usersServiceIcon: string;
|
|
507
507
|
export declare const walletServiceIcon: string;
|
|
508
|
+
export declare const archievedOutlined: string;
|
|
509
|
+
export declare const closeOutlinedCircle: string;
|
|
510
|
+
export declare const dashedOutlinedCircle: string;
|
|
511
|
+
export declare const deactivatedCircle: string;
|
|
512
|
+
export declare const exclamationOutlinedCircle: string;
|
|
513
|
+
export declare const outlinedCircle: string;
|
|
@@ -509,3 +509,9 @@ export const payoutServiceIcon = `${lightUrl}/services/payoutService.svg`;
|
|
|
509
509
|
export const refundsServiceIcon = `${lightUrl}/services/refundsService.svg`;
|
|
510
510
|
export const usersServiceIcon = `${lightUrl}/services/usersService.svg`;
|
|
511
511
|
export const walletServiceIcon = `${lightUrl}/services/walletService.svg`;
|
|
512
|
+
export const archievedOutlined = `${lightUrl}/archievedOutlined.svg`;
|
|
513
|
+
export const closeOutlinedCircle = `${lightUrl}/closeOutlinedCircle.svg`;
|
|
514
|
+
export const dashedOutlinedCircle = `${lightUrl}/dashedOutlinedCircle.svg`;
|
|
515
|
+
export const deactivatedCircle = `${lightUrl}/deactivatedCircle.svg`;
|
|
516
|
+
export const exclamationOutlinedCircle = `${lightUrl}/exclamationOutlinedCircle.svg`;
|
|
517
|
+
export const outlinedCircle = `${lightUrl}/outlinedCircle.svg`;
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.234-test.19",
|
|
5
|
+
"testVersion": 19,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|