@tap-payments/os-micro-frontend-shared 0.0.299 → 0.0.300

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 (57) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/IconWithBadge/IconWithBadge.d.ts +1 -1
  4. package/build/components/IconWithBadge/IconWithBadge.js +9 -13
  5. package/build/components/IconWithBadge/type.d.ts +0 -3
  6. package/build/components/MaskedText/MaskedText.js +1 -3
  7. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +1 -3
  8. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +2 -8
  9. package/build/components/StatusIcons/PayoutIcon/PayoutIcon.d.ts +1 -3
  10. package/build/components/StatusIcons/PayoutIcon/PayoutIcon.js +2 -8
  11. package/build/components/StatusIcons/RefundIcon/RefundIcon.d.ts +1 -3
  12. package/build/components/StatusIcons/RefundIcon/RefundIcon.js +1 -6
  13. package/build/components/TableCells/CustomCells/ApplicationStatusCell/ApplicationStatusCell.d.ts +1 -1
  14. package/build/components/TableCells/CustomCells/ApplicationStatusCell/ApplicationStatusCell.js +5 -39
  15. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +4 -286
  16. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.js +14 -43
  17. package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.js +1 -1
  18. package/build/components/TableCells/CustomCells/BrandsCell/style.js +1 -2
  19. package/build/components/TableCells/CustomCells/SegmentsCell/SegmentsCell.js +4 -5
  20. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
  21. package/build/components/TableCells/CustomCells/SegmentsCell/style.js +5 -1
  22. package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +0 -34
  23. package/build/components/TableCells/CustomCells/StatusCell/constant.js +0 -30
  24. package/build/components/VirtualTable/SheetView/components/SheetViewTableRowLoading.d.ts +2 -1
  25. package/build/components/VirtualTable/SheetView/components/SheetViewTableRowLoading.js +6 -4
  26. package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.d.ts +1 -1
  27. package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +2 -2
  28. package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.d.ts +5 -2
  29. package/build/components/VirtualTable/components/virtualScroll/ListItemWrapper.js +37 -6
  30. package/build/components/index.d.ts +0 -1
  31. package/build/components/index.js +0 -1
  32. package/build/constants/assets.d.ts +0 -2
  33. package/build/constants/assets.js +0 -2
  34. package/build/constants/table/cell/chargeTableCellWidth.d.ts +12 -12
  35. package/build/constants/table/cell/chargeTableCellWidth.js +12 -12
  36. package/build/types/table.d.ts +1 -1
  37. package/package.json +2 -2
  38. package/build/components/SourceChips/AuthenticationChip/AuthenticationChip.d.ts +0 -7
  39. package/build/components/SourceChips/AuthenticationChip/AuthenticationChip.js +0 -31
  40. package/build/components/SourceChips/AuthenticationChip/constants.d.ts +0 -30
  41. package/build/components/SourceChips/AuthenticationChip/constants.js +0 -25
  42. package/build/components/SourceChips/AuthenticationChip/index.d.ts +0 -3
  43. package/build/components/SourceChips/AuthenticationChip/index.js +0 -2
  44. package/build/components/SourceChips/GeographyChip/GeographyChip.d.ts +0 -7
  45. package/build/components/SourceChips/GeographyChip/GeographyChip.js +0 -22
  46. package/build/components/SourceChips/GeographyChip/constants.d.ts +0 -16
  47. package/build/components/SourceChips/GeographyChip/constants.js +0 -11
  48. package/build/components/SourceChips/GeographyChip/index.d.ts +0 -2
  49. package/build/components/SourceChips/GeographyChip/index.js +0 -2
  50. package/build/components/SourceChips/PaymentAgreementChip/PaymentAgreementChip.d.ts +0 -7
  51. package/build/components/SourceChips/PaymentAgreementChip/PaymentAgreementChip.js +0 -21
  52. package/build/components/SourceChips/PaymentAgreementChip/constants.d.ts +0 -21
  53. package/build/components/SourceChips/PaymentAgreementChip/constants.js +0 -16
  54. package/build/components/SourceChips/PaymentAgreementChip/index.d.ts +0 -3
  55. package/build/components/SourceChips/PaymentAgreementChip/index.js +0 -2
  56. package/build/components/SourceChips/index.d.ts +0 -3
  57. package/build/components/SourceChips/index.js +0 -3
@@ -1,51 +1,22 @@
1
- import { styled } from '@mui/material';
2
- import { motion } from 'framer-motion';
3
- export const StyledAppsCell = styled('span')(({ theme }) => ({
1
+ import { Box, styled } from '@mui/material';
2
+ export const AppsWrapper = styled('div')(({ theme }) => ({
4
3
  display: 'flex',
5
4
  alignItems: 'center',
6
- justifyContent: 'flex-start',
7
5
  gap: theme.spacing(1),
6
+ borderRadius: '44px',
7
+ lineHeight: '120%',
8
8
  }));
9
- export const AppsStatusContainer = styled(motion.span)(({ theme, sourcesCount }) => ({
10
- display: 'flex',
11
- alignItems: 'center',
12
- justifyContent: 'flex-start',
13
- position: 'absolute',
14
- minWidth: `${sourcesCount * 6 + 36}px `,
15
- minHeight: '24px',
16
- cursor: 'default',
17
- backgroundColor: theme.palette.background.paper,
18
- borderRadius: '16px',
19
- }));
20
- export const AppTextLabel = styled('span')(() => ({
21
- fontSize: '11px',
22
- overflow: 'hidden',
23
- textOverflow: 'ellipsis',
24
- whiteSpace: 'nowrap',
25
- padding: '2px 0',
26
- }));
27
- export const AppTextWrapper = styled('div')(() => ({
9
+ export const IconWrapper = styled(Box)(({ theme }) => ({
28
10
  display: 'flex',
29
11
  alignItems: 'center',
30
12
  justifyContent: 'center',
31
- paddingInline: '4px',
32
- }));
33
- export const appStatusAnimation = (index, shadow, xDelta) => ({
34
- start: {
35
- x: index * 6,
36
- transition: {
37
- duration: 0.3,
38
- type: 'tween',
39
- ease: 'easeIn',
40
- },
41
- },
42
- animate: {
43
- x: xDelta ? index * xDelta : index * 40,
44
- transition: {
45
- duration: 0.3,
46
- type: 'tween',
47
- ease: 'easeOut',
48
- },
49
- boxShadow: shadow,
13
+ width: '23px',
14
+ height: '23px',
15
+ borderRadius: '50%',
16
+ border: `1px solid ${theme.palette.divider}`,
17
+ img: {
18
+ width: '18.5px',
19
+ height: '18.5px',
20
+ borderRadius: '50%',
50
21
  },
51
- });
22
+ }));
@@ -24,5 +24,5 @@ export default function BrandsCell(_a) {
24
24
  overlayIcon: icon ? _jsx(VerificationIcon, { src: icon }) : null,
25
25
  label: brand.name,
26
26
  };
27
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(BrandsWrapper, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden' } }, { children: [_jsx(IconWithBadge, { mainIcon: item.icon, overlayIcon: item.overlayIcon, mainIconSize: 16, containerSize: 16, borderColor: "transparent" }, item.label), _jsx(Label, { children: brand.name })] })) })) }) })));
27
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(BrandsWrapper, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden' } }, { children: [_jsx(IconWithBadge, { mainIcon: item.icon, overlayIcon: item.overlayIcon }, item.label), _jsx(Label, { children: brand.name })] })) })) }) })));
28
28
  }
@@ -3,10 +3,9 @@ export const BrandsWrapper = styled('div')(({ theme }) => ({
3
3
  display: 'flex',
4
4
  alignItems: 'center',
5
5
  gap: theme.spacing(1),
6
- border: '1px solid #F2F2F2',
7
6
  borderRadius: '44px',
8
- padding: '4px 8px',
9
7
  lineHeight: '120%',
8
+ cursor: 'pointer',
10
9
  }));
11
10
  export const BrandName = styled('div')(({ theme }) => ({
12
11
  fontSize: '14px',
@@ -17,8 +17,7 @@ import Tooltip from '../../../Tooltip';
17
17
  import { ImageWrapper } from '../../../index.js';
18
18
  import { TableCell } from '../../../TableCells';
19
19
  import { segmentsIcons } from './constant';
20
- import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, referenceSourceAnimation } from './style';
21
- import IconWithBadge from '../../../IconWithBadge';
20
+ import { ReferenceTextLabel, ReferenceTextWrapper, ReferenceSourcesContainer, StyledSourceCell, StyledSourceImage, referenceSourceAnimation, } from './style';
22
21
  function SegmentsCell(_a) {
23
22
  var { isTextShown } = _a, props = __rest(_a, ["isTextShown"]);
24
23
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
@@ -33,11 +32,11 @@ function SegmentsCell(_a) {
33
32
  }, onClose: () => {
34
33
  setIsTooltipOpen(false);
35
34
  }, title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: referenceSourceAnimation(index, theme.shadows[4], isTextShown ? 83 : 0), sx: {
36
- width: isTextShown ? '79px' : '36px',
37
- } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment) }) })) : (_jsx(IconWithBadge, { mainIcon: (segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) || segmentsIcons[segment], mainIconSize: segment === 'order' ? 11.82 : 16, containerSize: segment === 'order' ? 11.82 : 16, sx: Object.assign({}, ((segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) && { borderRadius: '40px' })), onError: (e) => {
35
+ width: isTextShown ? '79px' : '24px',
36
+ } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment) }) })) : (_jsx(StyledSourceImage, { src: (segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) || segmentsIcons[segment], alt: segment, sx: Object.assign(Object.assign({}, (segment === 'order' && { width: '11.82px' })), ((segmentData === null || segmentData === void 0 ? void 0 : segmentData.icon) && { borderRadius: '40px' })), onError: (e) => {
38
37
  e.currentTarget.src = segmentsIcons[segment];
39
38
  e.currentTarget.style.borderRadius = '0px';
40
- }, borderColor: "transparent" })) })) }), `${segment}-${index}`));
39
+ } })) })) }), `${segment}-${index}`));
41
40
  }), [props, segments, isTextShown, theme]);
