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.
1695 lines
67 KiB
1695 lines
67 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[98062],{
|
|
|
|
/***/ 94649:
|
|
/*!***************************************************************!*\
|
|
!*** ./src/pages/User/Detail/Topicbank/index.tsx + 7 modules ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Topicbank; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(58011);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
var dropdown = __webpack_require__(38854);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
var menu = __webpack_require__(20834);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(84578);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(66786);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(56971);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(9498);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Topics/Item/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Itemmodules = ({"wrap":"wrap___BPXsm","titleWrap":"titleWrap___LDO7D","title":"title___ITzue","contentWrap":"contentWrap___qlmVm","content":"content___xakEu","colorGray":"colorGray___C9imF","name":"name___VziWM","actionWrap":"actionWrap___DF8Dk","action":"action___zpnT_","public":"public___dkW04"});
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Topics/Item/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Items = function Items(_ref) {
|
|
var isPublicly = _ref.isPublicly,
|
|
data = _ref.data,
|
|
checkedIds = _ref.checkedIds,
|
|
_ref$onSetPublic = _ref.onSetPublic,
|
|
onSetPublic = _ref$onSetPublic === void 0 ? function () {} : _ref$onSetPublic,
|
|
_ref$onLink = _ref.onLink,
|
|
onLink = _ref$onLink === void 0 ? function () {} : _ref$onLink,
|
|
_ref$onEdit = _ref.onEdit,
|
|
onEdit = _ref$onEdit === void 0 ? function () {} : _ref$onEdit,
|
|
_ref$onCheck = _ref.onCheck,
|
|
onCheck = _ref$onCheck === void 0 ? function () {} : _ref$onCheck;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemmodules.titleWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
checked: checkedIds.includes(data.id),
|
|
onChange: function onChange(e) {
|
|
return onCheck(data.id, e.target.checked);
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: Itemmodules.title,
|
|
onClick: function onClick() {
|
|
return onLink(data.id, data.course_list_name);
|
|
},
|
|
children: data.name
|
|
}), data.is_public && !isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Itemmodules["public"],
|
|
children: "\u516C\u5F00"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemmodules.contentWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemmodules.content,
|
|
children: [isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "".concat(Itemmodules.colorGray, " mr50"),
|
|
children: data.creator_name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "".concat(Itemmodules.colorGray, " mr50"),
|
|
children: [data.quotes_count, "\u6B21\u5F15\u7528"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "".concat(Itemmodules.colorGray, " mr50"),
|
|
children: [data.solve_count, " \u6B21\u7B54\u9898"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "".concat(Itemmodules.colorGray, " mr50"),
|
|
children: dayjs_min_default()(data.updated_at).fromNow()
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Itemmodules.name,
|
|
children: data.course_list_name
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemmodules.actionWrap,
|
|
children: [!data.is_public && !isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: Itemmodules.action,
|
|
onClick: function onClick() {
|
|
return onSetPublic(data.id);
|
|
},
|
|
children: "\u8BBE\u4E3A\u516C\u5171\u8D44\u6E90"
|
|
}), !isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: Itemmodules.action,
|
|
onClick: function onClick() {
|
|
return onEdit(data.id, data.course_list_name);
|
|
},
|
|
children: "\u7F16\u8F91"
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Topics/Filter/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Filtermodules = ({"typeWrap":"typeWrap___moOWH","mainType":"mainType___DoIip","active":"active___VYgsq","otherTypeItem":"otherTypeItem___sWudA","otherTypeActive":"otherTypeActive___aWVdr","otherType":"otherType___NPEe0"});
|
|
;// CONCATENATED MODULE: ./src/components/EcListItems/Topics/Filter/index.tsx
|
|
|
|
|
|
|
|
|
|
var typeList = [{
|
|
val: "普通作业",
|
|
type: "normal"
|
|
}, {
|
|
val: "分组作业",
|
|
type: "group"
|
|
}, {
|
|
val: "问卷",
|
|
type: "poll"
|
|
}];
|
|
var Filter = function Filter(_ref) {
|
|
var courseList = _ref.courseList,
|
|
type = _ref.type,
|
|
courseId = _ref.courseId,
|
|
_ref$onChangeType = _ref.onChangeType,
|
|
onChangeType = _ref$onChangeType === void 0 ? function () {} : _ref$onChangeType,
|
|
_ref$onChangeCourseId = _ref.onChangeCourseId,
|
|
onChangeCourseId = _ref$onChangeCourseId === void 0 ? function () {} : _ref$onChangeCourseId;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "pb20",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Filtermodules.typeWrap,
|
|
children: typeList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(Filtermodules.mainType, " ").concat(type === item.type ? Filtermodules.active : ''),
|
|
onClick: function onClick() {
|
|
return onChangeType(item.type);
|
|
},
|
|
children: item.val
|
|
}, item.val);
|
|
})
|
|
}), !!courseList.length && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Filtermodules.typeWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(Filtermodules.otherTypeItem, " ").concat(courseId ? '' : Filtermodules.otherTypeActive),
|
|
onClick: function onClick() {
|
|
return onChangeCourseId(null);
|
|
},
|
|
children: "\u5168\u90E8"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Filtermodules.otherType,
|
|
children: courseList.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(Filtermodules.otherTypeItem, " ").concat(courseId === item.id ? Filtermodules.otherTypeActive : ''),
|
|
onClick: function onClick() {
|
|
return onChangeCourseId(item.id);
|
|
},
|
|
children: item.name
|
|
}, item.id);
|
|
})
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Topicbank/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Topicbankmodules = ({"flex_box_center":"flex_box_center___XQ0jm","flex_space_between":"flex_space_between___j40VD","flex_box_vertical_center":"flex_box_vertical_center___Zcqm6","flex_box_center_end":"flex_box_center_end___vsjRr","flex_box_column":"flex_box_column___V1Fq3","wrap":"wrap___IZ02d","filterWrap":"filterWrap___FVcow","flexRowReverse":"flexRowReverse___EoTu5","bankWrap":"bankWrap___hnjnn","bank":"bank___iofhW","active":"active___Ws95d","itemWrap":"itemWrap___O66WR","colorOrange":"colorOrange___eqeDP","action":"action___TYxXA","midWrap":"midWrap___AiVdh","color999":"color999___ea7ds","orderWrap":"orderWrap___j3xD_","orderIconWrap":"orderIconWrap___LllqQ","orderAsc":"orderAsc___TfoG5","orderDesc":"orderDesc___PxG47","color0152d9":"color0152d9___Yuur1","h10":"h10___pcenw","cursorPointer":"cursorPointer___gXwx3","orderTextWrap":"orderTextWrap___mTfNe","countWrap":"countWrap___igN4k","modal":"modal____1xBA","auth":"auth___mIcU_","authImgWrap":"authImgWrap___V1VzI","authText":"authText___AJ0Kz","authButtonWrap":"authButtonWrap___xRW3q","authButton":"authButton___PBzYz"});
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(62680);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Topicbank/components/SendToClassModal.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var SendToClassModalmodules = ({"wrap":"wrap___Bo_rt","title":"title___wI_Us","radioWrap":"radioWrap___CP5ly","radio":"radio___YVxh1","colorFF0000":"colorFF0000___cLFaW","pagination":"pagination___wQMOM"});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(73400);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Topicbank/components/SendToClassModal.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["userDetail", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = input/* default */.Z.Search;
|
|
var SendToClassModal = function SendToClassModal(_ref) {
|
|
var userDetail = _ref.userDetail,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
searchValue = _useState2[0],
|
|
setSearchValue = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
courseList = _useState4[0],
|
|
setCourseList = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
radioValue = _useState6[0],
|
|
setRadioValue = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
hasError = _useState8[0],
|
|
setHasError = _useState8[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
getCourseList();
|
|
}, []);
|
|
var getCourseList = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return dispatch({
|
|
type: 'userDetail/topicGetCourseList',
|
|
payload: {
|
|
search: searchValue
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if (res) {
|
|
setCourseList((res === null || res === void 0 ? void 0 : res.courses) || []);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getCourseList() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var _userDetail$actionTab;
|
|
var res, _userDetail$actionTab2, urlMapping;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (radioValue) {
|
|
_context2.next = 4;
|
|
break;
|
|
}
|
|
message/* default */.ZP.info("\u60A8\u9700\u8981\u521B\u5EFA\u8BFE\u5802\uFF0C\u624D\u80FD\u53D1\u9001");
|
|
setHasError(true);
|
|
return _context2.abrupt("return");
|
|
case 4:
|
|
_context2.next = 6;
|
|
return dispatch({
|
|
type: 'userDetail/topicSendToClass',
|
|
payload: objectSpread2_default()({
|
|
course_id: radioValue
|
|
}, (_userDetail$actionTab = userDetail.actionTabs) === null || _userDetail$actionTab === void 0 ? void 0 : _userDetail$actionTab.params)
|
|
});
|
|
case 6:
|
|
res = _context2.sent;
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
if (res && res.status === 0) {
|
|
urlMapping = {
|
|
'normal': 'common_homework',
|
|
'group': 'group_homework',
|
|
'exercise': 'exercise',
|
|
'poll': 'poll'
|
|
};
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(radioValue, "/").concat(urlMapping[(_userDetail$actionTab2 = userDetail.actionTabs) === null || _userDetail$actionTab2 === void 0 || (_userDetail$actionTab2 = _userDetail$actionTab2.params) === null || _userDetail$actionTab2 === void 0 ? void 0 : _userDetail$actionTab2.object_type]));
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleOk() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
destroyOnClose: true,
|
|
open: userDetail.actionTabs.key === 'UserDetail-SendToClass',
|
|
title: "\u53D1\u9001\u81F3\u8BFE\u5802",
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
confirmLoading: loading['userDetail/sendToClass'],
|
|
width: 600,
|
|
onOk: handleOk,
|
|
onCancel: function onCancel() {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SendToClassModalmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.title,
|
|
children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mb10",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Search, {
|
|
placeholder: "\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",
|
|
value: searchValue,
|
|
onChange: function onChange(e) {
|
|
return setSearchValue(e.target.value);
|
|
},
|
|
onSearch: function onSearch(value) {
|
|
setSearchValue(value);
|
|
getCourseList();
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.radioWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
value: radioValue,
|
|
onChange: function onChange(e) {
|
|
setRadioValue(e.target.value);
|
|
setHasError(false);
|
|
},
|
|
children: courseList.map(function (item, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
className: SendToClassModalmodules.radio,
|
|
value: item.course_id,
|
|
children: item.course_name
|
|
}, item.course_id);
|
|
})
|
|
})
|
|
}), hasError && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.colorFF0000,
|
|
children: "\u8BF7\u5148\u9009\u62E9\u8BFE\u5802"
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_SendToClassModal = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var userDetail = _ref4.userDetail,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting;
|
|
return {
|
|
userDetail: userDetail,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(SendToClassModal));
|
|
// EXTERNAL MODULE: ./src/assets/images/topics/permission.png
|
|
var permission = __webpack_require__(35092);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Topicbank/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Topics = function Topics(_ref) {
|
|
var user = _ref.user,
|
|
userDetail = _ref.userDetail,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch;
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)(0),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
count = _useState2[0],
|
|
setCount = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
data = _useState4[0],
|
|
setData = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
courseList = _useState6[0],
|
|
setCourseList = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
checkedIds = _useState8[0],
|
|
setCheckedIds = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
topicType = _useState10[0],
|
|
setTopicType = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(true),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
isAuth = _useState12[0],
|
|
setIsAuth = _useState12[1];
|
|
var _useState13 = (0,_react_17_0_2_react.useState)({
|
|
type: '',
|
|
object_type: 'normal',
|
|
course_list_id: null,
|
|
page: 1,
|
|
per_page: 15,
|
|
sort_by: 'updated_at',
|
|
sort_direction: 'desc'
|
|
}),
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
params = _useState14[0],
|
|
setParams = _useState14[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var topicType = urlParams.topicstype;
|
|
setTopicType(topicType);
|
|
params.type = topicType;
|
|
getQuestionBanks(params);
|
|
}, [urlParams]);
|
|
var getQuestionBanks = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(query) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setCheckedIds([]);
|
|
_context.next = 3;
|
|
return dispatch({
|
|
type: 'userDetail/getQuestionBanks',
|
|
payload: query
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
if (!(res.status === -2)) {
|
|
_context.next = 7;
|
|
break;
|
|
}
|
|
setIsAuth(false);
|
|
return _context.abrupt("return");
|
|
case 7:
|
|
setIsAuth(true);
|
|
if (res) {
|
|
setCount(res.count || 0);
|
|
setCourseList(res.course_list || []);
|
|
setData(res.question_banks || []);
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getQuestionBanks(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleChangeType = function handleChangeType(objectType) {
|
|
params.object_type = objectType;
|
|
params.course_list_id = null;
|
|
params.page = 1;
|
|
setParams(params);
|
|
getQuestionBanks(params);
|
|
};
|
|
var handleChangeCourseId = function handleChangeCourseId(courseId) {
|
|
params.course_list_id = courseId;
|
|
params.page = 1;
|
|
setParams(params);
|
|
getQuestionBanks(params);
|
|
};
|
|
var handleChangeOrder = function handleChangeOrder() {
|
|
params.sort_direction = params.sort_direction === 'desc' ? 'asc' : 'desc';
|
|
setParams(params);
|
|
getQuestionBanks(params);
|
|
};
|
|
var handleChangeOrderField = function handleChangeOrderField(sort_by) {
|
|
params.sort_by = sort_by;
|
|
params.sort_direction = 'desc';
|
|
setParams(params);
|
|
getQuestionBanks(params);
|
|
};
|
|
var handleChangePage = function handleChangePage(page) {
|
|
params.page = page;
|
|
setParams(params);
|
|
getQuestionBanks(params);
|
|
};
|
|
var handleCheck = function handleCheck(id, checked) {
|
|
if (checked) {
|
|
setCheckedIds([].concat(toConsumableArray_default()(checkedIds), [id]));
|
|
} else {
|
|
setCheckedIds(checkedIds.filter(function (item) {
|
|
return item !== id;
|
|
}));
|
|
}
|
|
};
|
|
var handleSetPublic = function handleSetPublic(id) {
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
title: '提示',
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Topicbankmodules.modal,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: "\u8BBE\u4E3A\u516C\u5171\u8D44\u6E90\u540E\uFF0C\u4E0D\u80FD\u518D\u6539\u56DE\u79C1\u6709\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: "\u662F\u5426\u786E\u8BA4\u8BBE\u4E3A\u516C\u5171\u8D44\u6E90\uFF1F"
|
|
})]
|
|
}),
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return dispatch({
|
|
type: 'userDetail/topicsSetPublic',
|
|
payload: {
|
|
object_id: [id],
|
|
object_type: params.object_type
|
|
}
|
|
});
|
|
case 2:
|
|
getQuestionBanks(params);
|
|
case 3:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var hanldeDelete = function hanldeDelete() {
|
|
if (!checkedIds.length) {
|
|
message/* default */.ZP.info('请选择资源');
|
|
return;
|
|
}
|
|
modal/* default */.Z.confirm({
|
|
centered: true,
|
|
title: '提示',
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.modal,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"
|
|
})
|
|
}),
|
|
onOk: function () {
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return dispatch({
|
|
type: 'userDetail/topicsDelete',
|
|
payload: {
|
|
object_id: checkedIds,
|
|
object_type: params.object_type
|
|
}
|
|
});
|
|
case 2:
|
|
getQuestionBanks(params);
|
|
case 3:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
function onOk() {
|
|
return _onOk2.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var handleSend = function handleSend() {
|
|
if (!checkedIds.length) {
|
|
message/* default */.ZP.info('请选择资源');
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {
|
|
key: 'UserDetail-SendToClass',
|
|
params: {
|
|
object_id: checkedIds,
|
|
object_type: params.object_type
|
|
}
|
|
}
|
|
});
|
|
};
|
|
var handleLink = function handleLink(id, courseName) {
|
|
_umi_production_exports.history.push("/users/".concat(urlParams.username, "/topics/").concat(id, "/").concat(params.type, "/").concat(params.object_type, "/detail"));
|
|
};
|
|
var handleEdit = function handleEdit(id, courseName) {
|
|
_umi_production_exports.history.push("/users/".concat(urlParams.username, "/topics/").concat(id, "/").concat(params.type, "/").concat(params.object_type, "/edit"));
|
|
};
|
|
var renderOrderText = function renderOrderText() {
|
|
if (params.sort_by === 'updated_at') {
|
|
return '最近更新';
|
|
}
|
|
if (params.sort_by === 'name') {
|
|
return '题目名称';
|
|
}
|
|
if (params.sort_by === 'contributor') {
|
|
return '贡献者';
|
|
}
|
|
return '';
|
|
};
|
|
var isPublicly = topicType === 'publicly';
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "".concat(Topicbankmodules.wrap, " ").concat(isPublicly ? 'mt30' : ''),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Topicbankmodules.filterWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "".concat(Topicbankmodules.bankWrap, " ").concat(topicType === 'publicly' ? Topicbankmodules.flexRowReverse : ''),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(Topicbankmodules.bank, " ").concat(topicType !== 'personal' ? Topicbankmodules.active : ''),
|
|
onClick: function onClick() {
|
|
return _umi_production_exports.history.push("/users/".concat(urlParams.username, "/topics/personal"));
|
|
},
|
|
children: "\u6211\u6536\u85CF\u7684\u8BFE\u5802\u8D44\u6E90"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(Topicbankmodules.bank, " ").concat(topicType !== 'publicly' ? Topicbankmodules.active : ''),
|
|
onClick: function onClick() {
|
|
return _umi_production_exports.history.push("/users/".concat(urlParams.username, "/topicbank/publicly"));
|
|
},
|
|
children: "\u516C\u5171\u8BFE\u5802\u8D44\u6E90"
|
|
})]
|
|
}), isAuth && /*#__PURE__*/(0,jsx_runtime.jsx)(Filter, {
|
|
type: params.object_type,
|
|
courseId: params.course_list_id,
|
|
courseList: courseList,
|
|
onChangeType: handleChangeType,
|
|
onChangeCourseId: handleChangeCourseId
|
|
})]
|
|
}), isAuth ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Topicbankmodules.midWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Topicbankmodules.color999,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "mr20",
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.colorOrange,
|
|
children: count
|
|
}), "\u4E2A"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u5DF2\u9009\u62E9", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.colorOrange,
|
|
children: checkedIds === null || checkedIds === void 0 ? void 0 : checkedIds.length
|
|
}), "\u4E2A(\u4E0D\u652F\u6301\u8DE8\u9875\u52FE\u9009)"]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Topicbankmodules.orderWrap,
|
|
children: [!isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.action,
|
|
onClick: hanldeDelete,
|
|
children: "\u5220\u9664"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.action,
|
|
onClick: handleSend,
|
|
children: "\u53D1\u9001"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
dropdownRender: function dropdownRender() {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
onClick: function onClick() {
|
|
return handleChangeOrderField('updated_at');
|
|
},
|
|
children: "\u6700\u8FD1\u66F4\u65B0"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
onClick: function onClick() {
|
|
return handleChangeOrderField('name');
|
|
},
|
|
children: "\u9898\u76EE\u540D\u79F0"
|
|
}), isPublicly && /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
onClick: function onClick() {
|
|
return handleChangeOrderField('contributor');
|
|
},
|
|
children: "\u8D21\u732E\u8005"
|
|
})]
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.orderTextWrap,
|
|
children: renderOrderText()
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Topicbankmodules.orderIconWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.orderAsc,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: params.sort_direction === 'asc' ? "iconfont icon-sanjiaoxing-up font12 ".concat(Topicbankmodules.color0152d9, " ").concat(Topicbankmodules.h10, " ").concat(Topicbankmodules.cursorPointer) : "iconfont icon-sanjiaoxing-up font12 ".concat(Topicbankmodules.h10, " ").concat(Topicbankmodules.cursorPointer),
|
|
onClick: function onClick() {
|
|
return handleChangeOrder();
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Topicbankmodules.orderDesc,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: params.sort_direction === 'desc' ? "iconfont icon-sanjiaoxing-down font12 ".concat(Topicbankmodules.color0152d9, " ").concat(Topicbankmodules.h10, " ").concat(Topicbankmodules.cursorPointer) : "iconfont icon-sanjiaoxing-down font12 ".concat(Topicbankmodules.h10, " ").concat(Topicbankmodules.cursorPointer),
|
|
onClick: function onClick() {
|
|
return handleChangeOrder();
|
|
}
|
|
})
|
|
})]
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
loading: loading['userDetail/getQuestionBanks'],
|
|
active: true,
|
|
paragraph: {
|
|
rows: 5
|
|
},
|
|
children: [!(data !== null && data !== void 0 && data.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.itemWrap,
|
|
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Items, {
|
|
isPublicly: isPublicly,
|
|
data: item,
|
|
checkedIds: checkedIds,
|
|
onCheck: handleCheck,
|
|
onSetPublic: handleSetPublic,
|
|
onLink: handleLink,
|
|
onEdit: handleEdit
|
|
}, item.id);
|
|
})
|
|
}), count > 15 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.countWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
showQuickJumper: true,
|
|
showSizeChanger: false,
|
|
total: count,
|
|
onChange: function onChange(page) {
|
|
return handleChangePage(page);
|
|
},
|
|
pageSize: 16,
|
|
current: params.page
|
|
})
|
|
})]
|
|
})]
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Topicbankmodules.auth,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.authImgWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: permission,
|
|
width: 150
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.authText,
|
|
children: "\u901A\u8FC7\u804C\u4E1A\u8BA4\u8BC1\u7684\u6559\u5E08\u624D\u80FD\u8BBF\u95EE\u516C\u5171\u8D44\u6E90"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Topicbankmodules.authButtonWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
className: Topicbankmodules.authButton,
|
|
type: "primary",
|
|
href: '/account/certification',
|
|
target: "_blank",
|
|
children: "\u7ACB\u5373\u8BA4\u8BC1"
|
|
})
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_SendToClassModal, {})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Topicbank = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var user = _ref3.user,
|
|
userDetail = _ref3.userDetail,
|
|
loading = _ref3.loading,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
user: user,
|
|
userDetail: userDetail,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(Topics));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 24905:
|
|
/*!************************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules ***!
|
|
\************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ es_checkbox; }
|
|
});
|
|
|
|
// 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-checkbox@3.1.0@rc-checkbox/es/index.js
|
|
var es = __webpack_require__(5630);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var config_provider_context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(1684);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
var context = __webpack_require__(32441);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/GroupContext.js
|
|
|
|
const GroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js
|
|
var checkbox_style = __webpack_require__(98447);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
var wave = __webpack_require__(14088);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/interface.js
|
|
var wave_interface = __webpack_require__(4572);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Checkbox.js
|
|
"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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalCheckbox = (props, ref) => {
|
|
var _a;
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
indeterminate = false,
|
|
style,
|
|
onMouseEnter,
|
|
onMouseLeave,
|
|
skipGroup = false,
|
|
disabled
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
checkbox
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const checkboxGroup = _react_17_0_2_react.useContext(checkbox_GroupContext);
|
|
const {
|
|
isFormItemInput
|
|
} = _react_17_0_2_react.useContext(context/* FormItemInputContext */.aM);
|
|
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
|
|
const prevValue = _react_17_0_2_react.useRef(restProps.value);
|
|
_react_17_0_2_react.useEffect(() => {
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
false ? 0 : void 0;
|
|
}, []);
|
|
_react_17_0_2_react.useEffect(() => {
|
|
if (skipGroup) {
|
|
return;
|
|
}
|
|
if (restProps.value !== prevValue.current) {
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
prevValue.current = restProps.value;
|
|
}
|
|
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
}, [restProps.value]);
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
const checkboxProps = Object.assign({}, restProps);
|
|
if (checkboxGroup && !skipGroup) {
|
|
checkboxProps.onChange = function () {
|
|
if (restProps.onChange) {
|
|
restProps.onChange.apply(restProps, arguments);
|
|
}
|
|
if (checkboxGroup.toggleOption) {
|
|
checkboxGroup.toggleOption({
|
|
label: children,
|
|
value: restProps.value
|
|
});
|
|
}
|
|
};
|
|
checkboxProps.name = checkboxGroup.name;
|
|
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
|
|
}
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
|
|
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
|
|
const checkboxClass = _classnames_2_5_1_classnames_default()({
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
}, wave_interface/* TARGET_CLS */.A, hashId);
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
component: "Checkbox",
|
|
disabled: mergedDisabled
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
|
|
className: classString,
|
|
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
onMouseEnter: onMouseEnter,
|
|
onMouseLeave: onMouseLeave
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
"aria-checked": ariaChecked
|
|
}, checkboxProps, {
|
|
prefixCls: prefixCls,
|
|
className: checkboxClass,
|
|
disabled: mergedDisabled,
|
|
ref: ref
|
|
})), children !== undefined && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children))));
|
|
};
|
|
const Checkbox = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalCheckbox);
|
|
if (false) {}
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(45112);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/omit.js
|
|
var omit = __webpack_require__(62805);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Group.js
|
|
"use client";
|
|
|
|
|
|
var Group_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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalGroup = (props, ref) => {
|
|
const {
|
|
defaultValue,
|
|
children,
|
|
options = [],
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
onChange
|
|
} = props,
|
|
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const [value, setValue] = _react_17_0_2_react.useState(restProps.value || defaultValue || []);
|
|
const [registeredValues, setRegisteredValues] = _react_17_0_2_react.useState([]);
|
|
_react_17_0_2_react.useEffect(() => {
|
|
if ('value' in restProps) {
|
|
setValue(restProps.value || []);
|
|
}
|
|
}, [restProps.value]);
|
|
const memoOptions = _react_17_0_2_react.useMemo(() => options.map(option => {
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
return {
|
|
label: option,
|
|
value: option
|
|
};
|
|
}
|
|
return option;
|
|
}), [options]);
|
|
const cancelValue = val => {
|
|
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
|
|
};
|
|
const registerValue = val => {
|
|
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
|
|
};
|
|
const toggleOption = option => {
|
|
const optionIndex = value.indexOf(option.value);
|
|
const newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
if (optionIndex === -1) {
|
|
newValue.push(option.value);
|
|
} else {
|
|
newValue.splice(optionIndex, 1);
|
|
}
|
|
if (!('value' in restProps)) {
|
|
setValue(newValue);
|
|
}
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
|
|
const indexA = memoOptions.findIndex(opt => opt.value === a);
|
|
const indexB = memoOptions.findIndex(opt => opt.value === b);
|
|
return indexA - indexB;
|
|
}));
|
|
};
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_Checkbox, {
|
|
prefixCls: prefixCls,
|
|
key: option.value.toString(),
|
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
value: option.value,
|
|
checked: value.includes(option.value),
|
|
onChange: option.onChange,
|
|
className: `${groupPrefixCls}-item`,
|
|
style: option.style,
|
|
title: option.title
|
|
}, option.label)) : children;
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
const context = {
|
|
toggleOption,
|
|
value,
|
|
disabled: restProps.disabled,
|
|
name: restProps.name,
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
registerValue,
|
|
cancelValue
|
|
};
|
|
const classString = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
className: classString,
|
|
style: style
|
|
}, domProps, {
|
|
ref: ref
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_GroupContext.Provider, {
|
|
value: context
|
|
}, childrenNode)));
|
|
};
|
|
|
|
const CheckboxGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalGroup);
|
|
/* harmony default export */ var Group = (/*#__PURE__*/_react_17_0_2_react.memo(CheckboxGroup));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
const es_checkbox_Checkbox = checkbox_Checkbox;
|
|
es_checkbox_Checkbox.Group = Group;
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
if (false) {}
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 98447:
|
|
/*!******************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js ***!
|
|
\******************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ C2: function() { return /* binding */ getStyle; }
|
|
/* harmony export */ });
|
|
/* unused harmony export genCheckboxStyle */
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 87832);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ 37613);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 83116);
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
const genCheckboxStyle = token => {
|
|
const {
|
|
checkboxCls
|
|
} = token;
|
|
const wrapperCls = `${checkboxCls}-wrapper`;
|
|
return [
|
|
// ===================== Basic =====================
|
|
{
|
|
// Group
|
|
[`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
display: 'inline-flex',
|
|
flexWrap: 'wrap',
|
|
columnGap: token.marginXS,
|
|
// Group > Grid
|
|
[`> ${token.antCls}-row`]: {
|
|
flex: 1
|
|
}
|
|
}),
|
|
// Wrapper
|
|
[wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
display: 'inline-flex',
|
|
alignItems: 'baseline',
|
|
cursor: 'pointer',
|
|
// Fix checkbox & radio in flex align #30260
|
|
'&:after': {
|
|
display: 'inline-block',
|
|
width: 0,
|
|
overflow: 'hidden',
|
|
content: "'\\a0'"
|
|
},
|
|
// Checkbox near checkbox
|
|
[`& + ${wrapperCls}`]: {
|
|
marginInlineStart: 0
|
|
},
|
|
[`&${wrapperCls}-in-form-item`]: {
|
|
'input[type="checkbox"]': {
|
|
width: 14,
|
|
height: 14 // FIXME: magic
|
|
}
|
|
}
|
|
}),
|
|
|
|
// Wrapper > Checkbox
|
|
[checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
position: 'relative',
|
|
whiteSpace: 'nowrap',
|
|
lineHeight: 1,
|
|
cursor: 'pointer',
|
|
borderRadius: token.borderRadiusSM,
|
|
// To make alignment right when `controlHeight` is changed
|
|
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
|
alignSelf: 'center',
|
|
// Wrapper > Checkbox > input
|
|
[`${checkboxCls}-input`]: {
|
|
position: 'absolute',
|
|
// Since baseline align will get additional space offset,
|
|
// we need to move input to top to make it align with text.
|
|
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
|
|
inset: 0,
|
|
zIndex: 1,
|
|
cursor: 'pointer',
|
|
opacity: 0,
|
|
margin: 0,
|
|
[`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .genFocusOutline */ .oN)(token))
|
|
},
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
boxSizing: 'border-box',
|
|
position: 'relative',
|
|
top: 0,
|
|
insetInlineStart: 0,
|
|
display: 'block',
|
|
width: token.checkboxSize,
|
|
height: token.checkboxSize,
|
|
direction: 'ltr',
|
|
backgroundColor: token.colorBgContainer,
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
borderRadius: token.borderRadiusSM,
|
|
borderCollapse: 'separate',
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
'&:after': {
|
|
boxSizing: 'border-box',
|
|
position: 'absolute',
|
|
top: '50%',
|
|
insetInlineStart: '21.5%',
|
|
display: 'table',
|
|
width: token.checkboxSize / 14 * 5,
|
|
height: token.checkboxSize / 14 * 8,
|
|
border: `${token.lineWidthBold}px solid ${token.colorWhite}`,
|
|
borderTop: 0,
|
|
borderInlineStart: 0,
|
|
transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
|
|
opacity: 0,
|
|
content: '""',
|
|
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
|
|
}
|
|
},
|
|
// Wrapper > Checkbox + Text
|
|
'& + span': {
|
|
paddingInlineStart: token.paddingXS,
|
|
paddingInlineEnd: token.paddingXS
|
|
}
|
|
})
|
|
},
|
|
// ===================== Hover =====================
|
|
{
|
|
// Wrapper & Wrapper > Checkbox
|
|
[`
|
|
${wrapperCls}:not(${wrapperCls}-disabled),
|
|
${checkboxCls}:not(${checkboxCls}-disabled)
|
|
`]: {
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
borderColor: token.colorPrimary
|
|
}
|
|
},
|
|
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimaryHover,
|
|
borderColor: 'transparent'
|
|
},
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
|
|
borderColor: token.colorPrimaryHover
|
|
}
|
|
}
|
|
},
|
|
// ==================== Checked ====================
|
|
{
|
|
// Wrapper > Checkbox
|
|
[`${checkboxCls}-checked`]: {
|
|
[`${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimary,
|
|
borderColor: token.colorPrimary,
|
|
'&:after': {
|
|
opacity: 1,
|
|
transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
|
|
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
|
|
}
|
|
}
|
|
},
|
|
[`
|
|
${wrapperCls}-checked:not(${wrapperCls}-disabled),
|
|
${checkboxCls}-checked:not(${checkboxCls}-disabled)
|
|
`]: {
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimaryHover,
|
|
borderColor: 'transparent'
|
|
}
|
|
}
|
|
},
|
|
// ================= Indeterminate =================
|
|
{
|
|
[checkboxCls]: {
|
|
'&-indeterminate': {
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorBgContainer,
|
|
borderColor: token.colorBorder,
|
|
'&:after': {
|
|
top: '50%',
|
|
insetInlineStart: '50%',
|
|
width: token.fontSizeLG / 2,
|
|
height: token.fontSizeLG / 2,
|
|
backgroundColor: token.colorPrimary,
|
|
border: 0,
|
|
transform: 'translate(-50%, -50%) scale(1)',
|
|
opacity: 1,
|
|
content: '""'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// ==================== Disable ====================
|
|
{
|
|
// Wrapper
|
|
[`${wrapperCls}-disabled`]: {
|
|
cursor: 'not-allowed'
|
|
},
|
|
// Wrapper > Checkbox
|
|
[`${checkboxCls}-disabled`]: {
|
|
// Wrapper > Checkbox > input
|
|
[`&, ${checkboxCls}-input`]: {
|
|
cursor: 'not-allowed',
|
|
// Disabled for native input to enable Tooltip event handler
|
|
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
|
|
pointerEvents: 'none'
|
|
},
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
background: token.colorBgContainerDisabled,
|
|
borderColor: token.colorBorder,
|
|
'&:after': {
|
|
borderColor: token.colorTextDisabled
|
|
}
|
|
},
|
|
'&:after': {
|
|
display: 'none'
|
|
},
|
|
'& + span': {
|
|
color: token.colorTextDisabled
|
|
},
|
|
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
|
|
background: token.colorTextDisabled
|
|
}
|
|
}
|
|
}];
|
|
};
|
|
// ============================== Export ==============================
|
|
function getStyle(prefixCls, token) {
|
|
const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__/* .merge */ .TS)(token, {
|
|
checkboxCls: `.${prefixCls}`,
|
|
checkboxSize: token.controlInteractiveSize
|
|
});
|
|
return [genCheckboxStyle(checkboxToken)];
|
|
}
|
|
/* harmony default export */ __webpack_exports__.ZP = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)('Checkbox', (token, _ref) => {
|
|
let {
|
|
prefixCls
|
|
} = _ref;
|
|
return [getStyle(prefixCls, token)];
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 38854:
|
|
/*!************************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules ***!
|
|
\************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ es_dropdown; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
|
|
var dropdown = __webpack_require__(91857);
|
|
// 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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
|
|
var EllipsisOutlined = __webpack_require__(40090);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
var space = __webpack_require__(81327);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
var Compact = __webpack_require__(33234);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/style/index.js + 1 modules
|
|
var style = __webpack_require__(47211);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown-button.js
|
|
"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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DropdownButton = props => {
|
|
const {
|
|
getPopupContainer: getContextPopupContainer,
|
|
getPrefixCls,
|
|
direction
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
type = 'default',
|
|
danger,
|
|
disabled,
|
|
loading,
|
|
onClick,
|
|
htmlType,
|
|
children,
|
|
className,
|
|
menu,
|
|
arrow,
|
|
autoFocus,
|
|
overlay,
|
|
trigger,
|
|
align,
|
|
open,
|
|
onOpenChange,
|
|
placement,
|
|
getPopupContainer,
|
|
href,
|
|
icon = /*#__PURE__*/_react_17_0_2_react.createElement(EllipsisOutlined/* default */.Z, null),
|
|
title,
|
|
buttonsRender = buttons => buttons,
|
|
mouseEnterDelay,
|
|
mouseLeaveDelay,
|
|
overlayClassName,
|
|
overlayStyle,
|
|
destroyPopupOnHide,
|
|
dropdownRender
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
|
|
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
|
const buttonPrefixCls = `${prefixCls}-button`;
|
|
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
|
|
const dropdownProps = {
|
|
menu,
|
|
arrow,
|
|
autoFocus,
|
|
align,
|
|
disabled,
|
|
trigger: disabled ? [] : trigger,
|
|
onOpenChange,
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
mouseEnterDelay,
|
|
mouseLeaveDelay,
|
|
overlayClassName,
|
|
overlayStyle,
|
|
destroyPopupOnHide,
|
|
dropdownRender
|
|
};
|
|
const {
|
|
compactSize,
|
|
compactItemClassnames
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
const classes = _classnames_2_5_1_classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
|
|
if ('overlay' in props) {
|
|
dropdownProps.overlay = overlay;
|
|
}
|
|
if ('open' in props) {
|
|
dropdownProps.open = open;
|
|
}
|
|
if ('placement' in props) {
|
|
dropdownProps.placement = placement;
|
|
} else {
|
|
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
|
}
|
|
const leftButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
type: type,
|
|
danger: danger,
|
|
disabled: disabled,
|
|
loading: loading,
|
|
onClick: onClick,
|
|
htmlType: htmlType,
|
|
href: href,
|
|
title: title
|
|
}, children);
|
|
const rightButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
type: type,
|
|
danger: danger,
|
|
icon: icon
|
|
});
|
|
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(space/* default */.Z.Compact, Object.assign({
|
|
className: classes,
|
|
size: compactSize,
|
|
block: true
|
|
}, restProps), leftButtonToRender, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
|
|
};
|
|
DropdownButton.__ANT_BUTTON = true;
|
|
/* harmony default export */ var dropdown_button = (DropdownButton);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
const Dropdown = dropdown/* default */.Z;
|
|
Dropdown.Button = dropdown_button;
|
|
/* harmony default export */ var es_dropdown = (Dropdown);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 81327:
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ space; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: SpaceContext
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// 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/Children/toArray.js
|
|
var toArray = __webpack_require__(47783);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
var Compact = __webpack_require__(33234);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/context.js
|
|
|
|
const SpaceContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
latestIndex: 0
|
|
});
|
|
const SpaceContextProvider = SpaceContext.Provider;
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Item.js
|
|
"use client";
|
|
|
|
|
|
|
|
const Item = _ref => {
|
|
let {
|
|
className,
|
|
index,
|
|
children,
|
|
split,
|
|
style
|
|
} = _ref;
|
|
const {
|
|
latestIndex
|
|
} = _react_17_0_2_react.useContext(SpaceContext);
|
|
if (children === null || children === undefined) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: className,
|
|
style: style
|
|
}, children), index < latestIndex && split && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${className}-split`
|
|
}, split));
|
|
};
|
|
/* harmony default export */ var space_Item = (Item);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/style/index.js + 1 modules
|
|
var space_style = __webpack_require__(2856);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/utils.js
|
|
function isPresetSize(size) {
|
|
return ['small', 'middle', 'large'].includes(size);
|
|
}
|
|
function isValidGapNumber(size) {
|
|
if (!size) {
|
|
// The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
|
|
return false;
|
|
}
|
|
return typeof size === 'number' && !Number.isNaN(size);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js
|
|
"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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Space = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
var _a, _b;
|
|
const {
|
|
getPrefixCls,
|
|
space,
|
|
direction: directionConfig
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
size = (space === null || space === void 0 ? void 0 : space.size) || 'small',
|
|
align,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
direction = 'horizontal',
|
|
prefixCls: customizePrefixCls,
|
|
split,
|
|
style,
|
|
wrap = false,
|
|
classNames: customClassNames,
|
|
styles
|
|
} = props,
|
|
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
|
|
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
|
|
const isPresetVerticalSize = isPresetSize(verticalSize);
|
|
const isPresetHorizontalSize = isPresetSize(horizontalSize);
|
|
const isValidVerticalSize = isValidGapNumber(verticalSize);
|
|
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
|
|
const childNodes = (0,toArray/* default */.Z)(children, {
|
|
keepEmpty: true
|
|
});
|
|
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
|
|
const prefixCls = getPrefixCls('space', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,space_style/* default */.Z)(prefixCls);
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {
|
|
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
|
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
|
|
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
|
|
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
|
|
}, className, rootClassName);
|
|
const itemClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.classNames) === null || _b === void 0 ? void 0 : _b.item);
|
|
// Calculate latest one
|
|
let latestIndex = 0;
|
|
const nodes = childNodes.map((child, i) => {
|
|
var _a, _b;
|
|
if (child !== null && child !== undefined) {
|
|
latestIndex = i;
|
|
}
|
|
const key = child && child.key || `${itemClassName}-${i}`;
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(space_Item, {
|
|
className: itemClassName,
|
|
key: key,
|
|
index: i,
|
|
split: split,
|
|
style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item
|
|
}, child);
|
|
});
|
|
const spaceContext = _react_17_0_2_react.useMemo(() => ({
|
|
latestIndex
|
|
}), [latestIndex]);
|
|
// =========================== Render ===========================
|
|
if (childNodes.length === 0) {
|
|
return null;
|
|
}
|
|
const gapStyle = {};
|
|
if (wrap) {
|
|
gapStyle.flexWrap = 'wrap';
|
|
}
|
|
if (!isPresetHorizontalSize && isValidHorizontalSize) {
|
|
gapStyle.columnGap = horizontalSize;
|
|
}
|
|
if (!isPresetVerticalSize && isValidVerticalSize) {
|
|
gapStyle.rowGap = verticalSize;
|
|
}
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
ref: ref,
|
|
className: cls,
|
|
style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)
|
|
}, otherProps), /*#__PURE__*/_react_17_0_2_react.createElement(SpaceContextProvider, {
|
|
value: spaceContext
|
|
}, nodes)));
|
|
});
|
|
if (false) {}
|
|
const CompoundedSpace = Space;
|
|
CompoundedSpace.Compact = Compact/* default */.ZP;
|
|
/* harmony default export */ var space = (CompoundedSpace);
|
|
|
|
/***/ })
|
|
|
|
}]); |