You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
638 lines
26 KiB
638 lines
26 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[66034],{
|
|
|
|
/***/ 26554:
|
|
/*!*******************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons-svg/es/asn/LeftOutlined.js ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
// This icon file is generated automatically.
|
|
var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
|
|
/* harmony default export */ __webpack_exports__["Z"] = (LeftOutlined);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 50756:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons-svg/es/asn/RightOutlined.js ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
// This icon file is generated automatically.
|
|
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
|
|
/* harmony default export */ __webpack_exports__["Z"] = (RightOutlined);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 86441:
|
|
/*!*********************************************************!*\
|
|
!*** ./src/pages/HttpStatus/UserAgents.tsx + 1 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ UserAgents; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
|
|
var style = __webpack_require__(14182);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(260);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/HttpStatus/Argentitem.tsx
|
|
|
|
|
|
|
|
function listitem(_ref) {
|
|
var item = _ref.item,
|
|
type = _ref.type,
|
|
page = _ref.page;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
flexDirection: 'initial',
|
|
height: '37px',
|
|
background: '#ffffff',
|
|
padding: '0px 15px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: page === 1 ? type + 1 : type + 1 + (page - 1) * 20
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: item.login || '--'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: item.name || '--'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: item.register_info || '--'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: item.competition_info || '--'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: item.ip || '--'
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: item.username || '--'
|
|
})]
|
|
});
|
|
}
|
|
/* harmony default export */ var Argentitem = (listitem);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
;// CONCATENATED MODULE: ./src/pages/HttpStatus/UserAgents.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//竞赛引流
|
|
|
|
|
|
function useragents(props) {
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,react.useState)(1),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
page = _useState2[0],
|
|
setPage = _useState2[1];
|
|
var _useState3 = (0,react.useState)(20),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
per_page = _useState4[0],
|
|
setPer_page = _useState4[1];
|
|
var _useState5 = (0,react.useState)(),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
agentslist = _useState6[0],
|
|
setAgentslist = _useState6[1];
|
|
var _useState7 = (0,react.useState)(),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
alintsdata = _useState8[0],
|
|
setAlintsdata = _useState8[1];
|
|
(0,react.useEffect)(function () {
|
|
function init() {
|
|
return _init.apply(this, arguments);
|
|
}
|
|
function _init() {
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,fetch/* default */.ZP)("/api/user_agents.json", {
|
|
method: 'get',
|
|
params: {
|
|
page: page,
|
|
per_page: per_page
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
setAgentslist(res.data.user_agents);
|
|
setAlintsdata(res.data);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return _init.apply(this, arguments);
|
|
}
|
|
init();
|
|
}, [page]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "edu-container minH500",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "educontent mb20 persmstyle",
|
|
style: {
|
|
width: "1200px",
|
|
marginTop: "26px"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex",
|
|
background: '#ffffff',
|
|
height: '60px',
|
|
alignItems: 'center',
|
|
padding: '0px 15px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u5F15\u6D41\u603B\u4EBA\u6570\uFF1A", alintsdata && alintsdata.agents_count || '0']
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
style: {
|
|
marginLeft: '20px'
|
|
},
|
|
children: ["\u7ADE\u8D5B\u6210\u529F\u62A5\u540D\uFF1A", alintsdata && alintsdata.action_count || '0']
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
marginTop: '1px',
|
|
background: '#ffffff'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
flexDirection: 'initial',
|
|
height: '37px',
|
|
background: '#ffffff',
|
|
padding: '0px 15px'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: "\u5E8F\u53F7"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: "\u4EE3\u7406\u4EBA\u767B\u5F55\u540D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: "\u4EE3\u7406\u4EBA\u59D3\u540D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: "\u6CE8\u518C\u60C5\u51B5"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1'
|
|
},
|
|
children: "\u7ADE\u8D5B\u62A5\u540D"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: "IP"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '2'
|
|
},
|
|
children: "\u5F15\u6D41\u4EBA\u59D3\u540D"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
border: '1px solid #fafafa',
|
|
minHeight: '400px'
|
|
},
|
|
children: agentslist && agentslist.map(function (item, i) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Argentitem, {
|
|
page: page,
|
|
item: item,
|
|
type: i
|
|
});
|
|
})
|
|
})]
|
|
}), alintsdata && alintsdata.agents_count > 20 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
justifyContent: 'center',
|
|
display: 'flex',
|
|
marginTop: '20px'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
defaultCurrent: 1,
|
|
defaultPageSize: 20,
|
|
onChange: function onChange(page, pagesize) {
|
|
return setPage(page);
|
|
},
|
|
total: alintsdata && alintsdata.agents_count
|
|
})
|
|
}) : '']
|
|
})
|
|
});
|
|
}
|
|
/* harmony default export */ var UserAgents = (useragents);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9708:
|
|
/*!***************************************************!*\
|
|
!*** ./node_modules/antd/es/_util/statusUtils.js ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "F": function() { return /* binding */ getMergedStatus; },
|
|
/* harmony export */ "Z": function() { return /* binding */ getStatusClassNames; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ 4942);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./type */ 93355);
|
|
|
|
|
|
|
|
var InputStatuses = (0,_type__WEBPACK_IMPORTED_MODULE_1__/* .tuple */ .b)('warning', 'error', '');
|
|
function getStatusClassNames(prefixCls, status, hasFeedback) {
|
|
var _classNames;
|
|
return classnames__WEBPACK_IMPORTED_MODULE_0___default()((_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-status-success"), status === 'success'), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-status-warning"), status === 'warning'), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-status-error"), status === 'error'), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-status-validating"), status === 'validating'), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-has-feedback"), hasFeedback), _classNames));
|
|
}
|
|
var getMergedStatus = function getMergedStatus(contextStatus, customStatus) {
|
|
return customStatus || contextStatus;
|
|
};
|
|
|
|
/***/ }),
|
|
|
|
/***/ 97454:
|
|
/*!***********************************************************************************!*\
|
|
!*** ./node_modules/antd/node_modules/@ant-design/icons/es/icons/LeftOutlined.js ***!
|
|
\***********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _ant_design_icons_svg_es_asn_LeftOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/LeftOutlined */ 26554);
|
|
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 93771);
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var LeftOutlined = function LeftOutlined(props, ref) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: _ant_design_icons_svg_es_asn_LeftOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
|
|
}));
|
|
};
|
|
LeftOutlined.displayName = 'LeftOutlined';
|
|
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(LeftOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 62994:
|
|
/*!************************************************************************************!*\
|
|
!*** ./node_modules/antd/node_modules/@ant-design/icons/es/icons/RightOutlined.js ***!
|
|
\************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _ant_design_icons_svg_es_asn_RightOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/RightOutlined */ 50756);
|
|
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 93771);
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var RightOutlined = function RightOutlined(props, ref) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: _ant_design_icons_svg_es_asn_RightOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
|
|
}));
|
|
};
|
|
RightOutlined.displayName = 'RightOutlined';
|
|
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(RightOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 48555:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/rc-resize-observer/es/index.js + 4 modules ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: _rs
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(50344);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
var warning = __webpack_require__(80334);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(42550);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
|
|
var findDOMNode = __webpack_require__(34203);
|
|
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
|
|
var ResizeObserver_es = __webpack_require__(91033);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-resize-observer/es/utils/observerUtil.js
|
|
|
|
// =============================== Const ===============================
|
|
var elementListeners = new Map();
|
|
function onResize(entities) {
|
|
entities.forEach(function (entity) {
|
|
var _elementListeners$get;
|
|
var target = entity.target;
|
|
(_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function (listener) {
|
|
return listener(target);
|
|
});
|
|
});
|
|
}
|
|
// Note: ResizeObserver polyfill not support option to measure border-box resize
|
|
var resizeObserver = new ResizeObserver_es/* default */.Z(onResize);
|
|
// Dev env only
|
|
var _el = (/* unused pure expression or super */ null && ( false ? 0 : null)); // eslint-disable-line
|
|
var _rs = (/* unused pure expression or super */ null && ( false ? 0 : null)); // eslint-disable-line
|
|
// ============================== Observe ==============================
|
|
function observe(element, callback) {
|
|
if (!elementListeners.has(element)) {
|
|
elementListeners.set(element, new Set());
|
|
resizeObserver.observe(element);
|
|
}
|
|
elementListeners.get(element).add(callback);
|
|
}
|
|
function unobserve(element, callback) {
|
|
if (elementListeners.has(element)) {
|
|
elementListeners.get(element).delete(callback);
|
|
if (!elementListeners.get(element).size) {
|
|
resizeObserver.unobserve(element);
|
|
elementListeners.delete(element);
|
|
}
|
|
}
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__(15671);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__(43144);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__(60136);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__(51630);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Fallback to findDOMNode if origin ref do not provide any dom element
|
|
*/
|
|
var DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
(0,inherits/* default */.Z)(DomWrapper, _React$Component);
|
|
var _super = (0,createSuper/* default */.Z)(DomWrapper);
|
|
function DomWrapper() {
|
|
(0,classCallCheck/* default */.Z)(this, DomWrapper);
|
|
return _super.apply(this, arguments);
|
|
}
|
|
(0,createClass/* default */.Z)(DomWrapper, [{
|
|
key: "render",
|
|
value: function render() {
|
|
return this.props.children;
|
|
}
|
|
}]);
|
|
return DomWrapper;
|
|
}(react.Component);
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/rc-resize-observer/es/Collection.js
|
|
|
|
var CollectionContext = /*#__PURE__*/react.createContext(null);
|
|
/**
|
|
* Collect all the resize event from children ResizeObserver
|
|
*/
|
|
function Collection(_ref) {
|
|
var children = _ref.children,
|
|
onBatchResize = _ref.onBatchResize;
|
|
var resizeIdRef = react.useRef(0);
|
|
var resizeInfosRef = react.useRef([]);
|
|
var onCollectionResize = react.useContext(CollectionContext);
|
|
var onResize = react.useCallback(function (size, element, data) {
|
|
resizeIdRef.current += 1;
|
|
var currentId = resizeIdRef.current;
|
|
resizeInfosRef.current.push({
|
|
size: size,
|
|
element: element,
|
|
data: data
|
|
});
|
|
Promise.resolve().then(function () {
|
|
if (currentId === resizeIdRef.current) {
|
|
onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
|
|
resizeInfosRef.current = [];
|
|
}
|
|
});
|
|
// Continue bubbling if parent exist
|
|
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
|
|
}, [onBatchResize, onCollectionResize]);
|
|
return /*#__PURE__*/react.createElement(CollectionContext.Provider, {
|
|
value: onResize
|
|
}, children);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-resize-observer/es/SingleObserver/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SingleObserver(props, ref) {
|
|
var children = props.children,
|
|
disabled = props.disabled;
|
|
var elementRef = react.useRef(null);
|
|
var wrapperRef = react.useRef(null);
|
|
var onCollectionResize = react.useContext(CollectionContext);
|
|
// =========================== Children ===========================
|
|
var isRenderProps = typeof children === 'function';
|
|
var mergedChildren = isRenderProps ? children(elementRef) : children;
|
|
// ============================= Size =============================
|
|
var sizeRef = react.useRef({
|
|
width: -1,
|
|
height: -1,
|
|
offsetWidth: -1,
|
|
offsetHeight: -1
|
|
});
|
|
// ============================= Ref ==============================
|
|
var canRef = !isRenderProps && /*#__PURE__*/react.isValidElement(mergedChildren) && (0,es_ref/* supportRef */.Yr)(mergedChildren);
|
|
var originRef = canRef ? mergedChildren.ref : null;
|
|
var mergedRef = react.useMemo(function () {
|
|
return (0,es_ref/* composeRef */.sQ)(originRef, elementRef);
|
|
}, [originRef, elementRef]);
|
|
var getDom = function getDom() {
|
|
return (0,findDOMNode/* default */.Z)(elementRef.current) || (0,findDOMNode/* default */.Z)(wrapperRef.current);
|
|
};
|
|
react.useImperativeHandle(ref, function () {
|
|
return getDom();
|
|
});
|
|
// =========================== Observe ============================
|
|
var propsRef = react.useRef(props);
|
|
propsRef.current = props;
|
|
// Handler
|
|
var onInternalResize = react.useCallback(function (target) {
|
|
var _propsRef$current = propsRef.current,
|
|
onResize = _propsRef$current.onResize,
|
|
data = _propsRef$current.data;
|
|
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
width = _target$getBoundingCl.width,
|
|
height = _target$getBoundingCl.height;
|
|
var offsetWidth = target.offsetWidth,
|
|
offsetHeight = target.offsetHeight;
|
|
/**
|
|
* Resize observer trigger when content size changed.
|
|
* In most case we just care about element size,
|
|
* let's use `boundary` instead of `contentRect` here to avoid shaking.
|
|
*/
|
|
var fixedWidth = Math.floor(width);
|
|
var fixedHeight = Math.floor(height);
|
|
if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
|
|
var size = {
|
|
width: fixedWidth,
|
|
height: fixedHeight,
|
|
offsetWidth: offsetWidth,
|
|
offsetHeight: offsetHeight
|
|
};
|
|
sizeRef.current = size;
|
|
// IE is strange, right?
|
|
var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
|
|
var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
|
|
var sizeInfo = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, size), {}, {
|
|
offsetWidth: mergedOffsetWidth,
|
|
offsetHeight: mergedOffsetHeight
|
|
});
|
|
// Let collection know what happened
|
|
onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
|
|
if (onResize) {
|
|
// defer the callback but not defer to next frame
|
|
Promise.resolve().then(function () {
|
|
onResize(sizeInfo, target);
|
|
});
|
|
}
|
|
}
|
|
}, []);
|
|
// Dynamic observe
|
|
react.useEffect(function () {
|
|
var currentElement = getDom();
|
|
if (currentElement && !disabled) {
|
|
observe(currentElement, onInternalResize);
|
|
}
|
|
return function () {
|
|
return unobserve(currentElement, onInternalResize);
|
|
};
|
|
}, [elementRef.current, disabled]);
|
|
// ============================ Render ============================
|
|
return /*#__PURE__*/react.createElement(DomWrapper, {
|
|
ref: wrapperRef
|
|
}, canRef ? /*#__PURE__*/react.cloneElement(mergedChildren, {
|
|
ref: mergedRef
|
|
}) : mergedChildren);
|
|
}
|
|
var RefSingleObserver = /*#__PURE__*/react.forwardRef(SingleObserver);
|
|
if (false) {}
|
|
/* harmony default export */ var es_SingleObserver = (RefSingleObserver);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-resize-observer/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
|
|
|
|
|
|
function ResizeObserver(props, ref) {
|
|
var children = props.children;
|
|
var childNodes = typeof children === 'function' ? [children] : (0,toArray/* default */.Z)(children);
|
|
if (false) {}
|
|
return childNodes.map(function (child, index) {
|
|
var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
|
|
return /*#__PURE__*/react.createElement(es_SingleObserver, (0,esm_extends/* default */.Z)({}, props, {
|
|
key: key,
|
|
ref: index === 0 ? ref : undefined
|
|
}), child);
|
|
});
|
|
}
|
|
var RefResizeObserver = /*#__PURE__*/react.forwardRef(ResizeObserver);
|
|
if (false) {}
|
|
RefResizeObserver.Collection = Collection;
|
|
/* harmony default export */ var es = (RefResizeObserver);
|
|
|
|
/***/ })
|
|
|
|
}]); |