@tap-payments/os-micro-frontend-shared 0.1.400 → 0.1.401-test.1

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 (59) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/Chip/style.d.ts +0 -1
  3. package/build/components/CountBadge/style.d.ts +0 -1
  4. package/build/components/Dialog/style.d.ts +0 -1
  5. package/build/components/FlippingCard/style.d.ts +0 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  7. package/build/components/JSONViewer/style.d.ts +0 -1
  8. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  9. package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
  10. package/build/components/SearchButton/styles.d.ts +0 -1
  11. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  12. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  13. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  14. package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
  15. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  16. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
  17. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  18. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  19. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  20. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  21. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  22. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  23. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  28. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  29. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  39. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  40. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  41. package/build/components/TableReports/style.d.ts +0 -1
  42. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +3 -1
  43. package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +1 -0
  44. package/build/components/VirtualTables/VirtualTable/VirtualTable.js +2 -2
  45. package/build/components/VirtualTables/components/ColumnFilter/ColumnFilter.d.ts +1 -1
  46. package/build/components/VirtualTables/components/ColumnFilter/ColumnFilter.js +16 -28
  47. package/build/components/VirtualTables/components/ColumnFilter/type.d.ts +2 -0
  48. package/build/components/VirtualTables/components/TableHeader/TableHeader.d.ts +1 -1
  49. package/build/components/VirtualTables/components/TableHeader/TableHeader.js +2 -2
  50. package/build/components/VirtualTables/components/TableHeader/components/TableCell/TableCell.d.ts +2 -1
  51. package/build/components/VirtualTables/components/TableHeader/components/TableCell/TableCell.js +4 -2
  52. package/build/components/VirtualTables/components/TableHeader/type.d.ts +1 -0
  53. package/build/components/VirtualTables/components/style.d.ts +1 -4
  54. package/build/components/VirtualTables/components/style.js +17 -2
  55. package/build/components/VirtualTables/hooks/useColumnFilter.d.ts +10 -0
  56. package/build/components/VirtualTables/hooks/useColumnFilter.js +22 -0
  57. package/build/constants/assets.d.ts +2 -0
  58. package/build/constants/assets.js +2 -0
  59. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type AnimatedSpinnerIconProps = {
4
3
  width?: string;
5
4
  height?: string;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { GetSourceAnimationFunction } from './type';
4
3
  export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
4
  variant?: import("./type").ChipVariant | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const FOOTER_HEIGHT = 37;
4
3
  export declare const TITLE_BAR_HEIGHT = "32px";
5
4
  export declare const VIEWER_HEIGHT = 545;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { type Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
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>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
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>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { TableMode } from '../../../../types/index.js';
4
3
  export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
5
4
  tableMode?: TableMode | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledAgreementCardIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const CardContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
3
  export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
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>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
3
  isTextShown?: boolean | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
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>, {}>;
5
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
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>, {}>;
5
4
  export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
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>, {}>;
4
3
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
3
  variant?: "Global" | "Regional" | "Local" | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type ExportButtonProps = {
4
3
  notificationState?: {
5
4
  success: boolean;
@@ -8,11 +8,13 @@ import { PinIconContainer, HeaderText } from '../style';
8
8
  import ColumnSort from '../../components/ColumnSort';
9
9
  import { ColumnResize } from '../features/resize';
10
10
  import { getColumnId } from '../features/resize/utils/resize';
11
+ import useColumnFilter from '../../../VirtualTables/hooks/useColumnFilter';
11
12
  function SheetViewTableHeaderCell({ column: { header, id, tableViewId, align, headerStyle, sortable, filter, pinnable, width, order, pinned }, colIndex, isFirst, isLast, isSelected, isDefaultPinned, onColumnSort, columnsSorting, onColumnPin, isPinnable, lastColumnId, onColumnClick, pinnedColumns, onStartResize, isResizing = false, resizingColumn = null, }) {
12
13
  // Use the same unique column ID logic as resize to ensure consistency
13
14
  const columnId = getColumnId({ id, tableViewId });
14
15
  const [columnFilterEl, setColumnFilterEl] = useState(null);
15
16
  const cellRef = useRef(null);
17
+ const { isFilterApplied } = useColumnFilter({ filter });
16
18
  const checkIsPanned = useCallback((columnId) => pinnedColumns === null || pinnedColumns === void 0 ? void 0 : pinnedColumns.includes(columnId), [pinnedColumns]);
17
19
  const isPinned = useMemo(() => checkIsPanned(id), [id, checkIsPanned]);
18
20
  const handlePinClick = (columnId) => {
@@ -50,7 +52,7 @@ function SheetViewTableHeaderCell({ column: { header, id, tableViewId, align, he
50
52
  right: 0,
51
53
  left: 0,
52
54
  bottom: 0,
53
- } }, headerStyle)) }, { children: [_jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
55
+ } }, headerStyle)) }, { children: [_jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl, isFilterApplied: isFilterApplied })), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
54
56
  onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, e, pinned);
55
57
  } })), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
56
58
  event.stopPropagation();
@@ -27,6 +27,7 @@ export interface SheetViewTableHeaderProps {
27
27
  onStartResize?: (e: React.MouseEvent, columnId: string) => void;
28
28
  isResizing?: boolean;
29
29
  resizingColumn?: string | null;
30
+ totalCount?: number;
30
31
  }
31
32
  export interface VirtualTableContainerProps {
32
33
  columnsData: IColumnProps[];
@@ -35,7 +35,7 @@ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToInde
35
35
  isSheetView,
36
36
  }));
37
37
  function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, onStartDrag, isSheetView = false, isMinimized, footerComponent, customNoDataComponent, }) {
38
- var _a;
38
+ var _a, _b;
39
39
  const theme = useTheme();
40
40
  const onPointerDown = (e) => {
41
41
  onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
@@ -100,7 +100,7 @@ function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader,
100
100
  autoSizerKey,
101
101
  ]);
102
102
  const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
103
- return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [_jsx(StyledTableBox, Object.assign({ as: "main", id: "table-box-container", "aria-labelledby": "table-box-container", "data-testid": "VirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign({}, tableBodyStyles) }, { children: [showHeader && (_jsx(TableHeader, { "data-testid": "VirtualTable_TableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, isSheetView: isSheetView })), showNoDataView ? (customNoDataComponent ? (customNoDataComponent) : (_jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }))) : (_jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
103
+ return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [_jsx(StyledTableBox, Object.assign({ as: "main", id: "table-box-container", "aria-labelledby": "table-box-container", "data-testid": "VirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign({}, tableBodyStyles) }, { children: [showHeader && (_jsx(TableHeader, { "data-testid": "VirtualTable_TableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, isSheetView: isSheetView, totalCount: (_b = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _b !== void 0 ? _b : 0 })), showNoDataView ? (customNoDataComponent ? (customNoDataComponent) : (_jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }))) : (_jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
104
104
  width: '100%',
105
105
  minWidth: 'fit-content',
106
106
  } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "VirtualTable_StyledBox", hidePadding: true, className: "list-wrapper" }, { children: renderTableContainer })) })))] })) })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ColumnFilterProps } from './type';
3
- declare function ColumnFilter(filter: ColumnFilterProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function ColumnFilter(props: ColumnFilterProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof ColumnFilter>;
5
5
  export default _default;
@@ -7,52 +7,40 @@ import { closeIcon, columnIcon, whiteFilterIcon } from '../../../../constants/in
7
7
  import Inputs from './Inputs';
8
8
  import List from './List';
9
9
  import { FilterWrapper } from './style';
10
- function ColumnFilter(filter) {
11
- const { anchorEl, setAnchorEl, onClose } = filter;
10
+ function ColumnFilter(props) {
11
+ const { anchorEl, setAnchorEl, onClose, isFilterApplied, disabled } = props;
12
12
  const onCloseDropdown = (event) => {
13
13
  event.stopPropagation();
14
14
  setAnchorEl(null);
15
15
  onClose === null || onClose === void 0 ? void 0 : onClose(event);
16
16
  };
17
- const filterData = useMemo(() => { var _a; return ((_a = filter === null || filter === void 0 ? void 0 : filter.options) === null || _a === void 0 ? void 0 : _a.reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = filter === null || filter === void 0 ? void 0 : filter.data) === null || _a === void 0 ? void 0 : _a[apiKey] })); }, {})) || {}; }, [filter]);
18
- const listFilterData = useMemo(() => {
19
- var _a;
20
- const listFilter = filter;
21
- const rawData = (_a = listFilter === null || listFilter === void 0 ? void 0 : listFilter.data) === null || _a === void 0 ? void 0 : _a[listFilter.apiKey];
22
- return Array.isArray(rawData) ? rawData : [];
23
- }, [filter]);
24
- const showClearIcon = useMemo(() => Object.values(filterData || {}).some((value) => {
25
- if (typeof value === 'string' || Array.isArray(value))
26
- return value.length > 0;
27
- return value != null;
28
- }) || listFilterData.length > 0, [filterData, listFilterData]);
29
17
  const open = Boolean(anchorEl);
30
18
  const filterApiKeys = useMemo(() => {
31
19
  var _a;
32
- if (filter.type === 'list') {
33
- return [filter.apiKey];
20
+ if (props.type === 'list') {
21
+ return [props.apiKey];
34
22
  }
35
- return (_a = ((filter === null || filter === void 0 ? void 0 : filter.options) || [])) === null || _a === void 0 ? void 0 : _a.map(({ apiKey }) => apiKey);
36
- }, [filter]);
23
+ return (_a = ((props === null || props === void 0 ? void 0 : props.options) || [])) === null || _a === void 0 ? void 0 : _a.map(({ apiKey }) => apiKey);
24
+ }, [props]);
37
25
  const renderFilter = useMemo(() => {
38
- if (filter.type === 'list')
39
- return _jsx(List, { onCloseDropdown: onCloseDropdown, filter: filter });
40
- if (filter.type === 'inputs')
41
- return _jsx(Inputs, { onCloseDropdown: onCloseDropdown, filter: filter });
42
- if (filter.type === 'custom') {
26
+ if (props.type === 'list')
27
+ return _jsx(List, { onCloseDropdown: onCloseDropdown, filter: props });
28
+ if (props.type === 'inputs')
29
+ return _jsx(Inputs, { onCloseDropdown: onCloseDropdown, filter: props });
30
+ if (props.type === 'custom') {
43
31
  const componentSharedProps = {
44
32
  anchorEl,
45
33
  setAnchorEl,
46
34
  onCloseDropdown,
47
35
  };
48
- return filter.render(componentSharedProps);
36
+ return props.render(componentSharedProps);
49
37
  }
50
38
  return null;
51
- }, [open, filter, onCloseDropdown]);
52
- return (_jsxs(_Fragment, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 } }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: (e) => {
39
+ }, [open, props, onCloseDropdown]);
40
+ return (_jsxs(_Fragment, { children: [isFilterApplied ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 } }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: (e) => {
53
41
  e.stopPropagation();
54
42
  setAnchorEl(null);
55
- filter.onClear(filterApiKeys);
56
- } })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { cursor: 'pointer', marginTop: '2px', userSelect: 'none' } })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start" }, { children: renderFilter }))] }));
43
+ props.onClear(filterApiKeys);
44
+ } })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { marginTop: '2px', userSelect: 'none', opacity: disabled ? 0.5 : 1 } })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start" }, { children: renderFilter }))] }));
57
45
  }
58
46
  export default memo(ColumnFilter);
@@ -4,6 +4,8 @@ export type ColumnFilterProps = IColumnFilter & {
4
4
  anchorEl: HTMLElement | null;
5
5
  setAnchorEl: (el: HTMLElement | null) => void;
6
6
  onClose?: (e: MouseEvent<HTMLElement>) => void;
7
+ isFilterApplied: boolean;
8
+ disabled?: boolean;
7
9
  };
8
10
  export interface CustomColumnFilterProps extends Pick<ColumnFilterProps, 'anchorEl' | 'setAnchorEl'> {
9
11
  onCloseDropdown: (e: MouseEvent<HTMLElement>) => void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { TableHeaderProps } from './type';
3
- declare function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView, totalCount }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof TableHeader>;
5
5
  export default _default;
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import { TableCell } from './components';
4
4
  import { StyledHeader, StyledMUITableRow } from './style';
5
- function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView }) {
5
+ function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView, totalCount }) {
6
6
  return (_jsx(StyledHeader, Object.assign({ component: "nav", "data-testid": "VirtualTable_TableHeader_StyledHeader", showBackDrop: showBackDrop }, headerProps, { children: _jsx(StyledMUITableRow, Object.assign({ component: "section", "data-testid": "VirtualTable_TableHeader_StyledMUITableRow", isSheetView: isSheetView }, { children: columns.map((column, colIndex) => {
7
- return (_jsx(TableCell, { column: column, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, isSheetView: isSheetView }, `${column.id}-${colIndex}`));
7
+ return (_jsx(TableCell, { column: column, isFirst: column.id === columns[0].id, isLast: column.id === columns[columns.length - 1].id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, isSheetView: isSheetView, totalCount: totalCount }, `${column.id}-${colIndex}`));
8
8
  }) })) })));
9
9
  }
10
10
  export default memo(TableHeader);
@@ -4,6 +4,7 @@ interface TableCellProps extends Pick<TableHeaderProps, 'onColumnSort' | 'isShee
4
4
  column: IColumnProps;
5
5
  isFirst: boolean;
6
6
  isLast: boolean;
7
+ totalCount?: number;
7
8
  }
8
- export declare function TableCell({ column: { header, id, align, headerStyle, sortable, filter, width, order }, isFirst, isLast, isSheetView, onColumnSort, columnsSorting, }: TableCellProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function TableCell({ column: { header, id, align, headerStyle, sortable, filter, width, order }, isFirst, isLast, isSheetView, onColumnSort, columnsSorting, totalCount, }: TableCellProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -4,11 +4,13 @@ import Box from '@mui/material/Box';
4
4
  import ColumnFilter from '../../../../../VirtualTables/components/ColumnFilter';
5
5
  import ColumnSort from '../../../../../VirtualTables/components/ColumnSort';
6
6
  import { StyledCell, TableHeaderInner } from '../../../../../VirtualTables/components/style';
7
- export function TableCell({ column: { header, id, align, headerStyle, sortable, filter, width, order }, isFirst, isLast, isSheetView, onColumnSort, columnsSorting, }) {
7
+ import useColumnFilter from '../../../../../VirtualTables/hooks/useColumnFilter';
8
+ export function TableCell({ column: { header, id, align, headerStyle, sortable, filter, width, order }, isFirst, isLast, isSheetView, onColumnSort, columnsSorting, totalCount, }) {
8
9
  const [columnFilterEl, setColumnFilterEl] = useState(null);
9
10
  const cellRef = useRef(null);
11
+ const { isFilterApplied, filterDisabled } = useColumnFilter({ filter, totalCount });
10
12
  const onOpenFilterDropdown = () => {
11
13
  setColumnFilterEl(cellRef.current);
12
14
  };
13
- return (_jsx(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, isFirst: isFirst, isLast: isLast, ref: cellRef, sx: (theme) => (Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: width, textAlign: align, overflow: 'unset', fontWeight: 600 }, headerStyle)), isSheetView: isSheetView }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: onOpenFilterDropdown }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && _jsx(ColumnSort, { onColumnSort: onColumnSort, columnsSorting: columnsSorting, columnId: id })] })) })));
15
+ return (_jsx(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, isFirst: isFirst, isLast: isLast, ref: cellRef, sx: (theme) => (Object.assign(Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: width, textAlign: align, overflow: 'unset', fontWeight: 600 }, (filterDisabled && { cursor: 'not-allowed' })), headerStyle)), isSheetView: isSheetView }, { children: _jsxs(TableHeaderInner, Object.assign({ disabled: filterDisabled, onClick: onOpenFilterDropdown }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && (_jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl, isFilterApplied: isFilterApplied, disabled: filterDisabled }))), sortable && _jsx(ColumnSort, { onColumnSort: onColumnSort, columnsSorting: columnsSorting, columnId: id })] })) })));
14
16
  }
@@ -7,4 +7,5 @@ export interface TableHeaderProps {
7
7
  onColumnSort?: IVirtualTable['onColumnSort'];
8
8
  showBackDrop: boolean;
9
9
  isSheetView?: boolean;
10
+ totalCount?: number;
10
11
  }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  interface TableWrapperProps {
4
3
  showNoDataView?: boolean;
5
4
  }
@@ -20,9 +19,7 @@ export declare const StyledCell: import("@emotion/styled").StyledComponent<impor
20
19
  isSheetView?: boolean | undefined;
21
20
  isSelected?: boolean | undefined;
22
21
  }, {}, {}>;
23
- export declare const TableHeaderInner: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
24
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
25
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
22
+ export declare const TableHeaderInner: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
26
23
  interface StyledVirtualListProps {
27
24
  areTotalRowsNotFillingHeight: boolean;
28
25
  isSheetView?: boolean;
@@ -51,12 +51,27 @@ export const StyledCell = styled(TableCell, {
51
51
  },
52
52
  }));
53
53
  });
