UNPKG

@krowdy-ui/views

Version:

React components that implement Google's Material Design.

42 lines (36 loc) 1.5 kB
import React from 'react'; // import { TableHead, TableRow, TableBody, TableCell } from '@krowdy-ui/core' // import { FixedSizeList as List } from 'react-window' // import InfiniteLoader from 'react-window-infinite-loader' import ListWindow from '../ListWindow'; function TableWindow(props) { const { rows, /* columns,*/ itemHeight = 50, listHeight = 400, pagination } = props; // const isItemLoaded = index => Boolean(rows[index]) const loadMoreItems = (startIndex, stopIndex) => { console.log('Grover: loadMoreItems -> stopIndex', stopIndex); console.log('Grover: loadMoreItems -> startIndex', startIndex); console.log('Grover: loadMoreItems -> pagination', pagination); // pagination.page + 1 // pagination.page // console.log('Grover: loadMoreItems -> args', args) }; const sortOrder = 'asc'; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, rows.length ? /*#__PURE__*/React.createElement(ListWindow, { ItemComponent: ({ index, style }) => /*#__PURE__*/React.createElement("div", { style: style }, rows[index] ? rows[index].name : 'Loading....'), itemHeight: itemHeight, listHeight: listHeight, loadMoreItems: loadMoreItems, pagination: pagination, rows: rows, sortOrder: sortOrder }) : null)))); } export default TableWindow;