react-smart-data-table
Version:
A smart data table component for React.js meant to be configuration free
50 lines (49 loc) • 2.18 kB
TypeScript
/// <reference types="react" />
import PropTypes from 'prop-types';
import { ColumnToggleAllFn, SelectAllProps } from './SelectAll';
import * as utils from '../helpers/functions';
import '../css/toggles.css';
declare type ColumnToggleFn = (key: string) => void;
export declare type TogglesSelectAllProps = boolean | SelectAllProps;
interface TogglesProps<T = utils.UnknownObject> {
columns: utils.Column<T>[];
colProperties: utils.Headers<T>;
handleColumnToggle: ColumnToggleFn;
handleColumnToggleAll: ColumnToggleAllFn;
selectAll?: TogglesSelectAllProps;
}
declare const Toggles: {
<T>({ columns, colProperties, handleColumnToggle, handleColumnToggleAll, selectAll, }: TogglesProps<T>): JSX.Element;
propTypes: {
columns: PropTypes.Validator<object[]>;
colProperties: PropTypes.Validator<{
[x: string]: PropTypes.InferProps<{
key: PropTypes.Requireable<string>;
text: PropTypes.Requireable<string>;
invisible: PropTypes.Requireable<boolean>;
sortable: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
filterable: PropTypes.Requireable<boolean>;
}>;
}>;
handleColumnToggle: PropTypes.Validator<(...args: any[]) => any>;
handleColumnToggleAll: PropTypes.Validator<(...args: any[]) => any>;
selectAll: PropTypes.Requireable<boolean | PropTypes.InferProps<{
locale: PropTypes.Requireable<PropTypes.InferProps<{
selectAllWord: PropTypes.Requireable<string>;
unSelectAllWord: PropTypes.Requireable<string>;
}>>;
handleToggleAll: PropTypes.Validator<(...args: any[]) => any>;
}>>;
};
defaultProps: {
selectAll: boolean;
};
};
export declare const togglesSelectAllPropTypes: PropTypes.Requireable<boolean | PropTypes.InferProps<{
locale: PropTypes.Requireable<PropTypes.InferProps<{
selectAllWord: PropTypes.Requireable<string>;
unSelectAllWord: PropTypes.Requireable<string>;
}>>;
handleToggleAll: PropTypes.Validator<(...args: any[]) => any>;
}>>;
export default Toggles;