@tap-payments/os-micro-frontend-shared 0.0.30 → 0.0.31-dev-shared-migration-v1

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.
Files changed (81) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/Chip/Chip.d.ts +4 -0
  4. package/build/components/Chip/Chip.js +19 -0
  5. package/build/components/Chip/GroupIconChip.d.ts +3 -0
  6. package/build/components/Chip/GroupIconChip.js +11 -0
  7. package/build/components/Chip/GroupIconChips.d.ts +3 -0
  8. package/build/components/Chip/GroupIconChips.js +10 -0
  9. package/build/components/Chip/index.d.ts +4 -0
  10. package/build/components/Chip/index.js +4 -0
  11. package/build/components/Chip/style.d.ts +293 -0
  12. package/build/components/Chip/style.js +78 -0
  13. package/build/components/Chip/type.d.ts +13 -0
  14. package/build/components/Chip/type.js +1 -0
  15. package/build/components/MultiSelectDropdownButton/MultiSelectDropdownButton.js +3 -3
  16. package/build/components/TableHeader_V2/FiltersRow.d.ts +2 -0
  17. package/build/components/TableHeader_V2/FiltersRow.js +5 -0
  18. package/build/components/TableHeader_V2/TableHeader.d.ts +4 -0
  19. package/build/components/TableHeader_V2/TableHeader.js +7 -0
  20. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.d.ts +2 -0
  21. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.js +16 -0
  22. package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.d.ts +3 -0
  23. package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.js +54 -0
  24. package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.d.ts +11 -0
  25. package/build/components/TableHeader_V2/components/StatusButtons/StatusButtons.js +38 -0
  26. package/build/components/TableHeader_V2/components/StatusButtons/constant.d.ts +24 -0
  27. package/build/components/TableHeader_V2/components/StatusButtons/constant.js +25 -0
  28. package/build/components/TableHeader_V2/components/StatusButtons/index.d.ts +3 -0
  29. package/build/components/TableHeader_V2/components/StatusButtons/index.js +3 -0
  30. package/build/components/TableHeader_V2/components/StatusButtons/style.d.ts +35 -0
  31. package/build/components/TableHeader_V2/components/StatusButtons/style.js +74 -0
  32. package/build/components/TableHeader_V2/components/StatusButtons/type.d.ts +22 -0
  33. package/build/components/TableHeader_V2/components/StatusButtons/type.js +1 -0
  34. package/build/components/TableHeader_V2/components/TableView/CustomViews.d.ts +13 -0
  35. package/build/components/TableHeader_V2/components/TableView/CustomViews.js +78 -0
  36. package/build/components/TableHeader_V2/components/TableView/DefaultViews.d.ts +13 -0
  37. package/build/components/TableHeader_V2/components/TableView/DefaultViews.js +22 -0
  38. package/build/components/TableHeader_V2/components/TableView/TableView.d.ts +12 -0
  39. package/build/components/TableHeader_V2/components/TableView/TableView.js +55 -0
  40. package/build/components/TableHeader_V2/components/TableView/index.d.ts +3 -0
  41. package/build/components/TableHeader_V2/components/TableView/index.js +3 -0
  42. package/build/components/TableHeader_V2/components/TableView/style.d.ts +24 -0
  43. package/build/components/TableHeader_V2/components/TableView/style.js +102 -0
  44. package/build/components/TableHeader_V2/components/index.d.ts +2 -0
  45. package/build/components/TableHeader_V2/components/index.js +2 -0
  46. package/build/components/TableHeader_V2/data.d.ts +5 -0
  47. package/build/components/TableHeader_V2/data.js +7 -0
  48. package/build/components/TableHeader_V2/index.d.ts +5 -0
  49. package/build/components/TableHeader_V2/index.js +5 -0
  50. package/build/components/TableHeader_V2/style.d.ts +21 -0
  51. package/build/components/TableHeader_V2/style.js +43 -0
  52. package/build/components/TableHeader_V2/type.d.ts +67 -0
  53. package/build/components/TableHeader_V2/type.js +8 -0
  54. package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +16 -10
  55. package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +66 -14
  56. package/build/components/VirtualTable/components/ColumnFilter/List/List.js +1 -1
  57. package/build/components/VirtualTable/components/index.d.ts +1 -1
  58. package/build/components/VirtualTable/components/index.js +1 -1
  59. package/build/components/VirtualTable/index.d.ts +1 -0
  60. package/build/components/VirtualTable/index.js +1 -0
  61. package/build/components/index.d.ts +1 -1
  62. package/build/components/index.js +1 -1
  63. package/build/constants/api.d.ts +3 -0
  64. package/build/constants/api.js +3 -0
  65. package/build/constants/apps.d.ts +3 -0
  66. package/build/constants/apps.js +9 -1
  67. package/build/constants/assets.d.ts +8 -0
  68. package/build/constants/assets.js +8 -0
  69. package/build/constants/table/cell/index.d.ts +1 -0
  70. package/build/constants/table/cell/index.js +1 -0
  71. package/build/constants/table/cell/merchantsTableCellWidth.d.ts +6 -2
  72. package/build/constants/table/cell/merchantsTableCellWidth.js +6 -2
  73. package/build/constants/table/cell/terminalsTableCellWidth.d.ts +46 -0
  74. package/build/constants/table/cell/terminalsTableCellWidth.js +46 -0
  75. package/build/theme/palette.js +1 -0
  76. package/build/types/cell.d.ts +5 -1
  77. package/build/types/table.d.ts +17 -7
  78. package/build/utils/string.d.ts +1 -0
  79. package/build/utils/string.js +1 -0
  80. package/build/utils/table.js +3 -1
  81. package/package.json +130 -130
