|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[73220],{
|
|
|
|
|
|
/***/ 75769:
|
|
|
/*!*******************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CheckOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_CheckOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/CheckOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var CheckOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_CheckOutlined = (CheckOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CheckOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CheckOutlined_CheckOutlined = function CheckOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_CheckOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_CheckOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(CheckOutlined_CheckOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 15997:
|
|
|
/*!*****************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules ***!
|
|
|
\*****************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_EyeOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/EyeOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(EyeOutlined_EyeOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 52063:
|
|
|
/*!******************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules ***!
|
|
|
\******************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_LeftOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/LeftOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_LeftOutlined = (LeftOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/LeftOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var LeftOutlined_LeftOutlined = function LeftOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_LeftOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_LeftOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(LeftOutlined_LeftOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 96402:
|
|
|
/*!********************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UploadOutlined.js + 1 modules ***!
|
|
|
\********************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_UploadOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/UploadOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var UploadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "upload", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_UploadOutlined = (UploadOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UploadOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var UploadOutlined_UploadOutlined = function UploadOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_UploadOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_UploadOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(UploadOutlined_UploadOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 59389:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/CoverUpload/index.tsx + 1 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_CoverUpload; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
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: ./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/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
|
var upload = __webpack_require__(6557);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UploadOutlined.js + 1 modules
|
|
|
var UploadOutlined = __webpack_require__(96402);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
|
|
var CloseCircleFilled = __webpack_require__(48796);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(47015);
|
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var CoverUploadmodules = ({"img":"img___BgL9D"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CoverUpload = function CoverUpload(_ref) {
|
|
|
var value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
getFileProgress = _ref.getFileProgress;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
imgLoading = _useState2[0],
|
|
|
setImgLoading = _useState2[1];
|
|
|
var uploadButton = /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
loading: imgLoading,
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(UploadOutlined/* default */.Z, {}),
|
|
|
children: "\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"
|
|
|
});
|
|
|
var renderImg = function renderImg() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: CoverUploadmodules.img,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.API_SERVER + "/api/attachments/" + value,
|
|
|
alt: "avatar",
|
|
|
style: {
|
|
|
width: 288
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
return onChange('');
|
|
|
},
|
|
|
style: {
|
|
|
fontSize: '16px',
|
|
|
color: 'red'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var handleChange = function handleChange(info) {
|
|
|
if (getFileProgress) {
|
|
|
getFileProgress(info);
|
|
|
}
|
|
|
if (info.file.status === 'uploading') {
|
|
|
setImgLoading(true);
|
|
|
return;
|
|
|
}
|
|
|
if (info.file.status === 'done') {
|
|
|
var _info$file, _info$file3;
|
|
|
setImgLoading(false);
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
|
|
|
var _info$file2;
|
|
|
message/* default */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
|
|
|
// onChange()
|
|
|
return;
|
|
|
}
|
|
|
onChange(info === null || info === void 0 || (_info$file3 = info.file) === null || _info$file3 === void 0 || (_info$file3 = _info$file3.response) === null || _info$file3 === void 0 ? void 0 : _info$file3.id);
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: value ? renderImg() : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
|
withCredentials: true,
|
|
|
name: "file",
|
|
|
showUploadList: false,
|
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
onChange: handleChange,
|
|
|
accept: "image/*",
|
|
|
children: uploadButton
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20 c-light-black",
|
|
|
children: "\u8BF4\u660E\uFF1A\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528288*158\u50CF\u7D20\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-light-black",
|
|
|
children: "\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_CoverUpload = (CoverUpload);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 23091:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Video/Upload/index.tsx + 3 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 */ Video_Upload; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(27161);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// 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 + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(66660);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
|
|
|
var LeftOutlined = __webpack_require__(52063);
|
|
|
// 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/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
|
|
|
var progress = __webpack_require__(93948);
|
|
|
// 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/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
;// CONCATENATED MODULE: ./src/assets/images/video/upload.png
|
|
|
var upload_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAwBAMAAABTZWEsAAAAIVBMVEVHcExMrf9Qr/9TuP9Mrf9Nrf9Mrf9MrP9Nrv9Orv9MrP98EuefAAAACnRSTlMA3CULV5jA84JH4j3LZgAAANVJREFUOMvl1a0OwjAUBeCb/QgcGckSphqeAASBoKaR4KpwJDwAYhaHQuGbLNtynpKWmTWs92rg2n45orc7I9qeEZzrjSgqwIxRtAI7M7rzoKMLjhScNRqqsAyDGC0BxIw9/UYQKQEUHQ9SoGSBBmoOpG4/JQO0A3UYpP2KyyDQaGG8CB/YgDnMfhjhAw2zgEmGER6wAVkEQzbiMQp29g07YCOmo2CDjBywEadRkOSqB5NcBa/6Dbhd/AmIq0Z41c/DL3y8n0AsMbEGxSIVq1gsc+l38AI000Nd23IRqQAAAABJRU5ErkJggg==";
|
|
|
;// CONCATENATED MODULE: ./src/assets/images/video/upload_hover.png
|
|
|
var upload_hover_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAABgBAMAAAAnVGd6AAAAJFBMVEVHcExMrf9Orf9Nrf90uv9MrP////95wP/M5//z+v+x2/9cs//eVCejAAAABXRSTlMA10ycBa32wqwAAAFsSURBVFjD7dk/TsMwFMfxJ8QNIHsHOABDduAGJXoyUnZTsmcoByg3KANz/0i9AHA6YruBIjXPr/6hLrWlLlXy0dcZrPSViOj+puCENb64Ir/Okm73xMjdf15y8qpuO+COgXXZASUCVN0TYGiNsB24PVxjwAP2CNxDKDBgjAMMrgxkIANHAr5aDPiwtoWAubVPCPBobSxBBmYOeEsHfIB9bpMBHxBJoGhAJIHiAXICxQPkBFIEiAmkCBATSBMgJZAmQEogMWDiPnMxgcSAlQOmYgJJAY1xgBETSApYeIDFBJICOABiAkkBW0BM2A8sQ0APhIR3PVBvA3ogJDR6wPTX94BPmBwILHYAn3AA4A7jhncBM3g87wemIeAX+PlGCdTrFf8FeP2acqybwa1nIAMZODWgHjyMtW+qM/BNlT+HjkItUL9s8i+WDGTgSECB3f8Ps7QSAyp8IAmPROGhLDwWxgfT8GgcHs6Dfw98A1V0Ca+XaA0MAAAAAElFTkSuQmCC";
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Video/Upload/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Uploadmodules = ({"bg":"bg___A_od2","main":"main___f6Wx0","uploadTop":"uploadTop___Yx2Un","imgWrap":"imgWrap___S6ChW","defaultImg":"defaultImg___qUJQT","hoverImg":"hoverImg___pZT3G","uploadTitle":"uploadTitle___FLy1b","colorBlue":"colorBlue___HfgxM","uploadDescription":"uploadDescription___Cn5KA","description":"description___qbCxZ","colorOrange":"colorOrange___ZuvEg","fileMain":"fileMain___asNqA","fileWrap":"fileWrap___gPP0_","fileProgress":"fileProgress___xmdZ4","fileCancel":"fileCancel___ikgzZ","fileInputWrap":"fileInputWrap___mvunl","fileImgWrap":"fileImgWrap___zdrgz","fileInput":"fileInput___Tw2dZ","flexRowCenter":"flexRowCenter___pGglA","continueAdd":"continueAdd___SV9wg"});
|
|
|
// EXTERNAL MODULE: ./src/utils/aliyunUpload.ts
|
|
|
var aliyunUpload = __webpack_require__(1502);
|
|
|
// EXTERNAL MODULE: ./src/components/CoverUpload/index.tsx + 1 modules
|
|
|
var CoverUpload = __webpack_require__(59389);
|
|
|
// EXTERNAL MODULE: ./src/service/user.ts
|
|
|
var service_user = __webpack_require__(52138);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(27291);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Video/Upload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["user", "userDetail", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MAX_LENGTH = 30;
|
|
|
var MAX_FILE_SIZE = 1024;
|
|
|
var videoReducer = function videoReducer(state, action) {
|
|
|
var _state$videoList, _state$videoList2, _state$videoList3;
|
|
|
var uploadInfo = action.payload.uploadInfo;
|
|
|
switch (action.type) {
|
|
|
case 'addVideo':
|
|
|
// console.log(uploadInfo,{
|
|
|
// videoList: [...state.videoList, {
|
|
|
// videoId: uploadInfo.videoId,
|
|
|
// name: uploadInfo.file.name,
|
|
|
// size: uploadInfo.file.size,
|
|
|
// type: uploadInfo.file.type,
|
|
|
// fileHash: uploadInfo.fileHash,
|
|
|
// state: uploadInfo.state,
|
|
|
// loaded: 0,
|
|
|
// title: ''
|
|
|
// }]
|
|
|
// });
|
|
|
|
|
|
console.log("videoList: ", uploadInfo, uploadInfo.videoId, [].concat(toConsumableArray_default()(state.videoList), [{
|
|
|
name: uploadInfo.file.name,
|
|
|
size: uploadInfo.file.size,
|
|
|
type: uploadInfo.file.type,
|
|
|
filename: uploadInfo.file.name,
|
|
|
fileHash: uploadInfo.fileHash,
|
|
|
state: uploadInfo.state,
|
|
|
videoId: uploadInfo.videoId,
|
|
|
attachment_id: '',
|
|
|
loaded: 0,
|
|
|
title: ''
|
|
|
}]));
|
|
|
return {
|
|
|
videoList: [].concat(toConsumableArray_default()(state.videoList), [{
|
|
|
name: uploadInfo.file.name,
|
|
|
size: uploadInfo.file.size,
|
|
|
type: uploadInfo.file.type,
|
|
|
filename: uploadInfo.file.name,
|
|
|
fileHash: uploadInfo.fileHash,
|
|
|
state: uploadInfo.state,
|
|
|
videoId: uploadInfo.videoId,
|
|
|
attachment_id: '',
|
|
|
loaded: 0,
|
|
|
title: '',
|
|
|
allow_skip: true
|
|
|
}])
|
|
|
};
|
|
|
case 'removeVideo':
|
|
|
return {
|
|
|
videoList: state.videoList.filter(function (item) {
|
|
|
return item.name !== action.payload.name;
|
|
|
})
|
|
|
};
|
|
|
case 'removeAll':
|
|
|
return [];
|
|
|
case 'updateProgress':
|
|
|
return {
|
|
|
videoList: state.videoList.map(function (item) {
|
|
|
if (item.name === action.payload.uploadInfo.file.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, item), {
|
|
|
loaded: action.payload.progressPercent,
|
|
|
videoId: uploadInfo.videoId,
|
|
|
fileHash: uploadInfo.fileHash
|
|
|
});
|
|
|
}
|
|
|
return item;
|
|
|
})
|
|
|
};
|
|
|
case 'updateTitle':
|
|
|
return {
|
|
|
videoList: (_state$videoList = state.videoList) === null || _state$videoList === void 0 ? void 0 : _state$videoList.map(function (video) {
|
|
|
if (video.name === action.payload.item.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, video), {
|
|
|
title: action.payload.title
|
|
|
});
|
|
|
}
|
|
|
return video;
|
|
|
})
|
|
|
};
|
|
|
case 'updateImg':
|
|
|
return {
|
|
|
videoList: (_state$videoList2 = state.videoList) === null || _state$videoList2 === void 0 ? void 0 : _state$videoList2.map(function (video) {
|
|
|
if (video.name === action.payload.item.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, video), {
|
|
|
attachment_id: action.payload.attachment_id
|
|
|
});
|
|
|
}
|
|
|
return video;
|
|
|
})
|
|
|
};
|
|
|
case 'updateAllowSkip':
|
|
|
return {
|
|
|
videoList: (_state$videoList3 = state.videoList) === null || _state$videoList3 === void 0 ? void 0 : _state$videoList3.map(function (video) {
|
|
|
if (video.name === action.payload.item.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, video), {
|
|
|
allow_skip: action.payload.allow_skip
|
|
|
});
|
|
|
}
|
|
|
return video;
|
|
|
})
|
|
|
};
|
|
|
default:
|
|
|
return [];
|
|
|
}
|
|
|
};
|
|
|
var Upload = function Upload(_ref) {
|
|
|
var _state$videoList6;
|
|
|
var user = _ref.user,
|
|
|
userDetail = _ref.userDetail,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var Location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isLoading = _useState2[0],
|
|
|
setIsLoading = _useState2[1];
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(videoReducer, {
|
|
|
videoList: []
|
|
|
}),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
stateDispatch = _useReducer2[1];
|
|
|
var uploader = (0,_react_17_0_2_react.useRef)();
|
|
|
var files = (0,_react_17_0_2_react.useRef)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
window.addEventListener('beforeunload', handleBeforeunload);
|
|
|
return function () {
|
|
|
window.removeEventListener('beforeunload', handleBeforeunload);
|
|
|
};
|
|
|
}, []);
|
|
|
var handleBeforeunload = function handleBeforeunload(event) {
|
|
|
event.preventDefault();
|
|
|
event.returnValue = '';
|
|
|
};
|
|
|
var clearInput = function clearInput() {
|
|
|
var input = document.getElementById('fileUpload');
|
|
|
input.value = '';
|
|
|
};
|
|
|
var handleChangeUpload = function handleChangeUpload(e) {
|
|
|
var _user$userInfo, _user$userInfo2, _state$videoList4;
|
|
|
var file = e.target.files[0];
|
|
|
if (!file) {
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
var name = file.name.toLowerCase();
|
|
|
if (name && name.indexOf('.avi') == -1 && name.indexOf('.flv') == -1 && name.indexOf('.f4v') == -1 && name.indexOf('.m4v') == -1 && name.indexOf('.mov') == -1 && name.indexOf('.mp4') == -1 && name.indexOf('.rmvb') == -1 && name.indexOf('.swf') == -1 && name.indexOf('.webm') == -1 && name.indexOf('.wmv') == -1) {
|
|
|
message/* default */.ZP.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F");
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
if (!((_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.admin || (_user$userInfo2 = user.userInfo) !== null && _user$userInfo2 !== void 0 && _user$userInfo2.business) && file.size > MAX_FILE_SIZE * 1024 * 1024) {
|
|
|
message/* default */.ZP.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(MAX_FILE_SIZE, "M"));
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
if ((_state$videoList4 = state.videoList) !== null && _state$videoList4 !== void 0 && _state$videoList4.find(function (item) {
|
|
|
return item.name === file.name;
|
|
|
})) {
|
|
|
message/* default */.ZP.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
handleUpload(file);
|
|
|
};
|
|
|
var handleRemove = function handleRemove(name, isSuccess) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: ["\u60A8\u786E\u8BA4\u8981", isSuccess ? '删除' : '取消上传', "\u8BE5\u89C6\u9891\u5417\uFF1F"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
clearInput();
|
|
|
stateDispatch({
|
|
|
type: 'removeVideo',
|
|
|
payload: {
|
|
|
name: name
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleUpload = function handleUpload(file) {
|
|
|
var userData = '{"Vod":{}}';
|
|
|
setIsLoading(true);
|
|
|
if (uploader.current) {
|
|
|
uploader.current.addFile(file, null, null, null, userData);
|
|
|
return;
|
|
|
}
|
|
|
(0,aliyunUpload/* getUploader */.o)(params === null || params === void 0 ? void 0 : params.username, '', {
|
|
|
create: !uploader,
|
|
|
addFileSuccess: function addFileSuccess(uploadInfo) {
|
|
|
;
|
|
|
stateDispatch({
|
|
|
type: 'addVideo',
|
|
|
payload: {
|
|
|
uploadInfo: uploadInfo
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
onUploadProgress: function onUploadProgress(uploadInfo, totalSize, progress) {
|
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
|
stateDispatch({
|
|
|
type: 'updateProgress',
|
|
|
payload: {
|
|
|
uploadInfo: uploadInfo,
|
|
|
progressPercent: progressPercent
|
|
|
}
|
|
|
});
|
|
|
clearInput();
|
|
|
},
|
|
|
onUploadFailed: function onUploadFailed(uploadInfo) {
|
|
|
message/* default */.ZP.info('视频云服务出现异常,请重新上传。');
|
|
|
},
|
|
|
onUploadEnd: function onUploadEnd(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
},
|
|
|
onUploadSucceed: function onUploadSucceed(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
console.log("files.current", files.current);
|
|
|
// files.current
|
|
|
},
|
|
|
|
|
|
onUploadError: function onUploadError(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
},
|
|
|
gotUploader: function gotUploader(_uploader) {
|
|
|
_uploader.addFile(file, null, null, null, userData);
|
|
|
uploader.current = _uploader;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handlePublish = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _state$videoList5;
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if ((_state$videoList5 = state.videoList) !== null && _state$videoList5 !== void 0 && _state$videoList5.length) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请先上传视频');
|
|
|
return _context.abrupt("return");
|
|
|
case 3:
|
|
|
_context.next = 5;
|
|
|
return (0,service_user/* batchPublish */.dt)({
|
|
|
username: params.username,
|
|
|
videos: state.videoList.map(function (item) {
|
|
|
return {
|
|
|
video_id: item.videoId,
|
|
|
title: item.title,
|
|
|
filename: item.filename,
|
|
|
attachment_id: item.attachment_id,
|
|
|
course_id: params.coursesId,
|
|
|
category_id: searchParams.get("categoryId"),
|
|
|
allow_skip: item.allow_skip
|
|
|
};
|
|
|
})
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '视频', '上传视频']);
|
|
|
_umi_production_exports.history.back();
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handlePublish() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var hasFile = (_state$videoList6 = state.videoList) === null || _state$videoList6 === void 0 ? void 0 : _state$videoList6.length;
|
|
|
var renderUpload = function renderUpload() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.main,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.uploadTop,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
|
htmlFor: "fileUpload",
|
|
|
className: Uploadmodules.imgWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: Uploadmodules.defaultImg,
|
|
|
src: upload_namespaceObject
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: Uploadmodules.hoverImg,
|
|
|
src: upload_hover_namespaceObject
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Uploadmodules.uploadTitle,
|
|
|
children: "\u9009\u62E9\u60A8\u8981\u4E0A\u4F20\u7684\u89C6\u9891"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/users/".concat(params === null || params === void 0 ? void 0 : params.username, "/videos/protocol"),
|
|
|
className: Uploadmodules.colorBlue,
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Uploadmodules.uploadDescription,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.description,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u4E0A\u4F20\u8BF4\u660E\uFF1A\u76EE\u524D\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u5355\u4E2A\u89C6\u9891\u6587\u4EF6\u6700\u5927\u9650\u52361G\uFF0C\u5355\u6B21\u6700\u591A\u652F\u63013\u4E2A\u89C6\u9891\u6587\u4EF6\u4E0A\u4F20 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u89C6\u9891\u89C4\u683C\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u6E29\u99A8\u63D0\u793A\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Uploadmodules.colorOrange,
|
|
|
children: "\u4E3A\u4E86\u66F4\u597D\u7684\u64AD\u653E\u4F53\u9A8C\uFF0C\u5EFA\u8BAE\u60A8\u4F18\u5148\u4E0A\u4F20MP4\u683C\u5F0F\u3002\u5982\u679C\u60A8\u662F\u81EA\u5DF1\u5F55\u5236\u89C6\u9891\uFF0C\u5EFA\u8BAE\u60A8\u4FDD\u5B58\u7684\u65F6\u5019\u5C06\u89C6\u9891\u7F16\u7801\u8BBE\u7F6E\u4E3AAVC(H264)"
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderFile = function renderFile() {
|
|
|
var _state$videoList7, _state$videoList8;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.fileMain,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: isLoading,
|
|
|
children: (_state$videoList7 = state.videoList) === null || _state$videoList7 === void 0 ? void 0 : _state$videoList7.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.fileWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [index + 1, ". ", item.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.fileProgress,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
|
|
|
percent: item.loaded,
|
|
|
status: item.loaded == 100 ? "normal" : 'active'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Uploadmodules.fileCancel,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
return handleRemove(item.name, item.loaded == 100);
|
|
|
},
|
|
|
children: item.loaded === 100 ? '删除' : '取消上传'
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.fileInputWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr5",
|
|
|
children: "\u6807\u9898:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
value: item.title,
|
|
|
onChange: function onChange(e) {
|
|
|
stateDispatch({
|
|
|
type: 'updateTitle',
|
|
|
payload: {
|
|
|
title: e.target.value,
|
|
|
item: item
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
className: Uploadmodules.fileInput,
|
|
|
placeholder: "\u6807\u9898\u652F\u6301\u6700\u591A".concat(MAX_LENGTH, "\u4E2A\u5B57\u7B26"),
|
|
|
maxLength: MAX_LENGTH,
|
|
|
addonAfter: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-light-black font12",
|
|
|
children: [String(item.title.length), "/", MAX_LENGTH]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.fileImgWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "mr5",
|
|
|
children: "\u4E0A\u4F20\u5C01\u9762\u56FE:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CoverUpload/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.attachment_id,
|
|
|
onChange: function onChange(e) {
|
|
|
stateDispatch({
|
|
|
type: 'updateImg',
|
|
|
payload: {
|
|
|
attachment_id: e,
|
|
|
item: item
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "mt10",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr5",
|
|
|
children: "\u64AD\u653E\u8BBE\u7F6E:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
className: "font14",
|
|
|
checked: item.allow_skip,
|
|
|
onChange: function onChange(e) {
|
|
|
stateDispatch({
|
|
|
type: 'updateAllowSkip',
|
|
|
payload: {
|
|
|
allow_skip: e.target.checked,
|
|
|
item: item
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u5141\u8BB8\u5FEB\u8FDB\u64AD\u653E"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt10",
|
|
|
children: ((_state$videoList8 = state.videoList) === null || _state$videoList8 === void 0 ? void 0 : _state$videoList8.length) <= 2 ? /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
|
htmlFor: "fileUpload",
|
|
|
className: "".concat(Uploadmodules.continueAdd, " current"),
|
|
|
children: "\u7EE7\u7EED\u6DFB\u52A0"
|
|
|
}) : '提示:单次最多支持3个视频文件上传'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Uploadmodules.description,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u4E0A\u4F20\u8BF4\u660E\uFF1A\u76EE\u524D\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u5355\u4E2A\u89C6\u9891\u6587\u4EF6\u6700\u5927\u9650\u52361G\uFF0C\u5355\u6B21\u6700\u591A\u652F\u63013\u4E2A\u89C6\u9891\u6587\u4EF6\u4E0A\u4F20 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u89C6\u9891\u89C4\u683C\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u6E29\u99A8\u63D0\u793A\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Uploadmodules.colorOrange,
|
|
|
children: "\u4E3A\u4E86\u66F4\u597D\u7684\u64AD\u653E\u4F53\u9A8C\uFF0C\u5EFA\u8BAE\u60A8\u4F18\u5148\u4E0A\u4F20MP4\u683C\u5F0F\u3002\u5982\u679C\u60A8\u662F\u81EA\u5DF1\u5F55\u5236\u89C6\u9891\uFF0C\u5EFA\u8BAE\u60A8\u4FDD\u5B58\u7684\u65F6\u5019\u5C06\u89C6\u9891\u7F16\u7801\u8BBE\u7F6E\u4E3AAVC(H264)"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Uploadmodules.flexRowCenter,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: handlePublish,
|
|
|
children: "\u7ACB\u5373\u53D1\u5E03"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Uploadmodules.flexRowCenter, " mt10"),
|
|
|
children: ["\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/users/".concat(params === null || params === void 0 ? void 0 : params.username, "/videos/protocol"),
|
|
|
className: Uploadmodules.colorBlue,
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1"]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: Uploadmodules.bg,
|
|
|
style: {
|
|
|
width: '100%'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt5",
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: "baseline"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '8px'
|
|
|
},
|
|
|
className: "current mr10 font16",
|
|
|
onClick: function onClick() {
|
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/video"));
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h2", {
|
|
|
children: "\u4E0A\u4F20\u89C6\u9891"
|
|
|
})]
|
|
|
}), hasFile ? renderFile() : renderUpload(), /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
|
ref: files,
|
|
|
type: "file",
|
|
|
id: "fileUpload",
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
onChange: handleChangeUpload,
|
|
|
accept: ".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Video_Upload = ((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.models.index
|
|
|
};
|
|
|
})(Upload));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1502:
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/utils/aliyunUpload.ts ***!
|
|
|
\***********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ o: function() { return /* binding */ getUploader; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 97174);
|
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! aliyun-vod-upload-ll */ 93125);
|
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
var login = '';
|
|
|
var uploader;
|
|
|
var virtual_classroom_id = '';
|
|
|
function createUploader(options) {
|
|
|
doCreateUploader(options);
|
|
|
}
|
|
|
function doCreateUploader(options) {
|
|
|
uploader = new (aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default().Vod)({
|
|
|
timeout: 60000,
|
|
|
partSize: 1048576,
|
|
|
parallel: 5,
|
|
|
retryCount: 3,
|
|
|
retryDuration: 2,
|
|
|
region: 'ap-southeast-1',
|
|
|
userId: 1829848226361863,
|
|
|
enableUploadProgress: false,
|
|
|
addFileSuccess: function addFileSuccess(uploadInfo) {
|
|
|
console.log("addFileSuccess: " + uploadInfo.file.name);
|
|
|
options.addFileSuccess && options.addFileSuccess(uploadInfo);
|
|
|
uploader.startUpload();
|
|
|
},
|
|
|
// 开始上传
|
|
|
onUploadstarted: function onUploadstarted(uploadInfo) {
|
|
|
var fileName = uploadInfo.file.name;
|
|
|
if (!uploadInfo.videoId) {
|
|
|
var createUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
var _random = ''; // Math.random().toString().substring(3, 6)+'-'
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(createUrl, {
|
|
|
method: 'Post',
|
|
|
body: {
|
|
|
title: _random + fileName,
|
|
|
file_name: _random + fileName,
|
|
|
virtual_classroom_id: virtual_classroom_id
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
if (response) {
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
var uploadAddress = data.UploadAddress;
|
|
|
var videoId = data.VideoId;
|
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId);
|
|
|
}
|
|
|
})["catch"](function (error) {
|
|
|
uploader.deleteFile(uploader._curIndex);
|
|
|
uploader.nextUpload();
|
|
|
console.log(error);
|
|
|
});
|
|
|
console.log('文件开始上传...');
|
|
|
} else {
|
|
|
// 如果videoId有值,根据videoId刷新上传凭证
|
|
|
var refreshUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
video_id: uploadInfo.videoId,
|
|
|
title: fileName,
|
|
|
file_name: fileName,
|
|
|
virtual_classroom_id: virtual_classroom_id
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
if (response.status == -1) {
|
|
|
options.onUploadError && options.onUploadError(uploadInfo);
|
|
|
return;
|
|
|
}
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
var uploadAddress = data.UploadAddress;
|
|
|
var videoId = data.VideoId;
|
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress);
|
|
|
})["catch"](function (error) {
|
|
|
uploader.deleteFile(uploader._curIndex);
|
|
|
uploader.nextUpload();
|
|
|
console.log(error);
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
// 文件上传成功
|
|
|
onUploadSucceed: function onUploadSucceed(uploadInfo) {
|
|
|
options.onUploadSucceed && options.onUploadSucceed(uploadInfo);
|
|
|
console.log('文件上传成功!');
|
|
|
},
|
|
|
// 文件上传失败
|
|
|
onUploadFailed: function onUploadFailed(uploadInfo, code, message) {
|
|
|
options.onUploadFailed && options.onUploadFailed(uploadInfo);
|
|
|
console.log('文件上传失败!');
|
|
|
},
|
|
|
// 取消文件上传
|
|
|
onUploadCanceled: function onUploadCanceled(uploadInfo, code, message) {
|
|
|
console.log('文件上传已暂停!');
|
|
|
},
|
|
|
// 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
|
|
|
onUploadProgress: function onUploadProgress(uploadInfo, totalSize, progress) {
|
|
|
options.onUploadProgress && options.onUploadProgress(uploadInfo, totalSize, progress);
|
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
|
console.log('文件上传中...');
|
|
|
},
|
|
|
// 上传凭证超时
|
|
|
onUploadTokenExpired: function onUploadTokenExpired(uploadInfo) {
|
|
|
console.log('文件上传超时!');
|
|
|
var refreshUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
video_id: uploadInfo.videoId
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
uploader.resumeUploadWithAuth(uploadAuth);
|
|
|
})["catch"](function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
// 全部文件上传结束
|
|
|
onUploadEnd: function onUploadEnd(uploadInfo) {
|
|
|
options.onUploadEnd && options.onUploadEnd(uploadInfo);
|
|
|
console.log("onUploadEnd: uploaded all the files");
|
|
|
}
|
|
|
});
|
|
|
if (options.gotUploader) {
|
|
|
options.gotUploader(uploader);
|
|
|
}
|
|
|
}
|
|
|
function getUploader(_login, _virtual_classroom_id, options) {
|
|
|
_login && (login = _login);
|
|
|
_virtual_classroom_id && (virtual_classroom_id = _virtual_classroom_id);
|
|
|
// if (!uploader || options.create == true) {
|
|
|
createUploader(options);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 56762:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Z: function() { return /* binding */ useForceUpdate; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
function useForceUpdate() {
|
|
|
const [, forceUpdate] = react__WEBPACK_IMPORTED_MODULE_0__.useReducer(x => x + 1, 0);
|
|
|
return forceUpdate;
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 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.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_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_3_2_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_3_2_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.23.2@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(42371);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(99468);
|
|
|
;// 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_3_2_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 */ 17313);
|
|
|
/* 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)];
|
|
|
}));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1056:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ input; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_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/_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/form/context.js
|
|
|
var form_context = __webpack_require__(32441);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/style/index.js
|
|
|
var style = __webpack_require__(9937);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Group = props => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className
|
|
|
} = props;
|
|
|
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input');
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.ZP)(inputPrefixCls);
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-lg`]: props.size === 'large',
|
|
|
[`${prefixCls}-sm`]: props.size === 'small',
|
|
|
[`${prefixCls}-compact`]: props.compact,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, hashId, className);
|
|
|
const formItemContext = (0,_react_17_0_2_react.useContext)(form_context/* FormItemInputContext */.aM);
|
|
|
const groupFormItemContext = (0,_react_17_0_2_react.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
|
|
|
isFormItemInput: false
|
|
|
}), [formItemContext]);
|
|
|
if (false) {}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: cls,
|
|
|
style: props.style,
|
|
|
onMouseEnter: props.onMouseEnter,
|
|
|
onMouseLeave: props.onMouseLeave,
|
|
|
onFocus: props.onFocus,
|
|
|
onBlur: props.onBlur
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(form_context/* FormItemInputContext */.aM.Provider, {
|
|
|
value: groupFormItemContext
|
|
|
}, props.children)));
|
|
|
};
|
|
|
/* harmony default export */ var input_Group = (Group);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Input.js + 1 modules
|
|
|
var Input = __webpack_require__(9432);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeInvisibleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeInvisibleOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeInvisibleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
|
var EyeOutlined = __webpack_require__(15997);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(99468);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(88831);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/hooks/useRemovePasswordTimeout.js
|
|
|
var useRemovePasswordTimeout = __webpack_require__(59412);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Password.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 defaultIconRender = visible => visible ? /*#__PURE__*/_react_17_0_2_react.createElement(EyeOutlined/* default */.Z, null) : /*#__PURE__*/_react_17_0_2_react.createElement(icons_EyeInvisibleOutlined, null);
|
|
|
const ActionMap = {
|
|
|
click: 'onClick',
|
|
|
hover: 'onMouseOver'
|
|
|
};
|
|
|
const Password = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
visibilityToggle = true
|
|
|
} = props;
|
|
|
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
|
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
|
|
|
const inputRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (visibilityControlled) {
|
|
|
setVisible(visibilityToggle.visible);
|
|
|
}
|
|
|
}, [visibilityControlled, visibilityToggle]);
|
|
|
// Remove Password value
|
|
|
const removePasswordTimeout = (0,useRemovePasswordTimeout/* default */.Z)(inputRef);
|
|
|
const onVisibleChange = () => {
|
|
|
const {
|
|
|
disabled
|
|
|
} = props;
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (visible) {
|
|
|
removePasswordTimeout();
|
|
|
}
|
|
|
setVisible(prevState => {
|
|
|
var _a;
|
|
|
const newState = !prevState;
|
|
|
if (typeof visibilityToggle === 'object') {
|
|
|
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
|
|
|
}
|
|
|
return newState;
|
|
|
});
|
|
|
};
|
|
|
const getIcon = prefixCls => {
|
|
|
const {
|
|
|
action = 'click',
|
|
|
iconRender = defaultIconRender
|
|
|
} = props;
|
|
|
const iconTrigger = ActionMap[action] || '';
|
|
|
const icon = iconRender(visible);
|
|
|
const iconProps = {
|
|
|
[iconTrigger]: onVisibleChange,
|
|
|
className: `${prefixCls}-icon`,
|
|
|
key: 'passwordIcon',
|
|
|
onMouseDown: e => {
|
|
|
// Prevent focused state lost
|
|
|
// https://github.com/ant-design/ant-design/issues/15173
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
onMouseUp: e => {
|
|
|
// Prevent caret position change
|
|
|
// https://github.com/ant-design/ant-design/issues/23524
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.cloneElement( /*#__PURE__*/_react_17_0_2_react.isValidElement(icon) ? icon : /*#__PURE__*/_react_17_0_2_react.createElement("span", null, icon), iconProps);
|
|
|
};
|
|
|
const {
|
|
|
className,
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
size
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
|
|
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
|
const inputClassName = _classnames_2_3_2_classnames_default()(prefixCls, className, {
|
|
|
[`${prefixCls}-${size}`]: !!size
|
|
|
});
|
|
|
const omittedProps = Object.assign(Object.assign({}, (0,omit/* default */.Z)(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
|
|
|
type: visible ? 'text' : 'password',
|
|
|
className: inputClassName,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
suffix: suffixIcon
|
|
|
});
|
|
|
if (size) {
|
|
|
omittedProps.size = size;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(ref, inputRef)
|
|
|
}, omittedProps));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Password = (Password);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
|
var SearchOutlined = __webpack_require__(46820);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(92343);
|
|
|
// 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/hooks/useSize.js
|
|
|
var useSize = __webpack_require__(19716);
|
|
|
// 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/input/Search.js
|
|
|
"use client";
|
|
|
|
|
|
var Search_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 Search = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
className,
|
|
|
size: customizeSize,
|
|
|
suffix,
|
|
|
enterButton = false,
|
|
|
addonAfter,
|
|
|
loading,
|
|
|
disabled,
|
|
|
onSearch: customOnSearch,
|
|
|
onChange: customOnChange,
|
|
|
onCompositionStart,
|
|
|
onCompositionEnd
|
|
|
} = props,
|
|
|
restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const composedRef = _react_17_0_2_react.useRef(false);
|
|
|
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const {
|
|
|
compactSize
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const size = (0,useSize/* default */.Z)(ctx => {
|
|
|
var _a;
|
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
|
});
|
|
|
const inputRef = _react_17_0_2_react.useRef(null);
|
|
|
const onChange = e => {
|
|
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
|
|
customOnSearch(e.target.value, e, {
|
|
|
source: 'clear'
|
|
|
});
|
|
|
}
|
|
|
if (customOnChange) {
|
|
|
customOnChange(e);
|
|
|
}
|
|
|
};
|
|
|
const onMouseDown = e => {
|
|
|
var _a;
|
|
|
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
const onSearch = e => {
|
|
|
var _a, _b;
|
|
|
if (customOnSearch) {
|
|
|
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e, {
|
|
|
source: 'input'
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
const onPressEnter = e => {
|
|
|
if (composedRef.current || loading) {
|
|
|
return;
|
|
|
}
|
|
|
onSearch(e);
|
|
|
};
|
|
|
const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/_react_17_0_2_react.createElement(SearchOutlined/* default */.Z, null) : null;
|
|
|
const btnClassName = `${prefixCls}-button`;
|
|
|
let button;
|
|
|
const enterButtonAsElement = enterButton || {};
|
|
|
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
|
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
|
button = (0,reactNode/* cloneElement */.Tm)(enterButtonAsElement, Object.assign({
|
|
|
onMouseDown,
|
|
|
onClick: e => {
|
|
|
var _a, _b;
|
|
|
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
|
onSearch(e);
|
|
|
},
|
|
|
key: 'enterButton'
|
|
|
}, isAntdButton ? {
|
|
|
className: btnClassName,
|
|
|
size
|
|
|
} : {}));
|
|
|
} else {
|
|
|
button = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
className: btnClassName,
|
|
|
type: enterButton ? 'primary' : undefined,
|
|
|
size: size,
|
|
|
disabled: disabled,
|
|
|
key: "enterButton",
|
|
|
onMouseDown: onMouseDown,
|
|
|
onClick: onSearch,
|
|
|
loading: loading,
|
|
|
icon: searchIcon
|
|
|
}, enterButton);
|
|
|
}
|
|
|
if (addonAfter) {
|
|
|
button = [button, (0,reactNode/* cloneElement */.Tm)(addonAfter, {
|
|
|
key: 'addonAfter'
|
|
|
})];
|
|
|
}
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-${size}`]: !!size,
|
|
|
[`${prefixCls}-with-button`]: !!enterButton
|
|
|
}, className);
|
|
|
const handleOnCompositionStart = e => {
|
|
|
composedRef.current = true;
|
|
|
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
|
|
|
};
|
|
|
const handleOnCompositionEnd = e => {
|
|
|
composedRef.current = false;
|
|
|
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(inputRef, ref),
|
|
|
onPressEnter: onPressEnter
|
|
|
}, restProps, {
|
|
|
size: size,
|
|
|
onCompositionStart: handleOnCompositionStart,
|
|
|
onCompositionEnd: handleOnCompositionEnd,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
addonAfter: button,
|
|
|
suffix: suffix,
|
|
|
onChange: onChange,
|
|
|
className: cls,
|
|
|
disabled: disabled
|
|
|
}));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Search = (Search);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
|
var TextArea = __webpack_require__(1643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const input_Input = Input/* default */.Z;
|
|
|
if (false) {}
|
|
|
input_Input.Group = input_Group;
|
|
|
input_Input.Search = input_Search;
|
|
|
input_Input.TextArea = TextArea/* default */.Z;
|
|
|
input_Input.Password = input_Password;
|
|
|
/* harmony default export */ var input = (input_Input);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 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);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 5630:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js ***!
|
|
|
\*****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony export Checkbox */
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ 26508);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 74710);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ 80268);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ 39718);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ 26779);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 12124);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/hooks/useMergedState */ 84381);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Checkbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
|
|
var _classNames;
|
|
|
var _props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
|
|
|
className = props.className,
|
|
|
style = props.style,
|
|
|
checked = props.checked,
|
|
|
disabled = props.disabled,
|
|
|
_props$defaultChecked = props.defaultChecked,
|
|
|
defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
|
|
|
_props$type = props.type,
|
|
|
type = _props$type === void 0 ? 'checkbox' : _props$type,
|
|
|
title = props.title,
|
|
|
onChange = props.onChange,
|
|
|
inputProps = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(props, _excluded);
|
|
|
var inputRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
|
|
|
var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(defaultChecked, {
|
|
|
value: checked
|
|
|
}),
|
|
|
_useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(_useMergedState, 2),
|
|
|
rawValue = _useMergedState2[0],
|
|
|
setRawValue = _useMergedState2[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useImperativeHandle)(ref, function () {
|
|
|
return {
|
|
|
focus: function focus() {
|
|
|
var _inputRef$current;
|
|
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
|
},
|
|
|
blur: function blur() {
|
|
|
var _inputRef$current2;
|
|
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
|
},
|
|
|
input: inputRef.current
|
|
|
};
|
|
|
});
|
|
|
var classString = classnames__WEBPACK_IMPORTED_MODULE_0___default()(prefixCls, className, (_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-checked"), rawValue), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
|
var handleChange = function handleChange(e) {
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (!('checked' in props)) {
|
|
|
setRawValue(e.target.checked);
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
|
target: (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({}, props), {}, {
|
|
|
type: type,
|
|
|
checked: e.target.checked
|
|
|
}),
|
|
|
stopPropagation: function stopPropagation() {
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
preventDefault: function preventDefault() {
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
nativeEvent: e.nativeEvent
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
|
className: classString,
|
|
|
title: title,
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("input", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({}, inputProps, {
|
|
|
className: "".concat(prefixCls, "-input"),
|
|
|
ref: inputRef,
|
|
|
onChange: handleChange,
|
|
|
disabled: disabled,
|
|
|
checked: !!rawValue,
|
|
|
type: type
|
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-inner")
|
|
|
}));
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Checkbox);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |