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.
1436 lines
56 KiB
1436 lines
56 KiB
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[171],{
|
|
|
|
/***/ "+Ja/":
|
|
/*!****************************************!*\
|
|
!*** ./src/pages/MoopCases/index.less ***!
|
|
\****************************************/
|
|
/*! no static exports found */
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
/***/ }),
|
|
|
|
/***/ "55Ip":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/react-router-dom/esm/react-router-dom.js ***!
|
|
\***************************************************************/
|
|
/*! exports provided: MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter, BrowserRouter, HashRouter, Link, NavLink */
|
|
/*! exports used: Link, NavLink */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* unused harmony export BrowserRouter */
|
|
/* unused harmony export HashRouter */
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Link; });
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NavLink; });
|
|
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-router */ "Ty5D");
|
|
/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "dI71");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "cDcd");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! history */ "YS25");
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "17x9");
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "wx14");
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "zLVn");
|
|
/* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tiny-invariant */ "9R94");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The public API for a <Router> that uses HTML5 history.
|
|
*/
|
|
|
|
var BrowserRouter =
|
|
/*#__PURE__*/
|
|
function (_React$Component) {
|
|
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(BrowserRouter, _React$Component);
|
|
|
|
function BrowserRouter() {
|
|
var _this;
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
_this.history = Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createBrowserHistory */ "a"])(_this.props);
|
|
return _this;
|
|
}
|
|
|
|
var _proto = BrowserRouter.prototype;
|
|
|
|
_proto.render = function render() {
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* Router */ "c"], {
|
|
history: this.history,
|
|
children: this.props.children
|
|
});
|
|
};
|
|
|
|
return BrowserRouter;
|
|
}(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component);
|
|
|
|
if (false) {}
|
|
|
|
/**
|
|
* The public API for a <Router> that uses window.location.hash.
|
|
*/
|
|
|
|
var HashRouter =
|
|
/*#__PURE__*/
|
|
function (_React$Component) {
|
|
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(HashRouter, _React$Component);
|
|
|
|
function HashRouter() {
|
|
var _this;
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
_this.history = Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createHashHistory */ "b"])(_this.props);
|
|
return _this;
|
|
}
|
|
|
|
var _proto = HashRouter.prototype;
|
|
|
|
_proto.render = function render() {
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* Router */ "c"], {
|
|
history: this.history,
|
|
children: this.props.children
|
|
});
|
|
};
|
|
|
|
return HashRouter;
|
|
}(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component);
|
|
|
|
if (false) {}
|
|
|
|
var resolveToLocation = function resolveToLocation(to, currentLocation) {
|
|
return typeof to === "function" ? to(currentLocation) : to;
|
|
};
|
|
var normalizeToLocation = function normalizeToLocation(to, currentLocation) {
|
|
return typeof to === "string" ? Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createLocation */ "c"])(to, null, null, currentLocation) : to;
|
|
};
|
|
|
|
var forwardRefShim = function forwardRefShim(C) {
|
|
return C;
|
|
};
|
|
|
|
var forwardRef = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef;
|
|
|
|
if (typeof forwardRef === "undefined") {
|
|
forwardRef = forwardRefShim;
|
|
}
|
|
|
|
function isModifiedEvent(event) {
|
|
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
}
|
|
|
|
var LinkAnchor = forwardRef(function (_ref, forwardedRef) {
|
|
var innerRef = _ref.innerRef,
|
|
navigate = _ref.navigate,
|
|
_onClick = _ref.onClick,
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref, ["innerRef", "navigate", "onClick"]);
|
|
|
|
var target = rest.target;
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, rest, {
|
|
onClick: function onClick(event) {
|
|
try {
|
|
if (_onClick) _onClick(event);
|
|
} catch (ex) {
|
|
event.preventDefault();
|
|
throw ex;
|
|
}
|
|
|
|
if (!event.defaultPrevented && // onClick prevented default
|
|
event.button === 0 && ( // ignore everything but left clicks
|
|
!target || target === "_self") && // let browser handle "target=_blank" etc.
|
|
!isModifiedEvent(event) // ignore clicks with modifier keys
|
|
) {
|
|
event.preventDefault();
|
|
navigate();
|
|
}
|
|
}
|
|
}); // React 15 compat
|
|
|
|
|
|
if (forwardRefShim !== forwardRef) {
|
|
props.ref = forwardedRef || innerRef;
|
|
} else {
|
|
props.ref = innerRef;
|
|
}
|
|
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", props);
|
|
});
|
|
|
|
if (false) {}
|
|
/**
|
|
* The public API for rendering a history-aware <a>.
|
|
*/
|
|
|
|
|
|
var Link = forwardRef(function (_ref2, forwardedRef) {
|
|
var _ref2$component = _ref2.component,
|
|
component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,
|
|
replace = _ref2.replace,
|
|
to = _ref2.to,
|
|
innerRef = _ref2.innerRef,
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref2, ["component", "replace", "to", "innerRef"]);
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* __RouterContext */ "e"].Consumer, null, function (context) {
|
|
!context ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(false) : void 0;
|
|
var history = context.history;
|
|
var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
|
|
var href = location ? history.createHref(location) : "";
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, rest, {
|
|
href: href,
|
|
navigate: function navigate() {
|
|
var location = resolveToLocation(to, context.location);
|
|
var method = replace ? history.replace : history.push;
|
|
method(location);
|
|
}
|
|
}); // React 15 compat
|
|
|
|
|
|
if (forwardRefShim !== forwardRef) {
|
|
props.ref = forwardedRef || innerRef;
|
|
} else {
|
|
props.innerRef = innerRef;
|
|
}
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(component, props);
|
|
});
|
|
});
|
|
|
|
if (false) { var refType, toType; }
|
|
|
|
var forwardRefShim$1 = function forwardRefShim(C) {
|
|
return C;
|
|
};
|
|
|
|
var forwardRef$1 = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef;
|
|
|
|
if (typeof forwardRef$1 === "undefined") {
|
|
forwardRef$1 = forwardRefShim$1;
|
|
}
|
|
|
|
function joinClassnames() {
|
|
for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
classnames[_key] = arguments[_key];
|
|
}
|
|
|
|
return classnames.filter(function (i) {
|
|
return i;
|
|
}).join(" ");
|
|
}
|
|
/**
|
|
* A <Link> wrapper that knows if it's "active" or not.
|
|
*/
|
|
|
|
|
|
var NavLink = forwardRef$1(function (_ref, forwardedRef) {
|
|
var _ref$ariaCurrent = _ref["aria-current"],
|
|
ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
|
|
_ref$activeClassName = _ref.activeClassName,
|
|
activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
|
|
activeStyle = _ref.activeStyle,
|
|
classNameProp = _ref.className,
|
|
exact = _ref.exact,
|
|
isActiveProp = _ref.isActive,
|
|
locationProp = _ref.location,
|
|
sensitive = _ref.sensitive,
|
|
strict = _ref.strict,
|
|
styleProp = _ref.style,
|
|
to = _ref.to,
|
|
innerRef = _ref.innerRef,
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* __RouterContext */ "e"].Consumer, null, function (context) {
|
|
!context ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(false) : void 0;
|
|
var currentLocation = locationProp || context.location;
|
|
var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
|
|
var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
|
|
|
|
var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
var match = escapedPath ? Object(react_router__WEBPACK_IMPORTED_MODULE_0__[/* matchPath */ "f"])(currentLocation.pathname, {
|
|
path: escapedPath,
|
|
exact: exact,
|
|
sensitive: sensitive,
|
|
strict: strict
|
|
}) : null;
|
|
var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);
|
|
var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
|
|
var style = isActive ? Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, styleProp, {}, activeStyle) : styleProp;
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({
|
|
"aria-current": isActive && ariaCurrent || null,
|
|
className: className,
|
|
style: style,
|
|
to: toLocation
|
|
}, rest); // React 15 compat
|
|
|
|
|
|
if (forwardRefShim$1 !== forwardRef$1) {
|
|
props.ref = forwardedRef || innerRef;
|
|
} else {
|
|
props.innerRef = innerRef;
|
|
}
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Link, props);
|
|
});
|
|
});
|
|
|
|
if (false) { var ariaCurrentType; }
|
|
|
|
|
|
//# sourceMappingURL=react-router-dom.js.map
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "9Oz4":
|
|
/*!***************************************!*\
|
|
!*** ./src/pages/MoopCases/index.tsx ***!
|
|
\***************************************/
|
|
/*! exports provided: Types, default */
|
|
/*! all exports used */
|
|
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
|
|
/* harmony import */ var antd_es_pagination_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/pagination/style */ "DjyN");
|
|
/* harmony import */ var antd_es_pagination__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/pagination */ "NUBc");
|
|
/* harmony import */ var antd_es_spin_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/spin/style */ "T2oS");
|
|
/* harmony import */ var antd_es_spin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd/es/spin */ "W9HT");
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8");
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
|
|
/* harmony import */ var antd_es_input_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/input/style */ "5NDa");
|
|
/* harmony import */ var antd_es_input__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/input */ "5rEg");
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS");
|
|
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react */ "cDcd");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_10__);
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/fetch */ "ErOA");
|
|
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./index.less */ "+Ja/");
|
|
/* harmony import */ var _index_less__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_index_less__WEBPACK_IMPORTED_MODULE_12__);
|
|
/* harmony import */ var _label_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./label.css */ "rmrE");
|
|
/* harmony import */ var _label_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_label_css__WEBPACK_IMPORTED_MODULE_13__);
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! umi */ "55Ip");
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! umi */ "9kvl");
|
|
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/utils/env */ "m3rI");
|
|
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/utils/authority */ "xKgJ");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = antd_es_input__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"].Search;
|
|
var initialState = {
|
|
loading: false,
|
|
type: 'all',
|
|
page: 1,
|
|
count: 0,
|
|
list: [],
|
|
keyword: ''
|
|
};
|
|
var Types;
|
|
|
|
(function (Types) {
|
|
Types[Types["GET_LIST"] = 0] = "GET_LIST";
|
|
Types[Types["CHANGE_KEYWORD"] = 1] = "CHANGE_KEYWORD";
|
|
Types[Types["CHANGE_PAGE"] = 2] = "CHANGE_PAGE";
|
|
Types[Types["CHANGE_TYPE"] = 3] = "CHANGE_TYPE";
|
|
Types[Types["SET_LOADING"] = 4] = "SET_LOADING";
|
|
})(Types || (Types = {}));
|
|
|
|
function reducer(state, action) {
|
|
switch (action.type) {
|
|
case Types.GET_LIST:
|
|
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, state), action.payload);
|
|
|
|
case Types.CHANGE_PAGE:
|
|
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, state), {}, {
|
|
page: action.payload
|
|
});
|
|
|
|
case Types.CHANGE_KEYWORD:
|
|
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, state), action.payload);
|
|
|
|
case Types.CHANGE_TYPE:
|
|
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, state), action.payload);
|
|
|
|
case Types.SET_LOADING:
|
|
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])({}, state), {}, {
|
|
loading: action.payload
|
|
});
|
|
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
|
|
var MoopCases = function MoopCases(_ref) {
|
|
var _globalSetting$settin;
|
|
|
|
var user = _ref.user,
|
|
globalSetting = _ref.globalSetting,
|
|
dispatch = _ref.dispatch;
|
|
|
|
// const MoopCases = () => {
|
|
var _useReducer = Object(react__WEBPACK_IMPORTED_MODULE_10__["useReducer"])(reducer, initialState),
|
|
_useReducer2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(_useReducer, 2),
|
|
state = _useReducer2[0],
|
|
setState = _useReducer2[1];
|
|
|
|
var loading = state.loading,
|
|
page = state.page,
|
|
list = state.list,
|
|
keyword = state.keyword,
|
|
type = state.type,
|
|
count = state.count; //出现页面右侧悬浮按钮
|
|
|
|
Object(react__WEBPACK_IMPORTED_MODULE_10__["useEffect"])(function () {
|
|
dispatch({
|
|
type: 'globalSetting/onlyShowBackTopToggle',
|
|
payload: false
|
|
});
|
|
return function () {
|
|
dispatch({
|
|
type: 'globalSetting/onlyShowBackTopToggle',
|
|
payload: true
|
|
});
|
|
};
|
|
}, []);
|
|
Object(react__WEBPACK_IMPORTED_MODULE_10__["useEffect"])(function () {
|
|
var didCancel = false;
|
|
|
|
function init() {
|
|
return _init.apply(this, arguments);
|
|
}
|
|
|
|
function _init() {
|
|
_init = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9___default.a.mark(function _callee() {
|
|
var response, libraries, count;
|
|
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9___default.a.wrap(function _callee$(_context) {
|
|
while (1) {
|
|
switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setState({
|
|
type: Types.SET_LOADING,
|
|
payload: true
|
|
});
|
|
_context.next = 3;
|
|
return Object(_utils_fetch__WEBPACK_IMPORTED_MODULE_11__[/* get */ "c"])("libraries.json", {
|
|
keyword: keyword,
|
|
page: page,
|
|
type: type
|
|
});
|
|
|
|
case 3:
|
|
response = _context.sent;
|
|
libraries = response.libraries, count = response.count;
|
|
|
|
if (!didCancel) {
|
|
setState({
|
|
type: Types.GET_LIST,
|
|
payload: {
|
|
count: count,
|
|
list: libraries,
|
|
loading: false
|
|
}
|
|
});
|
|
}
|
|
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return _init.apply(this, arguments);
|
|
}
|
|
|
|
if (!didCancel) {
|
|
init();
|
|
}
|
|
|
|
return function () {
|
|
didCancel = true;
|
|
};
|
|
}, [page, keyword, type]);
|
|
|
|
function onSetKeyword(value) {
|
|
setState({
|
|
type: Types.CHANGE_KEYWORD,
|
|
payload: {
|
|
keyword: value,
|
|
page: 1
|
|
}
|
|
});
|
|
}
|
|
|
|
function onChangeType(e) {
|
|
setState({
|
|
type: Types.CHANGE_TYPE,
|
|
payload: {
|
|
type: e.target.id,
|
|
page: 1
|
|
}
|
|
});
|
|
}
|
|
|
|
function onPageChange(value) {
|
|
document.body.scrollIntoView();
|
|
setState({
|
|
type: Types.CHANGE_PAGE,
|
|
payload: value
|
|
});
|
|
}
|
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "moop-case"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("section", {
|
|
className: "banner"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("img", {
|
|
src: _utils_env__WEBPACK_IMPORTED_MODULE_16__[/* default */ "a"].IMG_SERVER + '/' + (globalSetting === null || globalSetting === void 0 ? void 0 : (_globalSetting$settin = globalSetting.setting) === null || _globalSetting$settin === void 0 ? void 0 : _globalSetting$settin.moop_cases_banner_url),
|
|
alt: "bg"
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("section", {
|
|
className: "moop-main"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "moop-title"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", null, "\u6559\u5B66\u6848\u4F8B"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(umi__WEBPACK_IMPORTED_MODULE_14__[/* Link */ "a"], {
|
|
to: "/moop_cases/new",
|
|
className: "btn-ghost"
|
|
}, "\u53D1\u5E03\u6848\u4F8B")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "search-input-container"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "flex-container"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("a", {
|
|
id: "all",
|
|
onClick: onChangeType,
|
|
className: type === 'all' ? 'active' : ''
|
|
}, "\u5168\u90E8"), Object(_utils_authority__WEBPACK_IMPORTED_MODULE_17__[/* isLogin */ "p"])() ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("a", {
|
|
id: "mine",
|
|
onClick: onChangeType,
|
|
className: type === 'mine' ? 'active' : ''
|
|
}, "\u6211\u7684") : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(Search, {
|
|
className: "moop-search",
|
|
defaultValue: keyword,
|
|
placeholder: "\u8F93\u5165\u6559\u5B66\u6848\u4F8B\u6807\u9898\u3001\u4F5C\u8005\u3001\u5355\u4F4D\u8FDB\u884C\u68C0\u7D22",
|
|
onSearch: onSetKeyword
|
|
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(antd_es_spin__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], {
|
|
spinning: loading,
|
|
delay: 500
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(CaseList, {
|
|
data: list
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "search-footer"
|
|
}, count > 20 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(antd_es_pagination__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], {
|
|
showQuickJumper: true,
|
|
current: page,
|
|
onChange: onPageChange,
|
|
pageSize: 20,
|
|
showSizeChanger: false,
|
|
total: count
|
|
}) : null));
|
|
};
|
|
|
|
function CaseList(_ref2) {
|
|
var data = _ref2.data;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("ul", {
|
|
className: "case-list"
|
|
}, data.map(function (item) {
|
|
var _item$tags;
|
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("li", {
|
|
key: item.id
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("a", {
|
|
href: "/moop_cases/".concat(item.id),
|
|
target: "_blank"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("img", {
|
|
src: "".concat(_utils_env__WEBPACK_IMPORTED_MODULE_16__[/* default */ "a"].IMG_SERVER).concat(item.cover_url),
|
|
width: 120,
|
|
alt: item.title
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "info"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("h2", null, item.title, (_item$tags = item.tags) === null || _item$tags === void 0 ? void 0 : _item$tags.map(function (tag, index) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", {
|
|
className: 'label-' + index,
|
|
key: tag.id
|
|
}, tag.name);
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "detail"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "flex-container"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", null, "".concat(item.author_name, " ").concat(item.author_school_name))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("div", {
|
|
className: "sum"
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", null, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("i", {
|
|
className: "fa fa-eye"
|
|
}), " ", item.visited_count, " \u6D4F\u89C8 "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", null, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("i", {
|
|
className: "fa fa-thumbs-o-up"
|
|
}), " ", item.praise_count, " \u8D5E "), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("span", null, " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement("i", {
|
|
className: "fa fa-download"
|
|
}), " ", item.download_count, " \u4E0B\u8F7D "))))));
|
|
}));
|
|
}
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(umi__WEBPACK_IMPORTED_MODULE_15__[/* connect */ "a"])(function (_ref3) {
|
|
var user = _ref3.user,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
user: user,
|
|
globalSetting: globalSetting
|
|
};
|
|
})(MoopCases));
|
|
|
|
/***/ }),
|
|
|
|
/***/ "Gytx":
|
|
/*!********************************************!*\
|
|
!*** ./node_modules/shallowequal/index.js ***!
|
|
\********************************************/
|
|
/*! no static exports found */
|
|
/*! exports used: default */
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
/***/ (function(module, exports) {
|
|
|
|
//
|
|
|
|
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
|
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
|
|
if (ret !== void 0) {
|
|
return !!ret;
|
|
}
|
|
|
|
if (objA === objB) {
|
|
return true;
|
|
}
|
|
|
|
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
|
return false;
|
|
}
|
|
|
|
var keysA = Object.keys(objA);
|
|
var keysB = Object.keys(objB);
|
|
|
|
if (keysA.length !== keysB.length) {
|
|
return false;
|
|
}
|
|
|
|
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
|
|
// Test for A's keys different from B.
|
|
for (var idx = 0; idx < keysA.length; idx++) {
|
|
var key = keysA[idx];
|
|
|
|
if (!bHasOwnProperty(key)) {
|
|
return false;
|
|
}
|
|
|
|
var valueA = objA[key];
|
|
var valueB = objB[key];
|
|
|
|
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
|
|
if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "Y1PL":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
|
|
\**********************************************************/
|
|
/*! exports provided: ResizableTextArea, default */
|
|
/*! all exports used */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, "ResizableTextArea", function() { return /* reexport */ es_ResizableTextArea; });
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__("wx14");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
|
var classCallCheck = __webpack_require__("1OyB");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
|
var createClass = __webpack_require__("vuIU");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
|
var inherits = __webpack_require__("Ji7U");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js + 1 modules
|
|
var createSuper = __webpack_require__("LK+K");
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__("VTBJ");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__("rePB");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__("Zm9Q");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
var warning = __webpack_require__("Kwbf");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
|
|
var ref = __webpack_require__("c+Xe");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
|
|
var findDOMNode = __webpack_require__("m+aA");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
|
|
var ResizeObserver_es = __webpack_require__("bdgK");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/utils/observerUtil.js
|
|
// =============================== Const ===============================
|
|
|
|
var elementListeners = new Map();
|
|
|
|
function observerUtil_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"](observerUtil_onResize); // Dev env only
|
|
|
|
var _el = false ? undefined : null; // eslint-disable-line
|
|
|
|
var _rs = false ? undefined : 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);
|
|
}
|
|
}
|
|
}
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Fallback to findDOMNode if origin ref do not provide any dom element
|
|
*/
|
|
|
|
var DomWrapper_DomWrapper = /*#__PURE__*/function (_React$Component) {
|
|
Object(inherits["a" /* default */])(DomWrapper, _React$Component);
|
|
|
|
var _super = Object(createSuper["a" /* default */])(DomWrapper);
|
|
|
|
function DomWrapper() {
|
|
Object(classCallCheck["a" /* default */])(this, DomWrapper);
|
|
|
|
return _super.apply(this, arguments);
|
|
}
|
|
|
|
Object(createClass["a" /* default */])(DomWrapper, [{
|
|
key: "render",
|
|
value: function render() {
|
|
return this.props.children;
|
|
}
|
|
}]);
|
|
|
|
return DomWrapper;
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/Collection.js
|
|
|
|
var CollectionContext = /*#__PURE__*/external_window_React_["createContext"](null);
|
|
/**
|
|
* Collect all the resize event from children ResizeObserver
|
|
*/
|
|
|
|
function Collection(_ref) {
|
|
var children = _ref.children,
|
|
onBatchResize = _ref.onBatchResize;
|
|
var resizeIdRef = external_window_React_["useRef"](0);
|
|
var resizeInfosRef = external_window_React_["useRef"]([]);
|
|
var onCollectionResize = external_window_React_["useContext"](CollectionContext);
|
|
var onResize = external_window_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__*/external_window_React_["createElement"](CollectionContext.Provider, {
|
|
value: onResize
|
|
}, children);
|
|
}
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/SingleObserver/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SingleObserver(props) {
|
|
var children = props.children,
|
|
disabled = props.disabled;
|
|
var elementRef = external_window_React_["useRef"](null);
|
|
var wrapperRef = external_window_React_["useRef"](null);
|
|
var onCollectionResize = external_window_React_["useContext"](CollectionContext); // ============================= Size =============================
|
|
|
|
var sizeRef = external_window_React_["useRef"]({
|
|
width: -1,
|
|
height: -1,
|
|
offsetWidth: -1,
|
|
offsetHeight: -1
|
|
}); // ============================= Ref ==============================
|
|
|
|
var canRef = /*#__PURE__*/external_window_React_["isValidElement"](children) && Object(ref["c" /* supportRef */])(children);
|
|
var originRef = canRef ? children.ref : null;
|
|
var mergedRef = external_window_React_["useMemo"](function () {
|
|
return Object(ref["a" /* composeRef */])(originRef, elementRef);
|
|
}, [originRef, elementRef]); // =========================== Observe ============================
|
|
|
|
var propsRef = external_window_React_["useRef"](props);
|
|
propsRef.current = props; // Handler
|
|
|
|
var onInternalResize = external_window_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 = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, 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
|
|
|
|
external_window_React_["useEffect"](function () {
|
|
var currentElement = Object(findDOMNode["a" /* default */])(elementRef.current) || Object(findDOMNode["a" /* default */])(wrapperRef.current);
|
|
|
|
if (currentElement && !disabled) {
|
|
observe(currentElement, onInternalResize);
|
|
}
|
|
|
|
return function () {
|
|
return unobserve(currentElement, onInternalResize);
|
|
};
|
|
}, [elementRef.current, disabled]); // ============================ Render ============================
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](DomWrapper_DomWrapper, {
|
|
ref: wrapperRef
|
|
}, canRef ? /*#__PURE__*/external_window_React_["cloneElement"](children, {
|
|
ref: mergedRef
|
|
}) : children);
|
|
}
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/node_modules/rc-resize-observer/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var INTERNAL_PREFIX_KEY = 'rc-observer-key';
|
|
|
|
function ResizeObserver(props) {
|
|
var children = props.children;
|
|
var childNodes = Object(toArray["a" /* default */])(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__*/external_window_React_["createElement"](SingleObserver, Object(esm_extends["a" /* default */])({}, props, {
|
|
key: key
|
|
}), child);
|
|
});
|
|
}
|
|
|
|
ResizeObserver.Collection = Collection;
|
|
/* harmony default export */ var es = (ResizeObserver);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__("bT9E");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__("TSYQ");
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/calculateNodeHeight.js
|
|
// Thanks to https://github.com/andreypopp/react-textarea-autosize/
|
|
|
|
/**
|
|
* calculateNodeHeight(uiTextNode, useCache = false)
|
|
*/
|
|
var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n";
|
|
var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break'];
|
|
var computedStyleCache = {};
|
|
var hiddenTextarea;
|
|
function calculateNodeStyling(node) {
|
|
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
|
|
|
|
if (useCache && computedStyleCache[nodeRef]) {
|
|
return computedStyleCache[nodeRef];
|
|
}
|
|
|
|
var style = window.getComputedStyle(node);
|
|
var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
|
|
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
|
|
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
|
|
var sizingStyle = SIZING_STYLE.map(function (name) {
|
|
return "".concat(name, ":").concat(style.getPropertyValue(name));
|
|
}).join(';');
|
|
var nodeInfo = {
|
|
sizingStyle: sizingStyle,
|
|
paddingSize: paddingSize,
|
|
borderSize: borderSize,
|
|
boxSizing: boxSizing
|
|
};
|
|
|
|
if (useCache && nodeRef) {
|
|
computedStyleCache[nodeRef] = nodeInfo;
|
|
}
|
|
|
|
return nodeInfo;
|
|
}
|
|
function calculateNodeHeight(uiTextNode) {
|
|
var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
|
|
if (!hiddenTextarea) {
|
|
hiddenTextarea = document.createElement('textarea');
|
|
hiddenTextarea.setAttribute('tab-index', '-1');
|
|
hiddenTextarea.setAttribute('aria-hidden', 'true');
|
|
document.body.appendChild(hiddenTextarea);
|
|
} // Fix wrap="off" issue
|
|
// https://github.com/ant-design/ant-design/issues/6577
|
|
|
|
|
|
if (uiTextNode.getAttribute('wrap')) {
|
|
hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
|
|
} else {
|
|
hiddenTextarea.removeAttribute('wrap');
|
|
} // Copy all CSS properties that have an impact on the height of the content in
|
|
// the textbox
|
|
|
|
|
|
var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
|
|
paddingSize = _calculateNodeStyling.paddingSize,
|
|
borderSize = _calculateNodeStyling.borderSize,
|
|
boxSizing = _calculateNodeStyling.boxSizing,
|
|
sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise
|
|
// text-lines will not calculated properly as the shadow will technically be
|
|
// narrower for content
|
|
|
|
|
|
hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
|
|
hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
|
|
var minHeight = Number.MIN_SAFE_INTEGER;
|
|
var maxHeight = Number.MAX_SAFE_INTEGER;
|
|
var height = hiddenTextarea.scrollHeight;
|
|
var overflowY;
|
|
|
|
if (boxSizing === 'border-box') {
|
|
// border-box: add border, since height = content + padding + border
|
|
height += borderSize;
|
|
} else if (boxSizing === 'content-box') {
|
|
// remove padding, since height = content
|
|
height -= paddingSize;
|
|
}
|
|
|
|
if (minRows !== null || maxRows !== null) {
|
|
// measure height of a textarea with a single row
|
|
hiddenTextarea.value = ' ';
|
|
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
|
|
if (minRows !== null) {
|
|
minHeight = singleRowHeight * minRows;
|
|
|
|
if (boxSizing === 'border-box') {
|
|
minHeight = minHeight + paddingSize + borderSize;
|
|
}
|
|
|
|
height = Math.max(minHeight, height);
|
|
}
|
|
|
|
if (maxRows !== null) {
|
|
maxHeight = singleRowHeight * maxRows;
|
|
|
|
if (boxSizing === 'border-box') {
|
|
maxHeight = maxHeight + paddingSize + borderSize;
|
|
}
|
|
|
|
overflowY = height > maxHeight ? '' : 'hidden';
|
|
height = Math.min(maxHeight, height);
|
|
}
|
|
}
|
|
|
|
return {
|
|
height: height,
|
|
minHeight: minHeight,
|
|
maxHeight: maxHeight,
|
|
overflowY: overflowY,
|
|
resize: 'none'
|
|
};
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
|
|
var shallowequal = __webpack_require__("Gytx");
|
|
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
|
|
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/ResizableTextArea.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
var RESIZE_STATUS;
|
|
|
|
(function (RESIZE_STATUS) {
|
|
RESIZE_STATUS[RESIZE_STATUS["NONE"] = 0] = "NONE";
|
|
RESIZE_STATUS[RESIZE_STATUS["RESIZING"] = 1] = "RESIZING";
|
|
RESIZE_STATUS[RESIZE_STATUS["RESIZED"] = 2] = "RESIZED";
|
|
})(RESIZE_STATUS || (RESIZE_STATUS = {}));
|
|
|
|
var ResizableTextArea_ResizableTextArea = /*#__PURE__*/function (_React$Component) {
|
|
Object(inherits["a" /* default */])(ResizableTextArea, _React$Component);
|
|
|
|
var _super = Object(createSuper["a" /* default */])(ResizableTextArea);
|
|
|
|
function ResizableTextArea(props) {
|
|
var _this;
|
|
|
|
Object(classCallCheck["a" /* default */])(this, ResizableTextArea);
|
|
|
|
_this = _super.call(this, props);
|
|
_this.nextFrameActionId = void 0;
|
|
_this.resizeFrameId = void 0;
|
|
_this.textArea = void 0;
|
|
|
|
_this.saveTextArea = function (textArea) {
|
|
_this.textArea = textArea;
|
|
};
|
|
|
|
_this.handleResize = function (size) {
|
|
var resizeStatus = _this.state.resizeStatus;
|
|
var _this$props = _this.props,
|
|
autoSize = _this$props.autoSize,
|
|
onResize = _this$props.onResize;
|
|
|
|
if (resizeStatus !== RESIZE_STATUS.NONE) {
|
|
return;
|
|
}
|
|
|
|
if (typeof onResize === 'function') {
|
|
onResize(size);
|
|
}
|
|
|
|
if (autoSize) {
|
|
_this.resizeOnNextFrame();
|
|
}
|
|
};
|
|
|
|
_this.resizeOnNextFrame = function () {
|
|
cancelAnimationFrame(_this.nextFrameActionId);
|
|
_this.nextFrameActionId = requestAnimationFrame(_this.resizeTextarea);
|
|
};
|
|
|
|
_this.resizeTextarea = function () {
|
|
var autoSize = _this.props.autoSize;
|
|
|
|
if (!autoSize || !_this.textArea) {
|
|
return;
|
|
}
|
|
|
|
var minRows = autoSize.minRows,
|
|
maxRows = autoSize.maxRows;
|
|
var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows);
|
|
|
|
_this.setState({
|
|
textareaStyles: textareaStyles,
|
|
resizeStatus: RESIZE_STATUS.RESIZING
|
|
}, function () {
|
|
cancelAnimationFrame(_this.resizeFrameId);
|
|
_this.resizeFrameId = requestAnimationFrame(function () {
|
|
_this.setState({
|
|
resizeStatus: RESIZE_STATUS.RESIZED
|
|
}, function () {
|
|
_this.resizeFrameId = requestAnimationFrame(function () {
|
|
_this.setState({
|
|
resizeStatus: RESIZE_STATUS.NONE
|
|
});
|
|
|
|
_this.fixFirefoxAutoScroll();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
|
|
_this.renderTextArea = function () {
|
|
var _this$props2 = _this.props,
|
|
_this$props2$prefixCl = _this$props2.prefixCls,
|
|
prefixCls = _this$props2$prefixCl === void 0 ? 'rc-textarea' : _this$props2$prefixCl,
|
|
autoSize = _this$props2.autoSize,
|
|
onResize = _this$props2.onResize,
|
|
className = _this$props2.className,
|
|
disabled = _this$props2.disabled;
|
|
var _this$state = _this.state,
|
|
textareaStyles = _this$state.textareaStyles,
|
|
resizeStatus = _this$state.resizeStatus;
|
|
var otherProps = Object(omit["a" /* default */])(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'defaultValue', 'onResize']);
|
|
var cls = classnames_default()(prefixCls, className, Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-disabled"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776
|
|
// Make sure it could be reset when using form.getFieldDecorator
|
|
|
|
if ('value' in otherProps) {
|
|
otherProps.value = otherProps.value || '';
|
|
}
|
|
|
|
var style = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this.props.style), textareaStyles), resizeStatus === RESIZE_STATUS.RESIZING ? // React will warning when mix `overflow` & `overflowY`.
|
|
// We need to define this separately.
|
|
{
|
|
overflowX: 'hidden',
|
|
overflowY: 'hidden'
|
|
} : null);
|
|
|
|
return /*#__PURE__*/external_window_React_["createElement"](es, {
|
|
onResize: _this.handleResize,
|
|
disabled: !(autoSize || onResize)
|
|
}, /*#__PURE__*/external_window_React_["createElement"]("textarea", Object(esm_extends["a" /* default */])({}, otherProps, {
|
|
className: cls,
|
|
style: style,
|
|
ref: _this.saveTextArea
|
|
})));
|
|
};
|
|
|
|
_this.state = {
|
|
textareaStyles: {},
|
|
resizeStatus: RESIZE_STATUS.NONE
|
|
};
|
|
return _this;
|
|
}
|
|
|
|
Object(createClass["a" /* default */])(ResizableTextArea, [{
|
|
key: "componentDidUpdate",
|
|
value: function componentDidUpdate(prevProps) {
|
|
// Re-render with the new content or new autoSize property then recalculate the height as required.
|
|
if (prevProps.value !== this.props.value || !shallowequal_default()(prevProps.autoSize, this.props.autoSize)) {
|
|
this.resizeTextarea();
|
|
}
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
cancelAnimationFrame(this.nextFrameActionId);
|
|
cancelAnimationFrame(this.resizeFrameId);
|
|
} // https://github.com/ant-design/ant-design/issues/21870
|
|
|
|
}, {
|
|
key: "fixFirefoxAutoScroll",
|
|
value: function fixFirefoxAutoScroll() {
|
|
try {
|
|
if (document.activeElement === this.textArea) {
|
|
var currentStart = this.textArea.selectionStart;
|
|
var currentEnd = this.textArea.selectionEnd;
|
|
this.textArea.setSelectionRange(currentStart, currentEnd);
|
|
}
|
|
} catch (e) {// Fix error in Chrome:
|
|
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
|
|
// http://stackoverflow.com/q/21177489/3040605
|
|
}
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
return this.renderTextArea();
|
|
}
|
|
}]);
|
|
|
|
return ResizableTextArea;
|
|
}(external_window_React_["Component"]);
|
|
|
|
/* harmony default export */ var es_ResizableTextArea = (ResizableTextArea_ResizableTextArea);
|
|
// CONCATENATED MODULE: ./node_modules/rc-textarea/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var es_TextArea = /*#__PURE__*/function (_React$Component) {
|
|
Object(inherits["a" /* default */])(TextArea, _React$Component);
|
|
|
|
var _super = Object(createSuper["a" /* default */])(TextArea);
|
|
|
|
function TextArea(props) {
|
|
var _this;
|
|
|
|
Object(classCallCheck["a" /* default */])(this, TextArea);
|
|
|
|
_this = _super.call(this, props);
|
|
_this.resizableTextArea = void 0;
|
|
|
|
_this.focus = function () {
|
|
_this.resizableTextArea.textArea.focus();
|
|
};
|
|
|
|
_this.saveTextArea = function (resizableTextArea) {
|
|
_this.resizableTextArea = resizableTextArea;
|
|
};
|
|
|
|
_this.handleChange = function (e) {
|
|
var onChange = _this.props.onChange;
|
|
|
|
_this.setValue(e.target.value, function () {
|
|
_this.resizableTextArea.resizeTextarea();
|
|
});
|
|
|
|
if (onChange) {
|
|
onChange(e);
|
|
}
|
|
};
|
|
|
|
_this.handleKeyDown = function (e) {
|
|
var _this$props = _this.props,
|
|
onPressEnter = _this$props.onPressEnter,
|
|
onKeyDown = _this$props.onKeyDown;
|
|
|
|
if (e.keyCode === 13 && onPressEnter) {
|
|
onPressEnter(e);
|
|
}
|
|
|
|
if (onKeyDown) {
|
|
onKeyDown(e);
|
|
}
|
|
};
|
|
|
|
var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;
|
|
_this.state = {
|
|
value: value
|
|
};
|
|
return _this;
|
|
}
|
|
|
|
Object(createClass["a" /* default */])(TextArea, [{
|
|
key: "setValue",
|
|
value: function setValue(value, callback) {
|
|
if (!('value' in this.props)) {
|
|
this.setState({
|
|
value: value
|
|
}, callback);
|
|
}
|
|
}
|
|
}, {
|
|
key: "blur",
|
|
value: function blur() {
|
|
this.resizableTextArea.textArea.blur();
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render() {
|
|
return /*#__PURE__*/external_window_React_["createElement"](es_ResizableTextArea, Object(esm_extends["a" /* default */])({}, this.props, {
|
|
value: this.state.value,
|
|
onKeyDown: this.handleKeyDown,
|
|
onChange: this.handleChange,
|
|
ref: this.saveTextArea
|
|
}));
|
|
}
|
|
}], [{
|
|
key: "getDerivedStateFromProps",
|
|
value: function getDerivedStateFromProps(nextProps) {
|
|
if ('value' in nextProps) {
|
|
return {
|
|
value: nextProps.value
|
|
};
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}]);
|
|
|
|
return TextArea;
|
|
}(external_window_React_["Component"]);
|
|
|
|
|
|
/* harmony default export */ var rc_textarea_es = __webpack_exports__["default"] = (es_TextArea);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "bT9E":
|
|
/*!*****************************************!*\
|
|
!*** ./node_modules/rc-util/es/omit.js ***!
|
|
\*****************************************/
|
|
/*! exports provided: default */
|
|
/*! exports used: default */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return omit; });
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "VTBJ");
|
|
|
|
function omit(obj, fields) {
|
|
var clone = Object(_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, obj);
|
|
|
|
if (Array.isArray(fields)) {
|
|
fields.forEach(function (key) {
|
|
delete clone[key];
|
|
});
|
|
}
|
|
|
|
return clone;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "rmrE":
|
|
/*!***************************************!*\
|
|
!*** ./src/pages/MoopCases/label.css ***!
|
|
\***************************************/
|
|
/*! no static exports found */
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
/***/ })
|
|
|
|
}]); |