Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | import { ReactNode } from "react";
import { SxProps, TableRowProps } from "@mui/material";
import { ExportRecordsTotal } from "@common/Table/helpers";
import {
TEmptyStateAction,
TEmptyStateWrapperSection,
} from "@shared/EmptyState/types";
import { PaginationMethodType } from "@components/VirtualList/api";
import { GiveTooltipProps } from "@shared/Tooltip/GiveTooltip.types";
import { PageAnimationsType } from "@shared/BannerAnimations/animations";
export type ColumnBaseType =
| "text"
| "half-text"
| "risk-level"
| "merchant-first"
| "product-title"
| "merchant-last"
| "assignment"
| "phase"
| "in-out"
| "processing-merchant"
| "status"
| "status-round"
| "member"
| "actions"
| "empty"
| "customer-profile"
| "amount"
| "apiKey-mobile"
| "customer-actions"
| "transaction-first"
| "invisible"
| "double-row"
| "avatar-name";
export type TableColumnType = {
/**
* Title of the column head
*/
title?: string | any;
/**
* If table can be sorted with the column values
*/
sortable?: boolean;
rightSort?: boolean;
hideColumn?: boolean;
/**
* Keyname of row item to access the value
*/
key: string | any;
/**
* Custom component to show the column value
*/
renderColumn?: (item: any, open?: boolean) => React.ReactNode;
/**
* If is to be shown expand button
*/
hasExpandButton?: boolean;
pinkBorder?: boolean;
iconButton?: boolean;
columnWidth?: number | string;
sx?: TableRowProps["sx"];
headerPosition?: "left" | "right" | "center";
columnType?: ColumnBaseType;
hasCheckbox?: boolean;
isComplexSort?: boolean;
complexSortOptions?: Array<{
key: string;
label: string;
order: TableOrder;
IconLeft: any;
}>;
};
export interface TableData {
id?: string | number;
[key: string]: any;
}
export type TableOrder = "asc" | "desc";
export type TableProps = {
type: TEmptyStateWrapperSection;
allRows: any[];
totalRows: number;
rowsPerPage?: number;
isLoading: boolean;
isError?: boolean;
page: number;
setPageDispatcher: React.Dispatch<React.SetStateAction<number>>;
setPage: () => void;
columns: TableColumnType[];
openModal: string;
onOpenRow?: (row: any) => void;
totalExportRecords?: ExportRecordsTotal;
emptyStateAction?: Omit<TEmptyStateAction, "label">;
/**
* The handler for the second button of an empty state that declares one
* (see GiveEmptyState's `secondaryAction`). Inert otherwise.
*/
emptyStateSecondaryAction?: Omit<TEmptyStateAction, "label">;
emptyStateActionTooltipProps?: Partial<GiveTooltipProps>;
emptyStateIconContainerSx?: SxProps;
emptyStateCellSx?: SxProps;
queryKey?: string;
onScroll?: any;
searchQuery?: any;
handleSearchChange?: any;
setSelectedRowIdx?: any;
selectedRowIdx?: any;
loadMore?: any;
numberOfPages?: any;
top?: number;
Head?: any;
/**
* Optional compact banner rendered as a slim bar pinned to the top of the
* table, revealed once the full `Head` banner scrolls out of view (AC004).
*/
CompactHead?: ReactNode;
/**
* Page key for the animated video background shown behind `CompactHead`
* (same asset the full banner uses). Omit for a plain white bar.
*/
compactAnimationPage?: PageAnimationsType;
/**
* What the page is about, shown in the mobile top bar's first row (where the
* balance normally sits) while `CompactHead` is expanded — for pages whose
* subject is a name rather than a set of stats. Mobile only; the wide view
* draws its own title inside `CompactHead`.
*/
compactTitle?: ReactNode;
/**
* Called as the compact head crosses its reveal threshold, so a page can react
* to the same transition without re-measuring the banner itself.
*/
onCompactVisibleChange?: (isVisible: boolean) => void;
/**
* The column header scrolls off with the content instead of pinning, and
* draws no background — transparent over the page's backdrop like the rest
* of the `Head` content. For pages whose rows sit on an animated backdrop
* (Event Detail), where the default pinned header reads as a white band cut
* into it. Applies to compact-head tables too: the descending header carries
* its own copy of the animation, so nothing needs the white band.
*/
scrollingHeader?: boolean;
handleResetFilters?: () => void;
hasFilters?: boolean;
defaultSortKey?: string;
isSponsorTabSelected?: boolean;
isCurrentTabEmpty?: boolean;
isFetching?: boolean;
enabledInfiniteScroll?: boolean;
isDescending?: boolean;
useIdForRows?: boolean;
hideCaret?: boolean;
customLoadingRowProps?: any;
disablePadding?: boolean;
tablePadding?: string;
canOpenModal?: (rowData: any) => boolean;
minHeight?: string;
paginationMethod?: PaginationMethodType;
nextCursor?: any;
sortReduxKey?: any;
containerSx?: SxProps;
isListPermissionAllowed?: boolean;
sectionName?: string;
storageKey?: string;
isFetchingNextPage?: boolean;
columnType?: ColumnBaseType;
isSponsor?: boolean;
rowSx?: SxProps;
increaseViewportByTop?: number;
// TRA013 AC007: show a "Showing 1 – N of Total" row-range footer that updates
// as the user infinite-scrolls (Manage Money / Transactions tables).
showLoadedRowCount?: boolean;
};
/**
* Compact-on-scroll banner variant (AC004). When `compact` is set, the
* merchant/provider table actions collapse the page search + actions + tab
* filters into a search icon that expands inline plus a kebab (`⋮`) menu.
*/
export type CompactTableFilter = {
label: string;
value: string;
hidden?: boolean;
disabled?: boolean;
onClickItem?: () => void;
};
export type CompactTableActionsProps = {
compact?: boolean;
/** Tab filters (from `useTabs`) surfaced as menu rows in compact mode. */
filters?: CompactTableFilter[];
/** Currently selected tab value, for the menu checkmark. */
selectedTab?: string;
/** Primary create action (e.g. "Add Provider") surfaced in the kebab menu. */
handleCreate?: () => void;
createLabel?: string;
disableCreate?: boolean;
};
|