@@ -0,0 +1,102 @@
1
+ import { Box, styled } from '@mui/material';
2
+ export const ButtonStyled = styled(Box)(({ theme }) => ({
3
+ display: 'flex',
4
+ alignItems: 'center',
5
+ justifyContent: 'space-between',
6
+ borderRadius: '4px',
7
+ background: theme.palette.common.white,
8
+ padding: '8px',
9
+ border: '1px solid',
10
+ borderColor: theme.palette.divider,
11
+ gap: 8,
12
+ height: 32,
13
+ cursor: 'pointer',
14
+ '&:hover': {
15
+ border: '1px solid',
16
+ borderColor: theme.palette.info.dark,
17
+ boxShadow: theme.shadows[7],
18
+ },
19
+ }));
20
+ export const ViewWrapper = styled(Box)(({ theme }) => ({
21
+ background: theme.palette.common.white,
22
+ display: 'flex',
23
+ gap: theme.spacing(1),
24
+ alignItems: 'center',
25
+ color: theme.palette.text.primary,
26
+ fontSize: '11px',
27
+ fontWeight: theme.typography.fontWeightRegular,
28
+ textTransform: 'capitalize',
29
+ position: 'relative',
30
+ transition: '0.5s',
31
+ '&:after': {
32
+ content: '""',
33
+ position: 'absolute',
34
+ left: -8,
35
+ right: 0,
36
+ width: '100%',
37
+ height: '100%',
38
+ boxShadow: theme.shadows[11],
39
+ borderRadius: theme.spacing(0.5),
40
+ paddingInlineStart: theme.spacing(1),
41
+ paddingTop: '9px',
42
+ paddingBottom: '9px',
43
+ paddingInlineEnd: '9px',
44
+ zIndex: -1,
45
+ },
46
+ }));
47
+ export const ListStyled = styled(Box)(({ theme }) => ({
48
+ background: theme.palette.common.white,
49
+ borderRadius: theme.spacing(0.5),
50
+ boxShadow: theme.shadows[8],
51
+ border: '1px solid',
52
+ borderColor: theme.palette.divider,
53
+ zIndex: 5,
54
+ fontSize: '11px',
55
+ width: 192,
56
+ }));
57
+ export const DropdownStyled = styled(Box)(() => ({
58
+ minWidth: 160,
59
+ position: 'relative',
60
+ }));
61
+ export const MenuItem = styled(Box, { shouldForwardProp: (props) => props !== 'addColumnViewEl' })(({ theme }) => ({
62
+ padding: theme.spacing(1),
63
+ paddingInlineEnd: 2,
64
+ borderBottom: '1px solid',
65
+ borderColor: theme.palette.divider,
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ height: 32,
69
+ cursor: 'pointer',
70
+ img: {
71
+ height: 12,
72
+ },
73
+ '.check-icon': {
74
+ height: 'auto',
75
+ marginInlineEnd: theme.spacing(1),
76
+ },
77
+ '&:hover': {
78
+ color: theme.palette.info.dark,
79
+ fontWeight: theme.typography.fontWeightBold,
80
+ },
81
+ '&.add-column': {
82
+ justifyContent: 'space-between',
83
+ paddingInlineEnd: theme.spacing(1),
84
+ position: 'relative',
85
+ border: 'none',
86
+ zIndex: 5,
87
+ borderBottom: '1px solid',
88
+ borderColor: theme.palette.divider,
89
+ borderTopRightRadius: theme.spacing(1),
90
+ borderTopLeftRadius: theme.spacing(1),
91
+ '&:hover': {
92
+ boxShadow: theme.shadows[6],
93
+ },
94
+ },
95
+ }));
96
+ export const Space = styled(Box)(({ theme }) => ({
97
+ width: 12,
98
+ marginInlineEnd: theme.spacing(1),
99
+ }));
100
+ export const SpaceAfter = styled(Box)(() => ({
101
+ width: 16,
102
+ }));
@@ -0,0 +1,2 @@
1
+ export * from './StatusButtons';
2
+ export * from './TableView';
@@ -0,0 +1,2 @@
1
+ export * from './StatusButtons';
2
+ export * from './TableView';
@@ -0,0 +1,5 @@
1
+ export declare const dummyViewList: {
2
+ label: string;
3
+ id: string;
4
+ columns: string[];
5
+ }[];
@@ -0,0 +1,7 @@
1
+ export const dummyViewList = [
2
+ {
3
+ label: 'Default',
4
+ id: 'default',
5
+ columns: ['default', 'default'],
6
+ },
7
+ ];
@@ -0,0 +1,5 @@
1
+ import TableHeader from './TableHeader';
2
+ export default TableHeader;
3
+ export * from './style';
4
+ export { FiltersRow } from './FiltersRow';
5
+ export * from './components';
@@ -0,0 +1,5 @@
1
+ import TableHeader from './TableHeader';
2
+ export default TableHeader;
3
+ export * from './style';
4
+ export { FiltersRow } from './FiltersRow';
5
+ export * from './components';
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const TableHeaderContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const TableHeaderTitle: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
9
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
10
+ }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "textAlign" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
11
+ component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
+ } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
13
+ export declare const TableHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
15
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
16
+ export declare const StatusButtonsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
18
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
19
+ export declare const FiltersRowWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
20
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
21
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,43 @@
1
+ import { Box, styled } from '@mui/material';
2
+ import Text from '../Text';
3
+ export const TitleContainer = styled(Box)(({ theme }) => ({
4
+ display: 'flex',
5
+ justifyContent: 'space-between',
6
+ alignItems: 'center',
7
+ gap: theme.spacing(3),
8
+ width: '100%',
9
+ marginBottom: theme.spacing(2.25),
10
+ marginTop: theme.spacing(2),
11
+ }));
12
+ export const TableHeaderContainer = styled(Box)(({ theme }) => ({
13
+ backgroundColor: theme.palette.background.default,
14
+ paddingInline: theme.spacing(4),
15
+ paddingBottom: theme.spacing(2),
16
+ paddingTop: theme.spacing(2),
17
+ overflowX: 'clip',
18
+ }));
19
+ export const TableHeaderTitle = styled(Text)(({ theme }) => ({
20
+ fontSize: '1.75rem',
21
+ fontWeight: theme.typography.fontWeightMedium,
22
+ lineHeight: '120%',
23
+ }));
24
+ export const TableHeaderRow = styled(Box)(({ theme }) => ({
25
+ display: 'flex',
26
+ justifyContent: 'space-between',
27
+ alignItems: 'center',
28
+ gap: theme.spacing(3),
29
+ width: '100%',
30
+ }));
31
+ export const StatusButtonsContainer = styled(Box)(({ theme }) => ({
32
+ display: 'flex',
33
+ justifyContent: 'flex-start',
34
+ alignItems: 'center',
35
+ gap: theme.spacing(1),
36
+ }));
37
+ export const FiltersRowWrapper = styled(Box)(() => ({
38
+ display: 'flex',
39
+ justifyContent: 'flex-start',
40
+ alignItems: 'center',
41
+ gap: '8px',
42
+ flexShrink: 0,
43
+ }));
@@ -0,0 +1,67 @@
1
+ import React, { PropsWithChildren, ReactNode } from 'react';
2
+ import type { CalenderMode, TableHeaderStatus, ColumnViewProps } from '../../types/index.js';
3
+ import type { StatusButtonProps } from '../StatusButton/type';
4
+ declare const viewsOptions: {
5
+ default: {};
6
+ developer: {};
7
+ marketing: {};
8
+ finance: {};
9
+ custom: {};
10
+ };
11
+ export type View = keyof typeof viewsOptions;
12
+ export type AvailableStatus = StatusButtonProps & {
13
+ status: TableHeaderStatus | TableHeaderStatus[];
14
+ };
15
+ export interface TableHeaderProps {
16
+ availableStatuses?: AvailableStatus[];
17
+ status?: TableHeaderStatus;
18
+ search?: string;
19
+ view?: View;
20
+ date?: Date | [Date, Date];
21
+ showMaximizedView?: boolean;
22
+ title?: string | null;
23
+ calendarMode?: CalenderMode;
24
+ onStatusChange?: (status: Partial<TableHeaderStatus>) => void;
25
+ onSearch?: (search: string) => void;
26
+ onViewChange?: () => void;
27
+ onDateChange?: (date: Date | [Date, Date], timezoneOffset?: number) => void;
28
+ tableReportsComponent?: React.ReactNode;
29
+ tableFilterComponent?: React.ReactNode;
30
+ onCalendarModeSwitch: (mode: CalenderMode) => void;
31
+ filteredIds?: string[];
32
+ onCancelFilteredIdsClick?: () => void;
33
+ isFilteredIdsShown?: boolean;
34
+ totalCount?: number;
35
+ cardNumber?: string;
36
+ leftActions?: ReactNode;
37
+ rightActions?: ReactNode;
38
+ isReportsButtonVisible?: boolean;
39
+ onSearchChange?: (search: string) => void;
40
+ onToggleViewButtonClick?: () => void;
41
+ leftComponent?: React.ReactNode;
42
+ setTableViews?: (columns: ColumnViewProps[]) => void;
43
+ tableViews?: ColumnViewProps[];
44
+ resetTableViews?: (view: {
45
+ id: string;
46
+ label: string;
47
+ }) => void;
48
+ onToggleTextButtonClick?: () => void;
49
+ isTextShown?: boolean;
50
+ children?: ReactNode;
51
+ calendarGroupBy?: string;
52
+ onCalendarGroupChange?: (value: string) => void;
53
+ maxDateRange?: number;
54
+ isAcceptance?: boolean;
55
+ }
56
+ export type FilterRowProps = PropsWithChildren<{}>;
57
+ export interface Column {
58
+ label: string;
59
+ name: string;
60
+ groupName: string;
61
+ selected: boolean;
62
+ }
63
+ export interface ViewOption {
64
+ id: string;
65
+ label: string;
66
+ }
67
+ export {};
@@ -0,0 +1,8 @@
1
+ const viewsOptions = {
2
+ default: {},
3
+ developer: {},
4
+ marketing: {},
5
+ finance: {},
6
+ custom: {},
7
+ };
8
+ export {};
@@ -20,9 +20,14 @@ function ColumnFilter(filter) {
20
20
  const listFilterData = useMemo(() => {
21
21
  var _a;
22
22
  const listFilter = filter;
23
- return ((_a = listFilter === null || listFilter === void 0 ? void 0 : listFilter.data) === null || _a === void 0 ? void 0 : _a[listFilter.apiKey]) || [];
23
+ const rawData = (_a = listFilter === null || listFilter === void 0 ? void 0 : listFilter.data) === null || _a === void 0 ? void 0 : _a[listFilter.apiKey];
24
+ return Array.isArray(rawData) ? rawData : [];
24
25
  }, [filter]);
25
- const showClearIcon = useMemo(() => Object.values(filterData || {}).some((value) => Boolean(value)) || listFilterData.length > 0, [filterData, listFilterData]);
26
+ const showClearIcon = useMemo(() => Object.values(filterData || {}).some((value) => {
27
+ if (typeof value === 'string' || Array.isArray(value))
28
+ return value.length > 0;
29
+ return Boolean(value);
30
+ }) || listFilterData.length > 0, [filterData, listFilterData]);
26
31
  const open = Boolean(anchorEl);
27
32
  const filterApiKeys = useMemo(() => {
28
33
  var _a;
@@ -32,18 +37,19 @@ function ColumnFilter(filter) {
32
37
  return (_a = ((filter === null || filter === void 0 ? void 0 : filter.options) || [])) === null || _a === void 0 ? void 0 : _a.map(({ apiKey }) => apiKey);
33
38
  }, [filter]);
34
39
  const renderFilter = useMemo(() => {
35
- var _a;
36
40
  if (filter.type === 'list')
37
41
  return _jsx(List, { onCloseDropdown: onCloseDropdown, filter: filter });
38
42
  if (filter.type === 'inputs')
39
43
  return _jsx(Inputs, { onCloseDropdown: onCloseDropdown, filter: filter });
40
- const componentSharedProps = {
41
- anchorEl,
42
- setAnchorEl,
43
- };
44
- const Component = (_a = filter.render) === null || _a === void 0 ? void 0 : _a.call(filter, componentSharedProps);
45
- return Component;
46
- }, [open, filter]);
44
+ if (filter.type === 'custom') {
45
+ const componentSharedProps = {
46
+ anchorEl,
47
+ setAnchorEl,
48
+ };
49
+ return filter.render(componentSharedProps);
50
+ }
51
+ return null;
52
+ }, [open, filter, anchorEl, setAnchorEl]);
47
53
  return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCloseDropdown }, { children: _jsxs(Box, Object.assign({ component: "section", "data-testid": "ColumnFilter", sx: { position: 'relative', display: 'inline-block', marginTop: 'auto' } }, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 }, onClick: openDropdown }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: () => {
48
54
  filter.onClear(filterApiKeys);
49
55
  } })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { marginInlineStart: '8px', cursor: 'pointer' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start", sx: {
@@ -4,30 +4,79 @@ import Box from '@mui/material/Box';
4
4
  import Collapse from '@mui/material/Collapse';
5
5
  import lodashValues from 'lodash/values';
6
6
  import { useTranslation } from 'react-i18next';
7
+ import { PhoneInputBase } from '../../../../InputBase';
7
8
  import { grayCloseIcon, searchIcon } from '../../../../../constants/index.js';
8
9
  import { Wrapper, Text, InputStyled, InputsWrapper, ClearButton, ClearWrapper } from './style';
9
10
  import { CancelButton, Footer, OkayButton } from '../style';
10
11
  function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter } }) {
11
12
  const [values, setValues] = useState({});
12
13
  useEffect(() => {
13
- setValues((options || []).reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = data === null || data === void 0 ? void 0 : data[apiKey]) !== null && _a !== void 0 ? _a : '' })); }, {}));
14
+ setValues((options || []).reduce((acc, { apiKey, type }) => {
15
+ var _a;
16
+ const optionData = data === null || data === void 0 ? void 0 : data[apiKey];
17
+ if (type === 'phone') {
18
+ const phoneData = optionData;
19
+ return Object.assign(Object.assign({}, acc), { [apiKey]: (_a = phoneData === null || phoneData === void 0 ? void 0 : phoneData.phone) !== null && _a !== void 0 ? _a : '', [`${apiKey}_country`]: phoneData === null || phoneData === void 0 ? void 0 : phoneData.country });
20
+ }
21
+ return Object.assign(Object.assign({}, acc), { [apiKey]: optionData !== null && optionData !== void 0 ? optionData : '' });
22
+ }, {}));
14
23
  }, []);
