@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,198 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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); }
10
+ 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; }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useMemo, useState } from 'react';
14
+ import { Iconfont } from '@pisell/materials';
15
+ import { locales } from '@pisell/utils';
16
+ import useEngineContext from "../../hooks/useEngineContext";
17
+ import Avatar from "./components/Avatar";
18
+ import { SwipeAction } from "./components/SwipeAction";
19
+ import ContactInfoModal from "../contactInfoModal";
20
+ import localeTexts from "./locales";
21
+ import "./index.less";
22
+ export var PREFIX = 'pisell-plus-contact-info';
23
+ var ContactInfo = function ContactInfo(props) {
24
+ var _context$appHelper$ut, _props$style2;
25
+ console.log('props>>>>>>>>>', props);
26
+ var dataSource = props.dataSource,
27
+ defaultName = props.defaultName,
28
+ placeholder = props.placeholder,
29
+ _props$direction = props.direction,
30
+ direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
31
+ isShowDelete = props.isShowDelete,
32
+ isShowAvatar = props.isShowAvatar,
33
+ isShowPhone = props.isShowPhone,
34
+ isShowEmail = props.isShowEmail,
35
+ horizontalGap = props.horizontalGap,
36
+ verticalGap = props.verticalGap,
37
+ _onSave = props.onSave,
38
+ _onDelete = props.onDelete,
39
+ _onCancel = props.onCancel;
40
+ var context = useEngineContext();
41
+ locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en');
42
+ var _useState = useState(false),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ modalVisible = _useState2[0],
45
+ setModalVisible = _useState2[1];
46
+ var isHorizontal = useMemo(function () {
47
+ return direction === 'horizontal';
48
+ }, [direction]);
49
+ var displayName = useMemo(function () {
50
+ var _ref = dataSource || {},
51
+ first_name = _ref.first_name,
52
+ last_name = _ref.last_name;
53
+ if (!first_name && !last_name) {
54
+ return defaultName || '';
55
+ }
56
+ return "".concat(first_name || '', " ").concat(last_name || '');
57
+ }, [dataSource, defaultName]);
58
+ var displayPhone = useMemo(function () {
59
+ var _ref2 = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.phone) || {},
60
+ country_calling_code = _ref2.country_calling_code,
61
+ phone = _ref2.phone;
62
+ if (!country_calling_code || !phone) {
63
+ return '';
64
+ }
65
+ // 需要对country_calling_code做兼容处理,部分数据可能没有+号前缀
66
+ var countryCallingCode = country_calling_code !== null && country_calling_code !== void 0 && country_calling_code.startsWith('+') ? country_calling_code : "+".concat(country_calling_code);
67
+ return "".concat(countryCallingCode || '', " ").concat(phone || '');
68
+ }, [dataSource === null || dataSource === void 0 ? void 0 : dataSource.phone]);
69
+ var isEmpty = useMemo(function () {
70
+ var _dataSource$phone;
71
+ return !(dataSource !== null && dataSource !== void 0 && dataSource.first_name) && !(dataSource !== null && dataSource !== void 0 && dataSource.last_name) && !(dataSource !== null && dataSource !== void 0 && (_dataSource$phone = dataSource.phone) !== null && _dataSource$phone !== void 0 && _dataSource$phone.phone) && !(dataSource !== null && dataSource !== void 0 && dataSource.email);
72
+ }, [dataSource]);
73
+ var handleClick = function handleClick() {
74
+ console.log('handleClick');
75
+ setModalVisible(true);
76
+ };
77
+ var _rightActions = useMemo(function () {
78
+ var deleteAction = {
79
+ key: 'delete',
80
+ text: /*#__PURE__*/React.createElement("div", {
81
+ style: {
82
+ display: 'flex',
83
+ justifyContent: 'center',
84
+ alignItems: 'center',
85
+ color: 'white',
86
+ cursor: 'pointer',
87
+ padding: '10px 0px',
88
+ borderRadius: '8px'
89
+ }
90
+ }, /*#__PURE__*/React.createElement(Iconfont, {
91
+ type: "pisell2-trash-01",
92
+ style: {
93
+ fontSize: 20,
94
+ marginRight: 4
95
+ }
96
+ }), /*#__PURE__*/React.createElement("span", {
97
+ style: {
98
+ fontSize: 12,
99
+ fontWeight: 500
100
+ }
101
+ }, locales.getText('pisell2.text.contact-info.actions.delete'))),
102
+ color: 'danger',
103
+ onClick: function onClick(e) {
104
+ e.preventDefault();
105
+ e.stopPropagation();
106
+ _onDelete === null || _onDelete === void 0 || _onDelete();
107
+ }
108
+ };
109
+ return [deleteAction];
110
+ }, [dataSource, _onDelete]);
111
+ var renderContent = function renderContent() {
112
+ var _props$style;
113
+ return /*#__PURE__*/React.createElement("div", {
114
+ className: "".concat(PREFIX, "__").concat(direction),
115
+ style: {
116
+ gap: verticalGap,
117
+ padding: (props === null || props === void 0 || (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.padding) || '8px'
118
+ }
119
+ }, isHorizontal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
120
+ className: "".concat(PREFIX, "__horizontal-left"),
121
+ style: {
122
+ gap: horizontalGap
123
+ }
124
+ }, isShowAvatar && /*#__PURE__*/React.createElement(Avatar, {
125
+ config: props.avatar,
126
+ name: displayName,
127
+ cover: ''
128
+ }), /*#__PURE__*/React.createElement("div", {
129
+ className: "".concat(PREFIX, "__horizontal-left-content"),
130
+ style: {
131
+ gap: verticalGap
132
+ }
133
+ }, isEmpty ? /*#__PURE__*/React.createElement("div", {
134
+ className: "".concat(PREFIX, "__empty-description")
135
+ }, placeholder || locales.getText('pisell2.text.contact-info.placeholder')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
136
+ className: "".concat(PREFIX, "__name-horizontal-container")
137
+ }, /*#__PURE__*/React.createElement("span", {
138
+ className: "".concat(PREFIX, "__name-horizontal"),
139
+ style: props.nameStyle
140
+ }, displayName), isShowPhone && displayPhone && /*#__PURE__*/React.createElement("span", {
141
+ className: "".concat(PREFIX, "__phone-horizontal"),
142
+ style: props.textStyle
143
+ }, "(", displayPhone, ")")), isShowEmail && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.email) && /*#__PURE__*/React.createElement("div", {
144
+ className: "".concat(PREFIX, "__text"),
145
+ style: props.textStyle
146
+ }, dataSource === null || dataSource === void 0 ? void 0 : dataSource.email)))), /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(PREFIX, "__horizontal-right")
148
+ }, /*#__PURE__*/React.createElement(Iconfont, {
149
+ type: isEmpty ? 'pisell2-plus-circle' : 'pisell2-edit-05',
150
+ className: "".concat(PREFIX, "__horizontal-right-icon")
151
+ }))) : /*#__PURE__*/React.createElement(React.Fragment, null, isShowAvatar && /*#__PURE__*/React.createElement(Avatar, {
152
+ config: props.avatar,
153
+ name: 'hhhhh',
154
+ cover: ''
155
+ }), isEmpty ? /*#__PURE__*/React.createElement("div", {
156
+ className: "".concat(PREFIX, "__empty-description")
157
+ }, placeholder || locales.getText('pisell2.text.contact-info.placeholder')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
158
+ className: "".concat(PREFIX, "__name"),
159
+ style: props.nameStyle
160
+ }, displayName), isShowPhone && displayPhone && /*#__PURE__*/React.createElement("div", {
161
+ className: "".concat(PREFIX, "__text"),
162
+ style: props.textStyle
163
+ }, displayPhone), isShowEmail && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.email) && /*#__PURE__*/React.createElement("div", {
164
+ className: "".concat(PREFIX, "__text"),
165
+ style: props.textStyle
166
+ }, dataSource === null || dataSource === void 0 ? void 0 : dataSource.email))));
167
+ };
168
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
169
+ className: "".concat(PREFIX),
170
+ style: _objectSpread(_objectSpread({}, props.style || {}), {}, {
171
+ padding: 0
172
+ }),
173
+ onClick: handleClick
174
+ }, isShowDelete && !isEmpty ? /*#__PURE__*/React.createElement(SwipeAction, {
175
+ closeOnAction: false,
176
+ rightActions: _rightActions,
177
+ style: {
178
+ borderRadius: (props === null || props === void 0 || (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.borderRadius) || 0
179
+ }
180
+ }, renderContent()) : renderContent()), /*#__PURE__*/React.createElement(ContactInfoModal, {
181
+ open: modalVisible,
182
+ dataSource: dataSource,
183
+ isShowDelete: isShowDelete,
184
+ onCancel: function onCancel() {
185
+ setModalVisible(false);
186
+ _onCancel === null || _onCancel === void 0 || _onCancel();
187
+ },
188
+ onSave: function onSave(value) {
189
+ setModalVisible(false);
190
+ _onSave === null || _onSave === void 0 || _onSave(value);
191
+ },
192
+ onDelete: function onDelete() {
193
+ setModalVisible(false);
194
+ _onDelete === null || _onDelete === void 0 || _onDelete();
195
+ }
196
+ }));
197
+ };
198
+ export default ContactInfo;