UNPKG

@vlsergey/react-bootstrap-pagetable

Version:

Complex solution to work with pageable data, including sorting, filtering, actions, changing displayed columns, etc.

17 lines 1.32 kB
import React from 'react'; import ControlledPropsType from '../controlled/ControlledPropsType'; import { NewComponentProps as SelectablePropsType } from '../selectable/withSelectable'; import Action from './Action'; export declare type RequiredChildComponentProps<T> = Pick<SelectablePropsType<T>, 'onSelectedIdsChange' | 'selectable' | 'selectedIds'> & Pick<ControlledPropsType<T>, 'footerElements' | 'headerElements' | 'itemModel' | 'page' | 'size'>; export interface NewComponentProps<T> { actions?: Action<T>[]; buttonProps?: (action: Action<T>, selectedItems: T[]) => Record<string, unknown>; toolbarProps?: Record<string, unknown>; onAfterAction?: (action: Action<T>, items: T[]) => unknown; onRefreshRequired?: () => unknown; onSelectedIdsChange?: SelectablePropsType<T>['onSelectedIdsChange']; } export declare type PropsType<T, P extends RequiredChildComponentProps<T>> = NewComponentProps<T> & Omit<P, 'onSelectedIdsChange' | 'selectedIds'>; declare const withActions: <T, P extends RequiredChildComponentProps<T>>(Child: React.ComponentType<P>) => ({ actions, buttonProps, footerElements, onAfterAction, onRefreshRequired, onSelectedIdsChange, selectable, ...etcProps }: PropsType<T, P>) => JSX.Element; export default withActions; //# sourceMappingURL=withActions.d.ts.map