parent
0ef7a6db13
commit
c9ae436659
@ -0,0 +1,587 @@
|
||||
(self["webpackChunk"] = self["webpackChunk"] || []).push([[83453],{
|
||||
|
||||
/***/ 87169:
|
||||
/*!*******************************************************************************************************************!*\
|
||||
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
|
||||
\*******************************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.9@@babel/runtime/helpers/esm/extends.js
|
||||
var esm_extends = __webpack_require__(92413);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
|
||||
// This icon file is generated automatically.
|
||||
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
|
||||
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
||||
var AntdIcon = __webpack_require__(7657);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
|
||||
|
||||
// GENERATE BY ./scripts/generate.ts
|
||||
// DON NOT EDIT IT MANUALLY
|
||||
|
||||
|
||||
|
||||
|
||||
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
||||
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
||||
ref: ref,
|
||||
icon: asn_ExclamationCircleOutlined
|
||||
}));
|
||||
};
|
||||
|
||||
/** */
|
||||
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined);
|
||||
if (false) {}
|
||||
/* harmony default export */ var icons_ExclamationCircleOutlined = (RefIcon);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 61481:
|
||||
/*!*******************************************************************************************************!*\
|
||||
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules ***!
|
||||
\*******************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ icons_InboxOutlined; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.9@@babel/runtime/helpers/esm/extends.js
|
||||
var esm_extends = __webpack_require__(92413);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/InboxOutlined.js
|
||||
// This icon file is generated automatically.
|
||||
var InboxOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z" } }] }, "name": "inbox", "theme": "outlined" };
|
||||
/* harmony default export */ var asn_InboxOutlined = (InboxOutlined);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
||||
var AntdIcon = __webpack_require__(7657);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/InboxOutlined.js
|
||||
|
||||
// GENERATE BY ./scripts/generate.ts
|
||||
// DON NOT EDIT IT MANUALLY
|
||||
|
||||
|
||||
|
||||
|
||||
var InboxOutlined_InboxOutlined = function InboxOutlined(props, ref) {
|
||||
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
||||
ref: ref,
|
||||
icon: asn_InboxOutlined
|
||||
}));
|
||||
};
|
||||
|
||||
/** */
|
||||
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(InboxOutlined_InboxOutlined);
|
||||
if (false) {}
|
||||
/* harmony default export */ var icons_InboxOutlined = (RefIcon);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 15278:
|
||||
/*!******************************************************************************************************!*\
|
||||
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LinkOutlined.js + 1 modules ***!
|
||||
\******************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXPORTS
|
||||
__webpack_require__.d(__webpack_exports__, {
|
||||
Z: function() { return /* binding */ icons_LinkOutlined; }
|
||||
});
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.9@@babel/runtime/helpers/esm/extends.js
|
||||
var esm_extends = __webpack_require__(92413);
|
||||
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
||||
var _react_17_0_2_react = __webpack_require__(59301);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/LinkOutlined.js
|
||||
// This icon file is generated automatically.
|
||||
var LinkOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z" } }] }, "name": "link", "theme": "outlined" };
|
||||
/* harmony default export */ var asn_LinkOutlined = (LinkOutlined);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
||||
var AntdIcon = __webpack_require__(7657);
|
||||
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LinkOutlined.js
|
||||
|
||||
// GENERATE BY ./scripts/generate.ts
|
||||
// DON NOT EDIT IT MANUALLY
|
||||
|
||||
|
||||
|
||||
|
||||
var LinkOutlined_LinkOutlined = function LinkOutlined(props, ref) {
|
||||
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
||||
ref: ref,
|
||||
icon: asn_LinkOutlined
|
||||
}));
|
||||
};
|
||||
|
||||
/** */
|
||||
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(LinkOutlined_LinkOutlined);
|
||||
if (false) {}
|
||||
/* harmony default export */ var icons_LinkOutlined = (RefIcon);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 88522:
|
||||
/*!*****************************************************************!*\
|
||||
!*** ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js ***!
|
||||
\*****************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
||||
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 11592);
|
||||
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 2738);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
||||
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_util/PurePanel */ 53487);
|
||||
/* harmony import */ var _util_reactNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_util/reactNode */ 92343);
|
||||
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config-provider */ 36355);
|
||||
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../select */ 57809);
|
||||
"use client";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const {
|
||||
Option
|
||||
} = _select__WEBPACK_IMPORTED_MODULE_3__["default"];
|
||||
function isSelectOptionOrSelectOptGroup(child) {
|
||||
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
||||
}
|
||||
const AutoComplete = (props, ref) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
className,
|
||||
popupClassName,
|
||||
dropdownClassName,
|
||||
children,
|
||||
dataSource
|
||||
} = props;
|
||||
const childNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(children);
|
||||
// ============================= Input =============================
|
||||
let customizeInput;
|
||||
if (childNodes.length === 1 && (0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
||||
[customizeInput] = childNodes;
|
||||
}
|
||||
const getInputElement = customizeInput ? () => customizeInput : undefined;
|
||||
// ============================ Options ============================
|
||||
let optionChildren;
|
||||
// [Legacy] convert `children` or `dataSource` into option children
|
||||
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
||||
optionChildren = children;
|
||||
} else {
|
||||
optionChildren = dataSource ? dataSource.map(item => {
|
||||
if ((0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(item)) {
|
||||
return item;
|
||||
}
|
||||
switch (typeof item) {
|
||||
case 'string':
|
||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
||||
key: item,
|
||||
value: item
|
||||
}, item);
|
||||
case 'object':
|
||||
{
|
||||
const {
|
||||
value: optionValue
|
||||
} = item;
|
||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
|
||||
key: optionValue,
|
||||
value: optionValue
|
||||
}, item.text);
|
||||
}
|
||||
default:
|
||||
false ? 0 : void 0;
|
||||
return undefined;
|
||||
}
|
||||
}) : [];
|
||||
}
|
||||
if (false) {}
|
||||
const {
|
||||
getPrefixCls
|
||||
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_5__/* .ConfigContext */ .E_);
|
||||
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_select__WEBPACK_IMPORTED_MODULE_3__["default"], Object.assign({
|
||||
ref: ref,
|
||||
suffixIcon: null
|
||||
}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props, ['dataSource', 'dropdownClassName']), {
|
||||
prefixCls: prefixCls,
|
||||
popupClassName: popupClassName || dropdownClassName,
|
||||
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${prefixCls}-auto-complete`, className),
|
||||
mode: _select__WEBPACK_IMPORTED_MODULE_3__["default"].SECRET_COMBOBOX_MODE_DO_NOT_USE
|
||||
}, {
|
||||
// Internal api
|
||||
getInputElement
|
||||
}), optionChildren);
|
||||
};
|
||||
const RefAutoComplete = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(AutoComplete);
|
||||
// We don't care debug panel
|
||||
/* istanbul ignore next */
|
||||
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(RefAutoComplete);
|
||||
RefAutoComplete.Option = Option;
|
||||
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
||||
if (false) {}
|
||||
/* harmony default export */ __webpack_exports__.Z = (RefAutoComplete);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 60028:
|
||||
/*!**********************************************************!*\
|
||||
!*** ./node_modules/_antd@5.9.0@antd/es/upload/index.js ***!
|
||||
\**********************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dragger */ 71409);
|
||||
/* harmony import */ var _Upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Upload */ 37714);
|
||||
"use client";
|
||||
|
||||
|
||||
|
||||
const Upload = _Upload__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z;
|
||||
Upload.Dragger = _Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
|
||||
Upload.LIST_IGNORE = _Upload__WEBPACK_IMPORTED_MODULE_0__/* .LIST_IGNORE */ .E;
|
||||
/* harmony default export */ __webpack_exports__.Z = (Upload);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 51581:
|
||||
/*!****************************************************************************************************!*\
|
||||
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/dist/InfiniteScroll.js ***!
|
||||
\****************************************************************************************************/
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({
|
||||
value: true
|
||||
}));
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _react = __webpack_require__(/*! react */ 59301);
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = __webpack_require__(/*! prop-types */ 12708);
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var InfiniteScroll = function (_Component) {
|
||||
_inherits(InfiniteScroll, _Component);
|
||||
|
||||
function InfiniteScroll(props) {
|
||||
_classCallCheck(this, InfiniteScroll);
|
||||
|
||||
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
|
||||
|
||||
_this.scrollListener = _this.scrollListener.bind(_this);
|
||||
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
|
||||
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(InfiniteScroll, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
this.pageLoaded = this.props.pageStart;
|
||||
this.options = this.eventListenerOptions();
|
||||
this.attachScrollListener();
|
||||
}
|
||||
}, {
|
||||
key: 'componentDidUpdate',
|
||||
value: function componentDidUpdate() {
|
||||
if (this.props.isReverse && this.loadMore) {
|
||||
var parentElement = this.getParentElement(this.scrollComponent);
|
||||
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
|
||||
this.loadMore = false;
|
||||
}
|
||||
this.attachScrollListener();
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillUnmount',
|
||||
value: function componentWillUnmount() {
|
||||
this.detachScrollListener();
|
||||
this.detachMousewheelListener();
|
||||
}
|
||||
}, {
|
||||
key: 'isPassiveSupported',
|
||||
value: function isPassiveSupported() {
|
||||
var passive = false;
|
||||
|
||||
var testOptions = {
|
||||
get passive() {
|
||||
passive = true;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
document.addEventListener('test', null, testOptions);
|
||||
document.removeEventListener('test', null, testOptions);
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
return passive;
|
||||
}
|
||||
}, {
|
||||
key: 'eventListenerOptions',
|
||||
value: function eventListenerOptions() {
|
||||
var options = this.props.useCapture;
|
||||
|
||||
if (this.isPassiveSupported()) {
|
||||
options = {
|
||||
useCapture: this.props.useCapture,
|
||||
passive: true
|
||||
};
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
// Set a defaut loader for all your `InfiniteScroll` components
|
||||
|
||||
}, {
|
||||
key: 'setDefaultLoader',
|
||||
value: function setDefaultLoader(loader) {
|
||||
this.defaultLoader = loader;
|
||||
}
|
||||
}, {
|
||||
key: 'detachMousewheelListener',
|
||||
value: function detachMousewheelListener() {
|
||||
var scrollEl = window;
|
||||
if (this.props.useWindow === false) {
|
||||
scrollEl = this.scrollComponent.parentNode;
|
||||
}
|
||||
|
||||
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
||||
}
|
||||
}, {
|
||||
key: 'detachScrollListener',
|
||||
value: function detachScrollListener() {
|
||||
var scrollEl = window;
|
||||
if (this.props.useWindow === false) {
|
||||
scrollEl = this.getParentElement(this.scrollComponent);
|
||||
}
|
||||
|
||||
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
||||
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
||||
}
|
||||
}, {
|
||||
key: 'getParentElement',
|
||||
value: function getParentElement(el) {
|
||||
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
|
||||
if (scrollParent != null) {
|
||||
return scrollParent;
|
||||
}
|
||||
return el && el.parentNode;
|
||||
}
|
||||
}, {
|
||||
key: 'filterProps',
|
||||
value: function filterProps(props) {
|
||||
return props;
|
||||
}
|
||||
}, {
|
||||
key: 'attachScrollListener',
|
||||
value: function attachScrollListener() {
|
||||
var parentElement = this.getParentElement(this.scrollComponent);
|
||||
|
||||
if (!this.props.hasMore || !parentElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
var scrollEl = window;
|
||||
if (this.props.useWindow === false) {
|
||||
scrollEl = parentElement;
|
||||
}
|
||||
|
||||
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
||||
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
||||
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
||||
|
||||
if (this.props.initialLoad) {
|
||||
this.scrollListener();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'mousewheelListener',
|
||||
value: function mousewheelListener(e) {
|
||||
// Prevents Chrome hangups
|
||||
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
|
||||
if (e.deltaY === 1 && !this.isPassiveSupported()) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'scrollListener',
|
||||
value: function scrollListener() {
|
||||
var el = this.scrollComponent;
|
||||
var scrollEl = window;
|
||||
var parentNode = this.getParentElement(el);
|
||||
|
||||
var offset = void 0;
|
||||
if (this.props.useWindow) {
|
||||
var doc = document.documentElement || document.body.parentNode || document.body;
|
||||
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
|
||||
if (this.props.isReverse) {
|
||||
offset = scrollTop;
|
||||
} else {
|
||||
offset = this.calculateOffset(el, scrollTop);
|
||||
}
|
||||
} else if (this.props.isReverse) {
|
||||
offset = parentNode.scrollTop;
|
||||
} else {
|
||||
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
|
||||
}
|
||||
|
||||
// Here we make sure the element is visible as well as checking the offset
|
||||
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
|
||||
this.detachScrollListener();
|
||||
this.beforeScrollHeight = parentNode.scrollHeight;
|
||||
this.beforeScrollTop = parentNode.scrollTop;
|
||||
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
|
||||
if (typeof this.props.loadMore === 'function') {
|
||||
this.props.loadMore(this.pageLoaded += 1);
|
||||
this.loadMore = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'calculateOffset',
|
||||
value: function calculateOffset(el, scrollTop) {
|
||||
if (!el) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
|
||||
}
|
||||
}, {
|
||||
key: 'calculateTopPosition',
|
||||
value: function calculateTopPosition(el) {
|
||||
if (!el) {
|
||||
return 0;
|
||||
}
|
||||
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var renderProps = this.filterProps(this.props);
|
||||
|
||||
var children = renderProps.children,
|
||||
element = renderProps.element,
|
||||
hasMore = renderProps.hasMore,
|
||||
initialLoad = renderProps.initialLoad,
|
||||
isReverse = renderProps.isReverse,
|
||||
loader = renderProps.loader,
|
||||
loadMore = renderProps.loadMore,
|
||||
pageStart = renderProps.pageStart,
|
||||
ref = renderProps.ref,
|
||||
threshold = renderProps.threshold,
|
||||
useCapture = renderProps.useCapture,
|
||||
useWindow = renderProps.useWindow,
|
||||
getScrollParent = renderProps.getScrollParent,
|
||||
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
|
||||
|
||||
props.ref = function (node) {
|
||||
_this2.scrollComponent = node;
|
||||
if (ref) {
|
||||
ref(node);
|
||||
}
|
||||
};
|
||||
|
||||
var childrenArray = [children];
|
||||
if (hasMore) {
|
||||
if (loader) {
|
||||
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
|
||||
} else if (this.defaultLoader) {
|
||||
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
|
||||
}
|
||||
}
|
||||
return _react2.default.createElement(element, props, childrenArray);
|
||||
}
|
||||
}]);
|
||||
|
||||
return InfiniteScroll;
|
||||
}(_react.Component);
|
||||
|
||||
InfiniteScroll.propTypes = {
|
||||
children: _propTypes2.default.node.isRequired,
|
||||
element: _propTypes2.default.node,
|
||||
hasMore: _propTypes2.default.bool,
|
||||
initialLoad: _propTypes2.default.bool,
|
||||
isReverse: _propTypes2.default.bool,
|
||||
loader: _propTypes2.default.node,
|
||||
loadMore: _propTypes2.default.func.isRequired,
|
||||
pageStart: _propTypes2.default.number,
|
||||
ref: _propTypes2.default.func,
|
||||
getScrollParent: _propTypes2.default.func,
|
||||
threshold: _propTypes2.default.number,
|
||||
useCapture: _propTypes2.default.bool,
|
||||
useWindow: _propTypes2.default.bool
|
||||
};
|
||||
InfiniteScroll.defaultProps = {
|
||||
element: 'div',
|
||||
hasMore: false,
|
||||
initialLoad: true,
|
||||
pageStart: 0,
|
||||
ref: null,
|
||||
threshold: 250,
|
||||
useWindow: true,
|
||||
isReverse: false,
|
||||
useCapture: false,
|
||||
loader: null,
|
||||
getScrollParent: null
|
||||
};
|
||||
exports["default"] = InfiniteScroll;
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 26724:
|
||||
/*!**************************************************************************************!*\
|
||||
!*** ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js ***!
|
||||
\**************************************************************************************/
|
||||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 51581)
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue