@pisell/private-materials 3.4.44 → 3.4.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +150 -164
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/pay/toC/index.js +23 -20
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/pro/Login2.0/AuthModal.d.ts +143 -0
- package/es/pro/Login2.0/AuthModal.js +630 -0
- package/es/pro/Login2.0/Login2.d.ts +61 -0
- package/es/pro/Login2.0/Login2.js +2235 -0
- package/es/pro/Login2.0/Register2.d.ts +65 -0
- package/es/pro/Login2.0/Register2.js +1501 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.js +330 -0
- package/es/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/es/pro/Login2.0/components/LegalTerms.js +51 -0
- package/es/pro/Login2.0/components/LegalTerms.less +74 -0
- package/es/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/es/pro/Login2.0/components/LoginCodeInput.js +207 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.js +55 -0
- package/es/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/es/pro/Login2.0/components/PhoneInput.js +414 -0
- package/es/pro/Login2.0/components/PhoneInput.less +148 -0
- package/es/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/es/pro/Login2.0/components/phoneValidation.js +228 -0
- package/es/pro/Login2.0/hooks/index.d.ts +2 -0
- package/es/pro/Login2.0/hooks/index.js +1 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.js +87 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.js +158 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.js +31 -0
- package/es/pro/Login2.0/index.js +8 -0
- package/es/pro/Login2.0/index.less +1002 -0
- package/es/pro/Login2.0/locales.d.ts +543 -0
- package/es/pro/Login2.0/locales.js +622 -0
- package/es/pro/Login2.0/shared/Header.d.ts +11 -0
- package/es/pro/Login2.0/shared/Header.js +42 -0
- package/es/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/es/pro/Login2.0/shared/OAuthButtons.js +59 -0
- package/es/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/es/pro/Login2.0/shared/registerFlow.js +171 -0
- package/es/pro/Login2.0/shared/types.d.ts +232 -0
- package/es/pro/Login2.0/shared/types.js +1 -0
- package/es/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/es/pro/Login2.0/steps/CodeInput.js +209 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.js +35 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +25 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.js +33 -0
- package/es/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/es/pro/Login2.0/steps/SetPassword.js +148 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.js +35 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.js +17 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.js +54 -0
- package/es/pro/Login2.0/steps/index.d.ts +19 -0
- package/es/pro/Login2.0/steps/index.js +11 -0
- package/es/pro/Login2.0/steps/steps.less +423 -0
- package/es/pro/Login2.0/types.d.ts +167 -0
- package/es/pro/Login2.0/types.js +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/pay/toC/index.js +9 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/index.d.ts +1 -0
- package/lib/index.js +7 -0
- package/lib/pro/Login2.0/AuthModal.d.ts +143 -0
- package/lib/pro/Login2.0/AuthModal.js +503 -0
- package/lib/pro/Login2.0/Login2.d.ts +61 -0
- package/lib/pro/Login2.0/Login2.js +1544 -0
- package/lib/pro/Login2.0/Register2.d.ts +65 -0
- package/lib/pro/Login2.0/Register2.js +1062 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.js +213 -0
- package/lib/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/lib/pro/Login2.0/components/LegalTerms.js +76 -0
- package/lib/pro/Login2.0/components/LegalTerms.less +74 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.js +161 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.js +87 -0
- package/lib/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/lib/pro/Login2.0/components/PhoneInput.js +263 -0
- package/lib/pro/Login2.0/components/PhoneInput.less +148 -0
- package/lib/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/lib/pro/Login2.0/components/phoneValidation.js +153 -0
- package/lib/pro/Login2.0/hooks/index.d.ts +2 -0
- package/lib/pro/Login2.0/hooks/index.js +29 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.js +140 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.js +149 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.js +51 -0
- package/lib/pro/Login2.0/index.js +45 -0
- package/lib/pro/Login2.0/index.less +1002 -0
- package/lib/pro/Login2.0/locales.d.ts +543 -0
- package/lib/pro/Login2.0/locales.js +646 -0
- package/lib/pro/Login2.0/shared/Header.d.ts +11 -0
- package/lib/pro/Login2.0/shared/Header.js +81 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.js +78 -0
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/lib/pro/Login2.0/shared/registerFlow.js +235 -0
- package/lib/pro/Login2.0/shared/types.d.ts +232 -0
- package/lib/pro/Login2.0/shared/types.js +17 -0
- package/lib/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/lib/pro/Login2.0/steps/CodeInput.js +160 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.js +46 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +51 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.js +51 -0
- package/lib/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/lib/pro/Login2.0/steps/SetPassword.js +131 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.js +49 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.js +41 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.js +67 -0
- package/lib/pro/Login2.0/steps/index.d.ts +19 -0
- package/lib/pro/Login2.0/steps/index.js +60 -0
- package/lib/pro/Login2.0/steps/steps.less +423 -0
- package/lib/pro/Login2.0/types.d.ts +167 -0
- package/lib/pro/Login2.0/types.js +17 -0
- package/lowcode/authmodal/meta.ts +395 -0
- package/lowcode/login2/CONFIG.md +447 -0
- package/lowcode/login2/TEST_CONFIG.md +324 -0
- package/lowcode/login2/VERIFICATION_METHODS.md +364 -0
- package/lowcode/login2/meta.ts +560 -0
- package/lowcode/login2/snippets.ts +124 -0
- package/lowcode/register2/meta.ts +562 -0
- package/lowcode/register2/snippets.ts +257 -0
- package/package.json +5 -5
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
/**
|
|
12
|
+
* 登录验证码输入组件
|
|
13
|
+
* 复用 Register2 的 CodeInput 样式和逻辑
|
|
14
|
+
*/
|
|
15
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
16
|
+
import { Button } from '@pisell/materials';
|
|
17
|
+
import { locales } from '@pisell/utils';
|
|
18
|
+
import IconFont from '@pisell/materials/src/components/iconfont';
|
|
19
|
+
function LoginCodeInput(_ref) {
|
|
20
|
+
var account = _ref.account,
|
|
21
|
+
accountType = _ref.accountType,
|
|
22
|
+
_ref$codeLength = _ref.codeLength,
|
|
23
|
+
codeLength = _ref$codeLength === void 0 ? 4 : _ref$codeLength,
|
|
24
|
+
onSubmit = _ref.onSubmit,
|
|
25
|
+
onResend = _ref.onResend,
|
|
26
|
+
onBack = _ref.onBack,
|
|
27
|
+
_ref$countdown = _ref.countdown,
|
|
28
|
+
countdown = _ref$countdown === void 0 ? 0 : _ref$countdown,
|
|
29
|
+
_ref$loading = _ref.loading,
|
|
30
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
31
|
+
submitButtonText = _ref.submitButtonText,
|
|
32
|
+
error = _ref.error,
|
|
33
|
+
onClearError = _ref.onClearError;
|
|
34
|
+
var _useState = useState(Array(codeLength).fill('')),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
code = _useState2[0],
|
|
37
|
+
setCode = _useState2[1];
|
|
38
|
+
var inputRefs = useRef([]);
|
|
39
|
+
var canResend = countdown === 0;
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
var _inputRefs$current$;
|
|
42
|
+
// 自动聚焦第一个输入框
|
|
43
|
+
(_inputRefs$current$ = inputRefs.current[0]) === null || _inputRefs$current$ === void 0 || _inputRefs$current$.focus();
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
// 当错误出现时,清空输入值
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (error) {
|
|
49
|
+
var _inputRefs$current$2;
|
|
50
|
+
setCode(Array(codeLength).fill(''));
|
|
51
|
+
// 聚焦第一个输入框
|
|
52
|
+
(_inputRefs$current$2 = inputRefs.current[0]) === null || _inputRefs$current$2 === void 0 || _inputRefs$current$2.focus();
|
|
53
|
+
}
|
|
54
|
+
}, [error, codeLength]);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 处理单个输入框的值变化
|
|
58
|
+
* @param index 输入框索引
|
|
59
|
+
* @param value 输入的值
|
|
60
|
+
*/
|
|
61
|
+
var handleInputChange = function handleInputChange(index, value) {
|
|
62
|
+
if (!/^\d*$/.test(value)) return; // 只允许数字
|
|
63
|
+
|
|
64
|
+
// 如果用户开始输入且有错误,清除错误
|
|
65
|
+
if (value && error && onClearError) {
|
|
66
|
+
onClearError();
|
|
67
|
+
}
|
|
68
|
+
var newCode = _toConsumableArray(code);
|
|
69
|
+
newCode[index] = value.slice(-1); // 只取最后一个字符
|
|
70
|
+
setCode(newCode);
|
|
71
|
+
|
|
72
|
+
// 自动跳到下一个输入框
|
|
73
|
+
if (value && index < codeLength - 1) {
|
|
74
|
+
var _inputRefs$current;
|
|
75
|
+
(_inputRefs$current = inputRefs.current[index + 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.focus();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 如果所有输入框都填满了,自动提交
|
|
79
|
+
if (newCode.every(function (digit) {
|
|
80
|
+
return digit !== '';
|
|
81
|
+
})) {
|
|
82
|
+
var fullCode = newCode.join('');
|
|
83
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(fullCode);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 处理键盘按键事件(主要处理退格键)
|
|
89
|
+
* @param index 当前输入框索引
|
|
90
|
+
* @param e 键盘事件
|
|
91
|
+
*/
|
|
92
|
+
var handleKeyDown = function handleKeyDown(index, e) {
|
|
93
|
+
// 当前输入框为空且按下退格键时,聚焦到前一个输入框
|
|
94
|
+
if (e.key === 'Backspace' && !code[index] && index > 0) {
|
|
95
|
+
var _inputRefs$current2;
|
|
96
|
+
(_inputRefs$current2 = inputRefs.current[index - 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 处理粘贴事件(支持粘贴完整验证码)
|
|
102
|
+
* @param e 剪贴板事件
|
|
103
|
+
*/
|
|
104
|
+
var handlePaste = function handlePaste(e) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
var pastedData = e.clipboardData.getData('text').trim();
|
|
107
|
+
if (!/^\d+$/.test(pastedData)) return; // 只允许数字
|
|
108
|
+
|
|
109
|
+
// 如果用户粘贴且有错误,清除错误
|
|
110
|
+
if (pastedData && error && onClearError) {
|
|
111
|
+
onClearError();
|
|
112
|
+
}
|
|
113
|
+
var newCode = pastedData.slice(0, codeLength).split('');
|
|
114
|
+
while (newCode.length < codeLength) {
|
|
115
|
+
newCode.push('');
|
|
116
|
+
}
|
|
117
|
+
setCode(newCode);
|
|
118
|
+
|
|
119
|
+
// 如果粘贴的是完整验证码,自动提交
|
|
120
|
+
if (newCode.every(function (digit) {
|
|
121
|
+
return digit !== '';
|
|
122
|
+
})) {
|
|
123
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(newCode.join(''));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 手动提交验证码
|
|
129
|
+
*/
|
|
130
|
+
var handleSubmit = function handleSubmit() {
|
|
131
|
+
var fullCode = code.join('');
|
|
132
|
+
if (fullCode.length === codeLength) {
|
|
133
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(fullCode);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// 根据账号类型显示不同的标题和描述
|
|
138
|
+
var title = accountType === 'email' ? locales.getText('pisell-login2-check-email-title') : locales.getText('pisell-login2-check-phone-title');
|
|
139
|
+
var description = accountType === 'email' ? locales.getText('pisell-login2-check-email-desc') : locales.getText('pisell-login2-check-phone-desc');
|
|
140
|
+
|
|
141
|
+
// 根据账号类型显示不同的"没有收到"提示
|
|
142
|
+
var noReceiveText = accountType === 'email' ? locales.getText('pisell-login2-no-email-received') : locales.getText('pisell-login2-no-message-received');
|
|
143
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "register-step-container code-input-page"
|
|
145
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
146
|
+
className: "back-button-top",
|
|
147
|
+
onClick: onBack,
|
|
148
|
+
"aria-label": "Go back"
|
|
149
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
150
|
+
type: "pisell2-arrow-left"
|
|
151
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: "register-step-content"
|
|
153
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
154
|
+
className: "register-step-title"
|
|
155
|
+
}, title), /*#__PURE__*/React.createElement("p", {
|
|
156
|
+
className: "register-step-desc"
|
|
157
|
+
}, description, /*#__PURE__*/React.createElement("br", null), account), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: "code-input-group",
|
|
159
|
+
onPaste: handlePaste
|
|
160
|
+
}, code.map(function (digit, index) {
|
|
161
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
162
|
+
key: index,
|
|
163
|
+
ref: function ref(el) {
|
|
164
|
+
return inputRefs.current[index] = el;
|
|
165
|
+
},
|
|
166
|
+
type: "text",
|
|
167
|
+
inputMode: "numeric",
|
|
168
|
+
maxLength: 1,
|
|
169
|
+
className: "code-input-box ".concat(digit ? 'has-value' : '', " ").concat(error ? 'has-error' : ''),
|
|
170
|
+
value: digit,
|
|
171
|
+
onChange: function onChange(e) {
|
|
172
|
+
return handleInputChange(index, e.target.value);
|
|
173
|
+
},
|
|
174
|
+
onKeyDown: function onKeyDown(e) {
|
|
175
|
+
return handleKeyDown(index, e);
|
|
176
|
+
},
|
|
177
|
+
disabled: loading
|
|
178
|
+
});
|
|
179
|
+
})), error && /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
className: "code-input-error"
|
|
181
|
+
}, error), /*#__PURE__*/React.createElement(Button, {
|
|
182
|
+
type: "primary",
|
|
183
|
+
size: "large",
|
|
184
|
+
block: true,
|
|
185
|
+
onClick: handleSubmit,
|
|
186
|
+
loading: loading,
|
|
187
|
+
disabled: code.some(function (digit) {
|
|
188
|
+
return !digit;
|
|
189
|
+
}),
|
|
190
|
+
className: "register-submit-btn"
|
|
191
|
+
}, submitButtonText || locales.getText('pisell-login2-login-button')), /*#__PURE__*/React.createElement(Button, {
|
|
192
|
+
type: "default",
|
|
193
|
+
size: "large",
|
|
194
|
+
block: true,
|
|
195
|
+
onClick: onBack,
|
|
196
|
+
className: "register-back-btn"
|
|
197
|
+
}, locales.getText('pisell-login2-back')), /*#__PURE__*/React.createElement("div", {
|
|
198
|
+
className: "register-resend-section"
|
|
199
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
200
|
+
className: "resend-text"
|
|
201
|
+
}, noReceiveText, " "), /*#__PURE__*/React.createElement("button", {
|
|
202
|
+
className: "resend-link",
|
|
203
|
+
onClick: onResend,
|
|
204
|
+
disabled: !canResend
|
|
205
|
+
}, locales.getText('pisell-login2-resend-code'), countdown > 0 && " (".concat(countdown, " s)")))));
|
|
206
|
+
}
|
|
207
|
+
export default LoginCodeInput;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface OAuthProviderConfig {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
badge?: string;
|
|
10
|
+
badgeClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface OAuthButtonGroupProps {
|
|
13
|
+
providers: OAuthProviderConfig[];
|
|
14
|
+
layout?: 'vertical' | 'horizontal';
|
|
15
|
+
size?: 'large' | 'middle' | 'small';
|
|
16
|
+
block?: boolean;
|
|
17
|
+
wrapperClassName?: string;
|
|
18
|
+
buttonClassName?: string;
|
|
19
|
+
gap?: number;
|
|
20
|
+
}
|
|
21
|
+
declare const OAuthButtonGroup: React.FC<OAuthButtonGroupProps>;
|
|
22
|
+
export default OAuthButtonGroup;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Button } from '@pisell/materials';
|
|
4
|
+
var OAuthButtonGroup = function OAuthButtonGroup(_ref) {
|
|
5
|
+
var providers = _ref.providers,
|
|
6
|
+
_ref$layout = _ref.layout,
|
|
7
|
+
layout = _ref$layout === void 0 ? 'vertical' : _ref$layout,
|
|
8
|
+
_ref$size = _ref.size,
|
|
9
|
+
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
10
|
+
_ref$block = _ref.block,
|
|
11
|
+
block = _ref$block === void 0 ? true : _ref$block,
|
|
12
|
+
wrapperClassName = _ref.wrapperClassName,
|
|
13
|
+
buttonClassName = _ref.buttonClassName,
|
|
14
|
+
_ref$gap = _ref.gap,
|
|
15
|
+
gap = _ref$gap === void 0 ? 12 : _ref$gap;
|
|
16
|
+
if (!providers.length) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
var isVertical = layout === 'vertical';
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: classNames('oauth-button-group', wrapperClassName, {
|
|
22
|
+
'oauth-button-group-vertical': isVertical,
|
|
23
|
+
'oauth-button-group-horizontal': !isVertical
|
|
24
|
+
}),
|
|
25
|
+
style: isVertical ? {
|
|
26
|
+
display: 'grid',
|
|
27
|
+
rowGap: gap
|
|
28
|
+
} : {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
columnGap: gap,
|
|
31
|
+
flexWrap: 'wrap'
|
|
32
|
+
}
|
|
33
|
+
}, providers.map(function (_ref2) {
|
|
34
|
+
var key = _ref2.key,
|
|
35
|
+
label = _ref2.label,
|
|
36
|
+
icon = _ref2.icon,
|
|
37
|
+
onClick = _ref2.onClick,
|
|
38
|
+
disabled = _ref2.disabled,
|
|
39
|
+
className = _ref2.className,
|
|
40
|
+
badge = _ref2.badge,
|
|
41
|
+
badgeClassName = _ref2.badgeClassName;
|
|
42
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
key: key,
|
|
44
|
+
size: size,
|
|
45
|
+
block: block,
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
className: classNames(buttonClassName, className),
|
|
48
|
+
icon: icon,
|
|
49
|
+
onClick: onClick
|
|
50
|
+
}, badge && /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
className: classNames('oauth-button-badge', badgeClassName)
|
|
52
|
+
}, badge), label);
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
export default OAuthButtonGroup;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './PhoneInput.less';
|
|
3
|
+
/** 国家/地区配置(后端返回格式) */
|
|
4
|
+
export interface CountryOption {
|
|
5
|
+
/** 国家/地区名称 */
|
|
6
|
+
name: string;
|
|
7
|
+
/** 国家/地区代码 */
|
|
8
|
+
code: string;
|
|
9
|
+
/** 区号(不带+号) */
|
|
10
|
+
calling_code: string;
|
|
11
|
+
/** 货币代码 */
|
|
12
|
+
currency_code: string;
|
|
13
|
+
}
|
|
14
|
+
/** 手机号对象格式 */
|
|
15
|
+
export interface PhoneValueObject {
|
|
16
|
+
/** 手机号(不含区号) */
|
|
17
|
+
phone: string;
|
|
18
|
+
/** 国家区号(不带+号) */
|
|
19
|
+
country_calling_code: string;
|
|
20
|
+
}
|
|
21
|
+
/** 值格式类型 */
|
|
22
|
+
export declare type ValueFormat = 'string' | 'object';
|
|
23
|
+
/** 手机号输入组件属性 */
|
|
24
|
+
export interface PhoneInputProps {
|
|
25
|
+
/** 完整的手机号值(包含区号),格式:+86138****,或 +1555****(字符串模式) */
|
|
26
|
+
value?: string | PhoneValueObject;
|
|
27
|
+
/** 值变化回调 */
|
|
28
|
+
onChange?: (value: string | PhoneValueObject) => void;
|
|
29
|
+
/** Placeholder */
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/** 大小 */
|
|
32
|
+
size?: 'large' | 'middle' | 'small';
|
|
33
|
+
/** 是否禁用 */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** 自定义类名 */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** 可用的国家/地区列表 */
|
|
38
|
+
countries?: CountryOption[];
|
|
39
|
+
/** 默认国家/地区代码 */
|
|
40
|
+
defaultCountry?: string;
|
|
41
|
+
/** 值格式:'string' 返回 "+8613800138000",'object' 返回 { phone: "13800138000", country_calling_code: "86" } */
|
|
42
|
+
valueFormat?: ValueFormat;
|
|
43
|
+
/** 键盘按键事件回调 */
|
|
44
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 手机号输入组件
|
|
48
|
+
*
|
|
49
|
+
* 支持国际区号选择和手机号输入
|
|
50
|
+
* 值格式:+区号+手机号,例如:+8613800138000 或 +15551234567
|
|
51
|
+
*/
|
|
52
|
+
declare function PhoneInput({ value, onChange, placeholder, onKeyDown, size, disabled, className, countries, defaultCountry, valueFormat, }: PhoneInputProps): JSX.Element;
|
|
53
|
+
export default PhoneInput;
|