@pisell/private-materials 6.3.30 → 6.3.32

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.
Files changed (287) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +9 -1
  6. package/build/lowcode/preview.js +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +267 -76
  14. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  15. package/es/components/appointmentBooking/hooks.d.ts +1 -0
  16. package/es/components/appointmentBooking/hooks.js +30 -30
  17. package/es/components/appointmentBooking/locales.d.ts +3 -0
  18. package/es/components/appointmentBooking/locales.js +9 -6
  19. package/es/components/booking/addons/model.d.ts +10 -1
  20. package/es/components/booking/components/footer/index.js +4 -1
  21. package/es/components/booking/components/footer/utils.js +62 -46
  22. package/es/components/booking/forms/model.d.ts +10 -1
  23. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +2 -2
  24. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  25. package/es/components/booking/info/main.js +3 -2
  26. package/es/components/booking/info/model.d.ts +10 -1
  27. package/es/components/booking/info/model.js +5 -0
  28. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  29. package/es/components/booking/info2/index.js +3 -2
  30. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  31. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  32. package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
  33. package/es/components/booking/locales.d.ts +3 -0
  34. package/es/components/booking/locales.js +9 -3
  35. package/es/components/booking/model.d.ts +13 -1
  36. package/es/components/booking/model.js +3 -0
  37. package/es/components/booking/notes/model.d.ts +10 -1
  38. package/es/components/booking/payments/model.d.ts +10 -1
  39. package/es/components/eftposPay/amount.d.ts +1 -1
  40. package/es/components/eftposPay/device.d.ts +1 -1
  41. package/es/components/eftposPay/store/index.d.ts +2 -2
  42. package/es/components/pay/toC/model.d.ts +9 -1
  43. package/es/components/schedules/model.d.ts +9 -1
  44. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
  45. package/es/components/wallet/Detail/model.d.ts +13 -1
  46. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  47. package/es/components/wallet/PointCard/model.d.ts +13 -1
  48. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  49. package/es/components/wallet/Voucher/model.d.ts +13 -1
  50. package/es/components/wallet/model.d.ts +9 -1
  51. package/es/index.d.ts +3 -0
  52. package/es/index.js +4 -1
  53. package/es/plus/clientName/index.d.ts +4 -0
  54. package/es/plus/clientName/index.js +18 -0
  55. package/es/plus/clientName/index.less +10 -0
  56. package/es/plus/clientName/type.d.ts +13 -0
  57. package/es/plus/clientName/type.js +1 -0
  58. package/es/plus/clientName/utils.d.ts +2 -0
  59. package/es/plus/clientName/utils.js +18 -0
  60. package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  61. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  62. package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  63. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  64. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  65. package/es/plus/contactInfo/index.d.ts +6 -0
  66. package/es/plus/contactInfo/index.js +198 -0
  67. package/es/plus/contactInfo/index.less +621 -0
  68. package/es/plus/contactInfo/locales.d.ts +15 -0
  69. package/es/plus/contactInfo/locales.js +14 -0
  70. package/es/plus/contactInfo/types.d.ts +91 -0
  71. package/es/plus/contactInfo/types.js +1 -0
  72. package/es/plus/contactInfo/utils.d.ts +7 -0
  73. package/es/plus/contactInfo/utils.js +50 -0
  74. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  75. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  76. package/es/plus/contactInfoModal/index.d.ts +40 -0
  77. package/es/plus/contactInfoModal/index.js +154 -0
  78. package/es/plus/contactInfoModal/index.less +19 -0
  79. package/es/plus/contactInfoModal/locales.d.ts +66 -0
  80. package/es/plus/contactInfoModal/locales.js +65 -0
  81. package/es/pro/Login2.0/AuthModal.d.ts +143 -0
  82. package/es/pro/Login2.0/AuthModal.js +624 -0
  83. package/es/pro/Login2.0/Login2.d.ts +61 -0
  84. package/es/pro/Login2.0/Login2.js +2157 -0
  85. package/es/pro/Login2.0/Register2.d.ts +65 -0
  86. package/es/pro/Login2.0/Register2.js +1501 -0
  87. package/es/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
  88. package/es/pro/Login2.0/components/ForgotPasswordFlow.js +330 -0
  89. package/es/pro/Login2.0/components/LegalTerms.d.ts +8 -0
  90. package/es/pro/Login2.0/components/LegalTerms.js +51 -0
  91. package/es/pro/Login2.0/components/LegalTerms.less +74 -0
  92. package/es/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
  93. package/es/pro/Login2.0/components/LoginCodeInput.js +207 -0
  94. package/es/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
  95. package/es/pro/Login2.0/components/OAuthButtonGroup.js +55 -0
  96. package/es/pro/Login2.0/components/PhoneInput.d.ts +53 -0
  97. package/es/pro/Login2.0/components/PhoneInput.js +414 -0
  98. package/es/pro/Login2.0/components/PhoneInput.less +148 -0
  99. package/es/pro/Login2.0/components/phoneValidation.d.ts +17 -0
  100. package/es/pro/Login2.0/components/phoneValidation.js +228 -0
  101. package/es/pro/Login2.0/hooks/index.d.ts +2 -0
  102. package/es/pro/Login2.0/hooks/index.js +1 -0
  103. package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
  104. package/es/pro/Login2.0/hooks/usePasswordValidationRules.js +87 -0
  105. package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
  106. package/es/pro/Login2.0/hooks/useRegisterFlow.js +158 -0
  107. package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
  108. package/es/pro/Login2.0/hooks/useRegistrationMethods.js +31 -0
  109. package/es/pro/Login2.0/index.js +8 -0
  110. package/es/pro/Login2.0/index.less +993 -0
  111. package/es/pro/Login2.0/locales.d.ts +543 -0
  112. package/es/pro/Login2.0/locales.js +622 -0
  113. package/es/pro/Login2.0/shared/Header.d.ts +11 -0
  114. package/es/pro/Login2.0/shared/Header.js +42 -0
  115. package/es/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
  116. package/es/pro/Login2.0/shared/OAuthButtons.js +59 -0
  117. package/es/pro/Login2.0/shared/registerFlow.d.ts +116 -0
  118. package/es/pro/Login2.0/shared/registerFlow.js +171 -0
  119. package/es/pro/Login2.0/shared/types.d.ts +232 -0
  120. package/es/pro/Login2.0/shared/types.js +1 -0
  121. package/es/pro/Login2.0/steps/CodeInput.d.ts +24 -0
  122. package/es/pro/Login2.0/steps/CodeInput.js +209 -0
  123. package/es/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
  124. package/es/pro/Login2.0/steps/EmailAlreadyRegistered.js +35 -0
  125. package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
  126. package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +25 -0
  127. package/es/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
  128. package/es/pro/Login2.0/steps/EmailLinkExpired.js +33 -0
  129. package/es/pro/Login2.0/steps/SetPassword.d.ts +19 -0
  130. package/es/pro/Login2.0/steps/SetPassword.js +148 -0
  131. package/es/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
  132. package/es/pro/Login2.0/steps/VerificationSuccess.js +35 -0
  133. package/es/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
  134. package/es/pro/Login2.0/steps/VerifyingEmailLink.js +17 -0
  135. package/es/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
  136. package/es/pro/Login2.0/steps/WaitEmailLink.js +54 -0
  137. package/es/pro/Login2.0/steps/index.d.ts +19 -0
  138. package/es/pro/Login2.0/steps/index.js +11 -0
  139. package/es/pro/Login2.0/steps/steps.less +423 -0
  140. package/es/pro/Login2.0/types.d.ts +167 -0
  141. package/es/pro/Login2.0/types.js +1 -0
  142. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  143. package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
  144. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +151 -13
  145. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  146. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  147. package/lib/components/appointmentBooking/hooks.js +73 -35
  148. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  149. package/lib/components/appointmentBooking/locales.js +6 -3
  150. package/lib/components/booking/addons/model.d.ts +10 -1
  151. package/lib/components/booking/components/footer/index.js +4 -1
  152. package/lib/components/booking/components/footer/utils.js +70 -38
  153. package/lib/components/booking/forms/model.d.ts +10 -1
  154. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +1 -1
  155. package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
  156. package/lib/components/booking/info/main.js +5 -4
  157. package/lib/components/booking/info/model.d.ts +10 -1
  158. package/lib/components/booking/info/model.js +5 -0
  159. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  160. package/lib/components/booking/info2/index.js +5 -4
  161. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  162. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  163. package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
  164. package/lib/components/booking/locales.d.ts +3 -0
  165. package/lib/components/booking/locales.js +9 -3
  166. package/lib/components/booking/model.d.ts +13 -1
  167. package/lib/components/booking/model.js +3 -0
  168. package/lib/components/booking/notes/model.d.ts +10 -1
  169. package/lib/components/booking/payments/model.d.ts +10 -1
  170. package/lib/components/eftposPay/amount.d.ts +1 -1
  171. package/lib/components/eftposPay/device.d.ts +1 -1
  172. package/lib/components/eftposPay/store/index.d.ts +2 -2
  173. package/lib/components/pay/toC/model.d.ts +9 -1
  174. package/lib/components/schedules/model.d.ts +9 -1
  175. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
  176. package/lib/components/wallet/Detail/model.d.ts +13 -1
  177. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  178. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  179. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  180. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  181. package/lib/components/wallet/model.d.ts +9 -1
  182. package/lib/index.d.ts +3 -0
  183. package/lib/index.js +13 -0
  184. package/lib/plus/clientName/index.d.ts +4 -0
  185. package/lib/plus/clientName/index.js +53 -0
  186. package/lib/plus/clientName/index.less +10 -0
  187. package/lib/plus/clientName/type.d.ts +13 -0
  188. package/lib/plus/clientName/type.js +17 -0
  189. package/lib/plus/clientName/utils.d.ts +2 -0
  190. package/lib/plus/clientName/utils.js +43 -0
  191. package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  192. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  193. package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  194. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  195. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  196. package/lib/plus/contactInfo/index.d.ts +6 -0
  197. package/lib/plus/contactInfo/index.js +226 -0
  198. package/lib/plus/contactInfo/index.less +621 -0
  199. package/lib/plus/contactInfo/locales.d.ts +15 -0
  200. package/lib/plus/contactInfo/locales.js +38 -0
  201. package/lib/plus/contactInfo/types.d.ts +91 -0
  202. package/lib/plus/contactInfo/types.js +17 -0
  203. package/lib/plus/contactInfo/utils.d.ts +7 -0
  204. package/lib/plus/contactInfo/utils.js +64 -0
  205. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  206. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  207. package/lib/plus/contactInfoModal/index.d.ts +40 -0
  208. package/lib/plus/contactInfoModal/index.js +138 -0
  209. package/lib/plus/contactInfoModal/index.less +19 -0
  210. package/lib/plus/contactInfoModal/locales.d.ts +66 -0
  211. package/lib/plus/contactInfoModal/locales.js +89 -0
  212. package/lib/pro/Login2.0/AuthModal.d.ts +143 -0
  213. package/lib/pro/Login2.0/AuthModal.js +498 -0
  214. package/lib/pro/Login2.0/Login2.d.ts +61 -0
  215. package/lib/pro/Login2.0/Login2.js +1468 -0
  216. package/lib/pro/Login2.0/Register2.d.ts +65 -0
  217. package/lib/pro/Login2.0/Register2.js +1062 -0
  218. package/lib/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
  219. package/lib/pro/Login2.0/components/ForgotPasswordFlow.js +213 -0
  220. package/lib/pro/Login2.0/components/LegalTerms.d.ts +8 -0
  221. package/lib/pro/Login2.0/components/LegalTerms.js +76 -0
  222. package/lib/pro/Login2.0/components/LegalTerms.less +74 -0
  223. package/lib/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
  224. package/lib/pro/Login2.0/components/LoginCodeInput.js +161 -0
  225. package/lib/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
  226. package/lib/pro/Login2.0/components/OAuthButtonGroup.js +87 -0
  227. package/lib/pro/Login2.0/components/PhoneInput.d.ts +53 -0
  228. package/lib/pro/Login2.0/components/PhoneInput.js +263 -0
  229. package/lib/pro/Login2.0/components/PhoneInput.less +148 -0
  230. package/lib/pro/Login2.0/components/phoneValidation.d.ts +17 -0
  231. package/lib/pro/Login2.0/components/phoneValidation.js +153 -0
  232. package/lib/pro/Login2.0/hooks/index.d.ts +2 -0
  233. package/lib/pro/Login2.0/hooks/index.js +29 -0
  234. package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
  235. package/lib/pro/Login2.0/hooks/usePasswordValidationRules.js +140 -0
  236. package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
  237. package/lib/pro/Login2.0/hooks/useRegisterFlow.js +149 -0
  238. package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
  239. package/lib/pro/Login2.0/hooks/useRegistrationMethods.js +51 -0
  240. package/lib/pro/Login2.0/index.js +45 -0
  241. package/lib/pro/Login2.0/index.less +993 -0
  242. package/lib/pro/Login2.0/locales.d.ts +543 -0
  243. package/lib/pro/Login2.0/locales.js +646 -0
  244. package/lib/pro/Login2.0/shared/Header.d.ts +11 -0
  245. package/lib/pro/Login2.0/shared/Header.js +81 -0
  246. package/lib/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
  247. package/lib/pro/Login2.0/shared/OAuthButtons.js +78 -0
  248. package/lib/pro/Login2.0/shared/registerFlow.d.ts +116 -0
  249. package/lib/pro/Login2.0/shared/registerFlow.js +235 -0
  250. package/lib/pro/Login2.0/shared/types.d.ts +232 -0
  251. package/lib/pro/Login2.0/shared/types.js +17 -0
  252. package/lib/pro/Login2.0/steps/CodeInput.d.ts +24 -0
  253. package/lib/pro/Login2.0/steps/CodeInput.js +160 -0
  254. package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
  255. package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.js +46 -0
  256. package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
  257. package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +51 -0
  258. package/lib/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
  259. package/lib/pro/Login2.0/steps/EmailLinkExpired.js +51 -0
  260. package/lib/pro/Login2.0/steps/SetPassword.d.ts +19 -0
  261. package/lib/pro/Login2.0/steps/SetPassword.js +131 -0
  262. package/lib/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
  263. package/lib/pro/Login2.0/steps/VerificationSuccess.js +49 -0
  264. package/lib/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
  265. package/lib/pro/Login2.0/steps/VerifyingEmailLink.js +41 -0
  266. package/lib/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
  267. package/lib/pro/Login2.0/steps/WaitEmailLink.js +67 -0
  268. package/lib/pro/Login2.0/steps/index.d.ts +19 -0
  269. package/lib/pro/Login2.0/steps/index.js +60 -0
  270. package/lib/pro/Login2.0/steps/steps.less +423 -0
  271. package/lib/pro/Login2.0/types.d.ts +167 -0
  272. package/lib/pro/Login2.0/types.js +17 -0
  273. package/lowcode/authmodal/meta.ts +395 -0
  274. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  275. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  276. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  277. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  278. package/lowcode/contact-info/meta.ts +199 -0
  279. package/lowcode/contact-info-modal/meta.ts +98 -0
  280. package/lowcode/login2/CONFIG.md +447 -0
  281. package/lowcode/login2/TEST_CONFIG.md +324 -0
  282. package/lowcode/login2/VERIFICATION_METHODS.md +364 -0
  283. package/lowcode/login2/meta.ts +560 -0
  284. package/lowcode/login2/snippets.ts +124 -0
  285. package/lowcode/register2/meta.ts +562 -0
  286. package/lowcode/register2/snippets.ts +257 -0
  287. package/package.json +7 -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;