|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[70928],{
|
|
|
|
|
|
/***/ 70531:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/pages/RestFul/Edit/index.tsx ***!
|
|
|
\******************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/defineProperty.js */ 85573);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js */ 39647);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! umi */ 58011);
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/fetch */ 56648);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78241);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 8591);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 95237);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 43604);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 62680);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 57809);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 3113);
|
|
|
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/authority */ 77971);
|
|
|
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/markdown-editor */ 64681);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["user", "globalSetting", "loading", "dispatch", "restful"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UserPage = function UserPage(_ref) {
|
|
|
var _restful$restfulDetai3, _restful$restful2;
|
|
|
var user = _ref.user,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
restful = _ref.restful,
|
|
|
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default()(_ref, _excluded);
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)({
|
|
|
content: "",
|
|
|
message: "",
|
|
|
status: 0,
|
|
|
contacts: [],
|
|
|
address: "",
|
|
|
data: []
|
|
|
}),
|
|
|
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(true),
|
|
|
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
|
|
|
isLoading = _useState4[0],
|
|
|
setIsLoading = _useState4[1];
|
|
|
var params = props.match.params;
|
|
|
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.useForm(),
|
|
|
_Form$useForm2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)("\n\n \n##### 简要描述\n\n- 用户注册接口\n\n##### 请求URL\n- ` http://xx.com/api/user/register `\n \n##### 请求方式\n- POST \n\n##### 参数\n\n|参数名|必选|类型|说明|\n|:---- |:---|:----- |----- |\n|username |是 |string |用户名 |\n|password |是 |string | 密码 |\n|name |否 |string | 昵称 |\n\n##### 返回示例 \n\n``` \n {\n \"error_code\": 0,\n \"data\": {\n \"uid\": \"1\",\n \"username\": \"12154545\",\n \"name\": \"吴系挂\",\n \"groupid\": 2 ,\n \"reg_time\": \"1436864169\",\n \"last_login_time\": \"0\",\n }\n }\n```\n\n##### 返回参数说明 \n\n|参数名|类型|说明|\n|:----- |:-----|----- |\n|groupid |int |用户组id,1:超级管理员;2:普通用户 |\n\n##### 备注 \n\n- 更多返回错误代码请看首页的错误代码描述\n\n\n\n欢迎使用!"),
|
|
|
_useState6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState5, 2),
|
|
|
defaultValue = _useState6[0],
|
|
|
setDefaultValue = _useState6[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {
|
|
|
form.resetFields();
|
|
|
}, [params.id]);
|
|
|
var onFinish = /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee(e) {
|
|
|
var values, fetchUrl, res;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return form.getFieldsValue();
|
|
|
case 2:
|
|
|
values = _context.sent;
|
|
|
fetchUrl = "/api/restfuls.json";
|
|
|
if (params.id != 0) {
|
|
|
fetchUrl = "/api/restfuls/".concat(params.id, ".json");
|
|
|
}
|
|
|
_context.next = 7;
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP)(fetchUrl, {
|
|
|
method: params.id != 0 ? "put" : 'post',
|
|
|
body: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({
|
|
|
file_type: 0
|
|
|
}, values), {}, {
|
|
|
parent_id: values.parent_id || ""
|
|
|
})
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP.success('添加成功');
|
|
|
props.history.push("/ch/rest/".concat(res.data.id));
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onFinish(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref3 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark(function _callee2() {
|
|
|
var res;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return dispatch({
|
|
|
type: "restful/getRestful"
|
|
|
});
|
|
|
case 2:
|
|
|
if (!(params.id != 0)) {
|
|
|
_context2.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 5;
|
|
|
return dispatch({
|
|
|
type: "restful/getRestfulDetail",
|
|
|
payload: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, params)
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context2.sent;
|
|
|
form.setFieldsValue({
|
|
|
description: res === null || res === void 0 ? void 0 : res.description,
|
|
|
name: res === null || res === void 0 ? void 0 : res.name
|
|
|
});
|
|
|
if (!(0,_utils_authority__WEBPACK_IMPORTED_MODULE_9__/* .isCommonSuperAdminOrOperation */ .ag)()) {
|
|
|
props.history.replace("/403");
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {
|
|
|
var _restful$restful, _restful$restfulDetai;
|
|
|
if ((_restful$restful = restful.restful) !== null && _restful$restful !== void 0 && _restful$restful.data) {
|
|
|
form.setFieldsValue({
|
|
|
parent_id: params.categoryId * 1
|
|
|
});
|
|
|
}
|
|
|
if ((_restful$restfulDetai = restful.restfulDetail) !== null && _restful$restfulDetai !== void 0 && _restful$restfulDetai.description && params.id != 0) {
|
|
|
var _restful$restfulDetai2;
|
|
|
setDefaultValue((_restful$restfulDetai2 = restful.restfulDetail) === null || _restful$restfulDetai2 === void 0 ? void 0 : _restful$restfulDetai2.description);
|
|
|
}
|
|
|
}, [restful.restful, (_restful$restfulDetai3 = restful.restfulDetail) === null || _restful$restfulDetai3 === void 0 ? void 0 : _restful$restfulDetai3.description]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_6__.useEffect)(function () {
|
|
|
setIsLoading(true);
|
|
|
getData();
|
|
|
}, [params.id]);
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("section", {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("aside", {
|
|
|
className: "edu-container mt30",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
|
|
|
onFinish: onFinish,
|
|
|
form: form,
|
|
|
initialValues: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_defineProperty_js__WEBPACK_IMPORTED_MODULE_0___default()({}, 'name', ""),
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
|
className: "mt30",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
flex: "80px",
|
|
|
className: "font14",
|
|
|
children: "\u76EE\u5F55\u540D\u79F0\uFF1A"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
|
name: "name",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入目录名称"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",
|
|
|
maxLength: 60
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
|
className: "",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
flex: "80px",
|
|
|
className: "font14",
|
|
|
children: "\u6240\u5C5E\u76EE\u5F55:"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
|
name: "parent_id",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "所属目录"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_17__["default"], {
|
|
|
showSearch: true,
|
|
|
style: {
|
|
|
width: 200
|
|
|
},
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u76EE\u5F55",
|
|
|
optionFilterProp: "children",
|
|
|
filterOption: function filterOption(input, option) {
|
|
|
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
|
|
|
value: 0,
|
|
|
children: "\u6839\u76EE\u5F55"
|
|
|
}, 9999), restful === null || restful === void 0 || (_restful$restful2 = restful.restful) === null || _restful$restful2 === void 0 || (_restful$restful2 = _restful$restful2.data) === null || _restful$restful2 === void 0 ? void 0 : _restful$restful2.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__["default"].Option, {
|
|
|
value: item.id,
|
|
|
children: item.title
|
|
|
}, key);
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.Item, {
|
|
|
name: "description",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入目录名称"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
|
|
|
defaultValue: defaultValue,
|
|
|
watch: true,
|
|
|
height: 600
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
|
align: "middle",
|
|
|
justify: "center",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .ZP, {
|
|
|
style: {
|
|
|
width: 130
|
|
|
},
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u4FDD\u5B58"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
|
|
|
className: "mt40"
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((0,umi__WEBPACK_IMPORTED_MODULE_7__.connect)(function (_ref5) {
|
|
|
var user = _ref5.user,
|
|
|
loading = _ref5.loading,
|
|
|
globalSetting = _ref5.globalSetting,
|
|
|
restful = _ref5.restful;
|
|
|
return {
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
restful: restful,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(UserPage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 57809:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/select/index.js ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* 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_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-select */ 77861);
|
|
|
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rc-util/es/omit */ 62805);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../_util/PurePanel */ 53487);
|
|
|
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../_util/motion */ 62892);
|
|
|
/* harmony import */ var _util_statusUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../_util/statusUtils */ 19080);
|
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
|
/* harmony import */ var _config_provider_DisabledContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../config-provider/DisabledContext */ 1684);
|
|
|
/* harmony import */ var _config_provider_defaultRenderEmpty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider/defaultRenderEmpty */ 93891);
|
|
|
/* harmony import */ var _config_provider_hooks_useSize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../config-provider/hooks/useSize */ 19716);
|
|
|
/* harmony import */ var _form_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../form/context */ 32441);
|
|
|
/* harmony import */ var _space_Compact__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../space/Compact */ 33234);
|
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 14154);
|
|
|
/* harmony import */ var _useBuiltinPlacements__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./useBuiltinPlacements */ 58582);
|
|
|
/* harmony import */ var _useShowArrow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./useShowArrow */ 84443);
|
|
|
/* harmony import */ var _utils_iconUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/iconUtil */ 66339);
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
|
const InternalSelect = (_a, ref) => {
|
|
|
var _b;
|
|
|
var {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
bordered = true,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
getPopupContainer,
|
|
|
popupClassName,
|
|
|
dropdownClassName,
|
|
|
listHeight = 256,
|
|
|
placement,
|
|
|
listItemHeight = 24,
|
|
|
size: customizeSize,
|
|
|
disabled: customDisabled,
|
|
|
notFoundContent,
|
|
|
status: customStatus,
|
|
|
builtinPlacements,
|
|
|
dropdownMatchSelectWidth,
|
|
|
popupMatchSelectWidth,
|
|
|
direction: propDirection,
|
|
|
style,
|
|
|
allowClear
|
|
|
} = _a,
|
|
|
props = __rest(_a, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear"]);
|
|
|
const {
|
|
|
getPopupContainer: getContextPopupContainer,
|
|
|
getPrefixCls,
|
|
|
renderEmpty,
|
|
|
direction: contextDirection,
|
|
|
virtual,
|
|
|
popupMatchSelectWidth: contextPopupMatchSelectWidth,
|
|
|
popupOverflow,
|
|
|
select
|
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
|
|
|
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
|
const rootPrefixCls = getPrefixCls();
|
|
|
const direction = propDirection !== null && propDirection !== void 0 ? propDirection : contextDirection;
|
|
|
const {
|
|
|
compactSize,
|
|
|
compactItemClassnames
|
|
|
} = (0,_space_Compact__WEBPACK_IMPORTED_MODULE_4__/* .useCompactItemContext */ .ri)(prefixCls, direction);
|
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
|
|
|
const mode = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => {
|
|
|
const {
|
|
|
mode: m
|
|
|
} = props;
|
|
|
if (m === 'combobox') {
|
|
|
return undefined;
|
|
|
}
|
|
|
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
|
|
|
return 'combobox';
|
|
|
}
|
|
|
return m;
|
|
|
}, [props.mode]);
|
|
|
const isMultiple = mode === 'multiple' || mode === 'tags';
|
|
|
const showSuffixIcon = (0,_useShowArrow__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props.suffixIcon, props.showArrow);
|
|
|
const mergedPopupMatchSelectWidth = (_b = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _b !== void 0 ? _b : contextPopupMatchSelectWidth;
|
|
|
// ===================== Form Status =====================
|
|
|
const {
|
|
|
status: contextStatus,
|
|
|
hasFeedback,
|
|
|
isFormItemInput,
|
|
|
feedbackIcon
|
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_form_context__WEBPACK_IMPORTED_MODULE_7__/* .FormItemInputContext */ .aM);
|
|
|
const mergedStatus = (0,_util_statusUtils__WEBPACK_IMPORTED_MODULE_8__/* .getMergedStatus */ .F)(contextStatus, customStatus);
|
|
|
// ===================== Empty =====================
|
|
|
let mergedNotFound;
|
|
|
if (notFoundContent !== undefined) {
|
|
|
mergedNotFound = notFoundContent;
|
|
|
} else if (mode === 'combobox') {
|
|
|
mergedNotFound = null;
|
|
|
} else {
|
|
|
mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_config_provider_defaultRenderEmpty__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
|
|
|
componentName: "Select"
|
|
|
});
|
|
|
}
|
|
|
// ===================== Icons =====================
|
|
|
const {
|
|
|
suffixIcon,
|
|
|
itemIcon,
|
|
|
removeIcon,
|
|
|
clearIcon
|
|
|
} = (0,_utils_iconUtil__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z)(Object.assign(Object.assign({}, props), {
|
|
|
multiple: isMultiple,
|
|
|
hasFeedback,
|
|
|
feedbackIcon,
|
|
|
showSuffixIcon,
|
|
|
prefixCls,
|
|
|
showArrow: props.showArrow,
|
|
|
componentName: 'Select'
|
|
|
}));
|
|
|
const mergedAllowClear = allowClear === true ? {
|
|
|
clearIcon
|
|
|
} : allowClear;
|
|
|
const selectProps = (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z)(props, ['suffixIcon', 'itemIcon']);
|
|
|
const rcSelectRtlDropdownClassName = classnames__WEBPACK_IMPORTED_MODULE_0___default()(popupClassName || dropdownClassName, {
|
|
|
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl'
|
|
|
}, rootClassName, hashId);
|
|
|
const mergedSize = (0,_config_provider_hooks_useSize__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)(ctx => {
|
|
|
var _a;
|
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
|
});
|
|
|
// ===================== Disabled =====================
|
|
|
const disabled = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider_DisabledContext__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z);
|
|
|
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
|
const mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
[`${prefixCls}-lg`]: mergedSize === 'large',
|
|
|
[`${prefixCls}-sm`]: mergedSize === 'small',
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-borderless`]: !bordered,
|
|
|
[`${prefixCls}-in-form-item`]: isFormItemInput
|
|
|
}, (0,_util_statusUtils__WEBPACK_IMPORTED_MODULE_8__/* .getStatusClassNames */ .Z)(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, select === null || select === void 0 ? void 0 : select.className, className, rootClassName, hashId);
|
|
|
// ===================== Placement =====================
|
|
|
const memoPlacement = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => {
|
|
|
if (placement !== undefined) {
|
|
|
return placement;
|
|
|
}
|
|
|
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
|
|
}, [placement, direction]);
|
|
|
const mergedBuiltinPlacements = (0,_useBuiltinPlacements__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z)(builtinPlacements, popupOverflow);
|
|
|
// ====================== Warning ======================
|
|
|
if (false) {}
|
|
|
// ====================== Render =======================
|
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_select__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, Object.assign({
|
|
|
ref: ref,
|
|
|
virtual: virtual,
|
|
|
showSearch: select === null || select === void 0 ? void 0 : select.showSearch
|
|
|
}, selectProps, {
|
|
|
style: Object.assign(Object.assign({}, select === null || select === void 0 ? void 0 : select.style), style),
|
|
|
dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
|
|
|
builtinPlacements: mergedBuiltinPlacements,
|
|
|
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_15__/* .getTransitionName */ .m)(rootPrefixCls, 'slide-up', props.transitionName),
|
|
|
listHeight: listHeight,
|
|
|
listItemHeight: listItemHeight,
|
|
|
mode: mode,
|
|
|
prefixCls: prefixCls,
|
|
|
placement: memoPlacement,
|
|
|
direction: direction,
|
|
|
suffixIcon: suffixIcon,
|
|
|
menuItemSelectedIcon: itemIcon,
|
|
|
removeIcon: removeIcon,
|
|
|
allowClear: mergedAllowClear,
|
|
|
notFoundContent: mergedNotFound,
|
|
|
className: mergedClassName,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
|
dropdownClassName: rcSelectRtlDropdownClassName,
|
|
|
disabled: mergedDisabled
|
|
|
})));
|
|
|
};
|
|
|
if (false) {}
|
|
|
const Select = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(InternalSelect);
|
|
|
// We don't care debug panel
|
|
|
/* istanbul ignore next */
|
|
|
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z)(Select);
|
|
|
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
|
|
|
Select.Option = rc_select__WEBPACK_IMPORTED_MODULE_1__/* .Option */ .Wx;
|
|
|
Select.OptGroup = rc_select__WEBPACK_IMPORTED_MODULE_1__/* .OptGroup */ .Xo;
|
|
|
Select._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Select);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8378:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/style/motion/collapse.js ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
const genCollapseMotion = token => ({
|
|
|
[token.componentCls]: {
|
|
|
// For common/openAnimation
|
|
|
[`${token.antCls}-motion-collapse-legacy`]: {
|
|
|
overflow: 'hidden',
|
|
|
'&-active': {
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
},
|
|
|
[`${token.antCls}-motion-collapse`]: {
|
|
|
overflow: 'hidden',
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (genCollapseMotion);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31561:
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/index.js + 4 modules ***!
|
|
|
\*****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ _rc_dropdown_4_1_0_rc_dropdown_es; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(66820);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(80999);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(38440);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@rc-component_trigger@1.18.3@@rc-component/trigger/es/index.js + 11 modules
|
|
|
var es = __webpack_require__(35593);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(76466);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/KeyCode.js
|
|
|
var KeyCode = __webpack_require__(81331);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/raf.js
|
|
|
var raf = __webpack_require__(91659);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/hooks/useAccessibility.js
|
|
|
|
|
|
|
|
|
|
|
|
var ESC = KeyCode/* default */.Z.ESC,
|
|
|
TAB = KeyCode/* default */.Z.TAB;
|
|
|
function useAccessibility(_ref) {
|
|
|
var visible = _ref.visible,
|
|
|
triggerRef = _ref.triggerRef,
|
|
|
onVisibleChange = _ref.onVisibleChange,
|
|
|
autoFocus = _ref.autoFocus,
|
|
|
overlayRef = _ref.overlayRef;
|
|
|
var focusMenuRef = _react_17_0_2_react.useRef(false);
|
|
|
var handleCloseMenuAndReturnFocus = function handleCloseMenuAndReturnFocus() {
|
|
|
if (visible) {
|
|
|
var _triggerRef$current, _triggerRef$current$f;
|
|
|
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : (_triggerRef$current$f = _triggerRef$current.focus) === null || _triggerRef$current$f === void 0 ? void 0 : _triggerRef$current$f.call(_triggerRef$current);
|
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(false);
|
|
|
}
|
|
|
};
|
|
|
var focusMenu = function focusMenu() {
|
|
|
var _overlayRef$current;
|
|
|
if ((_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.focus) {
|
|
|
overlayRef.current.focus();
|
|
|
focusMenuRef.current = true;
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
var handleKeyDown = function handleKeyDown(event) {
|
|
|
switch (event.keyCode) {
|
|
|
case ESC:
|
|
|
handleCloseMenuAndReturnFocus();
|
|
|
break;
|
|
|
case TAB:
|
|
|
{
|
|
|
var focusResult = false;
|
|
|
if (!focusMenuRef.current) {
|
|
|
focusResult = focusMenu();
|
|
|
}
|
|
|
if (focusResult) {
|
|
|
event.preventDefault();
|
|
|
} else {
|
|
|
handleCloseMenuAndReturnFocus();
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
_react_17_0_2_react.useEffect(function () {
|
|
|
if (visible) {
|
|
|
window.addEventListener("keydown", handleKeyDown);
|
|
|
if (autoFocus) {
|
|
|
// FIXME: hack with raf
|
|
|
(0,raf/* default */.Z)(focusMenu, 3);
|
|
|
}
|
|
|
return function () {
|
|
|
window.removeEventListener("keydown", handleKeyDown);
|
|
|
focusMenuRef.current = false;
|
|
|
};
|
|
|
}
|
|
|
return function () {
|
|
|
focusMenuRef.current = false;
|
|
|
};
|
|
|
}, [visible]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/Overlay.js
|
|
|
|
|
|
|
|
|
var Overlay = /*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(function (props, ref) {
|
|
|
var overlay = props.overlay,
|
|
|
arrow = props.arrow,
|
|
|
prefixCls = props.prefixCls;
|
|
|
var overlayNode = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
var overlayElement;
|
|
|
if (typeof overlay === 'function') {
|
|
|
overlayElement = overlay();
|
|
|
} else {
|
|
|
overlayElement = overlay;
|
|
|
}
|
|
|
return overlayElement;
|
|
|
}, [overlay]);
|
|
|
var composedRef = (0,es_ref/* composeRef */.sQ)(ref, overlayNode === null || overlayNode === void 0 ? void 0 : overlayNode.ref);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, arrow && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: "".concat(prefixCls, "-arrow")
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.cloneElement(overlayNode, {
|
|
|
ref: (0,es_ref/* supportRef */.Yr)(overlayNode) ? composedRef : undefined
|
|
|
}));
|
|
|
});
|
|
|
/* harmony default export */ var es_Overlay = (Overlay);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/placements.js
|
|
|
var autoAdjustOverflow = {
|
|
|
adjustX: 1,
|
|
|
adjustY: 1
|
|
|
};
|
|
|
var targetOffset = [0, 0];
|
|
|
var placements = {
|
|
|
topLeft: {
|
|
|
points: ['bl', 'tl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
top: {
|
|
|
points: ['bc', 'tc'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
topRight: {
|
|
|
points: ['br', 'tr'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, -4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottomLeft: {
|
|
|
points: ['tl', 'bl'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottom: {
|
|
|
points: ['tc', 'bc'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
},
|
|
|
bottomRight: {
|
|
|
points: ['tr', 'br'],
|
|
|
overflow: autoAdjustOverflow,
|
|
|
offset: [0, 4],
|
|
|
targetOffset: targetOffset
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var es_placements = (placements);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/Dropdown.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus", "overlay", "children", "onVisibleChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Dropdown(props, ref) {
|
|
|
var _children$props;
|
|
|
var _props$arrow = props.arrow,
|
|
|
arrow = _props$arrow === void 0 ? false : _props$arrow,
|
|
|
_props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-dropdown' : _props$prefixCls,
|
|
|
transitionName = props.transitionName,
|
|
|
animation = props.animation,
|
|
|
align = props.align,
|
|
|
_props$placement = props.placement,
|
|
|
placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,
|
|
|
_props$placements = props.placements,
|
|
|
placements = _props$placements === void 0 ? es_placements : _props$placements,
|
|
|
getPopupContainer = props.getPopupContainer,
|
|
|
showAction = props.showAction,
|
|
|
hideAction = props.hideAction,
|
|
|
overlayClassName = props.overlayClassName,
|
|
|
overlayStyle = props.overlayStyle,
|
|
|
visible = props.visible,
|
|
|
_props$trigger = props.trigger,
|
|
|
trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
|
|
|
autoFocus = props.autoFocus,
|
|
|
overlay = props.overlay,
|
|
|
children = props.children,
|
|
|
onVisibleChange = props.onVisibleChange,
|
|
|
otherProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
|
var _React$useState = _react_17_0_2_react.useState(),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
triggerVisible = _React$useState2[0],
|
|
|
setTriggerVisible = _React$useState2[1];
|
|
|
var mergedVisible = 'visible' in props ? visible : triggerVisible;
|
|
|
var triggerRef = _react_17_0_2_react.useRef(null);
|
|
|
var overlayRef = _react_17_0_2_react.useRef(null);
|
|
|
var childRef = _react_17_0_2_react.useRef(null);
|
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
|
return triggerRef.current;
|
|
|
});
|
|
|
var handleVisibleChange = function handleVisibleChange(newVisible) {
|
|
|
setTriggerVisible(newVisible);
|
|
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(newVisible);
|
|
|
};
|
|
|
useAccessibility({
|
|
|
visible: mergedVisible,
|
|
|
triggerRef: childRef,
|
|
|
onVisibleChange: handleVisibleChange,
|
|
|
autoFocus: autoFocus,
|
|
|
overlayRef: overlayRef
|
|
|
});
|
|
|
var onClick = function onClick(e) {
|
|
|
var onOverlayClick = props.onOverlayClick;
|
|
|
setTriggerVisible(false);
|
|
|
if (onOverlayClick) {
|
|
|
onOverlayClick(e);
|
|
|
}
|
|
|
};
|
|
|
var getMenuElement = function getMenuElement() {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Overlay, {
|
|
|
ref: overlayRef,
|
|
|
overlay: overlay,
|
|
|
prefixCls: prefixCls,
|
|
|
arrow: arrow
|
|
|
});
|
|
|
};
|
|
|
var getMenuElementOrLambda = function getMenuElementOrLambda() {
|
|
|
if (typeof overlay === 'function') {
|
|
|
return getMenuElement;
|
|
|
}
|
|
|
return getMenuElement();
|
|
|
};
|
|
|
var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger() {
|
|
|
var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger,
|
|
|
alignPoint = props.alignPoint;
|
|
|
if ('minOverlayWidthMatchTrigger' in props) {
|
|
|
return minOverlayWidthMatchTrigger;
|
|
|
}
|
|
|
return !alignPoint;
|
|
|
};
|
|
|
var getOpenClassName = function getOpenClassName() {
|
|
|
var openClassName = props.openClassName;
|
|
|
if (openClassName !== undefined) {
|
|
|
return openClassName;
|
|
|
}
|
|
|
return "".concat(prefixCls, "-open");
|
|
|
};
|
|
|
var childrenNode = /*#__PURE__*/_react_17_0_2_react.cloneElement(children, {
|
|
|
className: _classnames_2_5_1_classnames_default()((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, mergedVisible && getOpenClassName()),
|
|
|
ref: (0,es_ref/* supportRef */.Yr)(children) ? (0,es_ref/* composeRef */.sQ)(childRef, children.ref) : undefined
|
|
|
});
|
|
|
var triggerHideAction = hideAction;
|
|
|
if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {
|
|
|
triggerHideAction = ['click'];
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
builtinPlacements: placements
|
|
|
}, otherProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
ref: triggerRef,
|
|
|
popupClassName: _classnames_2_5_1_classnames_default()(overlayClassName, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-show-arrow"), arrow)),
|
|
|
popupStyle: overlayStyle,
|
|
|
action: trigger,
|
|
|
showAction: showAction,
|
|
|
hideAction: triggerHideAction,
|
|
|
popupPlacement: placement,
|
|
|
popupAlign: align,
|
|
|
popupTransitionName: transitionName,
|
|
|
popupAnimation: animation,
|
|
|
popupVisible: mergedVisible,
|
|
|
stretch: getMinOverlayWidthMatchTrigger() ? 'minWidth' : '',
|
|
|
popup: getMenuElementOrLambda(),
|
|
|
onPopupVisibleChange: handleVisibleChange,
|
|
|
onPopupClick: onClick,
|
|
|
getPopupContainer: getPopupContainer
|
|
|
}), childrenNode);
|
|
|
}
|
|
|
/* harmony default export */ var es_Dropdown = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Dropdown));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-dropdown@4.1.0@rc-dropdown/es/index.js
|
|
|
|
|
|
/* harmony default export */ var _rc_dropdown_4_1_0_rc_dropdown_es = (es_Dropdown);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |