@mjhls/mjh-framework 1.0.338 → 1.0.339

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,4 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal, b as commonjsRequire, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
- import React__default, { Component } from 'react';
3
- import reactDom from 'react-dom';
1
+ import { c as createCommonjsModule, a as commonjsGlobal, b as commonjsRequire } from './_commonjsHelpers-0c4b6f40.js';
4
2
 
5
3
  var moment = createCommonjsModule(function (module, exports) {
6
4
  (function (global, factory) {
@@ -5664,1009 +5662,4 @@ var moment = createCommonjsModule(function (module, exports) {
5664
5662
  })));
5665
5663
  });
5666
5664
 
5667
- /*! *****************************************************************************
5668
- Copyright (c) Microsoft Corporation. All rights reserved.
5669
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5670
- this file except in compliance with the License. You may obtain a copy of the
5671
- License at http://www.apache.org/licenses/LICENSE-2.0
5672
-
5673
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
5674
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
5675
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
5676
- MERCHANTABLITY OR NON-INFRINGEMENT.
5677
-
5678
- See the Apache Version 2.0 License for specific language governing permissions
5679
- and limitations under the License.
5680
- ***************************************************************************** */
5681
- /* global Reflect, Promise */
5682
-
5683
- var extendStatics = function(d, b) {
5684
- extendStatics = Object.setPrototypeOf ||
5685
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5686
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5687
- return extendStatics(d, b);
5688
- };
5689
-
5690
- function __extends(d, b) {
5691
- extendStatics(d, b);
5692
- function __() { this.constructor = d; }
5693
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5694
- }
5695
-
5696
- var __assign = function() {
5697
- __assign = Object.assign || function __assign(t) {
5698
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5699
- s = arguments[i];
5700
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5701
- }
5702
- return t;
5703
- };
5704
- return __assign.apply(this, arguments);
5705
- };
5706
-
5707
- /* eslint-disable no-undefined,no-param-reassign,no-shadow */
5708
-
5709
- /**
5710
- * Throttle execution of a function. Especially useful for rate limiting
5711
- * execution of handlers on events like resize and scroll.
5712
- *
5713
- * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
5714
- * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
5715
- * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
5716
- * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
5717
- * the internal counter is reset)
5718
- * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
5719
- * to `callback` when the throttled-function is executed.
5720
- * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
5721
- * schedule `callback` to execute after `delay` ms.
5722
- *
5723
- * @return {Function} A new, throttled, function.
5724
- */
5725
- function throttle (delay, noTrailing, callback, debounceMode) {
5726
- /*
5727
- * After wrapper has stopped being called, this timeout ensures that
5728
- * `callback` is executed at the proper times in `throttle` and `end`
5729
- * debounce modes.
5730
- */
5731
- var timeoutID;
5732
- var cancelled = false; // Keep track of the last time `callback` was executed.
5733
-
5734
- var lastExec = 0; // Function to clear existing timeout
5735
-
5736
- function clearExistingTimeout() {
5737
- if (timeoutID) {
5738
- clearTimeout(timeoutID);
5739
- }
5740
- } // Function to cancel next exec
5741
-
5742
-
5743
- function cancel() {
5744
- clearExistingTimeout();
5745
- cancelled = true;
5746
- } // `noTrailing` defaults to falsy.
5747
-
5748
-
5749
- if (typeof noTrailing !== 'boolean') {
5750
- debounceMode = callback;
5751
- callback = noTrailing;
5752
- noTrailing = undefined;
5753
- }
5754
- /*
5755
- * The `wrapper` function encapsulates all of the throttling / debouncing
5756
- * functionality and when executed will limit the rate at which `callback`
5757
- * is executed.
5758
- */
5759
-
5760
-
5761
- function wrapper() {
5762
- var self = this;
5763
- var elapsed = Date.now() - lastExec;
5764
- var args = arguments;
5765
-
5766
- if (cancelled) {
5767
- return;
5768
- } // Execute `callback` and update the `lastExec` timestamp.
5769
-
5770
-
5771
- function exec() {
5772
- lastExec = Date.now();
5773
- callback.apply(self, args);
5774
- }
5775
- /*
5776
- * If `debounceMode` is true (at begin) this is used to clear the flag
5777
- * to allow future `callback` executions.
5778
- */
5779
-
5780
-
5781
- function clear() {
5782
- timeoutID = undefined;
5783
- }
5784
-
5785
- if (debounceMode && !timeoutID) {
5786
- /*
5787
- * Since `wrapper` is being called for the first time and
5788
- * `debounceMode` is true (at begin), execute `callback`.
5789
- */
5790
- exec();
5791
- }
5792
-
5793
- clearExistingTimeout();
5794
-
5795
- if (debounceMode === undefined && elapsed > delay) {
5796
- /*
5797
- * In throttle mode, if `delay` time has been exceeded, execute
5798
- * `callback`.
5799
- */
5800
- exec();
5801
- } else if (noTrailing !== true) {
5802
- /*
5803
- * In trailing throttle mode, since `delay` time has not been
5804
- * exceeded, schedule `callback` to execute `delay` ms after most
5805
- * recent execution.
5806
- *
5807
- * If `debounceMode` is true (at begin), schedule `clear` to execute
5808
- * after `delay` ms.
5809
- *
5810
- * If `debounceMode` is false (at end), schedule `callback` to
5811
- * execute after `delay` ms.
5812
- */
5813
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
5814
- }
5815
- }
5816
-
5817
- wrapper.cancel = cancel; // Return the wrapper function.
5818
-
5819
- return wrapper;
5820
- }
5821
-
5822
- var ThresholdUnits = {
5823
- Pixel: 'Pixel',
5824
- Percent: 'Percent',
5825
- };
5826
- var defaultThreshold = {
5827
- unit: ThresholdUnits.Percent,
5828
- value: 0.8,
5829
- };
5830
- function parseThreshold(scrollThreshold) {
5831
- if (typeof scrollThreshold === 'number') {
5832
- return {
5833
- unit: ThresholdUnits.Percent,
5834
- value: scrollThreshold * 100,
5835
- };
5836
- }
5837
- if (typeof scrollThreshold === 'string') {
5838
- if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
5839
- return {
5840
- unit: ThresholdUnits.Pixel,
5841
- value: parseFloat(scrollThreshold),
5842
- };
5843
- }
5844
- if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
5845
- return {
5846
- unit: ThresholdUnits.Percent,
5847
- value: parseFloat(scrollThreshold),
5848
- };
5849
- }
5850
- console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
5851
- return defaultThreshold;
5852
- }
5853
- console.warn('scrollThreshold should be string or number');
5854
- return defaultThreshold;
5855
- }
5856
-
5857
- var InfiniteScroll = /** @class */ (function (_super) {
5858
- __extends(InfiniteScroll, _super);
5859
- function InfiniteScroll(props) {
5860
- var _this = _super.call(this, props) || this;
5861
- _this.lastScrollTop = 0;
5862
- _this.actionTriggered = false;
5863
- // variables to keep track of pull down behaviour
5864
- _this.startY = 0;
5865
- _this.currentY = 0;
5866
- _this.dragging = false;
5867
- // will be populated in componentDidMount
5868
- // based on the height of the pull down element
5869
- _this.maxPullDownDistance = 0;
5870
- _this.getScrollableTarget = function () {
5871
- if (_this.props.scrollableTarget instanceof HTMLElement)
5872
- return _this.props.scrollableTarget;
5873
- if (typeof _this.props.scrollableTarget === 'string') {
5874
- return document.getElementById(_this.props.scrollableTarget);
5875
- }
5876
- if (_this.props.scrollableTarget === null) {
5877
- console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n ");
5878
- }
5879
- return null;
5880
- };
5881
- _this.onStart = function (evt) {
5882
- if (_this.lastScrollTop)
5883
- return;
5884
- _this.dragging = true;
5885
- if (evt instanceof MouseEvent) {
5886
- _this.startY = evt.pageY;
5887
- }
5888
- else if (evt instanceof TouchEvent) {
5889
- _this.startY = evt.touches[0].pageY;
5890
- }
5891
- _this.currentY = _this.startY;
5892
- if (_this._infScroll) {
5893
- _this._infScroll.style.willChange = 'transform';
5894
- _this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
5895
- }
5896
- };
5897
- _this.onMove = function (evt) {
5898
- if (!_this.dragging)
5899
- return;
5900
- if (evt instanceof MouseEvent) {
5901
- _this.currentY = evt.pageY;
5902
- }
5903
- else if (evt instanceof TouchEvent) {
5904
- _this.currentY = evt.touches[0].pageY;
5905
- }
5906
- // user is scrolling down to up
5907
- if (_this.currentY < _this.startY)
5908
- return;
5909
- if (_this.currentY - _this.startY >=
5910
- Number(_this.props.pullDownToRefreshThreshold)) {
5911
- _this.setState({
5912
- pullToRefreshThresholdBreached: true,
5913
- });
5914
- }
5915
- // so you can drag upto 1.5 times of the maxPullDownDistance
5916
- if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
5917
- return;
5918
- if (_this._infScroll) {
5919
- _this._infScroll.style.overflow = 'visible';
5920
- _this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY -
5921
- _this.startY) + "px, 0px)";
5922
- }
5923
- };
5924
- _this.onEnd = function () {
5925
- _this.startY = 0;
5926
- _this.currentY = 0;
5927
- _this.dragging = false;
5928
- if (_this.state.pullToRefreshThresholdBreached) {
5929
- _this.props.refreshFunction && _this.props.refreshFunction();
5930
- _this.setState({
5931
- pullToRefreshThresholdBreached: false,
5932
- });
5933
- }
5934
- requestAnimationFrame(function () {
5935
- // this._infScroll
5936
- if (_this._infScroll) {
5937
- _this._infScroll.style.overflow = 'auto';
5938
- _this._infScroll.style.transform = 'none';
5939
- _this._infScroll.style.willChange = 'none';
5940
- }
5941
- });
5942
- };
5943
- _this.onScrollListener = function (event) {
5944
- if (typeof _this.props.onScroll === 'function') {
5945
- // Execute this callback in next tick so that it does not affect the
5946
- // functionality of the library.
5947
- setTimeout(function () { return _this.props.onScroll && _this.props.onScroll(event); }, 0);
5948
- }
5949
- var target = _this.props.height || _this._scrollableNode
5950
- ? event.target
5951
- : document.documentElement.scrollTop
5952
- ? document.documentElement
5953
- : document.body;
5954
- // return immediately if the action has already been triggered,
5955
- // prevents multiple triggers.
5956
- if (_this.actionTriggered)
5957
- return;
5958
- var atBottom = _this.isElementAtBottom(target, _this.props.scrollThreshold);
5959
- // call the `next` function in the props to trigger the next data fetch
5960
- if (atBottom && _this.props.hasMore) {
5961
- _this.actionTriggered = true;
5962
- _this.setState({ showLoader: true });
5963
- _this.props.next && _this.props.next();
5964
- }
5965
- _this.lastScrollTop = target.scrollTop;
5966
- };
5967
- _this.state = {
5968
- showLoader: false,
5969
- pullToRefreshThresholdBreached: false,
5970
- };
5971
- _this.throttledOnScrollListener = throttle(150, _this.onScrollListener).bind(_this);
5972
- _this.onStart = _this.onStart.bind(_this);
5973
- _this.onMove = _this.onMove.bind(_this);
5974
- _this.onEnd = _this.onEnd.bind(_this);
5975
- return _this;
5976
- }
5977
- InfiniteScroll.prototype.componentDidMount = function () {
5978
- if (typeof this.props.dataLength === 'undefined') {
5979
- throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed" +
5980
- " when loading more content. Check README.md for usage");
5981
- }
5982
- this._scrollableNode = this.getScrollableTarget();
5983
- this.el = this.props.height
5984
- ? this._infScroll
5985
- : this._scrollableNode || window;
5986
- if (this.el) {
5987
- this.el.addEventListener('scroll', this
5988
- .throttledOnScrollListener);
5989
- }
5990
- if (typeof this.props.initialScrollY === 'number' &&
5991
- this.el &&
5992
- this.el instanceof HTMLElement &&
5993
- this.el.scrollHeight > this.props.initialScrollY) {
5994
- this.el.scrollTo(0, this.props.initialScrollY);
5995
- }
5996
- if (this.props.pullDownToRefresh && this.el) {
5997
- this.el.addEventListener('touchstart', this.onStart);
5998
- this.el.addEventListener('touchmove', this.onMove);
5999
- this.el.addEventListener('touchend', this.onEnd);
6000
- this.el.addEventListener('mousedown', this.onStart);
6001
- this.el.addEventListener('mousemove', this.onMove);
6002
- this.el.addEventListener('mouseup', this.onEnd);
6003
- // get BCR of pullDown element to position it above
6004
- this.maxPullDownDistance =
6005
- (this._pullDown &&
6006
- this._pullDown.firstChild &&
6007
- this._pullDown.firstChild.getBoundingClientRect()
6008
- .height) ||
6009
- 0;
6010
- this.forceUpdate();
6011
- if (typeof this.props.refreshFunction !== 'function') {
6012
- throw new Error("Mandatory prop \"refreshFunction\" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage'");
6013
- }
6014
- }
6015
- };
6016
- InfiniteScroll.prototype.componentWillUnmount = function () {
6017
- if (this.el) {
6018
- this.el.removeEventListener('scroll', this
6019
- .throttledOnScrollListener);
6020
- if (this.props.pullDownToRefresh) {
6021
- this.el.removeEventListener('touchstart', this.onStart);
6022
- this.el.removeEventListener('touchmove', this.onMove);
6023
- this.el.removeEventListener('touchend', this.onEnd);
6024
- this.el.removeEventListener('mousedown', this.onStart);
6025
- this.el.removeEventListener('mousemove', this.onMove);
6026
- this.el.removeEventListener('mouseup', this.onEnd);
6027
- }
6028
- }
6029
- };
6030
- InfiniteScroll.prototype.UNSAFE_componentWillReceiveProps = function (props) {
6031
- // do nothing when dataLength and key are unchanged
6032
- if (this.props.key === props.key &&
6033
- this.props.dataLength === props.dataLength)
6034
- return;
6035
- this.actionTriggered = false;
6036
- // update state when new data was sent in
6037
- this.setState({
6038
- showLoader: false,
6039
- });
6040
- };
6041
- InfiniteScroll.prototype.isElementAtBottom = function (target, scrollThreshold) {
6042
- if (scrollThreshold === void 0) { scrollThreshold = 0.8; }
6043
- var clientHeight = target === document.body || target === document.documentElement
6044
- ? window.screen.availHeight
6045
- : target.clientHeight;
6046
- var threshold = parseThreshold(scrollThreshold);
6047
- if (threshold.unit === ThresholdUnits.Pixel) {
6048
- return (target.scrollTop + clientHeight >= target.scrollHeight - threshold.value);
6049
- }
6050
- return (target.scrollTop + clientHeight >=
6051
- (threshold.value / 100) * target.scrollHeight);
6052
- };
6053
- InfiniteScroll.prototype.render = function () {
6054
- var _this = this;
6055
- var style = __assign({ height: this.props.height || 'auto', overflow: 'auto', WebkitOverflowScrolling: 'touch' }, this.props.style);
6056
- var hasChildren = this.props.hasChildren ||
6057
- !!(this.props.children &&
6058
- this.props.children instanceof Array &&
6059
- this.props.children.length);
6060
- // because heighted infiniteScroll visualy breaks
6061
- // on drag down as overflow becomes visible
6062
- var outerDivStyle = this.props.pullDownToRefresh && this.props.height
6063
- ? { overflow: 'auto' }
6064
- : {};
6065
- return (React__default.createElement("div", { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
6066
- React__default.createElement("div", { className: "infinite-scroll-component " + (this.props.className || ''), ref: function (infScroll) { return (_this._infScroll = infScroll); }, style: style },
6067
- this.props.pullDownToRefresh && (React__default.createElement("div", { style: { position: 'relative' }, ref: function (pullDown) { return (_this._pullDown = pullDown); } },
6068
- React__default.createElement("div", { style: {
6069
- position: 'absolute',
6070
- left: 0,
6071
- right: 0,
6072
- top: -1 * this.maxPullDownDistance,
6073
- } }, this.state.pullToRefreshThresholdBreached
6074
- ? this.props.releaseToRefreshContent
6075
- : this.props.pullDownToRefreshContent))),
6076
- this.props.children,
6077
- !this.state.showLoader &&
6078
- !hasChildren &&
6079
- this.props.hasMore &&
6080
- this.props.loader,
6081
- this.state.showLoader && this.props.hasMore && this.props.loader,
6082
- !this.props.hasMore && this.props.endMessage)));
6083
- };
6084
- return InfiniteScroll;
6085
- }(Component));
6086
-
6087
- var visibilitySensor = createCommonjsModule(function (module, exports) {
6088
- (function webpackUniversalModuleDefinition(root, factory) {
6089
- module.exports = factory(React__default, reactDom);
6090
- })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
6091
- return /******/ (function(modules) { // webpackBootstrap
6092
- /******/ // The module cache
6093
- /******/ var installedModules = {};
6094
- /******/
6095
- /******/ // The require function
6096
- /******/ function __webpack_require__(moduleId) {
6097
- /******/
6098
- /******/ // Check if module is in cache
6099
- /******/ if(installedModules[moduleId]) {
6100
- /******/ return installedModules[moduleId].exports;
6101
- /******/ }
6102
- /******/ // Create a new module (and put it into the cache)
6103
- /******/ var module = installedModules[moduleId] = {
6104
- /******/ i: moduleId,
6105
- /******/ l: false,
6106
- /******/ exports: {}
6107
- /******/ };
6108
- /******/
6109
- /******/ // Execute the module function
6110
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
6111
- /******/
6112
- /******/ // Flag the module as loaded
6113
- /******/ module.l = true;
6114
- /******/
6115
- /******/ // Return the exports of the module
6116
- /******/ return module.exports;
6117
- /******/ }
6118
- /******/
6119
- /******/
6120
- /******/ // expose the modules object (__webpack_modules__)
6121
- /******/ __webpack_require__.m = modules;
6122
- /******/
6123
- /******/ // expose the module cache
6124
- /******/ __webpack_require__.c = installedModules;
6125
- /******/
6126
- /******/ // define getter function for harmony exports
6127
- /******/ __webpack_require__.d = function(exports, name, getter) {
6128
- /******/ if(!__webpack_require__.o(exports, name)) {
6129
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
6130
- /******/ }
6131
- /******/ };
6132
- /******/
6133
- /******/ // define __esModule on exports
6134
- /******/ __webpack_require__.r = function(exports) {
6135
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
6136
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6137
- /******/ }
6138
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
6139
- /******/ };
6140
- /******/
6141
- /******/ // create a fake namespace object
6142
- /******/ // mode & 1: value is a module id, require it
6143
- /******/ // mode & 2: merge all properties of value into the ns
6144
- /******/ // mode & 4: return value when already ns object
6145
- /******/ // mode & 8|1: behave like require
6146
- /******/ __webpack_require__.t = function(value, mode) {
6147
- /******/ if(mode & 1) value = __webpack_require__(value);
6148
- /******/ if(mode & 8) return value;
6149
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
6150
- /******/ var ns = Object.create(null);
6151
- /******/ __webpack_require__.r(ns);
6152
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
6153
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
6154
- /******/ return ns;
6155
- /******/ };
6156
- /******/
6157
- /******/ // getDefaultExport function for compatibility with non-harmony modules
6158
- /******/ __webpack_require__.n = function(module) {
6159
- /******/ var getter = module && module.__esModule ?
6160
- /******/ function getDefault() { return module['default']; } :
6161
- /******/ function getModuleExports() { return module; };
6162
- /******/ __webpack_require__.d(getter, 'a', getter);
6163
- /******/ return getter;
6164
- /******/ };
6165
- /******/
6166
- /******/ // Object.prototype.hasOwnProperty.call
6167
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
6168
- /******/
6169
- /******/ // __webpack_public_path__
6170
- /******/ __webpack_require__.p = "";
6171
- /******/
6172
- /******/
6173
- /******/ // Load entry module and return exports
6174
- /******/ return __webpack_require__(__webpack_require__.s = 4);
6175
- /******/ })
6176
- /************************************************************************/
6177
- /******/ ([
6178
- /* 0 */
6179
- /***/ (function(module, exports, __webpack_require__) {
6180
-
6181
- /**
6182
- * Copyright (c) 2013-present, Facebook, Inc.
6183
- *
6184
- * This source code is licensed under the MIT license found in the
6185
- * LICENSE file in the root directory of this source tree.
6186
- */
6187
-
6188
- {
6189
- // By explicitly using `prop-types` you are opting into new production behavior.
6190
- // http://fb.me/prop-types-in-prod
6191
- module.exports = __webpack_require__(5)();
6192
- }
6193
-
6194
-
6195
- /***/ }),
6196
- /* 1 */
6197
- /***/ (function(module, exports) {
6198
-
6199
- module.exports = __WEBPACK_EXTERNAL_MODULE__1__;
6200
-
6201
- /***/ }),
6202
- /* 2 */
6203
- /***/ (function(module, exports) {
6204
-
6205
- module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
6206
-
6207
- /***/ }),
6208
- /* 3 */
6209
- /***/ (function(module, exports) {
6210
-
6211
- // Tell whether the rect is visible, given an offset
6212
- //
6213
- // return: boolean
6214
- module.exports = function (offset, rect, containmentRect) {
6215
- var offsetDir = offset.direction;
6216
- var offsetVal = offset.value; // Rules for checking different kind of offsets. In example if the element is
6217
- // 90px below viewport and offsetTop is 100, it is considered visible.
6218
-
6219
- switch (offsetDir) {
6220
- case 'top':
6221
- return containmentRect.top + offsetVal < rect.top && containmentRect.bottom > rect.bottom && containmentRect.left < rect.left && containmentRect.right > rect.right;
6222
-
6223
- case 'left':
6224
- return containmentRect.left + offsetVal < rect.left && containmentRect.bottom > rect.bottom && containmentRect.top < rect.top && containmentRect.right > rect.right;
6225
-
6226
- case 'bottom':
6227
- return containmentRect.bottom - offsetVal > rect.bottom && containmentRect.left < rect.left && containmentRect.right > rect.right && containmentRect.top < rect.top;
6228
-
6229
- case 'right':
6230
- return containmentRect.right - offsetVal > rect.right && containmentRect.left < rect.left && containmentRect.top < rect.top && containmentRect.bottom > rect.bottom;
6231
- }
6232
- };
6233
-
6234
- /***/ }),
6235
- /* 4 */
6236
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6237
- __webpack_require__.r(__webpack_exports__);
6238
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return VisibilitySensor; });
6239
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
6240
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
6241
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
6242
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
6243
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
6244
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
6245
- /* harmony import */ var _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
6246
- /* harmony import */ var _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3__);
6247
-
6248
-
6249
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
6250
-
6251
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6252
-
6253
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6254
-
6255
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
6256
-
6257
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
6258
-
6259
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
6260
-
6261
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
6262
-
6263
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
6264
-
6265
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
6266
-
6267
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6268
-
6269
-
6270
-
6271
-
6272
-
6273
-
6274
- function normalizeRect(rect) {
6275
- if (rect.width === undefined) {
6276
- rect.width = rect.right - rect.left;
6277
- }
6278
-
6279
- if (rect.height === undefined) {
6280
- rect.height = rect.bottom - rect.top;
6281
- }
6282
-
6283
- return rect;
6284
- }
6285
-
6286
- var VisibilitySensor =
6287
- /*#__PURE__*/
6288
- function (_React$Component) {
6289
- _inherits(VisibilitySensor, _React$Component);
6290
-
6291
- function VisibilitySensor(props) {
6292
- var _this;
6293
-
6294
- _classCallCheck(this, VisibilitySensor);
6295
-
6296
- _this = _possibleConstructorReturn(this, _getPrototypeOf(VisibilitySensor).call(this, props));
6297
-
6298
- _defineProperty(_assertThisInitialized(_this), "getContainer", function () {
6299
- return _this.props.containment || window;
6300
- });
6301
-
6302
- _defineProperty(_assertThisInitialized(_this), "addEventListener", function (target, event, delay, throttle) {
6303
- if (!_this.debounceCheck) {
6304
- _this.debounceCheck = {};
6305
- }
6306
-
6307
- var timeout;
6308
- var func;
6309
-
6310
- var later = function later() {
6311
- timeout = null;
6312
-
6313
- _this.check();
6314
- };
6315
-
6316
- if (throttle > -1) {
6317
- func = function func() {
6318
- if (!timeout) {
6319
- timeout = setTimeout(later, throttle || 0);
6320
- }
6321
- };
6322
- } else {
6323
- func = function func() {
6324
- clearTimeout(timeout);
6325
- timeout = setTimeout(later, delay || 0);
6326
- };
6327
- }
6328
-
6329
- var info = {
6330
- target: target,
6331
- fn: func,
6332
- getLastTimeout: function getLastTimeout() {
6333
- return timeout;
6334
- }
6335
- };
6336
- target.addEventListener(event, info.fn);
6337
- _this.debounceCheck[event] = info;
6338
- });
6339
-
6340
- _defineProperty(_assertThisInitialized(_this), "startWatching", function () {
6341
- if (_this.debounceCheck || _this.interval) {
6342
- return;
6343
- }
6344
-
6345
- if (_this.props.intervalCheck) {
6346
- _this.interval = setInterval(_this.check, _this.props.intervalDelay);
6347
- }
6348
-
6349
- if (_this.props.scrollCheck) {
6350
- _this.addEventListener(_this.getContainer(), "scroll", _this.props.scrollDelay, _this.props.scrollThrottle);
6351
- }
6352
-
6353
- if (_this.props.resizeCheck) {
6354
- _this.addEventListener(window, "resize", _this.props.resizeDelay, _this.props.resizeThrottle);
6355
- } // if dont need delayed call, check on load ( before the first interval fires )
6356
-
6357
-
6358
- !_this.props.delayedCall && _this.check();
6359
- });
6360
-
6361
- _defineProperty(_assertThisInitialized(_this), "stopWatching", function () {
6362
- if (_this.debounceCheck) {
6363
- // clean up event listeners and their debounce callers
6364
- for (var debounceEvent in _this.debounceCheck) {
6365
- if (_this.debounceCheck.hasOwnProperty(debounceEvent)) {
6366
- var debounceInfo = _this.debounceCheck[debounceEvent];
6367
- clearTimeout(debounceInfo.getLastTimeout());
6368
- debounceInfo.target.removeEventListener(debounceEvent, debounceInfo.fn);
6369
- _this.debounceCheck[debounceEvent] = null;
6370
- }
6371
- }
6372
- }
6373
-
6374
- _this.debounceCheck = null;
6375
-
6376
- if (_this.interval) {
6377
- _this.interval = clearInterval(_this.interval);
6378
- }
6379
- });
6380
-
6381
- _defineProperty(_assertThisInitialized(_this), "check", function () {
6382
- var el = _this.node;
6383
- var rect;
6384
- var containmentRect; // if the component has rendered to null, dont update visibility
6385
-
6386
- if (!el) {
6387
- return _this.state;
6388
- }
6389
-
6390
- rect = normalizeRect(_this.roundRectDown(el.getBoundingClientRect()));
6391
-
6392
- if (_this.props.containment) {
6393
- var containmentDOMRect = _this.props.containment.getBoundingClientRect();
6394
-
6395
- containmentRect = {
6396
- top: containmentDOMRect.top,
6397
- left: containmentDOMRect.left,
6398
- bottom: containmentDOMRect.bottom,
6399
- right: containmentDOMRect.right
6400
- };
6401
- } else {
6402
- containmentRect = {
6403
- top: 0,
6404
- left: 0,
6405
- bottom: window.innerHeight || document.documentElement.clientHeight,
6406
- right: window.innerWidth || document.documentElement.clientWidth
6407
- };
6408
- } // Check if visibility is wanted via offset?
6409
-
6410
-
6411
- var offset = _this.props.offset || {};
6412
- var hasValidOffset = _typeof(offset) === "object";
6413
-
6414
- if (hasValidOffset) {
6415
- containmentRect.top += offset.top || 0;
6416
- containmentRect.left += offset.left || 0;
6417
- containmentRect.bottom -= offset.bottom || 0;
6418
- containmentRect.right -= offset.right || 0;
6419
- }
6420
-
6421
- var visibilityRect = {
6422
- top: rect.top >= containmentRect.top,
6423
- left: rect.left >= containmentRect.left,
6424
- bottom: rect.bottom <= containmentRect.bottom,
6425
- right: rect.right <= containmentRect.right
6426
- }; // https://github.com/joshwnj/react-visibility-sensor/pull/114
6427
-
6428
- var hasSize = rect.height > 0 && rect.width > 0;
6429
- var isVisible = hasSize && visibilityRect.top && visibilityRect.left && visibilityRect.bottom && visibilityRect.right; // check for partial visibility
6430
-
6431
- if (hasSize && _this.props.partialVisibility) {
6432
- var partialVisible = rect.top <= containmentRect.bottom && rect.bottom >= containmentRect.top && rect.left <= containmentRect.right && rect.right >= containmentRect.left; // account for partial visibility on a single edge
6433
-
6434
- if (typeof _this.props.partialVisibility === "string") {
6435
- partialVisible = visibilityRect[_this.props.partialVisibility];
6436
- } // if we have minimum top visibility set by props, lets check, if it meets the passed value
6437
- // so if for instance element is at least 200px in viewport, then show it.
6438
-
6439
-
6440
- isVisible = _this.props.minTopValue ? partialVisible && rect.top <= containmentRect.bottom - _this.props.minTopValue : partialVisible;
6441
- } // Deprecated options for calculating offset.
6442
-
6443
-
6444
- if (typeof offset.direction === "string" && typeof offset.value === "number") {
6445
- console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }", offset.direction, offset.value);
6446
- isVisible = _lib_is_visible_with_offset__WEBPACK_IMPORTED_MODULE_3___default()(offset, rect, containmentRect);
6447
- }
6448
-
6449
- var state = _this.state; // notify the parent when the value changes
6450
-
6451
- if (_this.state.isVisible !== isVisible) {
6452
- state = {
6453
- isVisible: isVisible,
6454
- visibilityRect: visibilityRect
6455
- };
6456
-
6457
- _this.setState(state);
6458
-
6459
- if (_this.props.onChange) _this.props.onChange(isVisible);
6460
- }
6461
-
6462
- return state;
6463
- });
6464
-
6465
- _this.state = {
6466
- isVisible: null,
6467
- visibilityRect: {}
6468
- };
6469
- return _this;
6470
- }
6471
-
6472
- _createClass(VisibilitySensor, [{
6473
- key: "componentDidMount",
6474
- value: function componentDidMount() {
6475
- this.node = react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this);
6476
-
6477
- if (this.props.active) {
6478
- this.startWatching();
6479
- }
6480
- }
6481
- }, {
6482
- key: "componentWillUnmount",
6483
- value: function componentWillUnmount() {
6484
- this.stopWatching();
6485
- }
6486
- }, {
6487
- key: "componentDidUpdate",
6488
- value: function componentDidUpdate(prevProps) {
6489
- // re-register node in componentDidUpdate if children diffs [#103]
6490
- this.node = react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.findDOMNode(this);
6491
-
6492
- if (this.props.active && !prevProps.active) {
6493
- this.setState({
6494
- isVisible: null,
6495
- visibilityRect: {}
6496
- });
6497
- this.startWatching();
6498
- } else if (!this.props.active) {
6499
- this.stopWatching();
6500
- }
6501
- }
6502
- }, {
6503
- key: "roundRectDown",
6504
- value: function roundRectDown(rect) {
6505
- return {
6506
- top: Math.floor(rect.top),
6507
- left: Math.floor(rect.left),
6508
- bottom: Math.floor(rect.bottom),
6509
- right: Math.floor(rect.right)
6510
- };
6511
- }
6512
- /**
6513
- * Check if the element is within the visible viewport
6514
- */
6515
-
6516
- }, {
6517
- key: "render",
6518
- value: function render() {
6519
- if (this.props.children instanceof Function) {
6520
- return this.props.children({
6521
- isVisible: this.state.isVisible,
6522
- visibilityRect: this.state.visibilityRect
6523
- });
6524
- }
6525
-
6526
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.only(this.props.children);
6527
- }
6528
- }]);
6529
-
6530
- return VisibilitySensor;
6531
- }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
6532
-
6533
- _defineProperty(VisibilitySensor, "defaultProps", {
6534
- active: true,
6535
- partialVisibility: false,
6536
- minTopValue: 0,
6537
- scrollCheck: false,
6538
- scrollDelay: 250,
6539
- scrollThrottle: -1,
6540
- resizeCheck: false,
6541
- resizeDelay: 250,
6542
- resizeThrottle: -1,
6543
- intervalCheck: true,
6544
- intervalDelay: 100,
6545
- delayedCall: false,
6546
- offset: {},
6547
- containment: null,
6548
- children: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null)
6549
- });
6550
-
6551
- _defineProperty(VisibilitySensor, "propTypes", {
6552
- onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
6553
- active: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
6554
- partialVisibility: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(["top", "right", "bottom", "left"])]),
6555
- delayedCall: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
6556
- offset: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({
6557
- top: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6558
- left: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6559
- bottom: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6560
- right: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
6561
- }), // deprecated offset property
6562
- prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.shape({
6563
- direction: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(["top", "right", "bottom", "left"]),
6564
- value: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
6565
- })]),
6566
- scrollCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
6567
- scrollDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6568
- scrollThrottle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6569
- resizeCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
6570
- resizeDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6571
- resizeThrottle: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6572
- intervalCheck: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
6573
- intervalDelay: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
6574
- containment: typeof window !== "undefined" ? prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.instanceOf(window.Element) : prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.any,
6575
- children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func]),
6576
- minTopValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
6577
- });
6578
-
6579
-
6580
-
6581
- /***/ }),
6582
- /* 5 */
6583
- /***/ (function(module, exports, __webpack_require__) {
6584
- /**
6585
- * Copyright (c) 2013-present, Facebook, Inc.
6586
- *
6587
- * This source code is licensed under the MIT license found in the
6588
- * LICENSE file in the root directory of this source tree.
6589
- */
6590
-
6591
-
6592
-
6593
- var ReactPropTypesSecret = __webpack_require__(6);
6594
-
6595
- function emptyFunction() {}
6596
- function emptyFunctionWithReset() {}
6597
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
6598
-
6599
- module.exports = function() {
6600
- function shim(props, propName, componentName, location, propFullName, secret) {
6601
- if (secret === ReactPropTypesSecret) {
6602
- // It is still safe when called from React.
6603
- return;
6604
- }
6605
- var err = new Error(
6606
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
6607
- 'Use PropTypes.checkPropTypes() to call them. ' +
6608
- 'Read more at http://fb.me/use-check-prop-types'
6609
- );
6610
- err.name = 'Invariant Violation';
6611
- throw err;
6612
- } shim.isRequired = shim;
6613
- function getShim() {
6614
- return shim;
6615
- } // Important!
6616
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
6617
- var ReactPropTypes = {
6618
- array: shim,
6619
- bool: shim,
6620
- func: shim,
6621
- number: shim,
6622
- object: shim,
6623
- string: shim,
6624
- symbol: shim,
6625
-
6626
- any: shim,
6627
- arrayOf: getShim,
6628
- element: shim,
6629
- elementType: shim,
6630
- instanceOf: getShim,
6631
- node: shim,
6632
- objectOf: getShim,
6633
- oneOf: getShim,
6634
- oneOfType: getShim,
6635
- shape: getShim,
6636
- exact: getShim,
6637
-
6638
- checkPropTypes: emptyFunctionWithReset,
6639
- resetWarningCache: emptyFunction
6640
- };
6641
-
6642
- ReactPropTypes.PropTypes = ReactPropTypes;
6643
-
6644
- return ReactPropTypes;
6645
- };
6646
-
6647
-
6648
- /***/ }),
6649
- /* 6 */
6650
- /***/ (function(module, exports, __webpack_require__) {
6651
- /**
6652
- * Copyright (c) 2013-present, Facebook, Inc.
6653
- *
6654
- * This source code is licensed under the MIT license found in the
6655
- * LICENSE file in the root directory of this source tree.
6656
- */
6657
-
6658
-
6659
-
6660
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
6661
-
6662
- module.exports = ReactPropTypesSecret;
6663
-
6664
-
6665
- /***/ })
6666
- /******/ ]);
6667
- });
6668
- });
6669
-
6670
- var VisibilitySensor = unwrapExports(visibilitySensor);
6671
-
6672
- export { InfiniteScroll as I, VisibilitySensor as V, moment as m };
5665
+ export { moment as m };