15
24
  const { t } = useTranslation();
16
25
  const onClickOkay = () => {
17
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(values);
26
+ const transformedValues = options.reduce((acc, { apiKey, type }) => {
27
+ if (type === 'phone') {
28
+ const phoneValue = values[apiKey];
29
+ const countryValue = values[`${apiKey}_country`];
30
+ if (phoneValue || countryValue) {
31
+ acc[apiKey] = {
32
+ phone: phoneValue || '',
33
+ country: countryValue,
34
+ };
35
+ }
36
+ }
37
+ else {
38
+ const value = values[apiKey];
39
+ if (value !== undefined && value !== '') {
40
+ acc[apiKey] = value;
41
+ }
42
+ }
43
+ return acc;
44
+ }, {});
45
+ onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(transformedValues);
18
46
  onCloseDropdown();
19
47
  };
20
48
  const onClickCancel = () => {
21
49
  onCloseDropdown();
22
50
  };
23
51
  const onClickClear = () => {
24
- setValues(options.reduce((acc, { apiKey }) => (Object.assign(Object.assign({}, acc), { [apiKey]: '' })), {}));
52
+ setValues(options.reduce((acc, { apiKey, type }) => {
53
+ if (type === 'phone') {
54
+ return Object.assign(Object.assign({}, acc), { [apiKey]: '', [`${apiKey}_country`]: undefined });
55
+ }
56
+ return Object.assign(Object.assign({}, acc), { [apiKey]: '' });
57
+ }, {}));
25
58
  };
26
- const isInputHasValue = (key) => values[key] !== undefined && values[key].length > 0;
27
- const getInputValue = (key) => (values[key] !== undefined && values[key].length ? values[key] : '');
28
- const onClickResetInput = (key) => {
29
- if (isInputHasValue(key))
30
- setValues(Object.assign(Object.assign({}, values), { [key]: '' }));
59
+ const isInputHasValue = (key, type) => {
60
+ if (type === 'phone') {
61
+ return values[key] !== undefined && typeof values[key] === 'string' && values[key].length > 0 && values[`${key}_country`] !== undefined;
62
+ }
63
+ return values[key] !== undefined && typeof values[key] === 'string' && values[key].length > 0;
64
+ };
65
+ const getInputValue = (key, type) => {
66
+ if (type === 'phone') {
67
+ return values[key] !== undefined && typeof values[key] === 'string' && values[key].length ? values[key] : '';
68
+ }
69
+ return values[key] !== undefined && typeof values[key] === 'string' && values[key].length ? values[key] : '';
70
+ };
71
+ const onClickResetInput = (key, type) => {
72
+ if (isInputHasValue(key, type)) {
73
+ if (type === 'phone') {
74
+ setValues(Object.assign(Object.assign({}, values), { [key]: '', [`${key}_country`]: undefined }));
75
+ }
76
+ else {
77
+ setValues(Object.assign(Object.assign({}, values), { [key]: '' }));
78
+ }
79
+ }
31
80
  };
32
81
  const showClearButton = useMemo(() => lodashValues(values).some((x) => Boolean(x)), [values]);
33
82
  const getFilterByApiKey = useCallback((apiKey) => {
@@ -38,7 +87,7 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
38
87
  const isAnyInputWithValue = Object.entries(values).some(([inputKey, val]) => { var _a; return Boolean(val) && (((_a = getFilterByApiKey(inputKey)) === null || _a === void 0 ? void 0 : _a.filterGroup) !== filterGroup || !filterGroup); });
39
88
  return isOnlyOneFilter && !inputWithValue && isAnyInputWithValue;
40
89
  }, [options, values, isOnlyOneFilter]);
41
- return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, customInput }) => {
90
+ return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, customInput, type, countries, isCountriesLoading }) => {
42
91
  if (customInput) {
43
92
  return customInput({
44
93
  key: apiKey,
@@ -47,17 +96,20 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
47
96
  setValues(Object.assign(Object.assign({}, values), { [apiKey]: value }));
48
97
  },
49
98
  isDisabled: isInputDisabled(apiKey, filterGroup),
50
- getInputValue,
51
- isInputHasValue: isInputHasValue(apiKey),
99
+ getInputValue: (keyToGet) => getInputValue(keyToGet, type),
100
+ isInputHasValue: () => isInputHasValue(apiKey, type),
52
101
  onClickReset: () => {
53
- onClickResetInput(apiKey);
102
+ onClickResetInput(apiKey, type);
54
103
  },
55
104
  });
56
105
  }
