@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
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -21,6 +21,11 @@ var _miniRedux = miniRedux({
21
21
  });
22
22
  // return { ...state, client: { ...state.client, ...payload } };
23
23
  },
24
+ setContactsInfo: function setContactsInfo(state, payload) {
25
+ state.setGlobalState({
26
+ contacts_info: _objectSpread(_objectSpread({}, state.contacts_info), payload)
27
+ });
28
+ },
24
29
  setService: function setService(state, payload) {
25
30
  var obj = {};
26
31
  // 拦截, 如果服务列表里 有两个相近时间的服务, 删除最后一个
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -34,6 +34,7 @@ import classNames from 'classnames';
34
34
  import useCreateBookingPageHeader from "../hooks/useCreateBookingPageHeader";
35
35
  import { getLocale } from "../../../utils/locales";
36
36
  import { useDebounceEffect } from 'ahooks';
37
+ import ContactInfoMode from "./service/contactInfoMode";
37
38
  var defaultModules = {
38
39
  client: 1,
39
40
  date: 1,
@@ -43,7 +44,7 @@ var defaultModules = {
43
44
  };
44
45
  locales.init(localeTexts, getLocale());
45
46
  var Info = Provider(function (props) {
46
- var _modal$state2, _modal$state4, _modal$state6, _context$appHelper4, _modal$state7;
47
+ var _modal$state2, _modal$state4, _modal$state6, _context$appHelper4, _modal$state7, _modal$state8;
47
48
  // return <Payments {...props} />;
48
49
  var style = props.style,
49
50
  globalState = props.globalState,
@@ -278,7 +279,7 @@ var Info = Provider(function (props) {
278
279
  height: context !== null && context !== void 0 && (_context$appHelper4 = context.appHelper) !== null && _context$appHelper4 !== void 0 && (_context$appHelper4 = _context$appHelper4.utils) !== null && _context$appHelper4 !== void 0 && _context$appHelper4.isMobile ? '100%' : '100vh'
279
280
  }), "bodyClassName", classNames('booking-info-warp', _defineProperty(_defineProperty({}, 'create-booking-page-info-wrap', isBookingCreatePage), 'create-booking-page-info-wrap-create', isBookingCreatePageCreateMode))), /*#__PURE__*/React.createElement("div", {
280
281
  className: "booking-info"
281
- }, createHeader, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state7 = modal.state) !== null && _modal$state7 !== void 0 && _modal$state7.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === 'form' ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, /*#__PURE__*/React.createElement(Skeleton, {
282
+ }, createHeader, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, (modal === null || modal === void 0 || (_modal$state7 = modal.state) === null || _modal$state7 === void 0 || (_modal$state7 = _modal$state7.bookingConfig) === null || _modal$state7 === void 0 || (_modal$state7 = _modal$state7.config) === null || _modal$state7 === void 0 || (_modal$state7 = _modal$state7.cart_settings_tab) === null || _modal$state7 === void 0 || (_modal$state7 = _modal$state7.display_contact_info) === null || _modal$state7 === void 0 ? void 0 : _modal$state7.show_contact_info) === true ? /*#__PURE__*/React.createElement(ContactInfoMode, null) : null, modules.holder && !((_modal$state8 = modal.state) !== null && _modal$state8 !== void 0 && _modal$state8.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === 'form' ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, /*#__PURE__*/React.createElement(Skeleton, {
282
283
  loading: globalState.loading,
283
284
  round: true,
284
285
  active: true,
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -0,0 +1,2 @@
1
+ declare const ContactInfoMode: () => JSX.Element;
2
+ export default ContactInfoMode;
@@ -0,0 +1,94 @@
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
+ import React, { useContext, useEffect } from 'react';
8
+ import { locales } from '@pisell/utils';
9
+ import ContactInfo from "../../../../../plus/contactInfo";
10
+ import { Context } from "../../../info/model";
11
+ var ContactInfoMode = function ContactInfoMode() {
12
+ var _state$client$value6, _state$contacts_info3, _state$contacts_info4;
13
+ var _useContext = useContext(Context),
14
+ state = _useContext.state,
15
+ dispatch = _useContext.dispatch;
16
+ console.log('state>>>>>>>>>', state);
17
+ useEffect(function () {
18
+ var _state$contacts_info, _state$client$value, _state$client$value2, _state$contacts_info2;
19
+ // 如果客户id发生变化,则获取客户信息中的ContactInfo,如果不存在,则使用客户信息填充ContactInfo
20
+ console.log('state>>>>>>>>>111', state === null || state === void 0 || (_state$contacts_info = state.contacts_info) === null || _state$contacts_info === void 0 ? void 0 : _state$contacts_info.client_id);
21
+ console.log('state>>>>>>>>>222', (_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id);
22
+ if (((_state$client$value2 = state.client.value) === null || _state$client$value2 === void 0 ? void 0 : _state$client$value2.id) != (state === null || state === void 0 || (_state$contacts_info2 = state.contacts_info) === null || _state$contacts_info2 === void 0 ? void 0 : _state$contacts_info2.client_id)) {
23
+ var _state$client$value3;
24
+ var contactInfo = (_state$client$value3 = state.client.value) === null || _state$client$value3 === void 0 || (_state$client$value3 = _state$client$value3.contacts_info) === null || _state$client$value3 === void 0 ? void 0 : _state$client$value3.value;
25
+ if (!contactInfo) {
26
+ var _state$client, _state$client$value4;
27
+ var _ref = ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || {},
28
+ first_name = _ref.first_name,
29
+ last_name = _ref.last_name,
30
+ phone = _ref.phone,
31
+ country_calling_code = _ref.country_calling_code,
32
+ country_code = _ref.country_code,
33
+ email = _ref.email;
34
+ dispatch({
35
+ type: 'setContactsInfo',
36
+ payload: {
37
+ value: {
38
+ first_name: first_name || '',
39
+ last_name: last_name || '',
40
+ phone: {
41
+ phone: phone || '',
42
+ country_calling_code: country_calling_code || '',
43
+ country_code: country_code || ''
44
+ },
45
+ email: email || ''
46
+ },
47
+ client_id: (_state$client$value4 = state.client.value) === null || _state$client$value4 === void 0 ? void 0 : _state$client$value4.id
48
+ }
49
+ });
50
+ } else {
51
+ var _state$client$value5;
52
+ dispatch({
53
+ type: 'setContactsInfo',
54
+ payload: {
55
+ value: _objectSpread({}, contactInfo || {}),
56
+ client_id: (_state$client$value5 = state.client.value) === null || _state$client$value5 === void 0 ? void 0 : _state$client$value5.id
57
+ }
58
+ });
59
+ }
60
+ }
61
+ }, [(_state$client$value6 = state.client.value) === null || _state$client$value6 === void 0 ? void 0 : _state$client$value6.id, state === null || state === void 0 || (_state$contacts_info3 = state.contacts_info) === null || _state$contacts_info3 === void 0 ? void 0 : _state$contacts_info3.client_id]);
62
+ var handleSave = function handleSave(value) {
63
+ dispatch({
64
+ type: 'setContactsInfo',
65
+ payload: {
66
+ value: value,
67
+ edit: true
68
+ }
69
+ });
70
+ };
71
+ return /*#__PURE__*/React.createElement("div", {
72
+ style: {
73
+ marginTop: '24px'
74
+ }
75
+ }, /*#__PURE__*/React.createElement("div", {
76
+ className: "pisell-lowcode__booking-contact-info-title",
77
+ style: {
78
+ fontSize: '16px',
79
+ fontWeight: 500,
80
+ marginBottom: '8px'
81
+ }
82
+ }, locales.getText('pisell2.booking.text.contact-info.title')), /*#__PURE__*/React.createElement(ContactInfo, {
83
+ dataSource: ((_state$contacts_info4 = state.contacts_info) === null || _state$contacts_info4 === void 0 ? void 0 : _state$contacts_info4.value) || null,
84
+ isShowDelete: false,
85
+ isShowAvatar: false,
86
+ isShowPhone: true,
87
+ isShowEmail: true,
88
+ style: {
89
+ padding: '14px 0 14px 14px'
90
+ },
91
+ onSave: handleSave
92
+ }));
93
+ };
94
+ export default ContactInfoMode;
@@ -276,6 +276,7 @@ declare const _default: {
276
276
  'pisell2.text.quotation.product.change.title': string;
277
277
  'pisell2.text.quotation.product.change.describe': string;
278
278
  'pisell2.text.form.link.to.another.record.more': string;
279
+ 'pisell2.booking.text.contact-info.title': string;
279
280
  };
280
281
  'zh-CN': {
281
282
  'pisell2.text.refunded-amount': string;
@@ -554,6 +555,7 @@ declare const _default: {
554
555
  'pisell2.text.quotation.product.change.title': string;
555
556
  'pisell2.text.quotation.product.change.describe': string;
556
557
  'pisell2.text.form.link.to.another.record.more': string;
558
+ 'pisell2.booking.text.contact-info.title': string;
557
559
  };
558
560
  'zh-HK': {
559
561
  'pisell2.text.refunded-amount': string;
@@ -832,6 +834,7 @@ declare const _default: {
832
834
  'pisell2.text.quotation.product.change.title': string;
833
835
  'pisell2.text.quotation.product.change.describe': string;
834
836
  'pisell2.text.form.link.to.another.record.more': string;
837
+ 'pisell2.booking.text.contact-info.title': string;
835
838
  };
836
839
  };
837
840
  export default _default;
@@ -320,7 +320,9 @@ export default {
320
320
  },
321
321
  'pisell2.text.quotation.product.change.title': "Notification",
322
322
  'pisell2.text.quotation.product.change.describe': "Product updates available: Please refresh the following items to load the latest data.",
323
- 'pisell2.text.form.link.to.another.record.more': 'View More'
323
+ 'pisell2.text.form.link.to.another.record.more': 'View More',
324
+ // 联系信息
325
+ 'pisell2.booking.text.contact-info.title': 'Contact info'
324
326
  },
325
327
  'zh-CN': {
326
328
  'pisell2.text.refunded-amount': '已退金额',
@@ -647,7 +649,9 @@ export default {
647
649
  },
648
650
  'pisell2.text.quotation.product.change.title': "提示",
649
651
  'pisell2.text.quotation.product.change.describe': "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
650
- 'pisell2.text.form.link.to.another.record.more': '查看更多'
652
+ 'pisell2.text.form.link.to.another.record.more': '查看更多',
653
+ // 联系信息
654
+ 'pisell2.booking.text.contact-info.title': '联系信息'
651
655
  },
652
656
  'zh-HK': {
653
657
  'pisell2.text.refunded-amount': '已退金額',
@@ -974,6 +978,8 @@ export default {
974
978
  },
975
979
  'pisell2.text.quotation.product.change.title': "提示",
976
980
  'pisell2.text.quotation.product.change.describe': "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
977
- 'pisell2.text.form.link.to.another.record.more': '查看更多'
981
+ 'pisell2.text.form.link.to.another.record.more': '查看更多',
982
+ // 联系信息
983
+ 'pisell2.booking.text.contact-info.title': '聯繫信息'
978
984
  }
979
985
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -26,6 +27,10 @@ export interface FormState {
26
27
  };
27
28
  edit: boolean;
28
29
  };
30
+ contacts_info: {
31
+ edit: boolean;
32
+ value: any;
33
+ };
29
34
  date: {
30
35
  value: any;
31
36
  end_date: any;
@@ -105,4 +110,11 @@ export declare const walkInData: {
105
110
  id: number;
106
111
  nickname: string;
107
112
  };
108
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -27,6 +27,9 @@ var apis = {
27
27
  },
28
28
  getFormData: function getFormData() {
29
29
  return [];
30
+ },
31
+ getContactsInfo: function getContactsInfo() {
32
+ return null;
30
33
  }
31
34
  };
32
35
  export var walkInData = {
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
298
+ mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
- action?: "amount" | "pay" | "deviceList" | undefined;
301
+ action?: "amount" | "deviceList" | "pay" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -29,4 +30,11 @@ export interface PayGroup {
29
30
  _order: any;
30
31
  front_order_uuid?: string;
31
32
  }
32
- export declare const Provider: any, Context: any;
33
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
34
+ state: FormState;
35
+ } & {
36
+ dispatch: (params: {
37
+ type: string;
38
+ payload: any;
39
+ }) => void;
40
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,4 +69,11 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: any, Context: any;
72
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
+ state: FormState;
74
+ } & {
75
+ dispatch: (params: {
76
+ type: string;
77
+ payload: any;
78
+ }) => void;
79
+ }>;
@@ -8,7 +8,8 @@
8
8
  .booking-info-create-new,
9
9
  .pisell-lowcode__booking-field-title,
10
10
  .pisell-lowcode__shopping-cart-empty,
11
- .pisell-lowcode__booking-service-clear-btn {
11
+ .pisell-lowcode__booking-service-clear-btn,
12
+ .pisell-lowcode__booking-contact-info-title {
12
13
  color: #ffffff;
13
14
  }
14
15
  }
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ addWalletCard: any;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ walletDetailState: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1 +1,14 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
4
+ setup?: 'menu' | 'list' | 'detail' | string;
5
+ }
6
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
7
+ state: RechargeState;
8
+ } & {
9
+ dispatch: (params: {
10
+ type: string;
11
+ payload: any;
12
+ }) => void;
13
+ }>;
14
+ export {};
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ state: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1 +1,29 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ selectedGiftOptionId: string | null;
4
+ cardList: Array<{
5
+ id: string;
6
+ name: string;
7
+ price: number;
8
+ }>;
9
+ selectedItem: {
10
+ id?: string;
11
+ gift_price?: number;
12
+ price?: number;
13
+ name?: string;
14
+ variant_id?: string;
15
+ };
16
+ productId?: string;
17
+ detailId?: string;
18
+ total: string | number;
19
+ rechargeModalOpen: boolean;
20
+ }
21
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
22
+ state: RechargeState;
23
+ } & {
24
+ dispatch: (params: {
25
+ type: string;
26
+ payload: any;
27
+ }) => void;
28
+ }>;
29
+ export {};
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: 0;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ state: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IWalletListItemProps } from './serve';
2
3
  export interface WalletCardItemProps {
3
4
  id: string;
@@ -26,4 +27,11 @@ export interface WalletListProps {
26
27
  currentSearchListItemCode?: string;
27
28
  [key: string]: any;
28
29
  }
29
- export declare const Provider: any, Context: any;
30
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
31
+ global_wallet: WalletListProps;
32
+ } & {
33
+ dispatch: (params: {
34
+ type: string;
35
+ payload: any;
36
+ }) => void;
37
+ }>;
package/es/index.d.ts CHANGED
@@ -50,3 +50,6 @@ export { default as SaasRegister } from './plus/saasRegister';
50
50
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
51
51
  export { default as PinModal } from './components/pinModal';
52
52
  export { default as PinVerifyModal } from './components/pinVerifyModal';
53
+ export { default as ContactInfo } from './plus/contactInfo';
54
+ export { default as ContactInfoModal } from './plus/contactInfoModal';
55
+ export { Login2, Register2, AuthModal } from './pro/Login2.0';
package/es/index.js CHANGED
@@ -53,4 +53,7 @@ export { default as SaasLogin } from "./plus/saasLogin";
53
53
  export { default as SaasRegister } from "./plus/saasRegister";
54
54
  export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
55
55
  export { default as PinModal } from "./components/pinModal";
56
- export { default as PinVerifyModal } from "./components/pinVerifyModal";
56
+ export { default as PinVerifyModal } from "./components/pinVerifyModal";
57
+ export { default as ContactInfo } from "./plus/contactInfo";
58
+ export { default as ContactInfoModal } from "./plus/contactInfoModal";
59
+ export { Login2, Register2, AuthModal } from "./pro/Login2.0";
@@ -0,0 +1,4 @@
1
+ import './index.less';
2
+ import { IClientNameProps } from './type';
3
+ declare const ClientName: ({ className, dataSource, style }: IClientNameProps) => JSX.Element | null;
4
+ export default ClientName;
@@ -0,0 +1,18 @@
1
+ import React, { useMemo } from 'react';
2
+ import classNames from 'classnames';
3
+ import "./index.less";
4
+ import { getClientName } from "./utils";
5
+ var ClientName = function ClientName(_ref) {
6
+ var className = _ref.className,
7
+ dataSource = _ref.dataSource,
8
+ style = _ref.style;
9
+ var name = useMemo(function () {
10
+ return getClientName(dataSource);
11
+ }, [dataSource]);
12
+ if (!dataSource) return null;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ className: classNames('pisell-client-name', className),
15
+ style: style || {}
16
+ }, name);
17
+ };
18
+ export default ClientName;
@@ -0,0 +1,10 @@
1
+ .pisell-client-name {
2
+ color: var(--Base-Black, #000);
3
+ font-size: 16px;
4
+ font-style: normal;
5
+ font-weight: 600;
6
+ line-height: 20px;
7
+ white-space: nowrap;
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare type ClientData = {
3
+ display_name?: string;
4
+ nickname?: string;
5
+ first_name?: string;
6
+ last_name?: string;
7
+ [key: string]: any;
8
+ };
9
+ export interface IClientNameProps {
10
+ dataSource?: string | ClientData | null;
11
+ className?: string;
12
+ style?: React.CSSProperties;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ClientData } from './type';
2
+ export declare const getClientName: (dataSource: string | ClientData | null) => string | null;
@@ -0,0 +1,18 @@
1
+ export var getClientName = function getClientName(dataSource) {
2
+ if (!dataSource || typeof dataSource === 'string') {
3
+ return dataSource;
4
+ }
5
+ var first_name = dataSource.first_name,
6
+ last_name = dataSource.last_name,
7
+ display_name = dataSource.display_name,
8
+ nickname = dataSource.nickname;
9
+ var finalName = '';
10
+ if (display_name) {
11
+ finalName = display_name;
12
+ } else if (nickname) {
13
+ finalName = nickname;
14
+ } else if (first_name || last_name) {
15
+ finalName = "".concat(first_name, " ").concat(last_name).trim();
16
+ }
17
+ return finalName;
18
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AvatarConfig } from '../../types';
3
+ import '../../index.less';
4
+ interface AvatarProps {
5
+ config?: AvatarConfig;
6
+ name: string;
7
+ cover?: string;
8
+ }
9
+ declare const Avatar: React.FC<AvatarProps>;
10
+ export default Avatar;
@@ -0,0 +1,30 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import React from 'react';
3
+ import { PisellAvatar } from '@pisell/materials';
4
+ import { getAvatarText } from "../../utils";
5
+ import { PREFIX } from "../../index";
6
+ import "../../index.less";
7
+ var Avatar = function Avatar(props) {
8
+ var config = props.config,
9
+ name = props.name,
10
+ cover = props.cover;
11
+ var _ref = config || {},
12
+ useTextAvatar = _ref.useTextAvatar,
13
+ children = _ref.children;
14
+ if (useTextAvatar) {
15
+ var text = children || getAvatarText(name);
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ className: "".concat(PREFIX, "__avatar-wrapper")
18
+ }, /*#__PURE__*/React.createElement(PisellAvatar, _extends({
19
+ className: "".concat(PREFIX, "__avatar")
20
+ }, config || {}), text));
21
+ }
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: "".concat(PREFIX, "__avatar-wrapper")
24
+ }, /*#__PURE__*/React.createElement(PisellAvatar, _extends({
25
+ className: "".concat(PREFIX, "__avatar")
26
+ }, config || {}, {
27
+ src: cover || ''
28
+ })));
29
+ };
30
+ export default Avatar;