/* @flow */ import * as React from 'react'; import Button from './components/Button'; import type { PagerProps, GeneralButtonOptions } from "../GridView"; import { PageContext } from "../contexts/PageContext"; export default class Pager extends React.Component { static defaultProps = { maxButtonCount: 10, pagerTag: 'ul', nextPageLabel: '»', prevPageLabel: '«', firstPageLabel: null, lastPageLabel: null, }; pageCount: number; generalOptions: GeneralButtonOptions; constructor(props: PagerProps) { super(props); this.pageCount = 0; this.generalOptions = { isFirstPage: false, isLastPage: false, isPrevPage: false, isNextPage: false, }; } _addButton = ( buttons: Array, pageButtonOptions: {idx: string | number, page: number, content: React.Node}, tableId: string ) => { let options = Object.assign({}, this.generalOptions, pageButtonOptions); options.key = `pg-${tableId}-${pageButtonOptions.idx}`; buttons.push(