///
import { CSSProperties, SyntheticEvent } from "react";
declare const _default: {
new (props: any): {
componentDidUpdate(nextProps: any): void;
renderBase(): (rootProps: {
getData: (filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => any;
}, filterProps: any, searchProps: any, sortProps: any, paginationProps: any, columnToggleProps: any) => import("react").JSX.Element;
renderWithColumnContext(base: any, baseProps: any): (rootProps: any, filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => import("react").JSX.Element;
renderWithSelectionContext(base: any, baseProps: any): (rootProps: {
getData: (filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => any;
}, filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => import("react").JSX.Element;
renderWithRowExpandContext(base: any, baseProps: any): (rootProps: {
getData: (filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => any;
}, filterProps: any, searchProps: any, sortProps: any, paginationProps: any) => import("react").JSX.Element;
renderWithPaginationContext(base: any): (rootProps: {
getData: (filterProps: any, searchProps: any, sortProps: any, paginationProps?: any) => any;
}, filterProps: any, searchProps: any, sortProps: any) => import("react").JSX.Element;
renderWithSortContext(base: any, baseProps: any): (rootProps: {
getData: (filterProps: any, searchProps: any, sortProps?: any, paginationProps?: any) => any; /**
* A numeric array is also available: [5, 10]. the purpose of above example is custom the text
*/
}, filterProps: any, searchProps: any) => import("react").JSX.Element;
renderWithSearchContext(base: any, baseProps: any): (rootProps: {
getData: (filterProps: any, searchProps?: any, sortProps?: any, paginationProps?: any) => any;
}, filterProps: any) => import("react").JSX.Element;
renderWithFilterContext(base: any, baseProps: any): (rootProps: any) => import("react").JSX.Element;
renderWithCellEditContext(base: any, baseProps: any): (rootProps: {
getData: (filterProps?: any, searchProps?: any, sortProps?: any, paginationProps?: any) => any;
}) => import("react").JSX.Element;
render(): import("react").JSX.Element;
remoteEmitter: import("events");
DataContext: any;
ColumnContext: any;
SelectionContext: any;
SearchContext: any;
FilterContext: any;
RowExpandContext: any;
CellEditContext: any;
PaginationContext: any;
SortContext: any;
Table: any;
dataContext: any;
columnContext: any;
selectionContext: any;
searchContext: any;
filterContext: any;
rowExpandContext: any;
cellEditContext: any;
paginationContext: any;
sortContext: any;
table: any;
getNewestState: (state?: any) => any;
isRemoteSearch: () => any;
isRemotePagination: (e?: any) => any;
isRemoteFiltering: () => any;
isRemoteSort: () => any;
isRemoteCellEdit: () => any;
handleRemotePageChange: (page: number, sizePerPage: number) => void;
handleRemoteFilterChange: (filters: any) => void;
handleRemoteSortChange: (sortField: string, sortOrder: string | undefined) => void;
handleRemoteCellChange: (rowId: any, dataField: string, newValue: any) => void;
handleRemoteSearchChange: (searchText: string) => void;
context: unknown;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly;
state: Readonly<{}>;
refs: {
[key: string]: import("react").ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly<{}>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): void;
};
contextType?: import("react").Context | undefined;
};
export default _default;
export declare const ROW_SELECT_SINGLE = "radio";
export declare const ROW_SELECT_MULTIPLE = "checkbox";
export declare const ROW_SELECT_DISABLED = "ROW_SELECT_DISABLED";
export declare const CHECKBOX_STATUS_INDETERMINATE = "indeterminate";
export declare const CHECKBOX_STATUS_CHECKED = "checked";
export declare const CHECKBOX_STATUS_UNCHECKED = "unchecked";
export declare const FILTERS_POSITION_INLINE = "inline";
export declare const FILTERS_POSITION_TOP = "top";
export declare const FILTERS_POSITION_BOTTOM = "bottom";
export declare const SORT_ASC = "asc";
export declare const SORT_DESC = "desc";
export declare const INDICATOR_POSITION_LEFT = "left";
export declare const INDICATOR_POSITION_RIGHT = "right";
export declare const TYPE_STRING = "string";
export declare const TYPE_NUMBER = "number";
export declare const TYPE_BOOLEAN = "bool";
export declare const TYPE_DATE = "date";
export type RowSelectionType = typeof ROW_SELECT_SINGLE | typeof ROW_SELECT_MULTIPLE | typeof ROW_SELECT_DISABLED;
export type TableCheckboxStatus = typeof CHECKBOX_STATUS_INDETERMINATE | typeof CHECKBOX_STATUS_CHECKED | typeof CHECKBOX_STATUS_UNCHECKED;
export type FilterPosition = typeof FILTERS_POSITION_INLINE | typeof FILTERS_POSITION_TOP | typeof FILTERS_POSITION_BOTTOM;
/**
* Table change event types
*/
export type TableChangeType = "filter" | "pagination" | "sort" | "cellEdit";
/**
* Used to specify the text alignment for a column.
*/
export type CellAlignment = ("left" | "center" | "right" | "start" | "end") | string;
/**
* Sort Order values. 'asc' = ascending, 'desc' = descending.
*/
export type SortOrder = "asc" | "desc";
export type ColumnSortValue = (cell: C, row: R) => boolean | string | number;
export type ColumnSortFunc = (a: T[E], b: T[E], order: "asc" | "desc", dataField: any, rowA: T, rowB: T) => number;
export type ColumnSortCaret = (order: "asc" | "desc" | undefined, column: ColumnDescription) => JSX.Element | string | null;
export type HeaderSortingClasses = string | ((column: ColumnDescription, sortOrder: "asc" | "desc", isLastSorting: boolean, colIndex: number) => string);
export interface TableChangeState {
page: number;
sizePerPage: number;
sortField: string;
sortOrder: "asc" | "desc";
filters: {
[key: string]: {
filterVal: any;
filterType: "TEXT";
comparator: any;
};
};
data: T[];
cellEdit: {
rowId: string;
dataField: any;
newValue: any;
};
}
export type HeaderFormatter = (column: ColumnDescription, colIndex: number, components: {
sortElement: JSX.Element;
filterElement: JSX.Element;
}) => React.ReactNode;
export type ColumnFormatter = (cell: C, row: R, rowIndex: number, formatExtraData?: E) => React.ReactNode;
export interface ValidationResult {
async?: boolean | undefined;
valid?: boolean | undefined;
message?: string | undefined;
}
export interface ColumnDescription {
/**
* If set the column will not use cell values
*/
isDummyField?: boolean | undefined;
dataField: any;
formatter?: ColumnFormatter | undefined;
hidden?: boolean | undefined;
/**
* Column header field
*/
text: string;
classes?: string | ((cell: T[keyof T], row: T, rowIndex: number, colIndex: number) => string) | undefined;
headerClasses?: string | ((column: ColumnDescription, colIndex: number) => string) | undefined;
style?: React.CSSProperties | ((cell: T[keyof T], row: T, rowIndex: number, colIndex: number) => React.CSSProperties) | undefined;
sort?: boolean | undefined;
sortValue?: ColumnSortValue | undefined;
sortFunc?: ColumnSortFunc | undefined;
sortCaret?: ColumnSortCaret | undefined;
searchable?: boolean | undefined;
align?: CellAlignment | ((cell: T[keyof T], row: T, rowIndex: number, colIndex: number) => CellAlignment) | undefined;
headerStyle?: React.CSSProperties | (() => React.CSSProperties) | undefined;
tooltipDataField?: string | undefined;
editable?: boolean | ((cell: any, row: T, rowIndex: number, colIndex: number) => boolean) | undefined;
editor?: {
type: string;
options?: Array<{
value: string;
label: string;
}> | undefined;
} | undefined;
filter?: boolean | TableColumnFilterProps | undefined;
filterValue?: ((cell: T[keyof T], row: T) => string) | undefined;
filterRenderer?: ((filterHandler: Function, column: any) => JSX.Element) | undefined;
headerAlign?: CellAlignment | undefined;
headerFormatter?: HeaderFormatter | undefined;
headerSortingClasses?: HeaderSortingClasses | undefined;
formatExtraData?: ({
tooltipFormatter?: ((row: T) => JSX.Element) | undefined;
} & E) | undefined;
width?: number | undefined;
footer?: boolean | number | string | ((columnData: any, column: ColumnDescription, columnIndex: number) => string) | undefined;
footerFormatter?: ((column: ColumnDescription, columnIndex: number, text: any) => void) | undefined;
footerClasses?: string | ((column: ColumnDescription, columnIndex: number) => string) | undefined;
footerStyle?: React.CSSProperties | undefined;
footerTitle?: boolean | undefined;
footerEvents?: {
onClick: (e: any, column: ColumnDescription, columnIndex: number) => void;
} | undefined;
footerAlign?: CellAlignment | ((column: ColumnDescription, colIndex: number) => CellAlignment) | undefined;
footerAttrs?: object | ((column: ColumnDescription, columnIndex: number) => object) | undefined;
validator?: ((newValue: any, row: T, column: ColumnDescription, done: (result?: ValidationResult) => any) => boolean | ValidationResult) | undefined;
/**
* CSV Column options only used with the toolkit provider
*/
/**
* export csv cell type can be Number or String
*/
csvType?: object | undefined;
/**
* Custom csv cell formatter used when exporting csv
*/
csvFormatter?: ColumnFormatter | undefined;
/**
* csvText defaults to column.text
*/
csvText?: string | undefined;
/**
* Toggle column display in CSV export
*/
csvExport?: boolean | undefined;
/**
* Column toggle list used by Toolkit provider
*/
toggle?: boolean | undefined;
}
/**
* Generic row event handler
*/
export type RowEventHandler = (e: SyntheticEvent, row: T, rowIndex: number) => void;
/**
* Row level event handlers
*/
export type RowEventHandlerProps = Partial<{
onClick: RowEventHandler;
onDoubleClick: RowEventHandler;
onMouseEnter: RowEventHandler;
onMouseLeave: RowEventHandler;
onContextMenu: RowEventHandler;
}>;
/**
* Table change callback method
*/
export type TableChangeHandler = (type: TableChangeType, newState: TableChangeState) => void;
/**
* All possible pagination options handled by the pagination plugin
*
* Consult [documentation](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/pagination-props.html)
*/
export type PaginationOptions = Partial<{
custom: boolean;
/**
* Specify the current page. It's necessary when remote is enabled
*/
page: number;
/**
* Specify the size per page. It's necessary when remote is enabled
*/
sizePerPage: number;
/**
* Total data size. It's necessary when remote is enabled
*/
totalSize: number;
/**
* first page will be 0, default is 1
*/
pageStartIndex: number;
/**
* the pagination bar size, default is 5
*/
paginationSize: number;
/**
* display pagination information
*/
showTotal: boolean;
/**
* A numeric array is also available: [5, 10]. the purpose of above example is custom the text
*/
sizePerPageList: number[] | Array<{
text: string;
value: number;
}>;
/**
* hide the going to first and last page button
*/
withFirstAndLast: boolean;
/**
* always show the next and previous page button
*/
alwaysShowAllBtns: boolean;
/**
* the text of first page button
*/
firstPageText: string | JSX.Element;
/**
* the text of previous page button
*/
prePageText: string | JSX.Element;
/**
* the text of next page button
*/
nextPageText: string | JSX.Element;
/**
* the text of last page button
*/
lastPageText: string | JSX.Element;
/**
* the title of next page button
*/
nextPageTitle: string;
/**
* the title of previous page button
*/
prePageTitle: string;
/**
* the title of first page button
*/
firstPageTitle: string;
/**
* the title of last page button
*/
lastPageTitle: string;
/**
* hide the size per page dropdown
*/
hideSizePerPage: boolean;
/**
* hide pagination bar when only one page, default is false
*/
hidePageListOnlyOnePage: boolean;
/**
* custom page button inside the pagination list
*/
pageButtonRenderer: (options: PageButtonRendererOptions) => JSX.Element;
/**
* callback function when page was changing
*/
onPageChange: (page: number, sizePerPage: number) => void;
/**
* callback function when page size was changing
*/
onSizePerPageChange: (page: number, sizePerPage: number) => void;
/**
* custom pagination list component
*/
pageListRenderer: (options: PageListRendererOptions) => JSX.Element;
/**
* custom size per page
*/
sizePerPageRenderer: (options: SizePerPageRendererOptions) => JSX.Element;
/**
* custom size per page dropdown component
*/
sizePerPageOptionRenderer: (options: SizePerPageOptionRendererOptions) => JSX.Element;
/**
* custom the pagination total
*/
paginationTotalRenderer: (from: number, to: number, size: number) => JSX.Element;
}>;
export interface SizePerPageOptionRendererOptions {
/**
* text of the option
*/
text: string;
/**
* size of per page option
*/
page: number;
/**
* call it when you need to change size per page
*/
onSizePerPageChange: (page: number, sizePerPage: number) => void;
}
export interface PageListRendererOptions {
/**
* current page
*/
pages: Array<{
active: boolean;
disabled: boolean;
page: number;
title: string;
}>;
/**
* call it when you need to change page
*/
onPageChange: (page: number, sizePerPage: number) => void;
}
export interface PageButtonRendererOptions {
/**
* page number
*/
page: number | string;
/**
* is this page the current page or not
*/
active: boolean;
/**
* is this page disabled or not
*/
disabled: boolean;
/**
* page title
*/
title: string;
/**
* call it when you need to change page
*/
onPageChange: (page: number, sizePerPage: number) => void;
}
export interface SizePerPageRendererOptions {
/**
* dropdown options
*/
options: Array<{
text: string;
page: number;
}>;
/**
* current size per page
*/
currSizePerPage: string;
/**
* call it when you need to change size per page
*/
onSizePerPageChange: (page: number) => void;
}
export interface SelectRowProps {
mode: string;
clickToSelect?: boolean | undefined;
clickToExpand?: boolean | undefined;
clickToEdit?: boolean | undefined;
hideSelectAll?: boolean | undefined;
selected?: Array | undefined;
onSelect?: ((row: T, isSelected: boolean, rowIndex: number, e: SyntheticEvent) => void | boolean) | undefined;
/**
* This callback function will be called when select/unselect all and it only work when you configure selectRow.mode as checkbox.
*/
onSelectAll?: ((isSelect: boolean, rows: T[], e: React.SyntheticEvent) => void | number[]) | undefined;
style?: ((row: T, rowIndex: number) => CSSProperties | undefined) | CSSProperties | undefined;
classes?: ((row: T, rowIndex: number) => string | undefined) | string | undefined;
nonSelectable?: number[] | undefined;
nonSelectableStyle?: ((row: T, rowIndex: number) => CSSProperties | undefined) | CSSProperties | undefined;
nonSelectableClasses?: ((row: T, rowIndex: number) => string | undefined) | string | undefined;
bgColor?: ((row: T, rowIndex: number) => string) | string | undefined;
hideSelectColumn?: boolean | undefined;
selectionRenderer?: ((options: {
checked: boolean;
disabled: boolean;
mode: string;
rowIndex: number;
rowKey: string;
}) => JSX.Element) | undefined;
selectionHeaderRenderer?: ((options: {
mode: string;
checked: boolean;
indeterminate: boolean;
}) => JSX.Element) | undefined;
headerColumnStyle?: ((status: string) => CSSProperties | undefined) | CSSProperties | undefined;
selectColumnStyle?: ((props: {
checked: boolean;
disabled: boolean;
rowIndex: number;
rowKey: string;
}) => CSSProperties | undefined) | CSSProperties | undefined;
selectColumnPosition?: "left" | "right" | undefined;
}
export interface BootstrapTableRef {
table: {
props: {
data: T[];
};
};
selectionContext?: {
selected?: any[] | undefined;
} | undefined;
rowExpandContext?: {
state: {
expanded?: any[] | undefined;
};
} | undefined;
paginationContext?: {
currPage: number;
currSizePerPage: number;
} | undefined;
sortContext?: {
state: {
sortColumn: ColumnDescription;
sortOrder: SortOrder;
};
} | undefined;
filterContext?: {
currFilters: any;
} | undefined;
cellEditContext?: {
startEditing: (rowIndex: number, columnIndex: number) => void;
} | undefined;
}
export interface BootstrapTableProps {
/**
* Tells react-bootstrap-table-nextgen which column is unique.
*/
keyField: string;
/**
* Provides data for your table. It accepts a single Array object.
*/
data: any[];
columns: ColumnDescription[];
bootstrap4?: boolean | undefined;
remote?: boolean | Partial<{
pagination: boolean;
filter: boolean;
sort: boolean;
cellEdit: boolean;
search: boolean;
}> | undefined;
noDataIndication?: (() => JSX.Element | string) | JSX.Element | string | undefined;
striped?: boolean | undefined;
bordered?: boolean | undefined;
hover?: boolean | undefined;
tabIndexCell?: boolean | undefined;
id?: string | undefined;
classes?: string | undefined;
headerClasses?: string | undefined;
bodyClasses?: string | undefined;
wrapperClasses?: string | undefined;
headerWrapperClasses?: string | undefined;
condensed?: boolean | undefined;
/**
* Same as HTML caption tag, you can set it as String or a React JSX.
*/
caption?: JSX.Element | string | undefined;
pagination?: {
options?: PaginationOptions | undefined;
} | undefined;
filter?: unknown | undefined;
cellEdit?: any;
selectRow?: SelectRowProps | undefined;
expandRow?: ExpandRowProps | undefined;
parentClassName?: string | ((isExpand: boolean, row: T, rowIndex: number) => string) | undefined;
rowStyle?: ((row: T, rowIndex: number) => CSSProperties) | CSSProperties | undefined;
rowEvents?: RowEventHandlerProps | undefined;
rowClasses?: ((row: T, rowIndex: number) => string) | string | undefined;
filtersClasses?: string | undefined;
filterPosition?: string | undefined;
footerClasses?: string | undefined;
defaultSorted?: [{
dataField: any;
order: SortOrder;
}] | undefined;
sort?: {
dataField?: any;
order: SortOrder;
sortFunc?: any;
sortCaret?: any;
} | undefined;
defaultSortDirection?: SortOrder | undefined;
overlay?: any;
onTableChange?: TableChangeHandler | undefined;
onSort?: any;
onFilter?: any;
onExternalFilter?: any;
/**
* This callback function will be called only when data size change by search/filter etc.
*/
onDataSizeChange?: ((props: {
dataSize: number;
}) => void) | undefined;
search?: SearchProps | boolean | undefined;
loading?: boolean | undefined;
sortField?: string;
sortOrder?: string;
currFilters?: object;
}
/**
* Search props
*
* Consult [documentation](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/search-props.html)
*/
export interface SearchProps {
placeholder?: string | undefined;
searchText?: string | undefined;
defaultSearch?: string | undefined;
onColumnMatch?: ((searchProps: {
searchText: string;
value: any;
column: any;
row: T;
}) => boolean) | undefined;
onClear?: () => void;
onSearch?: (searchText: string) => void;
}
export interface ExpandColumnRendererProps {
expanded: boolean;
rowKey: string;
expandable: boolean;
}
export interface ExpandHeaderColumnRenderer {
isAnyExpands: boolean;
}
export interface ExpandRowProps {
renderer: ((row: T, rowIndex: number) => JSX.Element) | undefined;
expanded?: K[] | undefined;
onExpand?: ((row: T, isExpand: boolean, rowIndex: number, e: SyntheticEvent) => void) | undefined;
onExpandAll?: ((isExpandAll: boolean, results: T[], e: SyntheticEvent) => void) | undefined;
nonExpandable?: K[] | undefined;
showExpandColumn?: boolean | undefined;
onlyOneExpanding?: boolean | undefined;
expandByColumnOnly?: boolean | undefined;
expandColumnRenderer?: ((props: ExpandColumnRendererProps) => JSX.Element) | undefined;
expandHeaderColumnRenderer?: ((props: ExpandHeaderColumnRenderer) => JSX.Element) | undefined;
expandColumnPosition?: "left" | "right" | undefined;
className?: string | ((isExpand: boolean, row: T, rowIndex: number) => string) | undefined;
}
export type TableColumnFilterProps = Partial<{
id: string;
/**
* custom the input placeholder
*/
placeholder: string;
/**
* custom classname on input
*/
className: string;
/**
* default filtering value
*/
defaultValue: any;
/**
* your custom styles on input
*/
style: React.CSSProperties;
/**
* how long will trigger filtering after user typing, default is 500 ms
*/
delay: number;
getFilter: (filter: (value: FV) => void | T[]) => void;
/**
* Register a listener which will be called when column filter being triggered. If you return an array value, react-bootstrap-table-nextgen will adopt this value as the final filtered result.
*/
onFilter: (filterValue: FV) => void | T[];
}>;