54
- export const TableHeaderInner = styled(Box)(({ theme }) => ({
54
+ export const TableHeaderInner = styled('button')(({ theme }) => ({
55
55
  zIndex: 1,
56
56
  display: 'flex',
57
57
  gap: theme.spacing(0.5),
58
58
  alignItems: 'center',
59
- overflow: 'hidden !important',
59
+ overflow: 'hidden',
60
+ maxWidth: '100%',
61
+ textOverflow: 'ellipsis',
62
+ whiteSpace: 'nowrap',
63
+ backgroundColor: 'transparent',
64
+ border: 'none',
65
+ cursor: 'pointer',
66
+ padding: 0,
67
+ margin: 0,
68
+ color: 'inherit',
69
+ fontSize: 'inherit',
70
+ fontWeight: 'inherit',
71
+ boxSizing: 'border-box',
72
+ ':disabled': {
73
+ cursor: 'not-allowed',
74
+ },
60
75
  }));
61
76
  export const StyledVirtualList = styled(VirtualScrollList, {
62
77
  shouldForwardProp: (prop) => !['areTotalRowsNotFillingHeight', 'isSheetView'].includes(prop),
@@ -0,0 +1,10 @@
1
+ import { IColumnFilter } from '../../../types/index.js';
2
+ type UseColumnFilterParams = {
3
+ filter?: IColumnFilter;
4
+ totalCount?: number;
5
+ };
6
+ declare const useColumnFilter: (params: UseColumnFilterParams) => {
7
+ isFilterApplied: boolean;
8
+ filterDisabled: boolean;
9
+ };
10
+ export default useColumnFilter;
@@ -0,0 +1,22 @@
1
+ import { useMemo } from 'react';
2
+ const useColumnFilter = (params) => {
3
+ const { filter, totalCount } = params;
4
+ const filterData = useMemo(() => { var _a; return ((_a = filter === null || filter === void 0 ? void 0 : filter.options) === null || _a === void 0 ? void 0 : _a.reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = filter === null || filter === void 0 ? void 0 : filter.data) === null || _a === void 0 ? void 0 : _a[apiKey] })); }, {})) || {}; }, [filter]);
5
+ const listFilterData = useMemo(() => {
6
+ var _a;
7
+ const listFilter = filter;
8
+ const rawData = (_a = listFilter === null || listFilter === void 0 ? void 0 : listFilter.data) === null || _a === void 0 ? void 0 : _a[listFilter.apiKey];
9
+ return Array.isArray(rawData) ? rawData : [];
10
+ }, [filter]);
11
+ const isFilterApplied = useMemo(() => Object.values(filterData || {}).some((value) => {
12
+ if (typeof value === 'string' || Array.isArray(value))
13
+ return value.length > 0;
14
+ return value != null;
15
+ }) || listFilterData.length > 0, [filterData, listFilterData]);
16
+ const filterDisabled = !isFilterApplied && totalCount === 0;
17
+ return {
18
+ isFilterApplied,
19
+ filterDisabled,
20
+ };
21
+ };
22
+ export default useColumnFilter;
@@ -66,6 +66,8 @@ export declare const desktopIcon: string;
66
66
  export declare const mobileIcon: string;
67
67
  export declare const tabletIcon: string;
68
68
  export declare const invoiceIcon: string;
69
+ export declare const cancelledInvoiceIcon: string;
70
+ export declare const invoiceNumberIcon: string;
69
71
  export declare const columnIcon: string;
70
72
  export declare const sortAzIcon: string;
71
73
  export declare const sortZaIcon: string;
@@ -71,6 +71,8 @@ export const desktopIcon = `${lightUrl}/desktop.svg`;
71
71
  export const mobileIcon = `${lightUrl}/mobile.svg`;
72
72
  export const tabletIcon = `${lightUrl}/tablet.svg`;
73
73
  export const invoiceIcon = `${lightUrl}/invoice.svg`;
74
+ export const cancelledInvoiceIcon = `${lightUrl}/cancelledInvoiceIcon.svg`;
75
+ export const invoiceNumberIcon = `${lightUrl}/invoiceNumberIcon.svg`;
74
76
  export const columnIcon = `${lightUrl}/column.svg`;
75
77
  export const sortAzIcon = `${lightUrl}/sortAz.svg`;
76
78
  export const sortZaIcon = `${lightUrl}/sortZa.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.1.400",
5
- "testVersion": 0,
4
+ "version": "0.1.401-test.1",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -164,4 +164,4 @@
164
164
  "publishConfig": {
165
165
  "registry": "https://registry.npmjs.org/"
166
166
  }
167
- }
167
+ }