106
+ if (type === 'phone') {
107
+ return (_jsx(PhoneInputBase, { "data-testid": `ColumnFilterInputs_PhoneInput_${apiKey}`, phoneValue: getInputValue(apiKey, 'phone'), onPhoneChange: (val) => setValues(Object.assign(Object.assign({}, values), { [apiKey]: val, [`${apiKey}_country`]: values[`${apiKey}_country`] })), countryValue: values[`${apiKey}_country`], onCountryChange: (country) => setValues(Object.assign(Object.assign({}, values), { [`${apiKey}_country`]: country, [apiKey]: values[apiKey] })), countries: countries || [], isCountriesLoading: isCountriesLoading || false, hasError: false, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), placeholder: placeholder }, apiKey));
108
+ }
57
109
  return (_jsx(InputStyled, { className: "input", "data-testid": "ColumnFilterInputs_InputStyled", name: apiKey, placeholder: placeholder, onChange: (e) => {
58
110
  setValues(Object.assign(Object.assign({}, values), { [apiKey]: e.target.value }));
59
- }, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey), inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue(apiKey) ? 'close' : 'search', src: isInputHasValue(apiKey) ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue(apiKey) ? 'pointer' : 'default' }, onClick: () => {
60
- onClickResetInput(apiKey);
111
+ }, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey, type), inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue(apiKey, type) ? 'close' : 'search', src: isInputHasValue(apiKey, type) ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue(apiKey, type) ? 'pointer' : 'default' }, onClick: () => {
112
+ onClickResetInput(apiKey, type);
61
113
  } }) }, apiKey));
