UNPKG

react-mui-table

Version:

A react component that takes data & style parameters, and renders a Material UI table.

33 lines (27 loc) 1.33 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var isSearchEnabled = exports.isSearchEnabled = function isSearchEnabled(props) { return typeof props.handleSearch === 'function'; }; var isDeleteEnabled = exports.isDeleteEnabled = function isDeleteEnabled(props) { return typeof props.handleDelete === 'function'; }; var isSortEnabled = exports.isSortEnabled = function isSortEnabled(props) { return typeof props.handleSort === 'function' && props.columns.some(function (col) { return col.sortable; }); }; var isFilterEnabled = exports.isFilterEnabled = function isFilterEnabled(props) { return typeof props.handleFilter === 'function' && Array.isArray(props.filters) && props.filters.length > 0; }; var areActionsEnabled = exports.areActionsEnabled = function areActionsEnabled(props) { return Array.isArray(props.actions) && props.actions.length > 0 && !props.actions.some(function (_ref) { var handler = _ref.handler; return typeof handler !== 'function'; }); }; var isPaginationEnabled = exports.isPaginationEnabled = function isPaginationEnabled(props) { return props.hasNextPage !== undefined && props.hasPreviousPage !== undefined && typeof props.paginationText === 'string' && typeof props.previousPage === 'function' && typeof props.nextPage === 'function'; };