|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[53270],{
|
|
|
|
|
|
/***/ 68269:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./src/components/User/RegisterPanel/index.tsx + 1 modules ***!
|
|
|
\*****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ RegisterPanel; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(14934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
|
var es_message = __webpack_require__(12461);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
|
|
|
var checkbox_style = __webpack_require__(82000);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
|
|
|
var es_checkbox = __webpack_require__(32808);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var button_style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
|
var input_style = __webpack_require__(69463);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(75008);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
|
var form_style = __webpack_require__(75627);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
|
var es_form = __webpack_require__(51018);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./src/components/User/RegisterPanel/unlock.tsx + 1 modules
|
|
|
var unlock = __webpack_require__(61854);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(29427);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/RegisterPanel/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var RegisterPanelmodules = ({"wrap":"wrap___FgHHn","formWrapper":"formWrapper___FFsPt","link":"link___Z6mDj","serviceTerms":"serviceTerms___VjOD1"});
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/RegisterPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var inputStyle = {
|
|
|
height: 46,
|
|
|
borderRadius: 4
|
|
|
};
|
|
|
var loginRegex = /(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$)/i;
|
|
|
var initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var Types;
|
|
|
(function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
})(Types || (Types = {}));
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.setTimer:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var RegisterComponent = function RegisterComponent(_ref) {
|
|
|
var _globalSetting$settin, _globalSetting$settin2;
|
|
|
var validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
register = _ref.register,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$buttonText = _ref.buttonText,
|
|
|
buttonText = _ref$buttonText === void 0 ? '注册' : _ref$buttonText,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,react.useReducer)(reducer, initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var _useState = (0,react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
var timer = state.timer;
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function _onFinish() {
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var login, password, code, _yield$register, message, status, addinfo, href;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
login = values.login, password = values.password, code = values.code;
|
|
|
_context2.next = 3;
|
|
|
return register({
|
|
|
login: login,
|
|
|
password: password,
|
|
|
code: code
|
|
|
});
|
|
|
case 3:
|
|
|
_yield$register = _context2.sent;
|
|
|
message = _yield$register.message;
|
|
|
status = _yield$register.status;
|
|
|
if (!(status < 0)) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
return _context2.abrupt("return");
|
|
|
case 9:
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
es_message/* default.info */.ZP.info('注册成功');
|
|
|
addinfo = localStorage.getItem('addinfo');
|
|
|
if (addinfo === '2') {
|
|
|
localStorage.setItem('addinfo', '2');
|
|
|
href = localStorage.getItem('classromeurl');
|
|
|
_umi_production_exports.history.replace(href);
|
|
|
} else {
|
|
|
_umi_production_exports.history.replace('/');
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function onValidateName() {
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
function _onValidateName() {
|
|
|
_onValidateName = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var login, flag, _yield$validateName, status, message, isOk;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
login = form.getFieldValue('login');
|
|
|
flag = 0;
|
|
|
if (!(!loginRegex.test(login) || login.indexOf(" ") > -1)) {
|
|
|
_context3.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: ['请输入正确的手机号或邮箱']
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
return _context3.abrupt("return", flag);
|
|
|
case 6:
|
|
|
_context3.next = 8;
|
|
|
return validateName({
|
|
|
login: login,
|
|
|
type: 1
|
|
|
});
|
|
|
case 8:
|
|
|
_yield$validateName = _context3.sent;
|
|
|
status = _yield$validateName.status;
|
|
|
message = _yield$validateName.message;
|
|
|
isOk = status > 0;
|
|
|
if (isOk) {
|
|
|
flag = 2;
|
|
|
} else {
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
}
|
|
|
return _context3.abrupt("return", flag);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
var onGetCode = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var verify, login, _yield$getCode, status, message;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
verify = form.getFieldValue('verify');
|
|
|
login = form.getFieldValue('login');
|
|
|
if (verify) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
form.validateFields(['verify']);
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
case 6:
|
|
|
setCodeLoading(true);
|
|
|
_context.next = 9;
|
|
|
return getCode({
|
|
|
login: login,
|
|
|
type: 1,
|
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
|
});
|
|
|
case 9:
|
|
|
_yield$getCode = _context.sent;
|
|
|
status = _yield$getCode.status;
|
|
|
message = _yield$getCode.message;
|
|
|
if (status < 0) {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
dispatch({
|
|
|
type: Types.setTimer,
|
|
|
payload: 60
|
|
|
});
|
|
|
setCodeLoading(false);
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onGetCode() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function validatePassword(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (value.indexOf(" ") > -1) {
|
|
|
return Promise.reject('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
var len = value.length;
|
|
|
if (len >= 8 && len <= 16) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
}
|
|
|
var verifyValidate = function verifyValidate(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
};
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
var LoginValidate = function LoginValidate(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (value.indexOf(" ") > -1) {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
if (loginRegex.test(value)) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: RegisterPanelmodules.wrap,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
className: RegisterPanelmodules.formWrapper,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: false
|
|
|
},
|
|
|
onFinish: onFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "login",
|
|
|
label: "\u8D26\u53F7",
|
|
|
required: false,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号或邮箱'
|
|
|
}, {
|
|
|
validator: LoginValidate
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: inputStyle,
|
|
|
autoComplete: "new-login",
|
|
|
size: "large",
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "verify",
|
|
|
rules: [{
|
|
|
validator: verifyValidate
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(unlock/* default */.Z, {
|
|
|
onValidate: onValidateName
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u9A8C\u8BC1\u7801",
|
|
|
required: false,
|
|
|
name: "code",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入验证码'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
loading: codeLoading,
|
|
|
type: "link",
|
|
|
onClick: onGetCode,
|
|
|
disabled: timer > 0,
|
|
|
children: [" ", timer === 0 ? '获取验证码' : "".concat(timer, "\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6")]
|
|
|
}),
|
|
|
style: {
|
|
|
paddingRight: 2,
|
|
|
height: 48,
|
|
|
borderRadius: 4
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
size: "large"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u5BC6\u7801",
|
|
|
name: "password",
|
|
|
required: false,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位密码,区分大小写、不能使用空格'
|
|
|
}, {
|
|
|
validator: validatePassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default.Password */.Z.Password, {
|
|
|
autoComplete: "new-password",
|
|
|
style: inputStyle,
|
|
|
size: "large",
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199",
|
|
|
visibilityToggle: false
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin2 = globalSetting.setting) !== null && _globalSetting$settin2 !== void 0 && _globalSetting$settin2.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
|
|
|
className: RegisterPanelmodules.serviceTerms,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
name: "protool",
|
|
|
valuePropName: "checked",
|
|
|
rules: [{
|
|
|
validator: function validator(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请同意《服务协议条款》');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#666666',
|
|
|
fontSize: 14
|
|
|
},
|
|
|
children: "\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "font14",
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
size: "large",
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: inputStyle,
|
|
|
className: "font16",
|
|
|
children: [" ", buttonText, " "]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var RegisterPanel = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var globalSetting = _ref3.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting
|
|
|
};
|
|
|
})(RegisterComponent));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 61854:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./src/components/User/RegisterPanel/unlock.tsx + 1 modules ***!
|
|
|
\******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ unlock; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/RegisterPanel/unlock.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js
|
|
|
var CloseOutlined = __webpack_require__(28508);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CheckOutlined.js
|
|
|
var CheckOutlined = __webpack_require__(88284);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DoubleRightOutlined.js
|
|
|
var DoubleRightOutlined = __webpack_require__(43183);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(29427);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/RegisterPanel/unlock.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialState = {
|
|
|
moveX: 0,
|
|
|
verify: 0
|
|
|
};
|
|
|
var Types;
|
|
|
(function (Types) {
|
|
|
Types[Types["SET_MOVEX"] = 0] = "SET_MOVEX";
|
|
|
Types[Types["VERIFY"] = 1] = "VERIFY";
|
|
|
})(Types || (Types = {}));
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.SET_MOVEX:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
moveX: action.payload
|
|
|
});
|
|
|
case Types.VERIFY:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//antd 自定义表单项
|
|
|
/* harmony default export */ var unlock = (function (_ref) {
|
|
|
var value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
onValidate = _ref.onValidate;
|
|
|
var _useReducer = (0,react.useReducer)(reducer, initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var moveX = state.moveX,
|
|
|
verify = state.verify;
|
|
|
var handlerEl = (0,react.useRef)();
|
|
|
var wrapperEL = (0,react.useRef)();
|
|
|
var bgEl = (0,react.useRef)();
|
|
|
var startDrag = (0,react.useRef)();
|
|
|
var wrapperRect = (0,react.useMemo)(function () {
|
|
|
if (wrapperEL.current) {
|
|
|
return wrapperEL.current.getBoundingClientRect();
|
|
|
}
|
|
|
}, [wrapperEL.current]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (wrapperRect) {
|
|
|
var onMove = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
|
|
|
var pageX;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!startDrag.current) {
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
pageX = e.pageX - left;
|
|
|
if (isMobile) {
|
|
|
pageX = e.changedTouches[0].pageX - left;
|
|
|
}
|
|
|
if (pageX < 0) {
|
|
|
pageX = 0;
|
|
|
}
|
|
|
if (!(pageX >= distance)) {
|
|
|
_context.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
startDrag.current = false;
|
|
|
pageX = distance;
|
|
|
_context.next = 9;
|
|
|
return onValidate();
|
|
|
case 9:
|
|
|
flag = _context.sent;
|
|
|
dispatch({
|
|
|
type: Types.VERIFY,
|
|
|
payload: {
|
|
|
moveX: pageX,
|
|
|
verify: flag
|
|
|
}
|
|
|
});
|
|
|
onChange(flag);
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
case 14:
|
|
|
dispatch({
|
|
|
type: Types.SET_MOVEX,
|
|
|
payload: pageX
|
|
|
});
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onMove(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var onMouseUp = function onMouseUp() {
|
|
|
startDrag.current = false;
|
|
|
if (flag === 0) {
|
|
|
handlerEl.current.style.transition = 'left .5s ease';
|
|
|
bgEl.current.style.transition = 'width .5s ease';
|
|
|
dispatch({
|
|
|
type: Types.VERIFY,
|
|
|
payload: {
|
|
|
moveX: 0
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
var flag = 0;
|
|
|
var width = wrapperRect.width,
|
|
|
left = wrapperRect.left;
|
|
|
var distance = width - 48;
|
|
|
var isMobile = !(0,util/* isPc */.b9)();
|
|
|
if (!isMobile) {
|
|
|
window.addEventListener('mousemove', onMove);
|
|
|
window.addEventListener('mouseup', onMouseUp);
|
|
|
} else {
|
|
|
window.addEventListener('touchmove', onMove);
|
|
|
window.addEventListener('touchend', onMouseUp);
|
|
|
}
|
|
|
return function () {
|
|
|
if (!isMobile) {
|
|
|
window.removeEventListener('mousemove', onMove);
|
|
|
window.removeEventListener('mouseup', onMouseUp);
|
|
|
} else {
|
|
|
window.removeEventListener('touchmove', onMove);
|
|
|
window.removeEventListener('touchend', onMouseUp);
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
}, [wrapperRect, util/* isPc */.b9]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: Types.VERIFY,
|
|
|
payload: {
|
|
|
verify: value,
|
|
|
moveX: value ? (wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - 48 : 0
|
|
|
}
|
|
|
});
|
|
|
}, [value]);
|
|
|
function onStartDrag() {
|
|
|
if (!verify) {
|
|
|
startDrag.current = true;
|
|
|
handlerEl.current.style.transition = '';
|
|
|
bgEl.current.style.transition = '';
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
ref: wrapperEL,
|
|
|
className: "unlock-wrapper",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: bgEl,
|
|
|
className: verify === 1 ? 'unlock-error-bg' : 'unlock-bg',
|
|
|
style: {
|
|
|
width: moveX
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "unlock-text",
|
|
|
children: verify ? verify === 1 ? '验证失败' : '验证通过' : '拖动滑块至右侧验证'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: handlerEl,
|
|
|
onTouchStart: onStartDrag,
|
|
|
onMouseDown: onStartDrag,
|
|
|
style: {
|
|
|
left: moveX
|
|
|
},
|
|
|
className: "unlock-handler",
|
|
|
children: verify ? verify === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(CheckOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(DoubleRightOutlined/* default */.Z, {})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 88063:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/pages/User/Register/service.ts ***!
|
|
|
\********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Ol": function() { return /* binding */ validateName; },
|
|
|
/* harmony export */ "c0": function() { return /* binding */ resetPassword; },
|
|
|
/* harmony export */ "o1": function() { return /* binding */ getValidateCode; },
|
|
|
/* harmony export */ "ry": function() { return /* binding */ wechatRegister; },
|
|
|
/* harmony export */ "z2": function() { return /* binding */ register; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 84519);
|
|
|
|
|
|
//type 1 表示用户注册 2 忘记密码 3 绑定手机/邮箱
|
|
|
function validateName(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)('accounts/valid_email_and_phone.json', params);
|
|
|
}
|
|
|
//type 1:用户注册注册 2:忘记密码 3:绑定手机 4: 绑定邮箱,5: 验收手机号有效
|
|
|
function getValidateCode(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)('accounts/get_verification_code.json', params);
|
|
|
}
|
|
|
function register(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)('accounts/register.json', params);
|
|
|
}
|
|
|
function wechatRegister(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)('weapps/register.json', params);
|
|
|
}
|
|
|
function resetPassword(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)('accounts/reset_password.json', params);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 32808:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/checkbox/index.js + 2 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/@babel/runtime/helpers/esm/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(4942);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(87462);
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
|
var classnames = __webpack_require__(94184);
|
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-checkbox/es/index.js
|
|
|
var es = __webpack_require__(50132);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(53124);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
|
var context = __webpack_require__(65223);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__(97685);
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(98423);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Group.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var GroupContext = /*#__PURE__*/react.createContext(null);
|
|
|
var InternalCheckboxGroup = function InternalCheckboxGroup(_a, ref) {
|
|
|
var defaultValue = _a.defaultValue,
|
|
|
children = _a.children,
|
|
|
_a$options = _a.options,
|
|
|
options = _a$options === void 0 ? [] : _a$options,
|
|
|
customizePrefixCls = _a.prefixCls,
|
|
|
className = _a.className,
|
|
|
style = _a.style,
|
|
|
onChange = _a.onChange,
|
|
|
restProps = __rest(_a, ["defaultValue", "children", "options", "prefixCls", "className", "style", "onChange"]);
|
|
|
var _React$useContext = react.useContext(config_provider_context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
var _React$useState = react.useState(restProps.value || defaultValue || []),
|
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
|
value = _React$useState2[0],
|
|
|
setValue = _React$useState2[1];
|
|
|
var _React$useState3 = react.useState([]),
|
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
|
registeredValues = _React$useState4[0],
|
|
|
setRegisteredValues = _React$useState4[1];
|
|
|
react.useEffect(function () {
|
|
|
if ('value' in restProps) {
|
|
|
setValue(restProps.value || []);
|
|
|
}
|
|
|
}, [restProps.value]);
|
|
|
var getOptions = function getOptions() {
|
|
|
return options.map(function (option) {
|
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
|
return {
|
|
|
label: option,
|
|
|
value: option
|
|
|
};
|
|
|
}
|
|
|
return option;
|
|
|
});
|
|
|
};
|
|
|
var cancelValue = function cancelValue(val) {
|
|
|
setRegisteredValues(function (prevValues) {
|
|
|
return prevValues.filter(function (v) {
|
|
|
return v !== val;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
var registerValue = function registerValue(val) {
|
|
|
setRegisteredValues(function (prevValues) {
|
|
|
return [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]);
|
|
|
});
|
|
|
};
|
|
|
var toggleOption = function toggleOption(option) {
|
|
|
var optionIndex = value.indexOf(option.value);
|
|
|
var newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
|
if (optionIndex === -1) {
|
|
|
newValue.push(option.value);
|
|
|
} else {
|
|
|
newValue.splice(optionIndex, 1);
|
|
|
}
|
|
|
if (!('value' in restProps)) {
|
|
|
setValue(newValue);
|
|
|
}
|
|
|
var opts = getOptions();
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(function (val) {
|
|
|
return registeredValues.includes(val);
|
|
|
}).sort(function (a, b) {
|
|
|
var indexA = opts.findIndex(function (opt) {
|
|
|
return opt.value === a;
|
|
|
});
|
|
|
var indexB = opts.findIndex(function (opt) {
|
|
|
return opt.value === b;
|
|
|
});
|
|
|
return indexA - indexB;
|
|
|
}));
|
|
|
};
|
|
|
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
var groupPrefixCls = "".concat(prefixCls, "-group");
|
|
|
var domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
|
if (options && options.length > 0) {
|
|
|
children = getOptions().map(function (option) {
|
|
|
return /*#__PURE__*/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: "".concat(groupPrefixCls, "-item"),
|
|
|
style: option.style
|
|
|
}, option.label);
|
|
|
});
|
|
|
}
|
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
|
var context = {
|
|
|
toggleOption: toggleOption,
|
|
|
value: value,
|
|
|
disabled: restProps.disabled,
|
|
|
name: restProps.name,
|
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
|
registerValue: registerValue,
|
|
|
cancelValue: cancelValue
|
|
|
};
|
|
|
var classString = classnames_default()(groupPrefixCls, (0,defineProperty/* default */.Z)({}, "".concat(groupPrefixCls, "-rtl"), direction === 'rtl'), className);
|
|
|
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
|
className: classString,
|
|
|
style: style
|
|
|
}, domProps, {
|
|
|
ref: ref
|
|
|
}), /*#__PURE__*/react.createElement(GroupContext.Provider, {
|
|
|
value: context
|
|
|
}, children));
|
|
|
};
|
|
|
var CheckboxGroup = /*#__PURE__*/react.forwardRef(InternalCheckboxGroup);
|
|
|
/* harmony default export */ var Group = (/*#__PURE__*/react.memo(CheckboxGroup));
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
|
var DisabledContext = __webpack_require__(98866);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Checkbox.js
|
|
|
|
|
|
|
|
|
var Checkbox_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;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var InternalCheckbox = function InternalCheckbox(_a, ref) {
|
|
|
var _classNames;
|
|
|
var _b;
|
|
|
var customizePrefixCls = _a.prefixCls,
|
|
|
className = _a.className,
|
|
|
children = _a.children,
|
|
|
_a$indeterminate = _a.indeterminate,
|
|
|
indeterminate = _a$indeterminate === void 0 ? false : _a$indeterminate,
|
|
|
style = _a.style,
|
|
|
onMouseEnter = _a.onMouseEnter,
|
|
|
onMouseLeave = _a.onMouseLeave,
|
|
|
_a$skipGroup = _a.skipGroup,
|
|
|
skipGroup = _a$skipGroup === void 0 ? false : _a$skipGroup,
|
|
|
disabled = _a.disabled,
|
|
|
restProps = Checkbox_rest(_a, ["prefixCls", "className", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
|
var _React$useContext = react.useContext(config_provider_context/* ConfigContext */.E_),
|
|
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
|
direction = _React$useContext.direction;
|
|
|
var checkboxGroup = react.useContext(GroupContext);
|
|
|
var _useContext = (0,react.useContext)(context/* FormItemInputContext */.aM),
|
|
|
isFormItemInput = _useContext.isFormItemInput;
|
|
|
var contextDisabled = (0,react.useContext)(DisabledContext/* default */.Z);
|
|
|
var mergedDisabled = (_b = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _b !== void 0 ? _b : contextDisabled;
|
|
|
var prevValue = react.useRef(restProps.value);
|
|
|
react.useEffect(function () {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
false ? 0 : void 0;
|
|
|
}, []);
|
|
|
react.useEffect(function () {
|
|
|
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 function () {
|
|
|
return checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
|
};
|
|
|
}, [restProps.value]);
|
|
|
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
var checkboxProps = (0,esm_extends/* default */.Z)({}, 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);
|
|
|
}
|
|
|
var classString = classnames_default()((_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-wrapper"), true), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-wrapper-checked"), checkboxProps.checked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-wrapper-disabled"), mergedDisabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-wrapper-in-form-item"), isFormItemInput), _classNames), className);
|
|
|
var checkboxClass = classnames_default()((0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-indeterminate"), indeterminate));
|
|
|
var ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
|
return (
|
|
|
/*#__PURE__*/
|
|
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
|
react.createElement("label", {
|
|
|
className: classString,
|
|
|
style: style,
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, /*#__PURE__*/react.createElement(es/* default */.Z, (0,esm_extends/* default */.Z)({
|
|
|
"aria-checked": ariaChecked
|
|
|
}, checkboxProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
className: checkboxClass,
|
|
|
disabled: mergedDisabled,
|
|
|
ref: ref
|
|
|
})), children !== undefined && /*#__PURE__*/react.createElement("span", null, children))
|
|
|
);
|
|
|
};
|
|
|
var Checkbox = /*#__PURE__*/react.forwardRef(InternalCheckbox);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/index.js
|
|
|
|
|
|
|
|
|
var es_checkbox_Checkbox = checkbox_Checkbox;
|
|
|
es_checkbox_Checkbox.Group = Group;
|
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82000:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./node_modules/antd/es/checkbox/style/index.js + 1 modules ***!
|
|
|
\******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/default.less
|
|
|
var style_default = __webpack_require__(43146);
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/style/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/style/index.js
|
|
|
|
|
|
|
|
|
// deps-lint-skip: form
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 50132:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/rc-checkbox/es/index.js ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ 87462);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ 4942);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ 45987);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ 15671);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ 43144);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ 60136);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createSuper */ 51630);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ 94184);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
|
|
|
|
|
|
|
|
|
|
var Checkbox = /*#__PURE__*/function (_Component) {
|
|
|
(0,_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(Checkbox, _Component);
|
|
|
|
|
|
var _super = (0,_babel_runtime_helpers_esm_createSuper__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(Checkbox);
|
|
|
|
|
|
function Checkbox(props) {
|
|
|
var _this;
|
|
|
|
|
|
(0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(this, Checkbox);
|
|
|
|
|
|
_this = _super.call(this, props);
|
|
|
|
|
|
_this.handleChange = function (e) {
|
|
|
var _this$props = _this.props,
|
|
|
disabled = _this$props.disabled,
|
|
|
onChange = _this$props.onChange;
|
|
|
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!('checked' in _this.props)) {
|
|
|
_this.setState({
|
|
|
checked: e.target.checked
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (onChange) {
|
|
|
onChange({
|
|
|
target: (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)({}, _this.props), {}, {
|
|
|
checked: e.target.checked
|
|
|
}),
|
|
|
stopPropagation: function stopPropagation() {
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
preventDefault: function preventDefault() {
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
nativeEvent: e.nativeEvent
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_this.saveInput = function (node) {
|
|
|
_this.input = node;
|
|
|
};
|
|
|
|
|
|
var checked = 'checked' in props ? props.checked : props.defaultChecked;
|
|
|
_this.state = {
|
|
|
checked: checked
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
(0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(Checkbox, [{
|
|
|
key: "focus",
|
|
|
value: function focus() {
|
|
|
this.input.focus();
|
|
|
}
|
|
|
}, {
|
|
|
key: "blur",
|
|
|
value: function blur() {
|
|
|
this.input.blur();
|
|
|
}
|
|
|
}, {
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _classNames;
|
|
|
|
|
|
var _this$props2 = this.props,
|
|
|
prefixCls = _this$props2.prefixCls,
|
|
|
className = _this$props2.className,
|
|
|
style = _this$props2.style,
|
|
|
name = _this$props2.name,
|
|
|
id = _this$props2.id,
|
|
|
type = _this$props2.type,
|
|
|
disabled = _this$props2.disabled,
|
|
|
readOnly = _this$props2.readOnly,
|
|
|
tabIndex = _this$props2.tabIndex,
|
|
|
onClick = _this$props2.onClick,
|
|
|
onFocus = _this$props2.onFocus,
|
|
|
onBlur = _this$props2.onBlur,
|
|
|
onKeyDown = _this$props2.onKeyDown,
|
|
|
onKeyPress = _this$props2.onKeyPress,
|
|
|
onKeyUp = _this$props2.onKeyUp,
|
|
|
autoFocus = _this$props2.autoFocus,
|
|
|
value = _this$props2.value,
|
|
|
required = _this$props2.required,
|
|
|
others = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(_this$props2, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "onKeyDown", "onKeyPress", "onKeyUp", "autoFocus", "value", "required"]);
|
|
|
|
|
|
var globalProps = Object.keys(others).reduce(function (prev, key) {
|
|
|
if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
prev[key] = others[key];
|
|
|
}
|
|
|
|
|
|
return prev;
|
|
|
}, {});
|
|
|
var checked = this.state.checked;
|
|
|
var classString = classnames__WEBPACK_IMPORTED_MODULE_1___default()(prefixCls, className, (_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-checked"), checked), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", {
|
|
|
className: classString,
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z)({
|
|
|
name: name,
|
|
|
id: id,
|
|
|
type: type,
|
|
|
required: required,
|
|
|
readOnly: readOnly,
|
|
|
disabled: disabled,
|
|
|
tabIndex: tabIndex,
|
|
|
className: "".concat(prefixCls, "-input"),
|
|
|
checked: !!checked,
|
|
|
onClick: onClick,
|
|
|
onFocus: onFocus,
|
|
|
onBlur: onBlur,
|
|
|
onKeyUp: onKeyUp,
|
|
|
onKeyDown: onKeyDown,
|
|
|
onKeyPress: onKeyPress,
|
|
|
onChange: this.handleChange,
|
|
|
autoFocus: autoFocus,
|
|
|
ref: this.saveInput,
|
|
|
value: value
|
|
|
}, globalProps)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-inner")
|
|
|
}));
|
|
|
}
|
|
|
}], [{
|
|
|
key: "getDerivedStateFromProps",
|
|
|
value: function getDerivedStateFromProps(props, state) {
|
|
|
if ('checked' in props) {
|
|
|
return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)({}, state), {}, {
|
|
|
checked: props.checked
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return Checkbox;
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
|
|
|
|
|
|
Checkbox.defaultProps = {
|
|
|
prefixCls: 'rc-checkbox',
|
|
|
className: '',
|
|
|
style: {},
|
|
|
type: 'checkbox',
|
|
|
defaultChecked: false,
|
|
|
onFocus: function onFocus() {},
|
|
|
onBlur: function onBlur() {},
|
|
|
onChange: function onChange() {},
|
|
|
onKeyDown: function onKeyDown() {},
|
|
|
onKeyPress: function onKeyPress() {},
|
|
|
onKeyUp: function onKeyUp() {}
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (Checkbox);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |