1+ "use strict" ;
2+
3+ function _typeof ( obj ) { "@babel/helpers - typeof" ; if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) { _typeof = function _typeof ( obj ) { return typeof obj ; } ; } else { _typeof = function _typeof ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; } return _typeof ( obj ) ; }
4+
5+ Object . defineProperty ( exports , "__esModule" , {
6+ value : true
7+ } ) ;
8+ exports [ "default" ] = void 0 ;
9+
10+ var _react = _interopRequireWildcard ( require ( "react" ) ) ;
11+
12+ var _EAMGridMain = _interopRequireDefault ( require ( "./EAMGridMain" ) ) ;
13+
14+ var _EAMGridPagination = _interopRequireDefault ( require ( "./EAMGridPagination" ) ) ;
15+
16+ var _EAMGridFooter = _interopRequireDefault ( require ( "./EAMGridFooter" ) ) ;
17+
18+ var _EAMGridHead = _interopRequireDefault ( require ( "./EAMGridHead" ) ) ;
19+
20+ var _EAMGridContext = require ( "./EAMGridContext" ) ;
21+
22+ var _reactBlockUi = _interopRequireDefault ( require ( "react-block-ui" ) ) ;
23+
24+ require ( "react-block-ui/style.css" ) ;
25+
26+ var _EAMGridKeyboardHandler = _interopRequireDefault ( require ( "./EAMGridKeyboardHandler" ) ) ;
27+
28+ var _core = require ( "@material-ui/core" ) ;
29+
30+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { "default" : obj } ; }
31+
32+ function _getRequireWildcardCache ( ) { if ( typeof WeakMap !== "function" ) return null ; var cache = new WeakMap ( ) ; _getRequireWildcardCache = function _getRequireWildcardCache ( ) { return cache ; } ; return cache ; }
33+
34+ function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } if ( obj === null || _typeof ( obj ) !== "object" && typeof obj !== "function" ) { return { "default" : obj } ; } var cache = _getRequireWildcardCache ( ) ; if ( cache && cache . has ( obj ) ) { return cache . get ( obj ) ; } var newObj = { } ; var hasPropertyDescriptor = Object . defineProperty && Object . getOwnPropertyDescriptor ; for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) { var desc = hasPropertyDescriptor ? Object . getOwnPropertyDescriptor ( obj , key ) : null ; if ( desc && ( desc . get || desc . set ) ) { Object . defineProperty ( newObj , key , desc ) ; } else { newObj [ key ] = obj [ key ] ; } } } newObj [ "default" ] = obj ; if ( cache ) { cache . set ( obj , newObj ) ; } return newObj ; }
35+
36+ var EAMGrid = function EAMGrid ( props ) {
37+ var getRowProps = props . getRowProps ,
38+ rowsPerPageOptionsComputed = props . rowsPerPageOptionsComputed ;
39+
40+ var _useContext = ( 0 , _react . useContext ) ( _EAMGridContext . EAMGridContext ) ,
41+ dataspies = _useContext . dataspies ,
42+ selectedDataspy = _useContext . selectedDataspy ,
43+ disableFilters = _useContext . disableFilters ,
44+ pageIndex = _useContext . pageIndex ,
45+ rowsPerPage = _useContext . rowsPerPage ,
46+ toggleFilters = _useContext . toggleFilters ,
47+ handleOnSearch = _useContext . handleOnSearch ,
48+ handleChangePage = _useContext . handleChangePage ,
49+ handleChangeRowsPerPage = _useContext . handleChangeRowsPerPage ,
50+ handleDataspyChange = _useContext . handleDataspyChange ,
51+ handleResetFilters = _useContext . handleResetFilters ,
52+ handleExportToCSV = _useContext . handleExportToCSV ,
53+ hasUnkownTotalRecords = _useContext . hasUnkownTotalRecords ,
54+ totalRecords = _useContext . totalRecords ,
55+ tableInstance = _useContext . tableInstance ,
56+ loading = _useContext . loading ,
57+ loadingExportToCSV = _useContext . loadingExportToCSV ;
58+
59+ return /*#__PURE__*/ _react [ "default" ] . createElement ( "div" , {
60+ style : {
61+ display : "flex" ,
62+ flexDirection : "column" ,
63+ width : "100%" ,
64+ height : "100%" ,
65+ background : "white"
66+ }
67+ } , /*#__PURE__*/ _react [ "default" ] . createElement ( _EAMGridKeyboardHandler [ "default" ] , {
68+ tableInstance : tableInstance ,
69+ onSearch : handleOnSearch ,
70+ toggleFilters : toggleFilters
71+ } ) , /*#__PURE__*/ _react [ "default" ] . createElement ( _EAMGridHead [ "default" ] , {
72+ selectedDataspy : selectedDataspy ,
73+ dataspies : dataspies ,
74+ onSearch : handleOnSearch ,
75+ disableFilters : disableFilters ,
76+ toggleFilters : toggleFilters ,
77+ onDataspyChange : handleDataspyChange ,
78+ onResetFilters : handleResetFilters
79+ } ) , /*#__PURE__*/ _react [ "default" ] . createElement ( _reactBlockUi [ "default" ] , {
80+ tag : "div" ,
81+ blocking : loading ,
82+ style : {
83+ height : "100%" ,
84+ display : "flex" ,
85+ alignItems : "center" ,
86+ justifyContent : "center"
87+ }
88+ } , /*#__PURE__*/ _react [ "default" ] . createElement ( _EAMGridMain [ "default" ] , {
89+ loading : loading ,
90+ tableInstance : tableInstance ,
91+ getRowProps : getRowProps
92+ } ) ) , /*#__PURE__*/ _react [ "default" ] . createElement ( _EAMGridFooter [ "default" ] , null , /*#__PURE__*/ _react [ "default" ] . createElement ( _core . Box , {
93+ flex : "1" ,
94+ display : "flex"
95+ } , /*#__PURE__*/ _react [ "default" ] . createElement ( _reactBlockUi [ "default" ] , {
96+ tag : "div" ,
97+ blocking : loadingExportToCSV ,
98+ style : {
99+ minHeight : "auto"
100+ }
101+ } , /*#__PURE__*/ _react [ "default" ] . createElement ( _core . Button , {
102+ variant : "outlined" ,
103+ size : "small" ,
104+ onClick : handleExportToCSV
105+ } , "Export to CSV" ) ) ) , /*#__PURE__*/ _react [ "default" ] . createElement ( _EAMGridPagination [ "default" ] , {
106+ labelRowsPerPage : "Per Page" ,
107+ onChangePage : handleChangePage ,
108+ onChangeRowsPerPage : handleChangeRowsPerPage ,
109+ pageIndex : pageIndex ,
110+ rowsPerPage : rowsPerPage ,
111+ hasUnkownTotalRecords : hasUnkownTotalRecords ,
112+ totalRecords : totalRecords ,
113+ rowsPerPageOptionsComputed : rowsPerPageOptionsComputed
114+ } ) ) ) ;
115+ } ;
116+
117+ var _default = EAMGrid ;
118+ exports [ "default" ] = _default ;
0 commit comments