@ -1,3 +1,4 @@
"use strict" ;
( self [ "webpackChunk" ] = self [ "webpackChunk" ] || [ ] ) . push ( [ [ 36029 ] , {
/***/ 15014 :
@ -6,7 +7,6 @@
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
@ -63,18 +63,13 @@ var modal = __webpack_require__(43418);
var es _checkbox = _ _webpack _require _ _ ( 24905 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = _ _webpack _require _ _ ( 6848 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es _button = _ _webpack _require _ _ ( 3113 ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = _ _webpack _require _ _ ( 46651 ) ;
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
var _react _infinite _scroller _1 _2 _4 _react _infinite _scroller = _ _webpack _require _ _ ( 26724 ) ;
var _react _infinite _scroller _1 _2 _4 _react _infinite _scroller _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( _react _infinite _scroller _1 _2 _4 _react _infinite _scroller ) ;
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es _button = _ _webpack _require _ _ ( 3113 ) ;
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.11@dayjs/dayjs.min.js
var dayjs _min = _ _webpack _require _ _ ( 99232 ) ;
var dayjs _min _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( dayjs _min ) ;
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
var ImagesIcon = _ _webpack _require _ _ ( 42195 ) ;
; // CONCATENATED MODULE: ./src/pages/Administration/Student/components/AddStudent.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var AddStudentmodules = ( { "addStudentContainer" : "addStudentContainer___c5ADl" , "listItem" : "listItem___cOpB2" , "tips" : "tips___UuolQ" , "qrCode" : "qrCode___OJ0wR" } ) ;
@ -105,11 +100,8 @@ var jsx_runtime = __webpack_require__(37712);
var TabPane = tabs /* default */ . Z . TabPane ;
var AddTeacher = function AddTeacher ( _ref ) {
var _actionTabs$selectArr , _actionTabs$selectArr2 ;
var classroomList = _ref . classroomList ,
loading = _ref . loading ,
dispatch = _ref . dispatch ,
@ -594,11 +586,13 @@ var AddTeacher = function AddTeacher(_ref) {
return /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( modal /* default */ . Z , {
className : AddStudentmodules . addStudentWrapContainer ,
centered : true ,
title : "\u 6DFB\u52A0 \u5B66\u751F",
title : "\u 5BFC\u5165 \u5B66\u751F",
open : classroomList . actionTabs . key === '添加学生' ? true : false ,
okText : "\u786E\u5B9A" ,
cancelText : "\u53D6\u6D88" ,
width : activeKey === '1' ? 960 : 600 ,
width : 600
// activeKey === '1' ? 960 : 600
,
zIndex : 1000 ,
afterClose : function afterClose ( ) {
setFileList ( [ ] ) ;
@ -632,173 +626,52 @@ var AddTeacher = function AddTeacher(_ref) {
payload : { }
} ) ;
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( tabs /* default */ . Z , {
activeKey : activeKey ,
onChange : function onChange ( k ) {
return handleTabChange ( k ) ;
} ,
className : AddStudentmodules . addStudentContainer ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( TabPane , {
tab : "\u624B\u52A8\u6DFB\u52A0" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : AddStudentmodules . listItem ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( es _form /* default */ . Z , {
layout : "inline" ,
form : form ,
initialValues : {
keyword : '' ,
search _type : '1'
} ,
className : "mt10"
// onFinish={onFinish}
,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _form /* default */ . Z . Item , {
name : "search_type" ,
label : "\u641C\u7D22\u7C7B\u578B" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( es _select [ "default" ] , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _select [ "default" ] . Option , {
value : "1" ,
children : "\u59D3\u540D"
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _select [ "default" ] . Option , {
value : "2" ,
children : "\u624B\u673A\u53F7"
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _select [ "default" ] . Option , {
value : "3" ,
children : "\u90AE\u7BB1"
} ) ]
} )
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _form /* default */ . Z . Item , {
name : "keyword" ,
label : "\u641C\u7D22\u5185\u5BB9" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( input /* default */ . Z , {
allowClear : true ,
style : {
width : 240
} ,
size : "middle" ,
defaultValue : ( ( _actionTabs$selectArr = actionTabs . selectArrs ) === null || _actionTabs$selectArr === void 0 ? void 0 : _actionTabs$selectArr . category _name ) || ( ( _actionTabs$selectArr2 = actionTabs . selectArrs ) === null || _actionTabs$selectArr2 === void 0 ? void 0 : _actionTabs$selectArr2 . name )
} )
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _form /* default */ . Z . Item , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
htmlType : "submit" ,
type : "primary" ,
size : "middle" ,
onClick : function onClick ( ) {
return onFinish ( ) ;
} ,
children : "\u641C\u7D22"
} )
} ) ]
} ) , notSearch && /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "tc font16 c-light-black mt40 pb30" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "img" , {
src : ImagesIcon /* search1Icon */ . L6 ,
width : "250" ,
alt : ""
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "br" , { } ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "p" , {
className : "mt20" ,
children : "\u8BF7\u641C\u7D22\u8981\u6DFB\u52A0\u7684\u4EBA\u5458"
} ) ]
} ) , ! notSearch && tableData == '' && ! isLoading && /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "tc font16 c-light-black mt40 pb30" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "img" , {
src : ImagesIcon /* noDataIcon */ . z3 ,
width : "100" ,
alt : ""
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "br" , { } ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "p" , {
className : "mt20" ,
children : "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"
} ) ]
} ) , ( ! notSearch && tableData != '' || isLoading ) && /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "section" , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : "flexd-table-header mt20" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( table /* default */ . Z , {
pagination : false ,
dataSource : [ ] ,
columns : columns
} )
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
style : {
maxHeight : 260 ,
overflow : 'auto'
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( ( _react _infinite _scroller _1 _2 _4 _react _infinite _scroller _default ( ) ) , {
initialLoad : false ,
pageStart : 1 ,
threshold : 20 ,
loadMore : function loadMore ( page ) {
handleInfiniteOnLoad ( ) ;
} ,
hasMore : hasMore ,
useWindow : false ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( table /* default */ . Z , {
loading : isLoading ,
showHeader : false ,
pagination : false ,
dataSource : tableData ,
columns : columns ,
onRow : function onRow ( record ) {
return {
onClick : function onClick ( event ) {
if ( ! event . currentTarget . querySelector ( 'input' ) . disabled ) saveSelect ( event . currentTarget . querySelector ( 'input' ) . value ) ;
}
} ;
}
} )
} )
} ) ]
} ) ]
} )
} , "1" ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( TabPane , {
tab : "\u6279\u91CF\u5BFC\u5165" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : AddStudentmodules . listItem ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "mt20" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "mb20" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
className : "mr40" ,
children : "\u6B65\u9AA41\uFF1A"
} ) , "\u4E0B\u8F7D" , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "a" , {
className : "ml5 mr5" ,
onClick : /*#__PURE__*/ asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee7 ( ) {
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee7$ ( _context7 ) {
while ( 1 ) switch ( _context7 . prev = _context7 . next ) {
case 0 :
( 0 , util /* downLoadFile */ . FH ) ( '' , ( 0 , util /* setUrlQuery */ . NY ) ( {
url : env /* default */ . Z . API _SERVER + "/api/school_manages/down_school_manages_template.json\t" ,
query : { }
} ) ) ;
case 1 :
case "end" :
return _context7 . stop ( ) ;
}
} , _callee7 ) ;
} ) ) ,
children : "\u9AD8\u6821\u7BA1\u7406\u6210\u5458\u5BFC\u5165\u6A21\u677F"
} ) , "\u6279\u91CF\u5BFC\u5165\u6210\u5458\u3002" ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
className : "mr40" ,
children : "\u6B65\u9AA42\uFF1A"
} ) , "\u4E0A\u4F20\u586B\u5199\u597D\u7684\u300A\u9AD8\u6821\u7BA1\u7406\u6210\u5458\u5BFC\u5165\u6A21\u677F\u300B\u3002" ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
style : {
margin : '4px 0px 20px 94px'
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( upload /* default */ . Z , objectSpread2 _default ( ) ( objectSpread2 _default ( ) ( { } , Draggers ) , { } , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
type : "primary" ,
className : "mt10" ,
icon : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( PlusOutlined /* default */ . Z , { } ) ,
children : "\u9009\u62E9\u6587\u4EF6"
} )
} ) )
} ) ]
} )
} )
} , "2" ) ]
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
className : AddStudentmodules . listItem ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "mt20" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
className : "mb20" ,
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
className : "mr40" ,
children : "\u6B65\u9AA41\uFF1A"
} ) , "\u4E0B\u8F7D" , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "a" , {
className : "ml5 mr5" ,
onClick : /*#__PURE__*/ asyncToGenerator _default ( ) ( /*#__PURE__*/ regeneratorRuntime _default ( ) ( ) . mark ( function _callee7 ( ) {
return regeneratorRuntime _default ( ) ( ) . wrap ( function _callee7$ ( _context7 ) {
while ( 1 ) switch ( _context7 . prev = _context7 . next ) {
case 0 :
( 0 , util /* downLoadFile */ . FH ) ( '' , ( 0 , util /* setUrlQuery */ . NY ) ( {
url : env /* default */ . Z . API _SERVER + "/api/school_manages/down_school_manages_template.json\t" ,
query : { }
} ) ) ;
case 1 :
case "end" :
return _context7 . stop ( ) ;
}
} , _callee7 ) ;
} ) ) ,
children : "\u9AD8\u6821\u7BA1\u7406\u6210\u5458\u5BFC\u5165\u6A21\u677F"
} ) , "\u6279\u91CF\u5BFC\u5165\u6210\u5458\u3002" ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsxs ) ( "div" , {
children : [ /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "span" , {
className : "mr40" ,
children : "\u6B65\u9AA42\uFF1A"
} ) , "\u4E0A\u4F20\u586B\u5199\u597D\u7684\u300A\u9AD8\u6821\u7BA1\u7406\u6210\u5458\u5BFC\u5165\u6A21\u677F\u300B\u3002" ]
} ) , /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( "div" , {
style : {
margin : '4px 0px 20px 94px'
} ,
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( upload /* default */ . Z , objectSpread2 _default ( ) ( objectSpread2 _default ( ) ( { } , Draggers ) , { } , {
children : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( es _button /* default */ . ZP , {
type : "primary" ,
className : "mt10" ,
icon : /*#__PURE__*/ ( 0 , jsx _runtime . jsx ) ( PlusOutlined /* default */ . Z , { } ) ,
children : "\u9009\u62E9\u6587\u4EF6"
} )
} ) )
} ) ]
} )
} )
} ) ;
} ;
@ -1264,322 +1137,6 @@ var Banner = function Banner(_ref) {
} ;
} ) ( Banner ) ) ;
/***/ } ) ,
/***/ 51581 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / node _modules / _react - infinite - scroller @ 1.2 . 4 @ react - infinite - scroller / dist / InfiniteScroll . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , ( {
value : true
} ) ) ;
var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
var _react = _ _webpack _require _ _ ( /*! react */ 59301 ) ;
var _react2 = _interopRequireDefault ( _react ) ;
var _propTypes = _ _webpack _require _ _ ( /*! prop-types */ 12708 ) ;
var _propTypes2 = _interopRequireDefault ( _propTypes ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _possibleConstructorReturn ( self , call ) { if ( ! self ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ; }
function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , enumerable : false , writable : true , configurable : true } } ) ; if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . _ _proto _ _ = superClass ; }
var InfiniteScroll = function ( _Component ) {
_inherits ( InfiniteScroll , _Component ) ;
function InfiniteScroll ( props ) {
_classCallCheck ( this , InfiniteScroll ) ;
var _this = _possibleConstructorReturn ( this , ( InfiniteScroll . _ _proto _ _ || Object . getPrototypeOf ( InfiniteScroll ) ) . call ( this , props ) ) ;
_this . scrollListener = _this . scrollListener . bind ( _this ) ;
_this . eventListenerOptions = _this . eventListenerOptions . bind ( _this ) ;
_this . mousewheelListener = _this . mousewheelListener . bind ( _this ) ;
return _this ;
}
_createClass ( InfiniteScroll , [ {
key : 'componentDidMount' ,
value : function componentDidMount ( ) {
this . pageLoaded = this . props . pageStart ;
this . options = this . eventListenerOptions ( ) ;
this . attachScrollListener ( ) ;
}
} , {
key : 'componentDidUpdate' ,
value : function componentDidUpdate ( ) {
if ( this . props . isReverse && this . loadMore ) {
var parentElement = this . getParentElement ( this . scrollComponent ) ;
parentElement . scrollTop = parentElement . scrollHeight - this . beforeScrollHeight + this . beforeScrollTop ;
this . loadMore = false ;
}
this . attachScrollListener ( ) ;
}
} , {
key : 'componentWillUnmount' ,
value : function componentWillUnmount ( ) {
this . detachScrollListener ( ) ;
this . detachMousewheelListener ( ) ;
}
} , {
key : 'isPassiveSupported' ,
value : function isPassiveSupported ( ) {
var passive = false ;
var testOptions = {
get passive ( ) {
passive = true ;
}
} ;
try {
document . addEventListener ( 'test' , null , testOptions ) ;
document . removeEventListener ( 'test' , null , testOptions ) ;
} catch ( e ) {
// ignore
}
return passive ;
}
} , {
key : 'eventListenerOptions' ,
value : function eventListenerOptions ( ) {
var options = this . props . useCapture ;
if ( this . isPassiveSupported ( ) ) {
options = {
useCapture : this . props . useCapture ,
passive : true
} ;
}
return options ;
}
// Set a defaut loader for all your `InfiniteScroll` components
} , {
key : 'setDefaultLoader' ,
value : function setDefaultLoader ( loader ) {
this . defaultLoader = loader ;
}
} , {
key : 'detachMousewheelListener' ,
value : function detachMousewheelListener ( ) {
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = this . scrollComponent . parentNode ;
}
scrollEl . removeEventListener ( 'mousewheel' , this . mousewheelListener , this . options ? this . options : this . props . useCapture ) ;
}
} , {
key : 'detachScrollListener' ,
value : function detachScrollListener ( ) {
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = this . getParentElement ( this . scrollComponent ) ;
}
scrollEl . removeEventListener ( 'scroll' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . removeEventListener ( 'resize' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
}
} , {
key : 'getParentElement' ,
value : function getParentElement ( el ) {
var scrollParent = this . props . getScrollParent && this . props . getScrollParent ( ) ;
if ( scrollParent != null ) {
return scrollParent ;
}
return el && el . parentNode ;
}
} , {
key : 'filterProps' ,
value : function filterProps ( props ) {
return props ;
}
} , {
key : 'attachScrollListener' ,
value : function attachScrollListener ( ) {
var parentElement = this . getParentElement ( this . scrollComponent ) ;
if ( ! this . props . hasMore || ! parentElement ) {
return ;
}
var scrollEl = window ;
if ( this . props . useWindow === false ) {
scrollEl = parentElement ;
}
scrollEl . addEventListener ( 'mousewheel' , this . mousewheelListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . addEventListener ( 'scroll' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
scrollEl . addEventListener ( 'resize' , this . scrollListener , this . options ? this . options : this . props . useCapture ) ;
if ( this . props . initialLoad ) {
this . scrollListener ( ) ;
}
}
} , {
key : 'mousewheelListener' ,
value : function mousewheelListener ( e ) {
// Prevents Chrome hangups
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
if ( e . deltaY === 1 && ! this . isPassiveSupported ( ) ) {
e . preventDefault ( ) ;
}
}
} , {
key : 'scrollListener' ,
value : function scrollListener ( ) {
var el = this . scrollComponent ;
var scrollEl = window ;
var parentNode = this . getParentElement ( el ) ;
var offset = void 0 ;
if ( this . props . useWindow ) {
var doc = document . documentElement || document . body . parentNode || document . body ;
var scrollTop = scrollEl . pageYOffset !== undefined ? scrollEl . pageYOffset : doc . scrollTop ;
if ( this . props . isReverse ) {
offset = scrollTop ;
} else {
offset = this . calculateOffset ( el , scrollTop ) ;
}
} else if ( this . props . isReverse ) {
offset = parentNode . scrollTop ;
} else {
offset = el . scrollHeight - parentNode . scrollTop - parentNode . clientHeight ;
}
// Here we make sure the element is visible as well as checking the offset
if ( offset < Number ( this . props . threshold ) && el && el . offsetParent !== null ) {
this . detachScrollListener ( ) ;
this . beforeScrollHeight = parentNode . scrollHeight ;
this . beforeScrollTop = parentNode . scrollTop ;
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
if ( typeof this . props . loadMore === 'function' ) {
this . props . loadMore ( this . pageLoaded += 1 ) ;
this . loadMore = true ;
}
}
}
} , {
key : 'calculateOffset' ,
value : function calculateOffset ( el , scrollTop ) {
if ( ! el ) {
return 0 ;
}
return this . calculateTopPosition ( el ) + ( el . offsetHeight - scrollTop - window . innerHeight ) ;
}
} , {
key : 'calculateTopPosition' ,
value : function calculateTopPosition ( el ) {
if ( ! el ) {
return 0 ;
}
return el . offsetTop + this . calculateTopPosition ( el . offsetParent ) ;
}
} , {
key : 'render' ,
value : function render ( ) {
var _this2 = this ;
var renderProps = this . filterProps ( this . props ) ;
var children = renderProps . children ,
element = renderProps . element ,
hasMore = renderProps . hasMore ,
initialLoad = renderProps . initialLoad ,
isReverse = renderProps . isReverse ,
loader = renderProps . loader ,
loadMore = renderProps . loadMore ,
pageStart = renderProps . pageStart ,
ref = renderProps . ref ,
threshold = renderProps . threshold ,
useCapture = renderProps . useCapture ,
useWindow = renderProps . useWindow ,
getScrollParent = renderProps . getScrollParent ,
props = _objectWithoutProperties ( renderProps , [ 'children' , 'element' , 'hasMore' , 'initialLoad' , 'isReverse' , 'loader' , 'loadMore' , 'pageStart' , 'ref' , 'threshold' , 'useCapture' , 'useWindow' , 'getScrollParent' ] ) ;
props . ref = function ( node ) {
_this2 . scrollComponent = node ;
if ( ref ) {
ref ( node ) ;
}
} ;
var childrenArray = [ children ] ;
if ( hasMore ) {
if ( loader ) {
isReverse ? childrenArray . unshift ( loader ) : childrenArray . push ( loader ) ;
} else if ( this . defaultLoader ) {
isReverse ? childrenArray . unshift ( this . defaultLoader ) : childrenArray . push ( this . defaultLoader ) ;
}
}
return _react2 . default . createElement ( element , props , childrenArray ) ;
}
} ] ) ;
return InfiniteScroll ;
} ( _react . Component ) ;
InfiniteScroll . propTypes = {
children : _propTypes2 . default . node . isRequired ,
element : _propTypes2 . default . node ,
hasMore : _propTypes2 . default . bool ,
initialLoad : _propTypes2 . default . bool ,
isReverse : _propTypes2 . default . bool ,
loader : _propTypes2 . default . node ,
loadMore : _propTypes2 . default . func . isRequired ,
pageStart : _propTypes2 . default . number ,
ref : _propTypes2 . default . func ,
getScrollParent : _propTypes2 . default . func ,
threshold : _propTypes2 . default . number ,
useCapture : _propTypes2 . default . bool ,
useWindow : _propTypes2 . default . bool
} ;
InfiniteScroll . defaultProps = {
element : 'div' ,
hasMore : false ,
initialLoad : true ,
pageStart : 0 ,
ref : null ,
threshold : 250 ,
useWindow : true ,
isReverse : false ,
useCapture : false ,
loader : null ,
getScrollParent : null
} ;
exports [ "default" ] = InfiniteScroll ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 26724 :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / node _modules / _react - infinite - scroller @ 1.2 . 4 @ react - infinite - scroller / index . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( function ( module , _ _unused _webpack _exports , _ _webpack _require _ _ ) {
module . exports = _ _webpack _require _ _ ( /*! ./dist/InfiniteScroll */ 51581 )
/***/ } )
} ] ) ;