42
41
  const referenceSourcesCount = (ReferenceSources === null || ReferenceSources === void 0 ? void 0 : ReferenceSources.length) || 0;
43
42
  return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(StyledSourceCell, { children: referenceSourcesCount > 0 ? (_jsx(ReferenceSourcesContainer, Object.assign({ layout: true, className: "reference-sources-container", whileHover: "animate", animate: isTooltipOpen ? 'animate' : 'start', sourcesCount: referenceSourcesCount, variants: { animate: { width: referenceSourcesCount * (6 + 32) } }, style: {
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
+ export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
3
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
5
6
  id?: string | undefined;
@@ -6,6 +6,10 @@ export const StyledSourceCell = styled('span')(({ theme }) => ({
6
6
  justifyContent: 'flex-start',
7
7
  gap: theme.spacing(1),
8
8
  }));
9
+ export const StyledSourceImage = styled('img')(() => ({
10
+ maxWidth: '12px',
11
+ maxHeight: '12px',
12
+ }));
9
13
  export const ReferenceSourcesContainer = styled(motion.span)(({ theme, sourcesCount }) => ({
10
14
  display: 'flex',
11
15
  alignItems: 'center',
@@ -40,7 +44,7 @@ export const referenceSourceAnimation = (index, shadow, xDelta) => ({
40
44
  },
41
45
  },
42
46
  animate: {
43
- x: xDelta ? index * xDelta : index * 40,
47
+ x: xDelta ? index * xDelta : index * 28,
44
48
  transition: {
45
49
  duration: 0.3,
46
50
  type: 'tween',
@@ -38,23 +38,6 @@ export declare const payoutStatusIcons: {
38
38
  SETTLED: string;
39
39
  PENDING: string;
40
40
  };
41
- export declare const payoutStatusStyles: {
42
- PAID_OUT: {
43
- color: string;
44
- background: string;
45
- border: string;
46
- };
47
- SETTLED: {
48
- color: string;
49
- background: string;
50
- border: string;
51
- };
52
- PENDING: {
53
- color: string;
54
- background: string;
55
- border: string;
56
- };
57
- };
58
41
  export declare const authorizedStatusIcons: {
59
42
  AUTHORIZED: string;
60
43
  };
@@ -62,20 +45,3 @@ export declare const capturedStatusesStyles: Record<(typeof unCapturedStatuses)[
62
45
  color: string;
63
46
  background: string;
64
47
  }>;
65
- export declare const chargeSheetViewChipStyles: {
66
- ABANDONED: {
67
- color: string;
68
- background: string;
69
- border: string;
70
- };
71
- CANCELLED: {
72
- color: string;
73
- background: string;
74
- border: string;
75
- };
76
- INITIATED: {
77
- color: string;
78
- background: string;
79
- border: string;
80
- };
81
- };
@@ -82,23 +82,6 @@ export const payoutStatusIcons = {
82
82
  SETTLED: settledIcon,
83
83
  PENDING: settlementInitiatedIcon,
84
84
  };
85
- export const payoutStatusStyles = {
86
- PAID_OUT: {
87
- color: '#2ACE00',
88
- background: '#2ACE001A',
89
- border: 'none',
90
- },
91
- SETTLED: {
92
- color: '#2ACE00',
93
- background: 'transparent',
94
- border: '1px solid #2ACE0066',
95
- },
96
- PENDING: {
97
- color: '#FF7A00',
98
- background: '#FF7A000D',
99
- border: 'none',
100
- },
101
- };
102
85
  export const authorizedStatusIcons = {
103
86
  AUTHORIZED: authorizedIcon,
104
87
  };
@@ -108,16 +91,3 @@ export const capturedStatusesStyles = {
108
91
  background: '#1F88D00D',
109
92
  },
110
93
  };
111
- export const chargeSheetViewChipStyles = Object.assign(Object.assign(Object.assign({}, unCapturedStatusesStyles), capturedStatusesStyles), { ABANDONED: {
112
- color: '#FFD600',
113
- background: 'white',
114
- border: '1px solid #FFD60080',
115
- }, CANCELLED: {
116
- color: '#EDC806',
117
- background: '#FFD6001A',
118
- border: 'none',
119
- }, INITIATED: {
120
- color: '#8D8D94',
121
- background: 'white',
122
- border: '1px solid #8D8D941A',
123
- } });
@@ -6,7 +6,8 @@ interface ISheetViewTableRowLoadingProps {
6
6
  animationType?: AnimationType;
7
7
  style?: CSSProperties;
8
8
  rowIndex?: number;
9
+ useTableBackground?: boolean;
9
10
  }
10
- declare function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex }: ISheetViewTableRowLoadingProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex, useTableBackground, }: ISheetViewTableRowLoadingProps): import("react/jsx-runtime").JSX.Element;
11
12
  declare const _default: import("react").MemoExoticComponent<typeof SheetViewTableRowLoading>;
12
13
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import Skeleton from '@mui/material/Skeleton';
4
- import { styled } from '@mui/material/styles';
4
+ import { styled, useTheme } from '@mui/material/styles';
5
5
  import TableCell from '@mui/material/TableCell';
6
6
  import MUITableRow from '@mui/material/TableRow';
7
7
  import { areEqual } from 'react-window';
@@ -11,14 +11,16 @@ const StyledSkeleton = styled(Skeleton)(() => ({
11
11
  width: '100%',
12
12
  minWidth: '20px',
13
13
  }));
14
- function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex = 0 }) {
15
- return (_jsx(MUITableRow, Object.assign({ sx: Object.assign(Object.assign({}, style), { display: 'flex', borderBottom: '1px solid #F2F2F2', minHeight: '28px', height: '28px', alignItems: 'center', '&:hover': {
14
+ function SheetViewTableRowLoading({ columns, style, index, animationType, rowIndex = 0, useTableBackground = false, }) {
15
+ const theme = useTheme();
16
+ return (_jsx(MUITableRow, Object.assign({ sx: Object.assign(Object.assign({}, style), { display: 'flex', borderBottom: '1px solid #F2F2F2', minHeight: '28px', height: '28px', alignItems: 'center', backgroundColor: useTableBackground ? theme.palette.background.default : 'transparent', '&:hover': {
16
17
  backgroundColor: 'transparent !important',
17
18
  } }), component: "div", hover: true }, { children: columns.map((column, colIndex) => {
18
19
  var _a;
19
20
  const isLastColumn = colIndex === columns.length - 1;
20
21
  const isFirstColumn = colIndex === 0;
21
- const shouldShowActualData = isFirstColumn && column.render;
22
+ const isPinnedStart = column.pinned === 'start';
23
+ const shouldShowActualData = isFirstColumn && isPinnedStart;
22
24
  return (_jsx(TableCell, Object.assign({ sx: {
23
25
  width: column.width || `${100 / columns.length}%` || '20%',
24
26
  paddingBlock: '0',
@@ -4,5 +4,5 @@ interface InputsI {
4
4
  onCloseDropdown: (e: MouseEvent<HTMLElement>) => void;
5
5
  filter: IColumnFilter & IColumnFilterInputs;
6
6
  }
7
- declare function Inputs({ onCloseDropdown, filter: { options, onConfirm, data, isOnlyOneFilter, onClearFilterFields, wrapperSx } }: InputsI): import("react/jsx-runtime").JSX.Element;
7
+ declare function Inputs({ onCloseDropdown, filter: { options, onConfirm, data, isOnlyOneFilter, onColumnFilterClearClick, wrapperSx } }: InputsI): import("react/jsx-runtime").JSX.Element;
8
8
  export default Inputs;
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
7
7
  import { grayCloseIcon, searchIcon } from '../../../../../constants/index.js';
8
8
  import { Wrapper, Text, InputStyled, InputsWrapper, ClearButton, ClearWrapper } from './style';
9
9
  import { CancelButton, Footer, OkayButton } from '../style';
10
- function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter, onClearFilterFields, wrapperSx } }) {
10
+ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter, onColumnFilterClearClick, wrapperSx } }) {
11
11
  const [values, setValues] = useState({});
12
12
  useEffect(() => {
13
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 : '' })); }, {}));
@@ -21,7 +21,7 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
21
21
  onCloseDropdown(e);
22
22
  };
23
23
  const onClickClear = () => {
24
- onClearFilterFields === null || onClearFilterFields === void 0 ? void 0 : onClearFilterFields();
24
+ onColumnFilterClearClick === null || onColumnFilterClearClick === void 0 ? void 0 : onColumnFilterClearClick();
25
25
  setValues(options.reduce((acc, { apiKey }) => (Object.assign(Object.assign({}, acc), { [apiKey]: '' })), {}));
26
26
  };
27
27
  const isInputHasValue = (key) => values[key] !== undefined && values[key].length > 0;
@@ -1,11 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { ListChildComponentProps } from 'react-window';
3
- export declare const LastRowContent: React.MemoExoticComponent<({ isLoadingRow, isSheetView }: {
3
+ import type { IColumnProps } from '../../../../types/index.js';
4
+ export declare const LastRowContent: React.MemoExoticComponent<({ isLoadingRow, isSheetView, columns, currentRowCount, }: {
4
5
  isLoadingRow: boolean;
5
6
  isSheetView?: boolean | undefined;
7
+ columns?: IColumnProps<any>[] | undefined;
8
+ currentRowCount?: number | undefined;
6
9
  }) => import("react/jsx-runtime").JSX.Element>;
7
10
  export declare const StyledItemWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
8
11
  showShadowHighlight?: boolean | undefined;
9
12
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
13
+ declare function ListItemWrapper({ index, style, data: { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned, ...restData }, }: Readonly<ListChildComponentProps>): import("react/jsx-runtime").JSX.Element;
11
14
  export default ListItemWrapper;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React from 'react';
14
14
  import { Box } from '@mui/material';
15
15
  import { styled } from '@mui/material/styles';
@@ -19,9 +19,13 @@ import { ActionIcon } from '../../style';
19
19
  import { RowErrorState } from '../RowErrorState';
20
20
  import { StyledParagraph } from '../TableLastItem';
21
21
  import TableRow from '../TableRow';
22
- export const LastRowContent = React.memo(({ isLoadingRow, isSheetView }) => {
22
+ import SheetViewTableRowLoading from '../../SheetView/components/SheetViewTableRowLoading';
23
+ export const LastRowContent = React.memo(({ isLoadingRow, isSheetView, columns, currentRowCount, }) => {
23
24
  const { t } = useTranslation();
24
25
  if (isLoadingRow) {
26
+ if (isSheetView && (columns === null || columns === void 0 ? void 0 : columns.length)) {
27
+ return (_jsx(_Fragment, { children: Array.from({ length: 3 }, (_, i) => (_jsx(SheetViewTableRowLoading, { columns: columns, animationType: "wave", rowIndex: (currentRowCount || 0) + i + 1, useTableBackground: true }, `loading-row-${i}`))) }));
28
+ }
25
29
  return (_jsxs(Box, Object.assign({ "data-testid": "ListItemWrapper_lastRowContent_isLoadingRow", sx: {
26
30
  height: isSheetView ? '100%' : '24px',
27
31
  width: '24px',
@@ -48,20 +52,33 @@ export const StyledItemWrapper = styled('div', {
48
52
  }));
49
53
  function ListItemWrapper(_a) {
50
54
  var _b;
51
- var { index, style } = _a, _c = _a.data, { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, limit, totalCount, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned = false } = _c, restData = __rest(_c, ["renderedScrollTopRef", "rows", "rowProps", "columns", "isLoading", "scrollToIndex", "limit", "totalCount", "newLoadedRowsEndIndex", "isError", "areAllRowsLoaded", "isSheetView", "isPinned"]);
55
+ var { index, style } = _a, _c = _a.data, { renderedScrollTopRef, rows, rowProps, columns, isLoading, scrollToIndex, newLoadedRowsEndIndex, isError, areAllRowsLoaded, isSheetView, isPinned = false } = _c, restData = __rest(_c, ["renderedScrollTopRef", "rows", "rowProps", "columns", "isLoading", "scrollToIndex", "newLoadedRowsEndIndex", "isError", "areAllRowsLoaded", "isSheetView", "isPinned"]);
52
56
  const lastItemIndex = rows.length - 1;
53
57
  const row = rows[index];
54
58
  const isLoadingRow = isLoading && index === lastItemIndex + 1;
55
59
  const isLoadedRow = index <= newLoadedRowsEndIndex;
56
60
  const rowClickHandler = React.useCallback(createRowClickHandler(row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick), [row, rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick]);
57
- const memoizedRowProps = React.useMemo(() => (Object.assign(Object.assign({ showShadowHighlight: scrollToIndex === index, showLoadedStyle: isLoadedRow }, rowProps), { onClick: rowClickHandler })), [scrollToIndex, index, isLoadedRow, rowProps, rowClickHandler, isLoadingRow, areAllRowsLoaded, lastItemIndex]);
61
+ const memoizedRowProps = React.useMemo(() => (Object.assign(Object.assign({ showShadowHighlight: scrollToIndex === index, showLoadedStyle: isLoadedRow }, rowProps), { onClick: rowClickHandler })), [scrollToIndex, index, isLoadedRow, rowProps, rowClickHandler]);
62
+ const renderSheetViewLoadingRow = React.useCallback((lastRowContent) => {
63
+ return (_jsx(Box, Object.assign({ sx: {
64
+ minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT,
65
+ height: '100%',
66
+ width: '100%',
67
+ } }, { children: isError ? _jsx(RowErrorState, {}) : lastRowContent })));
68
+ }, [isError]);
58
69
  const memoizedListItemComponent = React.useMemo(() => {
59
- const lastRowContent = _jsx(LastRowContent, { isSheetView: isSheetView, isLoadingRow: isLoadingRow });
70
+ const lastRowContent = _jsx(LastRowContent, { isSheetView: isSheetView, isLoadingRow: isLoadingRow, columns: columns, currentRowCount: rows.length });
60
71
  const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
61
72
  if (isPinned && isLastRow) {
73
+ if (isSheetView && isLoadingRow && columns && columns.length > 0) {
74
+ return renderSheetViewLoadingRow(lastRowContent);
75
+ }
62
76
  return (_jsx(Box, { sx: Object.assign(Object.assign({}, (isSheetView ? { minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT, height: '100%' } : { height: TABLE_ROW_HEIGHT })), { backgroundColor: '#F6F8FACC' }) }));
63
77
  }
64
78
  if (isLastRow) {
79
+ if (isSheetView && isLoadingRow && columns && columns.length > 0) {
80
+ return renderSheetViewLoadingRow(lastRowContent);
81
+ }
65
82
  return (_jsx(Box, Object.assign({ sx: Object.assign(Object.assign({}, (isSheetView ? { minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT, height: '100%' } : { height: TABLE_ROW_HEIGHT })), { display: 'flex', justifyContent: 'center', alignItems: 'center' }) }, { children: _jsx(Box, Object.assign({ sx: {
66
83
  backgroundColor: '#F6F8FACC',
67
84
  display: 'flex',
@@ -72,7 +89,21 @@ function ListItemWrapper(_a) {
72
89
  } }, { children: isError ? _jsx(RowErrorState, {}) : lastRowContent })) })));
73
90
  }
74
91
  return (_jsx(TableRow, { index: index, row: row, columns: columns, rowProps: memoizedRowProps, isSheetView: isSheetView, selectedCell: restData.selectedCell, selectedColumn: restData.selectedColumn, onCellClick: restData.onCellClick, isLastRow: index === rows.length - 1 }, `row-${index}`));
75
- }, [restData, index, row, columns, memoizedRowProps, isSheetView]);
92
+ }, [
93
+ restData,
94
+ index,
95
+ row,
96
+ columns,
97
+ memoizedRowProps,
98
+ isSheetView,
99
+ isLoadingRow,
100
+ isError,
101
+ areAllRowsLoaded,
102
+ lastItemIndex,
103
+ isPinned,
104
+ rows.length,
105
+ renderSheetViewLoadingRow,
106
+ ]);
76
107
  return (_jsx("div", Object.assign({ "data-testid": "ListItemWrapper", style: Object.assign(Object.assign({}, style), { top: Number(style.top) - ((_b = renderedScrollTopRef === null || renderedScrollTopRef === void 0 ? void 0 : renderedScrollTopRef.current) !== null && _b !== void 0 ? _b : 0), willChange: 'top' }) }, { children: _jsx(StyledItemWrapper, Object.assign({ "data-testid": "ListItemWrapper_StyledItemWrapper" }, { children: memoizedListItemComponent })) })));
77
108
  }
78
109
  export default ListItemWrapper;
@@ -94,6 +94,5 @@ export * from './StatusGroupChips';
94
94
  export * from './TableHeader';
95
95
  export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
- export * from './SourceChips';
98
97
  export { default as ScrollLoader } from './ScrollLoader';
99
98
  export * from './ScrollLoader';
@@ -94,6 +94,5 @@ export * from './StatusGroupChips';
94
94
  export * from './TableHeader';
95
95
  export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
- export * from './SourceChips';
98
97
  export { default as ScrollLoader } from './ScrollLoader';
99
98
  export * from './ScrollLoader';
@@ -133,8 +133,6 @@ export declare const receiptBillIcon: string;
133
133
  export declare const newReceiptIcon: string;
134
134
  export declare const acceptanceAppIcon: string;
135
135
  export declare const acceptanceEnabledIcon: string;
136
- export declare const acceptanceBlueIcon: string;
137
- export declare const payoutsGreenIcon: string;
138
136
  export declare const acceptanceAppDisabledIcon: string;
139
137
  export declare const payoutAppDisabledIcon: string;
140
138
  export declare const payoutEnabledIcon: string;
@@ -134,8 +134,6 @@ export const receiptBillIcon = `${appBaseUrl}/receiptBill.svg`;
134
134
  export const newReceiptIcon = `${lightUrl}/newReceiptIcon.svg`;
135
135
  export const acceptanceAppIcon = `${appBaseUrl}/acceptance.svg`;
136
136
  export const acceptanceEnabledIcon = `${lightUrl}/acceptanceEnabled.svg`;
137
- export const acceptanceBlueIcon = `${lightUrl}/acceptanceBlue.svg`;
138
- export const payoutsGreenIcon = `${lightUrl}/payoutsGreen.svg`;
139
137
  export const acceptanceAppDisabledIcon = `${appBaseUrl}/acceptanceAppIconDisabled.svg`;
140
138
  export const payoutAppDisabledIcon = `${appBaseUrl}/payoutsAppIconDisabled.svg`;
141
139
  export const payoutEnabledIcon = `${lightUrl}/payoutEnabled.svg`;
@@ -12,7 +12,7 @@ export declare const chargeTableCellWidth: {
12
12
  readonly id: {
13
13
  readonly default: "225px";
14
14
  readonly text: "225px";
15
- readonly sheet: "215px";
15
+ readonly sheet: "235px";
16
16
  };
17
17
  readonly product: {
18
18
  readonly default: "85px";
@@ -37,7 +37,7 @@ export declare const chargeTableCellWidth: {
37
37
  readonly customer: {
38
38
  readonly default: "180px";
39
39
  readonly text: "180px";
40
- readonly sheet: "115px";
40
+ readonly sheet: "145px";
41
41
  };
42
42
  readonly source: {
43
43
  readonly default: "114px";
@@ -62,7 +62,7 @@ export declare const chargeTableCellWidth: {
62
62
  readonly destinations: {
63
63
  readonly default: "70px";
64
64
  readonly text: "240px";
65
- readonly sheet: "380px";
65
+ readonly sheet: "340px";
66
66
  };
67
67
  readonly topup: {
68
68
  readonly default: "20px";
@@ -97,17 +97,17 @@ export declare const chargeTableCellWidth: {
97
97
  readonly receipt: {
98
98
  readonly default: "85px";
99
99
  readonly text: "150px";
100
- readonly sheet: "135px";
100
+ readonly sheet: "155px";
101
101
  };
102
102
  readonly fees: {
103
103
  readonly default: "150px";
104
104
  readonly text: "150px";
105
- readonly sheet: "150px";
105
+ readonly sheet: "170px";
106
106
  };
107
107
  readonly metadata: {
108
108
  readonly default: "180px";
109
109
  readonly text: "180px";
110
- readonly sheet: "245px";
110
+ readonly sheet: "265px";
111
111
  };
112
112
  readonly settlement: {
113
113
  readonly default: "200px";
@@ -137,12 +137,12 @@ export declare const chargeTableCellWidth: {
137
137
  readonly auth_code: {
138
138
  readonly default: "80px";
139
139
  readonly text: "80px";
140
- readonly sheet: "80px";
140
+ readonly sheet: "100px";
141
141
  };
142
142
  readonly rrn: {
143
143
  readonly default: "100px";
144
144
  readonly text: "100px";
145
- readonly sheet: "83px";
145
+ readonly sheet: "105px";
146
146
  };
147
147
  readonly device: {
148
148
  readonly default: "70px";
@@ -182,21 +182,21 @@ export declare const chargeTableCellWidth: {
182
182
  readonly acquirer_ref: {
183
183
  readonly default: "125px";
184
184
  readonly text: "125px";
185
- readonly sheet: "125px";
185
+ readonly sheet: "145px";
186
186
  };
187
187
  readonly order_ref: {
188
188
  readonly default: "200px";
189
189
  readonly text: "200px";
190
- readonly sheet: "200px";
190
+ readonly sheet: "220px";
191
191
  };
192
192
  readonly payment_ref: {
193
193
  readonly default: "150px";
194
194
  readonly text: "150px";
195
- readonly sheet: "150px";
195
+ readonly sheet: "170px";
196
196
  };
197
197
  readonly generic_ref: {
198
198
  readonly default: "125px";
199
199
  readonly text: "125px";
200
- readonly sheet: "125px";
200
+ readonly sheet: "145px";
201
201
  };
202
202
  };
@@ -12,7 +12,7 @@ export const chargeTableCellWidth = {
12
12
  id: {
13
13
  default: '225px',
14
14
  text: '225px',
15
- sheet: '215px',
15
+ sheet: '235px',
16
16
  },
17
17
  product: {
18
18
  default: '85px',
@@ -37,7 +37,7 @@ export const chargeTableCellWidth = {
37
37
  customer: {
38
38
  default: '180px',
39
39
  text: '180px',
40
- sheet: '115px',
40
+ sheet: '145px',
41
41
  },
42
42
  source: {
43
43
  default: '114px',
@@ -62,7 +62,7 @@ export const chargeTableCellWidth = {
62
62
  destinations: {
63
63
  default: '70px',
64
64
  text: '240px',
65
- sheet: '380px',
65
+ sheet: '340px',
66
66
  },
67
67
  topup: {
68
68
  default: '20px',
@@ -97,17 +97,17 @@ export const chargeTableCellWidth = {
97
97
  receipt: {
98
98
  default: '85px',
99
99
  text: '150px',
100
- sheet: '135px',
100
+ sheet: '155px',
101
101
  },
102
102
  fees: {
103
103
  default: '150px',
104
104
  text: '150px',
105
- sheet: '150px',
105
+ sheet: '170px',
106
106
  },
107
107
  metadata: {
108
108
  default: '180px',
109
109
  text: '180px',
110
- sheet: '245px',
110
+ sheet: '265px',
111
111
  },
112
112
  settlement: {
113
113
  default: '200px',
@@ -137,12 +137,12 @@ export const chargeTableCellWidth = {
137
137
  auth_code: {
138
138
  default: '80px',
139
139
  text: '80px',
140
- sheet: '80px',
140
+ sheet: '100px',
141
141
  },
142
142
  rrn: {
143
143
  default: '100px',
144
144
  text: '100px',
145
- sheet: '83px',
145
+ sheet: '105px',
146
146
  },
147
147
  device: {
148
148
  default: '70px',
@@ -182,21 +182,21 @@ export const chargeTableCellWidth = {
182
182
  acquirer_ref: {
183
183
  default: '125px',
184
184
  text: '125px',
185
- sheet: '125px',
185
+ sheet: '145px',
186
186
  },
187
187
  order_ref: {
188
188
  default: '200px',
189
189
  text: '200px',
190
- sheet: '200px',
190
+ sheet: '220px',
191
191
  },
192
192
  payment_ref: {
193
193
  default: '150px',
194
194
  text: '150px',
195
- sheet: '150px',
195
+ sheet: '170px',
196
196
  },
197
197
  generic_ref: {
198
198
  default: '125px',
199
199
  text: '125px',
200
- sheet: '125px',
200
+ sheet: '145px',
201
201
  },
202
202
  };
@@ -136,7 +136,7 @@ export type ColumnFilterValues = Record<string, string | string[] | Record<strin
136
136
  export type IColumnFilter = ({
137
137
  onConfirm?: (filterValues: ColumnFilterValues) => void;
138
138
  onClear: (apiKeys: string[]) => void;
139
- onClearFilterFields?: () => void;
139
+ onColumnFilterClearClick?: () => void;
140
140
  data?: ColumnFilterValues;
141
141
  isOnlyOneFilter?: boolean;
142
142
  wrapperSx?: SxProps;
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.299",
5
- "testVersion": 9,
4
+ "version": "0.0.300",
5
+ "testVersion": 5,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",