From f38cf10597554fefc9459a56d1c34898cd952802 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sun, 15 Oct 2017 17:47:43 +0300 Subject: [PATCH 1/8] Fixed top/bottom window height detection --- src/index.jsx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index 9a23b31..fdfec37 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -8,7 +8,7 @@ /> */ -import React, { Component } from 'react' +import React, { Component } from 'react/lib/React' import createReactClass from 'create-react-class' import PropTypes from 'prop-types' const jQuery = require('jquery') @@ -142,7 +142,7 @@ const ReactScrollPagination = createReactClass({ }, getOnePageHeight: function () { - const documentHeight = jQuery(document).height() + const documentHeight = this.documentHeight() /* * 当totalPages第一次有值时,表明List是初次加载,此时计算页面的高度,并将其作为单页的高度 @@ -155,25 +155,35 @@ const ReactScrollPagination = createReactClass({ handlePagePosition: function () { this.getOnePageHeight() - let windowHeight = jQuery(window).height() - let scrollTop = jQuery(window).scrollTop() + windowHeight - this.isolate.excludeHeight + let scrollBottom = this.scrollTop() + this.windowHeight() - this.isolate.excludeHeight if (this.isolate.onePageHeight !== null) { - let currentPage = Math.ceil(scrollTop / this.isolate.onePageHeight) || 1 + let currentPage = Math.ceil(scrollBottom / this.isolate.onePageHeight) || 1 this.setState({currentPage: currentPage}) this.showPagePositionDiv() } }, - scrollHandler: function () { - let documentHeight = jQuery(document).height() + windowHeight: function () { + return Math.max(document.body.clientHeight, window.innerWidth) + }, + + documentHeight: function () { + return Math.max(this.windowHeight(), document.documentElement.clientHeight, + document.body.scrollHeight, document.documentElement.scrollHeight, + document.body.offsetHeight, document.documentElement.offsetHeight) + }, - let windowHeight = jQuery(window).height() - let scrollBottom = jQuery(window).scrollTop() + windowHeight + scrollTop: function() { + return window.pageYOffset || document.documentElement.scrollTop + }, + + scrollHandler: function () { + let scrollBottom = this.scrollTop() + this.windowHeight() let triggerBottom = scrollBottom + this.isolate.triggerAt // 当滚动条距离底部距离小于30像素的时候出发请求操作 - if (triggerBottom >= documentHeight) { + if (triggerBottom >= this.documentHeight()) { this.props.fetchFunc() } From 588e074647055b6c96185c1e4dd319e0d65f8a6d Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sat, 21 Oct 2017 11:39:17 +0300 Subject: [PATCH 2/8] Replaced createReactClass with React Component. Avoided jquery --- src/index.jsx | 116 ++++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index fdfec37..11d6b5b 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -8,13 +8,15 @@ /> */ -import React, { Component } from 'react/lib/React' -import createReactClass from 'create-react-class' +import { Component } from 'react' import PropTypes from 'prop-types' -const jQuery = require('jquery') -const ReactScrollPagination = createReactClass({ - propTypes: { +export default class ReactScrollPagination extends Component { + static defaultProps = { + totalPages: null, + } + + static propTypes = { fetchFunc: PropTypes.func.isRequired, totalPages: PropTypes.number, paginationShowTime: PropTypes.oneOfType([ @@ -32,8 +34,9 @@ const ReactScrollPagination = createReactClass({ PropTypes.number, // The distance to trigger the fetchfunc PropTypes.string ]), - }, - isolate: { + } + + isolate = { onePageHeight: null, timeoutFuncHandler: null, excludeHeight: null, @@ -42,15 +45,17 @@ const ReactScrollPagination = createReactClass({ defaultShowTime: 2000, defaultTrigger: 30, defaultExcludeHeight: 0 - }, - pageDivStle: { + } + + pageDivStle = { position: 'fixed', bottom: '15px', left: 0, right: 0, textAlign: 'center' - }, - pageContentStyle: { + } + + pageContentStyle = { display: 'inline-block', background: 'rgba(6, 6, 6, 0.54)', borderRadius: '5px', @@ -64,16 +69,15 @@ const ReactScrollPagination = createReactClass({ MozTransition: 'opacity 0.8s', OTransition: 'opacity 0.8s', transition: 'opacity 0.8s' - }, - getInitialState: function () { - return { - currentPage: 1, - totalPages: null, - showPageStatus: false - } - }, + } + + state = { + currentPage: 1, + totalPages: this.props.totalPages, + showPageStatus: false + } - showPagePositionDiv: function () { + showPagePositionDiv = () => { if (this.isolate.timeoutFuncHandler) { clearTimeout(this.isolate.timeoutFuncHandler) } @@ -82,8 +86,9 @@ const ReactScrollPagination = createReactClass({ this.isolate.timeoutFuncHandler = setTimeout(() => { this.setState({showPageStatus: false}) }, this.isolate.showTime) - }, - getShowTime: function () { + } + + getShowTime = () => { let showTime = this.isolate.defaultShowTime if (this.props.paginationShowTime) { showTime = parseInt(this.props.paginationShowTime) @@ -94,9 +99,9 @@ const ReactScrollPagination = createReactClass({ } } return showTime - }, + } - getExcludeHeight: function () { + getExcludeHeight = () => { // 获取需要减去的高度 let excludeHeight = this.isolate.defaultExcludeHeight @@ -110,21 +115,21 @@ const ReactScrollPagination = createReactClass({ } } else if (this.props.excludeElement && typeof this.props.excludeElement === 'string') { - let excludeEle = jQuery(this.props.excludeElement) + let excludeEle = document.querySelector(this.props.excludeElement) - if (excludeEle.size() === 0) { + if (excludeEle) { + excludeHeight = excludeEle.offsetHeight + } else { console.error('WARNING: Failed to get the element with given selector "' + this.props.excludeElement + '", please veirify. Will take "' + this.isolate.defaultExcludeHeight + '" by default.') - } else { - excludeHeight = excludeEle.height() } } this.isolate.excludeHeight = excludeHeight return excludeHeight - }, + } - getTriggerAt: function () { + getTriggerAt = () => { let triggerAt = this.isolate.defaultTrigger if (this.props.triggerAt) { @@ -139,9 +144,9 @@ const ReactScrollPagination = createReactClass({ } return triggerAt - }, + } - getOnePageHeight: function () { + getOnePageHeight = () => { const documentHeight = this.documentHeight() /* @@ -151,8 +156,9 @@ const ReactScrollPagination = createReactClass({ if (typeof this.props.totalPages === 'number' && this.props.totalPages > 0 && this.isolate.onePageHeight === null) { this.isolate.onePageHeight = documentHeight - this.isolate.excludeHeight } - }, - handlePagePosition: function () { + } + + handlePagePosition = () => { this.getOnePageHeight() let scrollBottom = this.scrollTop() + this.windowHeight() - this.isolate.excludeHeight @@ -162,23 +168,23 @@ const ReactScrollPagination = createReactClass({ this.setState({currentPage: currentPage}) this.showPagePositionDiv() } - }, + } - windowHeight: function () { + windowHeight = () => { return Math.max(document.body.clientHeight, window.innerWidth) - }, + } - documentHeight: function () { + documentHeight = () => { return Math.max(this.windowHeight(), document.documentElement.clientHeight, document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight) - }, + } - scrollTop: function() { + scrollTop = () => { return window.pageYOffset || document.documentElement.scrollTop - }, + } - scrollHandler: function () { + scrollHandler = () => { let scrollBottom = this.scrollTop() + this.windowHeight() let triggerBottom = scrollBottom + this.isolate.triggerAt @@ -188,30 +194,30 @@ const ReactScrollPagination = createReactClass({ } this.handlePagePosition() - }, + } - validateAndSetPropValues: function () { + validateAndSetPropValues = () => { this.isolate.triggerAt = this.getTriggerAt() this.isolate.excludeHeight = this.getExcludeHeight() this.isolate.showTime = this.getShowTime() - }, + } - componentWillUnmount: function () { - jQuery(window).unbind('scroll', this.scrollHandler) - }, + componentWillUnmount = () => { + window.removeEventListener('scroll', this.scrollHandler) + } - componentDidMount: function () { + componentDidMount = () => { this.validateAndSetPropValues() - jQuery(window).scroll(this.scrollHandler) - }, + window.addEventListener('scroll', this.scrollHandler) + } - render: function () { + render = () => { // if no totalPages presented, will only do the fetchings if (typeof this.props.totalPages === 'undefined') { return (null) } - let acutalPageContentDivStyle = jQuery.extend({}, this.props.innerDivStyle || this.pageContentStyle) + let acutalPageContentDivStyle = Object.assign({}, this.props.innerDivStyle || this.pageContentStyle) // always set the opacity for inner div, so they are able to make the transition if (!this.state.showPageStatus) { @@ -232,6 +238,4 @@ const ReactScrollPagination = createReactClass({ ) } -}) - -export default ReactScrollPagination +} From da4a10821790957c1fb4f5bcfc43581c861820a3 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sat, 21 Oct 2017 11:41:31 +0300 Subject: [PATCH 3/8] Updated configs --- .babelrc | 5 +++-- package.json | 13 ++++++------- webpack.config.js | 9 ++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.babelrc b/.babelrc index d05b16e..07d2b77 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,7 @@ { "presets": [ + "env", + "es2015", "react", - "es2015" ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index e6d52a5..e3e69af 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,8 @@ }, "homepage": "https://github.com/codingfishman/react-scroll-pagination#readme", "dependencies": { - "create-react-class": "^15.6.2", - "jquery": "^1.0.0", - "prop-types": "^15.6.0" + "prop-types": "^15.6.0", + "react": "^16.0.0" }, "devDependencies": { "babel-core": "^6.26.0", @@ -36,8 +35,9 @@ "babel-jest": "^9.0.0", "babel-loader": "^7.1.2", "babel-plugin-transform-runtime": "^6.23.0", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", + "babel-preset-env": "^1.6.1", + "babel-preset-es2015": "^6.24.1", + "babel-preset-react": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "eslint": "^2.8.0", "eslint-plugin-flow-vars": "^0.3.0", @@ -45,8 +45,7 @@ "jest": "^21.2.1", "jest-cli": "^21.2.1", "jscs": "^3.0.3", - "react": "~15.6.2", - "react-dom": "^15.6.2", + "react-dom": "^16.0.0", "webpack": "^3.6.0" }, "jest": { diff --git a/webpack.config.js b/webpack.config.js index b7e41c9..6dd8a9a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,22 +6,21 @@ module.exports = { library: 'ReactScrollPagination' }, externals: { - react:'React', - jquery: 'jQuery' + react: 'React' }, module:{ rules: [ { test: /\.jsx$/, - exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['es2015', 'stage-0', 'react'], - plugins: ['transform-runtime'] + plugins: ['transform-runtime'], + ignore: /node_modules/, } } } ] } -} \ No newline at end of file +} From 70ef7b06e350d1ae79933e42bda2fd49085884b7 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sat, 21 Oct 2017 11:41:47 +0300 Subject: [PATCH 4/8] Updated built distribution --- dist/index.js | 3074 ++++++++++++++++++++++++++++--------------------- 1 file changed, 1741 insertions(+), 1333 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3b14d1c..1e6db2f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,13 +1,13 @@ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("React"), require("jQuery")); + module.exports = factory(require("React")); else if(typeof define === 'function' && define.amd) - define(["React", "jQuery"], factory); + define(["React"], factory); else if(typeof exports === 'object') - exports["ReactScrollPagination"] = factory(require("React"), require("jQuery")); + exports["ReactScrollPagination"] = factory(require("React")); else - root["ReactScrollPagination"] = factory(root["React"], root["jQuery"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_19__) { + root["ReactScrollPagination"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_91__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -70,13 +70,218 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 6); +/******/ return __webpack_require__(__webpack_require__.s = 47); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.1' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(0); +var core = __webpack_require__(1); +var ctx = __webpack_require__(34); +var hide = __webpack_require__(4); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(5); +var createDesc = __webpack_require__(13); +module.exports = __webpack_require__(6) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(10); +var IE8_DOM_DEFINE = __webpack_require__(35); +var toPrimitive = __webpack_require__(17); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(7)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(38); +var defined = __webpack_require__(18); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(21)('wks'); +var uid = __webpack_require__(15); +var Symbol = __webpack_require__(0).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(11); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + // shim for using process in browser var process = module.exports = {}; @@ -264,7 +469,240 @@ process.umask = function() { return 0; }; /***/ }), -/* 1 */ +/* 13 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(37); +var enumBugKeys = __webpack_require__(22); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(11); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(21)('keys'); +var uid = __webpack_require__(15); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(0); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); +module.exports = function (key) { + return store[key] || (store[key] = {}); +}; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(18); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(10); +var dPs = __webpack_require__(67); +var enumBugKeys = __webpack_require__(22); +var IE_PROTO = __webpack_require__(20)('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(36)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(68).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(5).f; +var has = __webpack_require__(2); +var TAG = __webpack_require__(9)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(9); + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(0); +var core = __webpack_require__(1); +var LIBRARY = __webpack_require__(25); +var wksExt = __webpack_require__(29); +var defineProperty = __webpack_require__(5).f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -306,7 +744,7 @@ emptyFunction.thatReturnsArgument = function (arg) { module.exports = emptyFunction; /***/ }), -/* 2 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -363,10 +801,10 @@ function invariant(condition, format, a, b, c, d, e, f) { } module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) /***/ }), -/* 3 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -385,55 +823,308 @@ module.exports = ReactPropTypesSecret; /***/ }), -/* 4 */ -/***/ (function(module, exports) { +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(51); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; -module.exports = __WEBPACK_EXTERNAL_MODULE_4__; /***/ }), -/* 5 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ +module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () { + return Object.defineProperty(__webpack_require__(36)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { -var emptyFunction = __webpack_require__(1); +var isObject = __webpack_require__(11); +var document = __webpack_require__(0).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ -var warning = emptyFunction; +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } +var has = __webpack_require__(2); +var toIObject = __webpack_require__(8); +var arrayIndexOf = __webpack_require__(53)(false); +var IE_PROTO = __webpack_require__(20)('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(39); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(2); +var toObject = __webpack_require__(24); +var IE_PROTO = __webpack_require__(20)('IE_PROTO'); +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _iterator = __webpack_require__(62); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = __webpack_require__(73); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(25); +var $export = __webpack_require__(3); +var redefine = __webpack_require__(43); +var hide = __webpack_require__(4); +var has = __webpack_require__(2); +var Iterators = __webpack_require__(26); +var $iterCreate = __webpack_require__(66); +var setToStringTag = __webpack_require__(28); +var getPrototypeOf = __webpack_require__(40); +var ITERATOR = __webpack_require__(9)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(4); + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(37); +var hiddenKeys = __webpack_require__(22).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(16); +var createDesc = __webpack_require__(13); +var toIObject = __webpack_require__(8); +var toPrimitive = __webpack_require__(17); +var has = __webpack_require__(2); +var IE8_DOM_DEFINE = __webpack_require__(35); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var emptyFunction = __webpack_require__(31); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); } catch (x) {} }; @@ -457,10 +1148,10 @@ if (process.env.NODE_ENV !== 'production') { } module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) /***/ }), -/* 6 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -470,1449 +1161,1172 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _react = __webpack_require__(4); +var _assign = __webpack_require__(48); + +var _assign2 = _interopRequireDefault(_assign); + +var _getPrototypeOf = __webpack_require__(56); + +var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); -var _react2 = _interopRequireDefault(_react); +var _classCallCheck2 = __webpack_require__(60); -var _createReactClass = __webpack_require__(7); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); -var _createReactClass2 = _interopRequireDefault(_createReactClass); +var _possibleConstructorReturn2 = __webpack_require__(61); -var _propTypes = __webpack_require__(14); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(83); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _react = __webpack_require__(91); + +var _propTypes = __webpack_require__(92); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var jQuery = __webpack_require__(19); /** - * 在页面滚动的时候,监听滚动事件,在快要到达底部指定距离的时候,执行相应函数 - * 如果传入 totalPages, 则会在鼠标滚动时 - * - * - */ - -var ReactScrollPagination = (0, _createReactClass2.default)({ - displayName: 'ReactScrollPagination', - - propTypes: { - fetchFunc: _propTypes2.default.func.isRequired, - totalPages: _propTypes2.default.number, - paginationShowTime: _propTypes2.default.oneOfType([_propTypes2.default.number, // How long shall the pagination div shows - _propTypes2.default.string]), - excludeElement: _propTypes2.default.string, // The element selector which should be excluded from calculation - excludeHeight: _propTypes2.default.oneOfType([_propTypes2.default.number, // the height value which should be excluded from calculation - _propTypes2.default.string]), - outterDivStyle: _propTypes2.default.object, // Style of the outter Div element - innerDivStyle: _propTypes2.default.object, // Style of the inner Div element - triggerAt: _propTypes2.default.oneOfType([_propTypes2.default.number, // The distance to trigger the fetchfunc - _propTypes2.default.string]) - }, - isolate: { - onePageHeight: null, - timeoutFuncHandler: null, - excludeHeight: null, - triggerAt: null, - showTime: null, - defaultShowTime: 2000, - defaultTrigger: 30, - defaultExcludeHeight: 0 - }, - pageDivStle: { - position: 'fixed', - bottom: '15px', - left: 0, - right: 0, - textAlign: 'center' - }, - pageContentStyle: { - display: 'inline-block', - background: 'rgba(6, 6, 6, 0.54)', - borderRadius: '5px', - padding: '3px 15px', - minWidth: '80px', - color: '#fff', - textAlign: 'center', - margin: '0 auto', - opacity: 1, - WebkitTransition: 'opacity 0.8s', - MozTransition: 'opacity 0.8s', - OTransition: 'opacity 0.8s', - transition: 'opacity 0.8s' - }, - getInitialState: function getInitialState() { - return { +/** +* 在页面滚动的时候,监听滚动事件,在快要到达底部指定距离的时候,执行相应函数 +* 如果传入 totalPages, 则会在鼠标滚动时 +* +* +*/ + +var ReactScrollPagination = function (_Component) { + (0, _inherits3.default)(ReactScrollPagination, _Component); + + function ReactScrollPagination() { + var _ref; + + var _temp, _this, _ret; + + (0, _classCallCheck3.default)(this, ReactScrollPagination); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ReactScrollPagination.__proto__ || (0, _getPrototypeOf2.default)(ReactScrollPagination)).call.apply(_ref, [this].concat(args))), _this), _this.isolate = { + onePageHeight: null, + timeoutFuncHandler: null, + excludeHeight: null, + triggerAt: null, + showTime: null, + defaultShowTime: 2000, + defaultTrigger: 30, + defaultExcludeHeight: 0 + }, _this.pageDivStle = { + position: 'fixed', + bottom: '15px', + left: 0, + right: 0, + textAlign: 'center' + }, _this.pageContentStyle = { + display: 'inline-block', + background: 'rgba(6, 6, 6, 0.54)', + borderRadius: '5px', + padding: '3px 15px', + minWidth: '80px', + color: '#fff', + textAlign: 'center', + margin: '0 auto', + opacity: 1, + WebkitTransition: 'opacity 0.8s', + MozTransition: 'opacity 0.8s', + OTransition: 'opacity 0.8s', + transition: 'opacity 0.8s' + }, _this.state = { currentPage: 1, - totalPages: null, + totalPages: _this.props.totalPages, showPageStatus: false - }; - }, - - showPagePositionDiv: function showPagePositionDiv() { - var _this = this; - - if (this.isolate.timeoutFuncHandler) { - clearTimeout(this.isolate.timeoutFuncHandler); - } - this.setState({ showPageStatus: true }); + }, _this.showPagePositionDiv = function () { + if (_this.isolate.timeoutFuncHandler) { + clearTimeout(_this.isolate.timeoutFuncHandler); + } + _this.setState({ showPageStatus: true }); + + _this.isolate.timeoutFuncHandler = setTimeout(function () { + _this.setState({ showPageStatus: false }); + }, _this.isolate.showTime); + }, _this.getShowTime = function () { + var showTime = _this.isolate.defaultShowTime; + if (_this.props.paginationShowTime) { + showTime = parseInt(_this.props.paginationShowTime); + if (isNaN(showTime)) { + showTime = _this.isolate.defaultShowTime; + console.error('WARNING: Failed to convert props "paginationShowTime" to Number with value: "' + _this.props.paginationShowTime + '". Will take ' + _this.isolate.defaultShowTime + ' by default.'); + } + } + return showTime; + }, _this.getExcludeHeight = function () { + // 获取需要减去的高度 + var excludeHeight = _this.isolate.defaultExcludeHeight; + + if (_this.props.excludeHeight) { + var propsExcludeHeight = parseInt(_this.props.excludeHeight); + if (isNaN(propsExcludeHeight)) { + console.error('WARNING: Failed to convert the props "excludeHeight" with value: "' + _this.props.excludeHeight + '" to Number, please verify. Will take "' + _this.isolate.defaultExcludeHeight + '" by default.'); + } else { + excludeHeight = propsExcludeHeight; + } + } else if (_this.props.excludeElement && typeof _this.props.excludeElement === 'string') { + var excludeEle = document.querySelector(_this.props.excludeElement); - this.isolate.timeoutFuncHandler = setTimeout(function () { - _this.setState({ showPageStatus: false }); - }, this.isolate.showTime); - }, - getShowTime: function getShowTime() { - var showTime = this.isolate.defaultShowTime; - if (this.props.paginationShowTime) { - showTime = parseInt(this.props.paginationShowTime); - if (isNaN(showTime)) { - showTime = this.isolate.defaultShowTime; - console.error('WARNING: Failed to convert props "paginationShowTime" to Number with value: "' + this.props.paginationShowTime + '". Will take ' + this.isolate.defaultShowTime + ' by default.'); + if (excludeEle) { + excludeHeight = excludeEle.offsetHeight; + } else { + console.error('WARNING: Failed to get the element with given selector "' + _this.props.excludeElement + '", please veirify. Will take "' + _this.isolate.defaultExcludeHeight + '" by default.'); + } } - } - return showTime; - }, + _this.isolate.excludeHeight = excludeHeight; - getExcludeHeight: function getExcludeHeight() { - // 获取需要减去的高度 - var excludeHeight = this.isolate.defaultExcludeHeight; + return excludeHeight; + }, _this.getTriggerAt = function () { + var triggerAt = _this.isolate.defaultTrigger; - if (this.props.excludeHeight) { - var propsExcludeHeight = parseInt(this.props.excludeHeight); - if (isNaN(propsExcludeHeight)) { - console.error('WARNING: Failed to convert the props "excludeHeight" with value: "' + this.props.excludeHeight + '" to Number, please verify. Will take "' + this.isolate.defaultExcludeHeight + '" by default.'); - } else { - excludeHeight = propsExcludeHeight; - } - } else if (this.props.excludeElement && typeof this.props.excludeElement === 'string') { - var excludeEle = jQuery(this.props.excludeElement); + if (_this.props.triggerAt) { + triggerAt = parseInt(_this.props.triggerAt); - if (excludeEle.size() === 0) { - console.error('WARNING: Failed to get the element with given selector "' + this.props.excludeElement + '", please veirify. Will take "' + this.isolate.defaultExcludeHeight + '" by default.'); - } else { - excludeHeight = excludeEle.height(); + if (isNaN(triggerAt)) { + triggerAt = _this.isolate.defaultTrigger; + + console.error('WARNING: Failed to convert the props "triggerAt" to number with value: "' + _this.props.triggerAt + '". Will take 30px by default.'); + } } - } - this.isolate.excludeHeight = excludeHeight; - return excludeHeight; - }, + return triggerAt; + }, _this.getOnePageHeight = function () { + var documentHeight = _this.documentHeight(); - getTriggerAt: function getTriggerAt() { - var triggerAt = this.isolate.defaultTrigger; + /* + * 当totalPages第一次有值时,表明List是初次加载,此时计算页面的高度,并将其作为单页的高度 + * 如果页面有固定的顶部头,通过 excludeHeight 将其减去 + */ + if (typeof _this.props.totalPages === 'number' && _this.props.totalPages > 0 && _this.isolate.onePageHeight === null) { + _this.isolate.onePageHeight = documentHeight - _this.isolate.excludeHeight; + } + }, _this.handlePagePosition = function () { + _this.getOnePageHeight(); - if (this.props.triggerAt) { - triggerAt = parseInt(this.props.triggerAt); + var scrollBottom = _this.scrollTop() + _this.windowHeight() - _this.isolate.excludeHeight; - if (isNaN(triggerAt)) { - triggerAt = this.isolate.defaultTrigger; + if (_this.isolate.onePageHeight !== null) { + var currentPage = Math.ceil(scrollBottom / _this.isolate.onePageHeight) || 1; + _this.setState({ currentPage: currentPage }); + _this.showPagePositionDiv(); + } + }, _this.windowHeight = function () { + return Math.max(document.body.clientHeight, window.innerWidth); + }, _this.documentHeight = function () { + return Math.max(_this.windowHeight(), document.documentElement.clientHeight, document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight); + }, _this.scrollTop = function () { + return window.pageYOffset || document.documentElement.scrollTop; + }, _this.scrollHandler = function () { + var scrollBottom = _this.scrollTop() + _this.windowHeight(); + var triggerBottom = scrollBottom + _this.isolate.triggerAt; + + // 当滚动条距离底部距离小于30像素的时候出发请求操作 + if (triggerBottom >= _this.documentHeight()) { + _this.props.fetchFunc(); + } - console.error('WARNING: Failed to convert the props "triggerAt" to number with value: "' + this.props.triggerAt + '". Will take 30px by default.'); + _this.handlePagePosition(); + }, _this.validateAndSetPropValues = function () { + _this.isolate.triggerAt = _this.getTriggerAt(); + _this.isolate.excludeHeight = _this.getExcludeHeight(); + _this.isolate.showTime = _this.getShowTime(); + }, _this.componentWillUnmount = function () { + window.removeEventListener('scroll', _this.scrollHandler); + }, _this.componentDidMount = function () { + _this.validateAndSetPropValues(); + window.addEventListener('scroll', _this.scrollHandler); + }, _this.render = function () { + // if no totalPages presented, will only do the fetchings + if (typeof _this.props.totalPages === 'undefined') { + return null; } - } - return triggerAt; - }, + var acutalPageContentDivStyle = (0, _assign2.default)({}, _this.props.innerDivStyle || _this.pageContentStyle); - getOnePageHeight: function getOnePageHeight() { - var documentHeight = jQuery(document).height(); + // always set the opacity for inner div, so they are able to make the transition + if (!_this.state.showPageStatus) { + acutalPageContentDivStyle.opacity = 0; + } - /* - * 当totalPages第一次有值时,表明List是初次加载,此时计算页面的高度,并将其作为单页的高度 - * 如果页面有固定的顶部头,通过 excludeHeight 将其减去 - */ - if (typeof this.props.totalPages === 'number' && this.props.totalPages > 0 && this.isolate.onePageHeight === null) { - this.isolate.onePageHeight = documentHeight - this.isolate.excludeHeight; - } - }, - handlePagePosition: function handlePagePosition() { - this.getOnePageHeight(); + return React.createElement( + 'div', + { style: _this.props.outterDivStyle || _this.pageDivStle }, + React.createElement( + 'div', + { style: acutalPageContentDivStyle, className: 'react-scroll-pagination-inner-div' }, + React.createElement( + 'span', + null, + _this.state.currentPage + ), + '/', + React.createElement( + 'span', + null, + _this.props.totalPages || 1 + ) + ) + ); + }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); + } - var windowHeight = jQuery(window).height(); - var scrollTop = jQuery(window).scrollTop() + windowHeight - this.isolate.excludeHeight; + return ReactScrollPagination; +}(_react.Component); - if (this.isolate.onePageHeight !== null) { - var currentPage = Math.ceil(scrollTop / this.isolate.onePageHeight) || 1; - this.setState({ currentPage: currentPage }); - this.showPagePositionDiv(); - } - }, +ReactScrollPagination.defaultProps = { + totalPages: null +}; +ReactScrollPagination.propTypes = { + fetchFunc: _propTypes2.default.func.isRequired, + totalPages: _propTypes2.default.number, + paginationShowTime: _propTypes2.default.oneOfType([_propTypes2.default.number, // How long shall the pagination div shows + _propTypes2.default.string]), + excludeElement: _propTypes2.default.string, // The element selector which should be excluded from calculation + excludeHeight: _propTypes2.default.oneOfType([_propTypes2.default.number, // the height value which should be excluded from calculation + _propTypes2.default.string]), + outterDivStyle: _propTypes2.default.object, // Style of the outter Div element + innerDivStyle: _propTypes2.default.object, // Style of the inner Div element + triggerAt: _propTypes2.default.oneOfType([_propTypes2.default.number, // The distance to trigger the fetchfunc + _propTypes2.default.string]) +}; +exports.default = ReactScrollPagination; - scrollHandler: function scrollHandler() { - var documentHeight = jQuery(document).height(); +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { - var windowHeight = jQuery(window).height(); - var scrollBottom = jQuery(window).scrollTop() + windowHeight; - var triggerBottom = scrollBottom + this.isolate.triggerAt; +module.exports = { "default": __webpack_require__(49), __esModule: true }; - // 当滚动条距离底部距离小于30像素的时候出发请求操作 - if (triggerBottom >= documentHeight) { - this.props.fetchFunc(); - } +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { - this.handlePagePosition(); - }, +__webpack_require__(50); +module.exports = __webpack_require__(1).Object.assign; - validateAndSetPropValues: function validateAndSetPropValues() { - this.isolate.triggerAt = this.getTriggerAt(); - this.isolate.excludeHeight = this.getExcludeHeight(); - this.isolate.showTime = this.getShowTime(); - }, - componentWillUnmount: function componentWillUnmount() { - jQuery(window).unbind('scroll', this.scrollHandler); - }, +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { - componentDidMount: function componentDidMount() { - this.validateAndSetPropValues(); - jQuery(window).scroll(this.scrollHandler); - }, +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(3); - render: function render() { - // if no totalPages presented, will only do the fetchings - if (typeof this.props.totalPages === 'undefined') { - return null; - } +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(52) }); - var acutalPageContentDivStyle = jQuery.extend({}, this.props.innerDivStyle || this.pageContentStyle); - // always set the opacity for inner div, so they are able to make the transition - if (!this.state.showPageStatus) { - acutalPageContentDivStyle.opacity = 0; - } +/***/ }), +/* 51 */ +/***/ (function(module, exports) { - return _react2.default.createElement( - 'div', - { style: this.props.outterDivStyle || this.pageDivStle }, - _react2.default.createElement( - 'div', - { style: acutalPageContentDivStyle, className: 'react-scroll-pagination-inner-div' }, - _react2.default.createElement( - 'span', - null, - this.state.currentPage - ), - '/', - _react2.default.createElement( - 'span', - null, - this.props.totalPages || 1 - ) - ) - ); - } -}); +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; -exports.default = ReactScrollPagination; /***/ }), -/* 7 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(14); +var gOPS = __webpack_require__(23); +var pIE = __webpack_require__(16); +var toObject = __webpack_require__(24); +var IObject = __webpack_require__(38); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(7)(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; -var React = __webpack_require__(4); -var factory = __webpack_require__(8); +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(8); +var toLength = __webpack_require__(54); +var toAbsoluteIndex = __webpack_require__(55); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; -if (typeof React === 'undefined') { - throw Error( - 'create-react-class could not find the React object. If you are using script tags, ' + - 'make sure that React is being loaded before create-react-class.' - ); -} -// Hack to grab NoopUpdateQueue from isomorphic React -var ReactNoopUpdateQueue = new React.Component().updater; +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = factory( - React.Component, - React.isValidElement, - ReactNoopUpdateQueue -); +// 7.1.15 ToLength +var toInteger = __webpack_require__(19); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; /***/ }), -/* 8 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ +var toInteger = __webpack_require__(19); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { -var _assign = __webpack_require__(9); +module.exports = { "default": __webpack_require__(57), __esModule: true }; -var emptyObject = __webpack_require__(10); -var _invariant = __webpack_require__(11); +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { -if (process.env.NODE_ENV !== 'production') { - var warning = __webpack_require__(12); -} +__webpack_require__(58); +module.exports = __webpack_require__(1).Object.getPrototypeOf; -var MIXINS_KEY = 'mixins'; -// Helper function to allow the creation of anonymous functions which do not -// have .name set to the name of the variable being assigned to. -function identity(fn) { - return fn; -} +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { -var ReactPropTypeLocationNames; -if (process.env.NODE_ENV !== 'production') { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(24); +var $getPrototypeOf = __webpack_require__(40); + +__webpack_require__(59)('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); }; -} else { - ReactPropTypeLocationNames = {}; -} +}); -function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { - /** - * Policies that describe methods in `ReactClassInterface`. - */ - var injectedMixins = []; +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Composite components are higher-level components that compose other composite - * or host components. - * - * To create a new type of `ReactClass`, pass a specification of - * your new class to `React.createClass`. The only requirement of your class - * specification is that you implement a `render` method. - * - * var MyComponent = React.createClass({ - * render: function() { - * return
Hello World
; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ - var ReactClassInterface = { - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - }; +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(3); +var core = __webpack_require__(1); +var fails = __webpack_require__(7); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; - /** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ - var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function() {} - }; - function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an _invariant so components - // don't show up in prod but only in __DEV__ - if (process.env.NODE_ENV !== 'production') { - warning( - typeof typeDef[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactClass', - ReactPropTypeLocationNames[location], - propName - ); - } - } - } +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); } +}; - function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) - ? ReactClassInterface[name] - : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - _invariant( - specPolicy === 'OVERRIDE_BASE', - 'ReactClassInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ); - } +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { - // Disallow defining methods more than once unless explicitly allowed. - if (isAlreadyDefined) { - _invariant( - specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', - 'ReactClassInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ); - } +"use strict"; + + +exports.__esModule = true; + +var _typeof2 = __webpack_require__(41); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } - /** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ - function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (process.env.NODE_ENV !== 'production') { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - if (process.env.NODE_ENV !== 'production') { - warning( - isMixinValid, - "%s: You're attempting to include a mixin that is either null " + - 'or not an object. Check the mixins included by the component, ' + - 'as well as any mixins they include themselves. ' + - 'Expected object but got %s.', - Constructor.displayName || 'ReactClass', - spec === null ? null : typeofSpec - ); - } - } + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; +}; - return; - } +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { - _invariant( - typeof spec !== 'function', - "ReactClass: You're attempting to " + - 'use a component class or function as a mixin. Instead, just use a ' + - 'regular object.' - ); - _invariant( - !isValidElement(spec), - "ReactClass: You're attempting to " + - 'use a component as a mixin. Instead, just use a regular object.' - ); +module.exports = { "default": __webpack_require__(63), __esModule: true }; - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } +__webpack_require__(64); +__webpack_require__(69); +module.exports = __webpack_require__(29).f('iterator'); - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); +"use strict"; - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isReactClassMethod && - !isAlreadyDefined && - spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - _invariant( - isReactClassMethod && - (specPolicy === 'DEFINE_MANY_MERGED' || - specPolicy === 'DEFINE_MANY'), - 'ReactClass: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ); +var $at = __webpack_require__(65)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(42)(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (process.env.NODE_ENV !== 'production') { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } - } - function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { - var isReserved = name in RESERVED_SPEC_KEYS; - _invariant( - !isReserved, - 'ReactClass: You are attempting to define a reserved ' + - 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + - 'as an instance property instead; it will still be accessible on the ' + - 'constructor.', - name - ); +var toInteger = __webpack_require__(19); +var defined = __webpack_require__(18); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; - var isInherited = name in Constructor; - _invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ); - Constructor[name] = property; - } - } - /** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ - function mergeIntoWithNoDuplicateKeys(one, two) { - _invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' - ); +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { - for (var key in two) { - if (two.hasOwnProperty(key)) { - _invariant( - one[key] === undefined, - 'mergeIntoWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: `%s`. This conflict ' + - 'may be due to a mixin; in particular, this may be caused by two ' + - 'getInitialState() or getDefaultProps() methods returning objects ' + - 'with clashing keys.', - key - ); - one[key] = two[key]; - } - } - return one; - } +"use strict"; - /** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; - } +var create = __webpack_require__(27); +var descriptor = __webpack_require__(13); +var setToStringTag = __webpack_require__(28); +var IteratorPrototype = {}; - /** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; - } +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(4)(IteratorPrototype, __webpack_require__(9)('iterator'), function () { return this; }); - /** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ - function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (process.env.NODE_ENV !== 'production') { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function(newThis) { - for ( - var _len = arguments.length, - args = Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', - componentName - ); - } - } else if (!args.length) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): You are binding a component method to the component. ' + - 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', - componentName - ); - } - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; - } - /** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ - function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(5); +var anObject = __webpack_require__(10); +var getKeys = __webpack_require__(14); + +module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(0).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(70); +var global = __webpack_require__(0); +var hide = __webpack_require__(4); +var Iterators = __webpack_require__(26); +var TO_STRING_TAG = __webpack_require__(9)('toStringTag'); + +var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + +for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(71); +var step = __webpack_require__(72); +var Iterators = __webpack_require__(26); +var toIObject = __webpack_require__(8); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(42)(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return step(1); } + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); - var IsMountedPreMixin = { - componentDidMount: function() { - this.__isMounted = true; - } - }; +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; - var IsMountedPostMixin = { - componentWillUnmount: function() { - this.__isMounted = false; - } - }; +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); - /** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ - var ReactClassMixin = { - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function(newState, callback) { - this.updater.enqueueReplaceState(this, newState, callback); - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - if (process.env.NODE_ENV !== 'production') { - warning( - this.__didWarnIsMounted, - '%s: isMounted is deprecated. Instead, make sure to clean up ' + - 'subscriptions and pending requests in componentWillUnmount to ' + - 'prevent memory leaks.', - (this.constructor && this.constructor.displayName) || - this.name || - 'Component' - ); - this.__didWarnIsMounted = true; - } - return !!this.__isMounted; - } - }; - var ReactClassComponent = function() {}; - _assign( - ReactClassComponent.prototype, - ReactComponent.prototype, - ReactClassMixin - ); +/***/ }), +/* 71 */ +/***/ (function(module, exports) { - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - function createClass(spec) { - // To keep our warnings more understandable, we'll use a little hack here to - // ensure that Constructor.name !== 'Constructor'. This makes sure we don't - // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function(props, context, updater) { - // This constructor gets overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if (process.env.NODE_ENV !== 'production') { - warning( - this instanceof Constructor, - 'Something is calling a React component directly. Use a factory or ' + - 'JSX instead. See: https://fb.me/react-legacyfactory' - ); - } +module.exports = function () { /* empty */ }; - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (process.env.NODE_ENV !== 'production') { - // We allow auto-mocks to proceed as if they're returning null. - if ( - initialState === undefined && - this.getInitialState._isMockFunction - ) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - _invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.getInitialState(): must return an object or null', - Constructor.displayName || 'ReactCompositeComponent' - ); +/***/ }), +/* 72 */ +/***/ (function(module, exports) { - this.state = initialState; - }); - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - Constructor.prototype.__reactAutoBindPairs = []; +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - mixSpecIntoComponent(Constructor, IsMountedPreMixin); - mixSpecIntoComponent(Constructor, spec); - mixSpecIntoComponent(Constructor, IsMountedPostMixin); +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } +module.exports = { "default": __webpack_require__(74), __esModule: true }; - if (process.env.NODE_ENV !== 'production') { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { - _invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ); +__webpack_require__(75); +__webpack_require__(80); +__webpack_require__(81); +__webpack_require__(82); +module.exports = __webpack_require__(1).Symbol; - if (process.env.NODE_ENV !== 'production') { - warning( - !Constructor.prototype.componentShouldUpdate, - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - spec.displayName || 'A component' - ); - warning( - !Constructor.prototype.componentWillRecieveProps, - '%s has a method called ' + - 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', - spec.displayName || 'A component' - ); - } - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(0); +var has = __webpack_require__(2); +var DESCRIPTORS = __webpack_require__(6); +var $export = __webpack_require__(3); +var redefine = __webpack_require__(43); +var META = __webpack_require__(76).KEY; +var $fails = __webpack_require__(7); +var shared = __webpack_require__(21); +var setToStringTag = __webpack_require__(28); +var uid = __webpack_require__(15); +var wks = __webpack_require__(9); +var wksExt = __webpack_require__(29); +var wksDefine = __webpack_require__(30); +var enumKeys = __webpack_require__(77); +var isArray = __webpack_require__(78); +var anObject = __webpack_require__(10); +var toIObject = __webpack_require__(8); +var toPrimitive = __webpack_require__(17); +var createDesc = __webpack_require__(13); +var _create = __webpack_require__(27); +var gOPNExt = __webpack_require__(79); +var $GOPD = __webpack_require__(45); +var $DP = __webpack_require__(5); +var $keys = __webpack_require__(14); +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; +var _stringify = $JSON && $JSON.stringify; +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function'; +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { return dP(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { enumerable: createDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } return result; +}; - return Constructor; +// 19.4.1.1 Symbol([description]) +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(44).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(16).f = $propertyIsEnumerable; + __webpack_require__(23).f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(25)) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } - return createClass; + wksExt.f = function (name) { + return wrap(wks(name)); + }; } -module.exports = factory; +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); + +for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); + +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + replacer = args[1]; + if (typeof replacer == 'function') $replacer = replacer; + if ($replacer || !isArray(replacer)) replacer = function (key, value) { + if ($replacer) value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(4)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 9 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ +var META = __webpack_require__(15)('meta'); +var isObject = __webpack_require__(11); +var has = __webpack_require__(2); +var setDesc = __webpack_require__(5).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(7)(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(14); +var gOPS = __webpack_require__(23); +var pIE = __webpack_require__(16); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; +}; - return Object(val); -} -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { - // Detect buggy property enumeration order in older V8 versions. +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(39); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(8); +var gOPN = __webpack_require__(44).f; +var toString = {}.toString; - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } +/***/ }), +/* 80 */ +/***/ (function(module, exports) { - return to; -}; /***/ }), -/* 10 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - +__webpack_require__(30)('asyncIterator'); -var emptyObject = {}; +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); -} +__webpack_require__(30)('observable'); -module.exports = emptyObject; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 11 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ +exports.__esModule = true; -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ +var _setPrototypeOf = __webpack_require__(84); -var validateFormat = function validateFormat(format) {}; +var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} +var _create = __webpack_require__(88); -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); +var _create2 = _interopRequireDefault(_create); - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } +var _typeof2 = __webpack_require__(41); - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); } -} -module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; +}; /***/ }), -/* 12 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - +module.exports = { "default": __webpack_require__(85), __esModule: true }; +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { -var emptyFunction = __webpack_require__(13); +__webpack_require__(86); +module.exports = __webpack_require__(1).Object.setPrototypeOf; -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ -var warning = emptyFunction; +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(3); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(87).set }); - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __webpack_require__(11); +var anObject = __webpack_require__(10); +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __webpack_require__(34)(Function.call, __webpack_require__(45).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - printWarning.apply(undefined, [format].concat(args)); - } - }; -} +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +module.exports = { "default": __webpack_require__(89), __esModule: true }; /***/ }), -/* 13 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +__webpack_require__(90); +var $Object = __webpack_require__(1).Object; +module.exports = function create(P, D) { + return $Object.create(P, D); +}; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} +var $export = __webpack_require__(3); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(27) }); -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; +/***/ }), +/* 91 */ +/***/ (function(module, exports) { -module.exports = emptyFunction; +module.exports = __WEBPACK_EXTERNAL_MODULE_91__; /***/ }), -/* 14 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -1937,17 +2351,17 @@ if (process.env.NODE_ENV !== 'production') { // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; - module.exports = __webpack_require__(15)(isValidElement, throwOnDirectAccess); + module.exports = __webpack_require__(93)(isValidElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(18)(); + module.exports = __webpack_require__(96)(); } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) /***/ }), -/* 15 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1960,13 +2374,13 @@ if (process.env.NODE_ENV !== 'production') { -var emptyFunction = __webpack_require__(1); -var invariant = __webpack_require__(2); -var warning = __webpack_require__(5); -var assign = __webpack_require__(16); +var emptyFunction = __webpack_require__(31); +var invariant = __webpack_require__(32); +var warning = __webpack_require__(46); +var assign = __webpack_require__(94); -var ReactPropTypesSecret = __webpack_require__(3); -var checkPropTypes = __webpack_require__(17); +var ReactPropTypesSecret = __webpack_require__(33); +var checkPropTypes = __webpack_require__(95); module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ @@ -2494,10 +2908,10 @@ module.exports = function(isValidElement, throwOnDirectAccess) { return ReactPropTypes; }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) /***/ }), -/* 16 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2594,7 +3008,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { /***/ }), -/* 17 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2608,9 +3022,9 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { if (process.env.NODE_ENV !== 'production') { - var invariant = __webpack_require__(2); - var warning = __webpack_require__(5); - var ReactPropTypesSecret = __webpack_require__(3); + var invariant = __webpack_require__(32); + var warning = __webpack_require__(46); + var ReactPropTypesSecret = __webpack_require__(33); var loggedTypeFailures = {}; } @@ -2658,10 +3072,10 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { module.exports = checkPropTypes; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) /***/ }), -/* 18 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2674,9 +3088,9 @@ module.exports = checkPropTypes; -var emptyFunction = __webpack_require__(1); -var invariant = __webpack_require__(2); -var ReactPropTypesSecret = __webpack_require__(3); +var emptyFunction = __webpack_require__(31); +var invariant = __webpack_require__(32); +var ReactPropTypesSecret = __webpack_require__(33); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { @@ -2725,12 +3139,6 @@ module.exports = function() { }; -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_19__; - /***/ }) /******/ ]); }); \ No newline at end of file From 658a81599eac22ac92f42935cdbe9ae941ddb306 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Fri, 10 Jan 2020 01:42:55 +0300 Subject: [PATCH 5/8] Fix real window visiable area detection ! fix window area detection to window.innerHeight --- src/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index 11d6b5b..4dc98a0 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -185,7 +185,7 @@ export default class ReactScrollPagination extends Component { } scrollHandler = () => { - let scrollBottom = this.scrollTop() + this.windowHeight() + let scrollBottom = this.scrollTop() + window.innerHeight let triggerBottom = scrollBottom + this.isolate.triggerAt // 当滚动条距离底部距离小于30像素的时候出发请求操作 From 90d34e0b5cb8fa6978b9ac611733ee844441e311 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Tue, 24 Mar 2020 02:36:10 +0300 Subject: [PATCH 6/8] updates and bugfixes, bump to 0.2.0 ^ react, babel, etc - .babelrc - jquery ! bugfix to snap the scroll area ! most test are fixed (except one) * syntax --- .babelrc | 7 - .gitignore | 4 + __tests__/index-test.js | 9 +- dist/index.js | 3142 +-------------------------------------- gulpfile.js | 10 - package.json | 35 +- src/index.jsx | 43 +- webpack.config.js | 79 +- 8 files changed, 113 insertions(+), 3216 deletions(-) delete mode 100644 .babelrc delete mode 100644 gulpfile.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 07d2b77..0000000 --- a/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "presets": [ - "env", - "es2015", - "react", - ] -} diff --git a/.gitignore b/.gitignore index e920c16..dfd1896 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,10 @@ node_modules # Optional npm cache directory .npm +*~ +*.sw* +yarn.lock +.cache # Optional REPL history .node_repl_history diff --git a/__tests__/index-test.js b/__tests__/index-test.js index d619fa5..cc19a1a 100644 --- a/__tests__/index-test.js +++ b/__tests__/index-test.js @@ -4,7 +4,6 @@ jest.unmock('../src/index.jsx') import React from 'react' import ReactDOM from 'react-dom' -import jQuery from 'jquery' import TestUtils from 'react-dom/test-utils' import ReactScrollPagination from '../src/index.jsx' @@ -34,13 +33,13 @@ describe('ReactScrollPagination', () => { expect(mockConsoleError.calls.count()).toEqual(1) }) - it('Should not display the pagination div if only props "fetchFunc" presented', () => { + it('Should not display the pagination div when no "totalPages" provided', () => { const reactScrollPagination = TestUtils.renderIntoDocument( ) const reactScrollPaginationNode = ReactDOM.findDOMNode(reactScrollPagination) expect(reactScrollPaginationNode).toEqual(null) - expect(mockConsoleWarn.calls.count()).toEqual(0) + expect(mockConsoleWarn.calls.count()).toEqual(1) }) describe('Test the props "paginationShowTime" ', () => { @@ -66,7 +65,7 @@ describe('ReactScrollPagination', () => { describe('Test the props "excludeElement" ', () => { beforeEach(() => { - document.body.innerHTML = '' + document.body.innerHTML = '' }) it('Should take default value if the props is not presented ', ()=> { @@ -192,4 +191,4 @@ describe('ReactScrollPagination', () => { }) }) -}) \ No newline at end of file +}) diff --git a/dist/index.js b/dist/index.js index 1e6db2f..10d851f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,3144 +1,14 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("React")); - else if(typeof define === 'function' && define.amd) - define(["React"], factory); - else if(typeof exports === 'object') - exports["ReactScrollPagination"] = factory(require("React")); - else - root["ReactScrollPagination"] = factory(root["React"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_91__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 47); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.1' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(0); -var core = __webpack_require__(1); -var ctx = __webpack_require__(34); -var hide = __webpack_require__(4); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var IS_WRAP = type & $export.W; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE]; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; - var key, own, out; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if (own && key in exports) continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function (C) { - var F = function (a, b, c) { - if (this instanceof C) { - switch (arguments.length) { - case 0: return new C(); - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if (IS_PROTO) { - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); - } - } -}; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(5); -var createDesc = __webpack_require__(13); -module.exports = __webpack_require__(6) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(10); -var IE8_DOM_DEFINE = __webpack_require__(35); -var toPrimitive = __webpack_require__(17); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(7)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(38); -var defined = __webpack_require__(18); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(21)('wks'); -var uid = __webpack_require__(15); -var Symbol = __webpack_require__(0).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(11); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(37); -var enumBugKeys = __webpack_require__(22); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(11); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function (it, S) { - if (!isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports) { - -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(21)('keys'); -var uid = __webpack_require__(15); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(0); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); -module.exports = function (key) { - return store[key] || (store[key] = {}); -}; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(18); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -module.exports = true; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(10); -var dPs = __webpack_require__(67); -var enumBugKeys = __webpack_require__(22); -var IE_PROTO = __webpack_require__(20)('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(36)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(68).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(5).f; -var has = __webpack_require__(2); -var TAG = __webpack_require__(9)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(9); - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(0); -var core = __webpack_require__(1); -var LIBRARY = __webpack_require__(25); -var wksExt = __webpack_require__(29); -var defineProperty = __webpack_require__(5).f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactScrollPagination=t():e.ReactScrollPagination=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m}));var r,o=n(1),i=n(0),u=n.n(i);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,o){r||(r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var i=e&&e.defaultProps,u=arguments.length-3;if(t||0===u||(t={children:void 0}),1===u)t.children=o;else if(u>1){for(var l=new Array(u),a=0;a0&&null===this.isolate.onePageHeight&&(this.isolate.onePageHeight=e-this.isolate.excludeHeight)}},{key:"handlePagePosition",value:function(){this.getOnePageHeight();var e=this.scrollTop()+this.windowHeight()-this.isolate.excludeHeight;if(null!==this.isolate.onePageHeight){var t=Math.ceil(e/this.isolate.onePageHeight)||1;this.setState({currentPage:t}),this.showPagePositionDiv()}}},{key:"windowHeight",value:function(){return Math.max(document.body.clientHeight,window.innerWidth)}},{key:"documentHeight",value:function(){return Math.max(this.windowHeight(),document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}},{key:"scrollTop",value:function(){return window.pageYOffset||document.documentElement.scrollTop}},{key:"scrollHandler",value:function(){this.scrollTop()+window.innerHeight+this.isolate.triggerAt>=this.documentHeight()&&this.props.fetchFunc(),this.handlePagePosition()}},{key:"validateAndSetPropValues",value:function(){this.isolate.triggerAt=this.getTriggerAt(),this.isolate.excludeHeight=this.getExcludeHeight(),this.isolate.showTime=this.getShowTime()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.scrollHandler)}},{key:"componentDidMount",value:function(){this.validateAndSetPropValues(),window.addEventListener("scroll",this.scrollHandler),this.props.fetchFunc||console.error("ERROR: the mandatory property 'fetchNext' isn't defined"),this.haveToRender()||console.warn("ERROR: the optional property 'totalPages' isn't defined, so the component won't be rendered")}},{key:"haveToRender",value:function(){return void 0!==this.props.totalPages&&null!==this.props.totalPages}},{key:"render",value:function(){if(!this.haveToRender())return null;var e=Object.assign({},this.props.innerDivStyle||this.pageContentStyle);return this.state.showPageStatus||(e.opacity=0),a("div",{style:this.props.outterDivStyle||this.pageDivStle},void 0,a("div",{style:e,className:"react-scroll-pagination-inner-div"},void 0,a("span",{},void 0,this.state.currentPage),"/",a("span",{},void 0,this.props.totalPages||1)))}}])&&s(n.prototype,r),o&&s(n,o),u}(o.Component);g(m,"defaultProps",{totalPages:null}),g(m,"propTypes",{fetchFunc:u.a.func.isRequired,totalPages:u.a.number,paginationShowTime:u.a.oneOfType([u.a.number,u.a.string]),excludeElement:u.a.string,excludeHeight:u.a.oneOfType([u.a.number,u.a.string]),outterDivStyle:u.a.object,innerDivStyle:u.a.object,triggerAt:u.a.oneOfType([u.a.number,u.a.string])})},function(e,t,n){"use strict"; +/** @license React v16.13.1 + * react.production.min.js * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var validateFormat = function validateFormat(format) {}; - -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(51); -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; -}; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () { - return Object.defineProperty(__webpack_require__(36)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(11); -var document = __webpack_require__(0).document; -// typeof document.createElement is 'object' in old IE -var is = isObject(document) && isObject(document.createElement); -module.exports = function (it) { - return is ? document.createElement(it) : {}; -}; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(2); -var toIObject = __webpack_require__(8); -var arrayIndexOf = __webpack_require__(53)(false); -var IE_PROTO = __webpack_require__(20)('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; -}; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(39); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(2); -var toObject = __webpack_require__(24); -var IE_PROTO = __webpack_require__(20)('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _iterator = __webpack_require__(62); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _symbol = __webpack_require__(73); - -var _symbol2 = _interopRequireDefault(_symbol); - -var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { - return typeof obj === "undefined" ? "undefined" : _typeof(obj); -} : function (obj) { - return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); -}; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(25); -var $export = __webpack_require__(3); -var redefine = __webpack_require__(43); -var hide = __webpack_require__(4); -var has = __webpack_require__(2); -var Iterators = __webpack_require__(26); -var $iterCreate = __webpack_require__(66); -var setToStringTag = __webpack_require__(28); -var getPrototypeOf = __webpack_require__(40); -var ITERATOR = __webpack_require__(9)('iterator'); -var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` -var FF_ITERATOR = '@@iterator'; -var KEYS = 'keys'; -var VALUES = 'values'; - -var returnThis = function () { return this; }; - -module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - $iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(4); - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(37); -var hiddenKeys = __webpack_require__(22).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(16); -var createDesc = __webpack_require__(13); -var toIObject = __webpack_require__(8); -var toPrimitive = __webpack_require__(17); -var has = __webpack_require__(2); -var IE8_DOM_DEFINE = __webpack_require__(35); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyFunction = __webpack_require__(31); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _assign = __webpack_require__(48); - -var _assign2 = _interopRequireDefault(_assign); - -var _getPrototypeOf = __webpack_require__(56); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(60); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _possibleConstructorReturn2 = __webpack_require__(61); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(83); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(91); - -var _propTypes = __webpack_require__(92); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** -* 在页面滚动的时候,监听滚动事件,在快要到达底部指定距离的时候,执行相应函数 -* 如果传入 totalPages, 则会在鼠标滚动时 -* -* -*/ - -var ReactScrollPagination = function (_Component) { - (0, _inherits3.default)(ReactScrollPagination, _Component); - - function ReactScrollPagination() { - var _ref; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, ReactScrollPagination); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ReactScrollPagination.__proto__ || (0, _getPrototypeOf2.default)(ReactScrollPagination)).call.apply(_ref, [this].concat(args))), _this), _this.isolate = { - onePageHeight: null, - timeoutFuncHandler: null, - excludeHeight: null, - triggerAt: null, - showTime: null, - defaultShowTime: 2000, - defaultTrigger: 30, - defaultExcludeHeight: 0 - }, _this.pageDivStle = { - position: 'fixed', - bottom: '15px', - left: 0, - right: 0, - textAlign: 'center' - }, _this.pageContentStyle = { - display: 'inline-block', - background: 'rgba(6, 6, 6, 0.54)', - borderRadius: '5px', - padding: '3px 15px', - minWidth: '80px', - color: '#fff', - textAlign: 'center', - margin: '0 auto', - opacity: 1, - WebkitTransition: 'opacity 0.8s', - MozTransition: 'opacity 0.8s', - OTransition: 'opacity 0.8s', - transition: 'opacity 0.8s' - }, _this.state = { - currentPage: 1, - totalPages: _this.props.totalPages, - showPageStatus: false - }, _this.showPagePositionDiv = function () { - if (_this.isolate.timeoutFuncHandler) { - clearTimeout(_this.isolate.timeoutFuncHandler); - } - _this.setState({ showPageStatus: true }); - - _this.isolate.timeoutFuncHandler = setTimeout(function () { - _this.setState({ showPageStatus: false }); - }, _this.isolate.showTime); - }, _this.getShowTime = function () { - var showTime = _this.isolate.defaultShowTime; - if (_this.props.paginationShowTime) { - showTime = parseInt(_this.props.paginationShowTime); - if (isNaN(showTime)) { - showTime = _this.isolate.defaultShowTime; - console.error('WARNING: Failed to convert props "paginationShowTime" to Number with value: "' + _this.props.paginationShowTime + '". Will take ' + _this.isolate.defaultShowTime + ' by default.'); - } - } - return showTime; - }, _this.getExcludeHeight = function () { - // 获取需要减去的高度 - var excludeHeight = _this.isolate.defaultExcludeHeight; - - if (_this.props.excludeHeight) { - var propsExcludeHeight = parseInt(_this.props.excludeHeight); - if (isNaN(propsExcludeHeight)) { - console.error('WARNING: Failed to convert the props "excludeHeight" with value: "' + _this.props.excludeHeight + '" to Number, please verify. Will take "' + _this.isolate.defaultExcludeHeight + '" by default.'); - } else { - excludeHeight = propsExcludeHeight; - } - } else if (_this.props.excludeElement && typeof _this.props.excludeElement === 'string') { - var excludeEle = document.querySelector(_this.props.excludeElement); - - if (excludeEle) { - excludeHeight = excludeEle.offsetHeight; - } else { - console.error('WARNING: Failed to get the element with given selector "' + _this.props.excludeElement + '", please veirify. Will take "' + _this.isolate.defaultExcludeHeight + '" by default.'); - } - } - _this.isolate.excludeHeight = excludeHeight; - - return excludeHeight; - }, _this.getTriggerAt = function () { - var triggerAt = _this.isolate.defaultTrigger; - - if (_this.props.triggerAt) { - triggerAt = parseInt(_this.props.triggerAt); - - if (isNaN(triggerAt)) { - triggerAt = _this.isolate.defaultTrigger; - - console.error('WARNING: Failed to convert the props "triggerAt" to number with value: "' + _this.props.triggerAt + '". Will take 30px by default.'); - } - } - - return triggerAt; - }, _this.getOnePageHeight = function () { - var documentHeight = _this.documentHeight(); - - /* - * 当totalPages第一次有值时,表明List是初次加载,此时计算页面的高度,并将其作为单页的高度 - * 如果页面有固定的顶部头,通过 excludeHeight 将其减去 - */ - if (typeof _this.props.totalPages === 'number' && _this.props.totalPages > 0 && _this.isolate.onePageHeight === null) { - _this.isolate.onePageHeight = documentHeight - _this.isolate.excludeHeight; - } - }, _this.handlePagePosition = function () { - _this.getOnePageHeight(); - - var scrollBottom = _this.scrollTop() + _this.windowHeight() - _this.isolate.excludeHeight; - - if (_this.isolate.onePageHeight !== null) { - var currentPage = Math.ceil(scrollBottom / _this.isolate.onePageHeight) || 1; - _this.setState({ currentPage: currentPage }); - _this.showPagePositionDiv(); - } - }, _this.windowHeight = function () { - return Math.max(document.body.clientHeight, window.innerWidth); - }, _this.documentHeight = function () { - return Math.max(_this.windowHeight(), document.documentElement.clientHeight, document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight); - }, _this.scrollTop = function () { - return window.pageYOffset || document.documentElement.scrollTop; - }, _this.scrollHandler = function () { - var scrollBottom = _this.scrollTop() + _this.windowHeight(); - var triggerBottom = scrollBottom + _this.isolate.triggerAt; - - // 当滚动条距离底部距离小于30像素的时候出发请求操作 - if (triggerBottom >= _this.documentHeight()) { - _this.props.fetchFunc(); - } - - _this.handlePagePosition(); - }, _this.validateAndSetPropValues = function () { - _this.isolate.triggerAt = _this.getTriggerAt(); - _this.isolate.excludeHeight = _this.getExcludeHeight(); - _this.isolate.showTime = _this.getShowTime(); - }, _this.componentWillUnmount = function () { - window.removeEventListener('scroll', _this.scrollHandler); - }, _this.componentDidMount = function () { - _this.validateAndSetPropValues(); - window.addEventListener('scroll', _this.scrollHandler); - }, _this.render = function () { - // if no totalPages presented, will only do the fetchings - if (typeof _this.props.totalPages === 'undefined') { - return null; - } - - var acutalPageContentDivStyle = (0, _assign2.default)({}, _this.props.innerDivStyle || _this.pageContentStyle); - - // always set the opacity for inner div, so they are able to make the transition - if (!_this.state.showPageStatus) { - acutalPageContentDivStyle.opacity = 0; - } - - return React.createElement( - 'div', - { style: _this.props.outterDivStyle || _this.pageDivStle }, - React.createElement( - 'div', - { style: acutalPageContentDivStyle, className: 'react-scroll-pagination-inner-div' }, - React.createElement( - 'span', - null, - _this.state.currentPage - ), - '/', - React.createElement( - 'span', - null, - _this.props.totalPages || 1 - ) - ) - ); - }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - return ReactScrollPagination; -}(_react.Component); - -ReactScrollPagination.defaultProps = { - totalPages: null -}; -ReactScrollPagination.propTypes = { - fetchFunc: _propTypes2.default.func.isRequired, - totalPages: _propTypes2.default.number, - paginationShowTime: _propTypes2.default.oneOfType([_propTypes2.default.number, // How long shall the pagination div shows - _propTypes2.default.string]), - excludeElement: _propTypes2.default.string, // The element selector which should be excluded from calculation - excludeHeight: _propTypes2.default.oneOfType([_propTypes2.default.number, // the height value which should be excluded from calculation - _propTypes2.default.string]), - outterDivStyle: _propTypes2.default.object, // Style of the outter Div element - innerDivStyle: _propTypes2.default.object, // Style of the inner Div element - triggerAt: _propTypes2.default.oneOfType([_propTypes2.default.number, // The distance to trigger the fetchfunc - _propTypes2.default.string]) -}; -exports.default = ReactScrollPagination; - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(49), __esModule: true }; - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(50); -module.exports = __webpack_require__(1).Object.assign; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(3); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(52) }); - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(14); -var gOPS = __webpack_require__(23); -var pIE = __webpack_require__(16); -var toObject = __webpack_require__(24); -var IObject = __webpack_require__(38); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(7)(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = gOPS.f; - var isEnum = pIE.f; - while (aLen > index) { - var S = IObject(arguments[index++]); - var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(8); -var toLength = __webpack_require__(54); -var toAbsoluteIndex = __webpack_require__(55); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(19); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(19); -var max = Math.max; -var min = Math.min; -module.exports = function (index, length) { - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(57), __esModule: true }; - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(58); -module.exports = __webpack_require__(1).Object.getPrototypeOf; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(24); -var $getPrototypeOf = __webpack_require__(40); - -__webpack_require__(59)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(3); -var core = __webpack_require__(1); -var fails = __webpack_require__(7); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -exports.default = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof2 = __webpack_require__(41); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; -}; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(63), __esModule: true }; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(64); -__webpack_require__(69); -module.exports = __webpack_require__(29).f('iterator'); - - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(65)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(42)(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(19); -var defined = __webpack_require__(18); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(27); -var descriptor = __webpack_require__(13); -var setToStringTag = __webpack_require__(28); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(4)(IteratorPrototype, __webpack_require__(9)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(5); -var anObject = __webpack_require__(10); -var getKeys = __webpack_require__(14); - -module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(0).document; -module.exports = document && document.documentElement; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(70); -var global = __webpack_require__(0); -var hide = __webpack_require__(4); -var Iterators = __webpack_require__(26); -var TO_STRING_TAG = __webpack_require__(9)('toStringTag'); - -var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + - 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + - 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + - 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + - 'TextTrackList,TouchList').split(','); - -for (var i = 0; i < DOMIterables.length; i++) { - var NAME = DOMIterables[i]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; -} - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(71); -var step = __webpack_require__(72); -var Iterators = __webpack_require__(26); -var toIObject = __webpack_require__(8); - -// 22.1.3.4 Array.prototype.entries() -// 22.1.3.13 Array.prototype.keys() -// 22.1.3.29 Array.prototype.values() -// 22.1.3.30 Array.prototype[@@iterator]() -module.exports = __webpack_require__(42)(Array, 'Array', function (iterated, kind) { - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind -// 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return step(1); - } - if (kind == 'keys') return step(0, index); - if (kind == 'values') return step(0, O[index]); - return step(0, [index, O[index]]); -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) -Iterators.Arguments = Iterators.Array; - -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - - -/***/ }), -/* 71 */ -/***/ (function(module, exports) { - -module.exports = function () { /* empty */ }; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(74), __esModule: true }; - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(75); -__webpack_require__(80); -__webpack_require__(81); -__webpack_require__(82); -module.exports = __webpack_require__(1).Symbol; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(0); -var has = __webpack_require__(2); -var DESCRIPTORS = __webpack_require__(6); -var $export = __webpack_require__(3); -var redefine = __webpack_require__(43); -var META = __webpack_require__(76).KEY; -var $fails = __webpack_require__(7); -var shared = __webpack_require__(21); -var setToStringTag = __webpack_require__(28); -var uid = __webpack_require__(15); -var wks = __webpack_require__(9); -var wksExt = __webpack_require__(29); -var wksDefine = __webpack_require__(30); -var enumKeys = __webpack_require__(77); -var isArray = __webpack_require__(78); -var anObject = __webpack_require__(10); -var toIObject = __webpack_require__(8); -var toPrimitive = __webpack_require__(17); -var createDesc = __webpack_require__(13); -var _create = __webpack_require__(27); -var gOPNExt = __webpack_require__(79); -var $GOPD = __webpack_require__(45); -var $DP = __webpack_require__(5); -var $keys = __webpack_require__(14); -var gOPD = $GOPD.f; -var dP = $DP.f; -var gOPN = gOPNExt.f; -var $Symbol = global.Symbol; -var $JSON = global.JSON; -var _stringify = $JSON && $JSON.stringify; -var PROTOTYPE = 'prototype'; -var HIDDEN = wks('_hidden'); -var TO_PRIMITIVE = wks('toPrimitive'); -var isEnum = {}.propertyIsEnumerable; -var SymbolRegistry = shared('symbol-registry'); -var AllSymbols = shared('symbols'); -var OPSymbols = shared('op-symbols'); -var ObjectProto = Object[PROTOTYPE]; -var USE_NATIVE = typeof $Symbol == 'function'; -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDesc = DESCRIPTORS && $fails(function () { - return _create(dP({}, 'a', { - get: function () { return dP(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (it, key, D) { - var protoDesc = gOPD(ObjectProto, key); - if (protoDesc) delete ObjectProto[key]; - dP(it, key, D); - if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); -} : dP; - -var wrap = function (tag) { - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; -}; - -var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return it instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto) $defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if (has(AllSymbols, key)) { - if (!D.enumerable) { - if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _create(D, { enumerable: createDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); -}; -var $defineProperties = function defineProperties(it, P) { - anObject(it); - var keys = enumKeys(P = toIObject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; -}; -var $create = function create(it, P) { - return P === undefined ? _create(it) : $defineProperties(_create(it), P); -}; -var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = toPrimitive(key, true)); - if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; -}; -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = toIObject(it); - key = toPrimitive(key, true); - if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; - var D = gOPD(it, key); - if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; -}; -var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN(toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; -}; -var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto; - var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); - } return result; -}; - -// 19.4.1.1 Symbol([description]) -if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto) $set.call(OPSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - __webpack_require__(44).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(16).f = $propertyIsEnumerable; - __webpack_require__(23).f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(25)) { - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function (name) { - return wrap(wks(name)); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - -for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' -).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); - -for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); - -$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } -}); - -$export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// 24.3.2 JSON.stringify(value [, replacer [, space]]) -$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; -})), 'JSON', { - stringify: function stringify(it) { - if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - replacer = args[1]; - if (typeof replacer == 'function') $replacer = replacer; - if ($replacer || !isArray(replacer)) replacer = function (key, value) { - if ($replacer) value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } -}); - -// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) -$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(4)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -// 19.4.3.5 Symbol.prototype[@@toStringTag] -setToStringTag($Symbol, 'Symbol'); -// 20.2.1.9 Math[@@toStringTag] -setToStringTag(Math, 'Math', true); -// 24.3.3 JSON[@@toStringTag] -setToStringTag(global.JSON, 'JSON', true); - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(15)('meta'); -var isObject = __webpack_require__(11); -var has = __webpack_require__(2); -var setDesc = __webpack_require__(5).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(7)(function () { - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); -}; -var fastKey = function (it, create) { - // return primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function (it, create) { - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze -}; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(14); -var gOPS = __webpack_require__(23); -var pIE = __webpack_require__(16); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(39); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(8); -var gOPN = __webpack_require__(44).f; -var toString = {}.toString; - -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } -}; - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); -}; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports) { - - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(30)('asyncIterator'); - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(30)('observable'); - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _setPrototypeOf = __webpack_require__(84); - -var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - -var _create = __webpack_require__(88); - -var _create2 = _interopRequireDefault(_create); - -var _typeof2 = __webpack_require__(41); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); - } - - subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; -}; - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(85), __esModule: true }; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(86); -module.exports = __webpack_require__(1).Object.setPrototypeOf; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(3); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(87).set }); - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = __webpack_require__(11); -var anObject = __webpack_require__(10); -var check = function (O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = __webpack_require__(34)(Function.call, __webpack_require__(45).f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(89), __esModule: true }; - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(90); -var $Object = __webpack_require__(1).Object; -module.exports = function create(P, D) { - return $Object.create(P, D); -}; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(3); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(27) }); - - -/***/ }), -/* 91 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_91__; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */ - -if (process.env.NODE_ENV !== 'production') { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(93)(isValidElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(96)(); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var emptyFunction = __webpack_require__(31); -var invariant = __webpack_require__(32); -var warning = __webpack_require__(46); -var assign = __webpack_require__(94); - -var ReactPropTypesSecret = __webpack_require__(33); -var checkPropTypes = __webpack_require__(95); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; - - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - // We need to check all keys in case some are required but missing from - // props. - var allKeys = assign({}, props[propName], shapeTypes); - for (var key in allKeys) { - var checker = shapeTypes[key]; - if (!checker) { - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') - ); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12))) - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + */var r=n(4),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,u=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,a=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,h=o?Symbol.for("react.suspense"):60113,y=o?Symbol.for("react.memo"):60115,d=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nR.length&&R.push(e)}function C(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var a=!1;if(null===t)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case i:case u:a=!0}}if(a)return r(o,t,""===n?"."+$(t,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c { + showPagePositionDiv() { if (this.isolate.timeoutFuncHandler) { clearTimeout(this.isolate.timeoutFuncHandler) } @@ -88,7 +88,7 @@ export default class ReactScrollPagination extends Component { }, this.isolate.showTime) } - getShowTime = () => { + getShowTime() { let showTime = this.isolate.defaultShowTime if (this.props.paginationShowTime) { showTime = parseInt(this.props.paginationShowTime) @@ -101,7 +101,7 @@ export default class ReactScrollPagination extends Component { return showTime } - getExcludeHeight = () => { + getExcludeHeight() { // 获取需要减去的高度 let excludeHeight = this.isolate.defaultExcludeHeight @@ -124,12 +124,11 @@ export default class ReactScrollPagination extends Component { '", please veirify. Will take "' + this.isolate.defaultExcludeHeight + '" by default.') } } - this.isolate.excludeHeight = excludeHeight return excludeHeight } - getTriggerAt = () => { + getTriggerAt() { let triggerAt = this.isolate.defaultTrigger if (this.props.triggerAt) { @@ -146,7 +145,7 @@ export default class ReactScrollPagination extends Component { return triggerAt } - getOnePageHeight = () => { + getOnePageHeight() { const documentHeight = this.documentHeight() /* @@ -158,7 +157,7 @@ export default class ReactScrollPagination extends Component { } } - handlePagePosition = () => { + handlePagePosition() { this.getOnePageHeight() let scrollBottom = this.scrollTop() + this.windowHeight() - this.isolate.excludeHeight @@ -170,21 +169,21 @@ export default class ReactScrollPagination extends Component { } } - windowHeight = () => { + windowHeight() { return Math.max(document.body.clientHeight, window.innerWidth) } - documentHeight = () => { + documentHeight() { return Math.max(this.windowHeight(), document.documentElement.clientHeight, document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight) } - scrollTop = () => { + scrollTop() { return window.pageYOffset || document.documentElement.scrollTop } - scrollHandler = () => { + scrollHandler() { let scrollBottom = this.scrollTop() + window.innerHeight let triggerBottom = scrollBottom + this.isolate.triggerAt @@ -196,24 +195,36 @@ export default class ReactScrollPagination extends Component { this.handlePagePosition() } - validateAndSetPropValues = () => { + validateAndSetPropValues() { this.isolate.triggerAt = this.getTriggerAt() this.isolate.excludeHeight = this.getExcludeHeight() this.isolate.showTime = this.getShowTime() } - componentWillUnmount = () => { + componentWillUnmount() { window.removeEventListener('scroll', this.scrollHandler) } - componentDidMount = () => { + componentDidMount() { this.validateAndSetPropValues() window.addEventListener('scroll', this.scrollHandler) + + if (!this.props.fetchFunc) { + console.error("ERROR: the mandatory property 'fetchNext' isn't defined") + } + if (!this.haveToRender()) { + console.warn("ERROR: the optional property 'totalPages' isn't defined, so the component won't be rendered") + } + + } + + haveToRender() { + return typeof this.props.totalPages !== 'undefined' && this.props.totalPages !== null } - render = () => { + render() { // if no totalPages presented, will only do the fetchings - if (typeof this.props.totalPages === 'undefined') { + if (!this.haveToRender()) { return (null) } diff --git a/webpack.config.js b/webpack.config.js index 6dd8a9a..136b936 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,26 +1,57 @@ module.exports = { - entry: './src/index.jsx', - output: { - filename: 'dist/index.js', - libraryTarget: 'umd', - library: 'ReactScrollPagination' - }, - externals: { - react: 'React' - }, - module:{ - rules: [ - { - test: /\.jsx$/, - use: { - loader: 'babel-loader', - options: { - presets: ['es2015', 'stage-0', 'react'], - plugins: ['transform-runtime'], - ignore: /node_modules/, - } - } - } - ] - } + entry: './src/index.jsx', + output: { + filename: 'index.js', + libraryTarget: 'umd', + library: 'ReactScrollPagination' + }, + module: { + rules: [ + { + test: /\.(js|jsx)$/, + use: [{ + loader: 'babel-loader', + options: { + babelrc: false, + configFile: false, + compact: false, + cacheDirectory: true, + ignore: [ /cjs/, /node_modules/ ], + presets: [ + [ + "@babel/preset-env", + { + "modules": false, + "targets": { + "browsers": "> 1%", + }, + "useBuiltIns": false, + "forceAllTransforms": true + }, + ], + [ + "@babel/preset-react", + { + runtime: "classic" + } + ] + ], + plugins: [ + [ "@babel/transform-runtime", { + helpers: false, + regenerator: true, + }], + [ + "@babel/plugin-proposal-class-properties", + { + "spec": true + } + ], + '@babel/plugin-transform-react-inline-elements', + ], + }, + }] + }, + ], + }, } From 7fae2cc8eae3c417266ba22c876cc5ac37ba65a3 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Wed, 25 Mar 2020 17:02:33 +0300 Subject: [PATCH 7/8] Added lost thin session the handler + contructor to redefine event handler declaration to make this pointed to the current instance context --- src/index.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.jsx b/src/index.jsx index b0cb411..767c4be 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -77,6 +77,12 @@ export default class ReactScrollPagination extends Component { showPageStatus: false } + constructor(props) { + super(props) + + this.scrollHandler = this.scrollHandler.bind(this) + } + showPagePositionDiv() { if (this.isolate.timeoutFuncHandler) { clearTimeout(this.isolate.timeoutFuncHandler) From e496ab1562f1cdc22807c918aae821347372a801 Mon Sep 17 00:00:00 2001 From: Malo Skrylevo Date: Sat, 28 Mar 2020 16:41:32 +0300 Subject: [PATCH 8/8] Some fixes ^ updated jest-cli, jest, babel-jest * some configuration settigns for jest ! lost babel module @babel/plugin-transform-react-inline-elements --- .eslintrc | 4 ---- dist/index.js | 4 ++-- package.json | 17 +++++++++++------ webpack.config.js | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 04d886c..e9b3e0c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,10 +10,6 @@ "env" : { "browser" : true }, - "globals" : { - "jQuery": false, - "$": false - }, "rules": { "semi" : [2, "never"], "max-len": [2, 120, 2], diff --git a/dist/index.js b/dist/index.js index 10d851f..6f4796b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactScrollPagination=t():e.ReactScrollPagination=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m}));var r,o=n(1),i=n(0),u=n.n(i);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,o){r||(r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var i=e&&e.defaultProps,u=arguments.length-3;if(t||0===u||(t={children:void 0}),1===u)t.children=o;else if(u>1){for(var l=new Array(u),a=0;a0&&null===this.isolate.onePageHeight&&(this.isolate.onePageHeight=e-this.isolate.excludeHeight)}},{key:"handlePagePosition",value:function(){this.getOnePageHeight();var e=this.scrollTop()+this.windowHeight()-this.isolate.excludeHeight;if(null!==this.isolate.onePageHeight){var t=Math.ceil(e/this.isolate.onePageHeight)||1;this.setState({currentPage:t}),this.showPagePositionDiv()}}},{key:"windowHeight",value:function(){return Math.max(document.body.clientHeight,window.innerWidth)}},{key:"documentHeight",value:function(){return Math.max(this.windowHeight(),document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}},{key:"scrollTop",value:function(){return window.pageYOffset||document.documentElement.scrollTop}},{key:"scrollHandler",value:function(){this.scrollTop()+window.innerHeight+this.isolate.triggerAt>=this.documentHeight()&&this.props.fetchFunc(),this.handlePagePosition()}},{key:"validateAndSetPropValues",value:function(){this.isolate.triggerAt=this.getTriggerAt(),this.isolate.excludeHeight=this.getExcludeHeight(),this.isolate.showTime=this.getShowTime()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.scrollHandler)}},{key:"componentDidMount",value:function(){this.validateAndSetPropValues(),window.addEventListener("scroll",this.scrollHandler),this.props.fetchFunc||console.error("ERROR: the mandatory property 'fetchNext' isn't defined"),this.haveToRender()||console.warn("ERROR: the optional property 'totalPages' isn't defined, so the component won't be rendered")}},{key:"haveToRender",value:function(){return void 0!==this.props.totalPages&&null!==this.props.totalPages}},{key:"render",value:function(){if(!this.haveToRender())return null;var e=Object.assign({},this.props.innerDivStyle||this.pageContentStyle);return this.state.showPageStatus||(e.opacity=0),a("div",{style:this.props.outterDivStyle||this.pageDivStle},void 0,a("div",{style:e,className:"react-scroll-pagination-inner-div"},void 0,a("span",{},void 0,this.state.currentPage),"/",a("span",{},void 0,this.props.totalPages||1)))}}])&&s(n.prototype,r),o&&s(n,o),u}(o.Component);g(m,"defaultProps",{totalPages:null}),g(m,"propTypes",{fetchFunc:u.a.func.isRequired,totalPages:u.a.number,paginationShowTime:u.a.oneOfType([u.a.number,u.a.string]),excludeElement:u.a.string,excludeHeight:u.a.oneOfType([u.a.number,u.a.string]),outterDivStyle:u.a.object,innerDivStyle:u.a.object,triggerAt:u.a.oneOfType([u.a.number,u.a.string])})},function(e,t,n){"use strict"; +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ReactScrollPagination=t():e.ReactScrollPagination=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return y}));var r,o=n(1),i=n(0),u=n.n(i);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n,o){r||(r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var i=e&&e.defaultProps,u=arguments.length-3;if(t||0===u||(t={children:void 0}),1===u)t.children=o;else if(u>1){for(var l=new Array(u),a=0;a0&&null===this.isolate.onePageHeight&&(this.isolate.onePageHeight=e-this.isolate.excludeHeight)}},{key:"handlePagePosition",value:function(){this.getOnePageHeight();var e=this.scrollTop()+this.windowHeight()-this.isolate.excludeHeight;if(null!==this.isolate.onePageHeight){var t=Math.ceil(e/this.isolate.onePageHeight)||1;this.setState({currentPage:t}),this.showPagePositionDiv()}}},{key:"windowHeight",value:function(){return Math.max(document.body.clientHeight,window.innerWidth)}},{key:"documentHeight",value:function(){return Math.max(this.windowHeight(),document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}},{key:"scrollTop",value:function(){return window.pageYOffset||document.documentElement.scrollTop}},{key:"scrollHandler",value:function(){this.scrollTop()+window.innerHeight+this.isolate.triggerAt>=this.documentHeight()&&this.props.fetchFunc(),this.handlePagePosition()}},{key:"validateAndSetPropValues",value:function(){this.isolate.triggerAt=this.getTriggerAt(),this.isolate.excludeHeight=this.getExcludeHeight(),this.isolate.showTime=this.getShowTime()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.scrollHandler)}},{key:"componentDidMount",value:function(){this.validateAndSetPropValues(),window.addEventListener("scroll",this.scrollHandler),this.props.fetchFunc||console.error("ERROR: the mandatory property 'fetchNext' isn't defined"),this.haveToRender()||console.warn("ERROR: the optional property 'totalPages' isn't defined, so the component won't be rendered")}},{key:"haveToRender",value:function(){return void 0!==this.props.totalPages&&null!==this.props.totalPages}},{key:"render",value:function(){if(!this.haveToRender())return null;var e=Object.assign({},this.props.innerDivStyle||this.pageContentStyle);return this.state.showPageStatus||(e.opacity=0),a("div",{style:this.props.outterDivStyle||this.pageDivStle},void 0,a("div",{style:e,className:"react-scroll-pagination-inner-div"},void 0,a("span",{},void 0,this.state.currentPage),"/",a("span",{},void 0,this.props.totalPages||1)))}}])&&c(n.prototype,r),o&&c(n,o),u}(o.Component);y.defaultProps={totalPages:null},y.propTypes={fetchFunc:u.a.func.isRequired,totalPages:u.a.number,paginationShowTime:u.a.oneOfType([u.a.number,u.a.string]),excludeElement:u.a.string,excludeHeight:u.a.oneOfType([u.a.number,u.a.string]),outterDivStyle:u.a.object,innerDivStyle:u.a.object,triggerAt:u.a.oneOfType([u.a.number,u.a.string])}},function(e,t,n){"use strict"; /** @license React v16.13.1 * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(4),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,u=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,a=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.forward_ref"):60112,h=o?Symbol.for("react.suspense"):60113,y=o?Symbol.for("react.memo"):60115,d=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nR.length&&R.push(e)}function C(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var a=!1;if(null===t)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case i:case u:a=!0}}if(a)return r(o,t,""===n?"."+$(t,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cH.length&&H.push(e)}function A(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var a=!1;if(null===t)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case i:case u:a=!0}}if(a)return r(o,t,""===n?"."+$(t,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c/node_modules/react-addons-test-utils", "/node_modules/jquery" ], - "collectCoverage": true + "collectCoverage": true, + "modulePathIgnorePatterns": [], + "transform": { + "^.+\\.js$": "babel-jest" + } } } diff --git a/webpack.config.js b/webpack.config.js index 136b936..9bd5b69 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -44,7 +44,8 @@ module.exports = { [ "@babel/plugin-proposal-class-properties", { - "spec": true + "spec": true, + "loose": true } ], '@babel/plugin-transform-react-inline-elements',