62
114
  }) })), _jsx(Collapse, Object.assign({ in: showClearButton, component: "section", "data-testid": "ColumnFilterInputs_Collapse" }, { children: _jsx(ClearWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_ClearWrapper" }, { children: _jsx(ClearButton, Object.assign({ type: "button", onClick: onClickClear, "data-testid": "ColumnFilterInputs_ClearButton" }, { children: t('clear') })) })) })), _jsxs(Footer, Object.assign({ component: "footer", "data-testid": "ColumnFilterInputs_footer" }, { children: [_jsx(CancelButton, Object.assign({ type: "button", onClick: onClickCancel, "data-testid": "ColumnFilterInputs_CancelButton" }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ type: "button", onClick: onClickOkay, "data-testid": "ColumnFilterInputs_OkayButton" }, { children: t('okay') }))] }))] })));
63
115
  }
@@ -10,7 +10,7 @@ function List({ onCloseDropdown, filter, styles }) {
10
10
  const isItemSelected = (apiKey) => {
11
11
  var _a, _b;
12
12
  const selectedValues = (_b = (_a = filter === null || filter === void 0 ? void 0 : filter.data) === null || _a === void 0 ? void 0 : _a[filter.apiKey]) !== null && _b !== void 0 ? _b : [];
13
- if (selectedValues.length) {
13
+ if (Array.isArray(selectedValues) && selectedValues.length) {
14
14
  const selectedValueSet = new Set(selectedValues);
15
15
  return selectedValueSet.has(apiKey);
16
16
  }
@@ -1,4 +1,4 @@
1
- export * from './ColumnFilter';
1
+ export { default as ColumnFilter, Inputs, List } from './ColumnFilter';
2
2
  export * from './EmptyList';
3
3
  export * from './ErrorList';
4
4
  export * from './TableFooter';
@@ -1,4 +1,4 @@
1
- export * from './ColumnFilter';
1
+ export { default as ColumnFilter, Inputs, List } from './ColumnFilter';
2
2
  export * from './EmptyList';
3
3
  export * from './ErrorList';
4
4
  export * from './TableFooter';
@@ -1,4 +1,5 @@
1
1
  import VirtualTable from './VirtualTable';
2
2
  export { default as VirtualTableWithCard } from './VirtualTableWithCard';
3
3
  export * from './components';
4
+ export { StyledCell } from './style';
4
5
  export default VirtualTable;
@@ -1,4 +1,5 @@
1
1
  import VirtualTable from './VirtualTable';
2
2
  export { default as VirtualTableWithCard } from './VirtualTableWithCard';
3
3
  export * from './components';
4
+ export { StyledCell } from './style';
4
5
  export default VirtualTable;
@@ -11,7 +11,7 @@ export { default as Checkbox } from './Checkbox';
11
11
  export { default as Dialog, DialogToolbar } from './Dialog';
12
12
  export { default as Tooltip } from './Tooltip';
13
13
  export * from './RFH';
14
- export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, } from './VirtualTable';
14
+ export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
15
15
  export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
16
16
  export { default as TapLogo } from './TapLogo';
17
17
  export { default as StatusButton, ChevronIcon, type ChevronIconProps, type StatusButtonIcon, type StatusButtonProps } from './StatusButton';
@@ -11,7 +11,7 @@ export { default as Checkbox } from './Checkbox';
11
11
  export { default as Dialog, DialogToolbar } from './Dialog';
12
12
  export { default as Tooltip } from './Tooltip';
13
13
  export * from './RFH';
14
- export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, } from './VirtualTable';
14
+ export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
15
15
  export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
16
16
  export { default as TapLogo } from './TapLogo';
17
17
  export { default as StatusButton, ChevronIcon } from './StatusButton';
@@ -51,4 +51,7 @@ export declare const API_LIST_CONSTANTS: {
51
51
  readonly MerchantsList: {
52
52
  readonly limit: 50;
53
53
  };
54
+ readonly TerminalDevices: {
55
+ readonly limit: 50;
56
+ };
54
57
  };
@@ -51,4 +51,7 @@ export const API_LIST_CONSTANTS = {
51
51
  MerchantsList: {
52
52
  limit: API_BASE_LIMIT,
53
53
  },
54
+ TerminalDevices: {
55
+ limit: API_BASE_LIMIT,
56
+ },
54
57
  };
@@ -644,6 +644,9 @@ export declare const APP_CODES: {
644
644
  };
645
645
  };
646
646
  };
647
+ terminals: {
648
+ code: string;
649
+ };
647
650
  };
648
651
  export declare const APP_DIMENSIONS: {
649
652
  [x: string]: {
@@ -1,4 +1,4 @@
1
- import { tokenAppIcon, billingAppIcon, acceptanceAppIcon, payoutsAppIcon, protectAppIcon, customersAppIcon, businessesAppIcon, accountAppIcon, walletAppIcon, authenticationAppIcon, acceptanceWindowIcon, walletWindowIcon, billingWindowIcon, customersWindowIcon, payoutWindowIcon, protectWindowIcon, tokensWindowIcon, accountWindowIcon, businessesWindowIcon, authenticationWindowIcon, reportsWindowIcon, reportAppIcon, orderAppIcon, orderWindowIcon, leadAppIcon, leadTitleIcon, } from './assets';
1
+ import { tokenAppIcon, billingAppIcon, acceptanceAppIcon, payoutsAppIcon, protectAppIcon, customersAppIcon, businessesAppIcon, accountAppIcon, walletAppIcon, authenticationAppIcon, acceptanceWindowIcon, walletWindowIcon, billingWindowIcon, customersWindowIcon, payoutWindowIcon, protectWindowIcon, tokensWindowIcon, accountWindowIcon, businessesWindowIcon, authenticationWindowIcon, reportsWindowIcon, reportAppIcon, orderAppIcon, orderWindowIcon, leadAppIcon, leadTitleIcon, terminalAppIcon, terminalWindowIcon, } from './assets';
2
2
  import { FOOTER_HEIGHT, HEADER_HEIGHT } from './style';
3
3
  export const SERVICE_COMMON_FUNCTIONS = {
4
4
  view: {
@@ -255,6 +255,9 @@ export const APP_CODES = {
255
255
  },
256
256
  },
257
257
  },
258
+ terminals: {
259
+ code: 'TERMINALS',
260
+ },
258
261
  };
259
262
  export const APP_DIMENSIONS = {
260
263
  general: {
@@ -341,5 +344,10 @@ export const APP_ICONS = [
341
344
  iconUrl: leadAppIcon,
342
345
  toolbarIconUrl: leadTitleIcon,
343
346
  },
347
+ {
348
+ code: APP_CODES.terminals.code,
349
+ iconUrl: terminalAppIcon,
350
+ toolbarIconUrl: terminalWindowIcon,
351
+ },
344
352
  ];
345
353
  export const excludedApps = ['login'];
@@ -459,3 +459,11 @@ export declare const rightLightArrowIcon: string;
459
459
  export declare const segmentInstitutionIcon: string;
460
460
  export declare const segmentTechnologyIcon: string;
461
461
  export declare const segmentDevelopmentHouseIcon: string;
462
+ export declare const terminalAppIcon: string;
463
+ export declare const terminalWindowIcon: string;
464
+ export declare const terminalCardPhone: string;
465
+ export declare const toastPOSIcon: string;
466
+ export declare const terminalTypeIcon: string;
467
+ export declare const terminalBrushIcon: string;
468
+ export declare const terminalBrushMuted: string;
469
+ export declare const navigationIcon: string;
@@ -463,3 +463,11 @@ export const rightLightArrowIcon = `${appBaseUrl}/rightLightArrow.svg`;
463
463
  export const segmentInstitutionIcon = `${lightUrl}/other/segmentInstitution.svg`;
464
464
  export const segmentTechnologyIcon = `${lightUrl}/other/segmentTechnology.svg`;
465
465
  export const segmentDevelopmentHouseIcon = `${lightUrl}/other/segmentDevelopmentHouse.svg`;
466
+ export const terminalAppIcon = `${lightUrl}/other/terminal.svg`;
467
+ export const terminalWindowIcon = `${lightUrl}/window/terminal.svg`;
468
+ export const terminalCardPhone = `${lightUrl}/terminalCardPhone.svg`;
469
+ export const toastPOSIcon = `${lightUrl}/ToastPOS.svg`;
470
+ export const terminalTypeIcon = `${lightUrl}/terminalTypeIcon.svg`;
471
+ export const terminalBrushIcon = `${lightUrl}/terminalBrush.svg`;
472
+ export const terminalBrushMuted = `${lightUrl}/terminalBrushMuted.svg`;
473
+ export const navigationIcon = `${lightUrl}/navigationIcon.svg`;
@@ -17,3 +17,4 @@ export * from './walletTableCellWidth';
17
17
  export * from './walletDetailsTableCellWidth';
18
18
  export * from './walletStatementTableCellWidth';
19
19
  export * from './merchantsTableCellWidth';
20
+ export * from './terminalsTableCellWidth';
@@ -17,3 +17,4 @@ export * from './walletTableCellWidth';
17
17
  export * from './walletDetailsTableCellWidth';
18
18
  export * from './walletStatementTableCellWidth';
19
19
  export * from './merchantsTableCellWidth';
20
+ export * from './terminalsTableCellWidth';