@pisell/private-materials 6.5.27 → 6.6.2

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 (340) 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 +2 -2
  6. package/build/lowcode/preview.js +146 -165
  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 +4 -2
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -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/components/actionButtons/index.js +34 -20
  20. package/es/components/booking/components/customSelect/index.js +1 -1
  21. package/es/components/booking/components/footer/amount.js +25 -8
  22. package/es/components/booking/components/footer/index.js +66 -33
  23. package/es/components/booking/components/footer/utils.d.ts +7 -0
  24. package/es/components/booking/components/footer/utils.js +126 -99
  25. package/es/components/booking/components/voucher/index.js +25 -9
  26. package/es/components/booking/dashboard/serve.js +1 -6
  27. package/es/components/booking/forms/footer.js +24 -10
  28. package/es/components/booking/forms/serve.js +2 -12
  29. package/es/components/booking/hooks/useQuotation.js +69 -21
  30. package/es/components/booking/info/client/index.js +28 -13
  31. package/es/components/booking/info/client/serve.js +2 -11
  32. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
  33. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
  34. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  35. package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  36. package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
  37. package/es/components/booking/info/main.js +3 -2
  38. package/es/components/booking/info/model.js +5 -0
  39. package/es/components/booking/info/pet/serve.js +1 -6
  40. package/es/components/booking/info/service/Lists.d.ts +1 -1
  41. package/es/components/booking/info/service/Lists.js +10 -4
  42. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  43. package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
  44. package/es/components/booking/info/service/serve.d.ts +14 -0
  45. package/es/components/booking/info/service/serve.js +25 -18
  46. package/es/components/booking/info/service2/Group/utils.js +2 -0
  47. package/es/components/booking/info/service2/utils.d.ts +1 -33
  48. package/es/components/booking/info/service2/utils.js +92 -56
  49. package/es/components/booking/info/utils.js +5 -0
  50. package/es/components/booking/info2/cartClientCard/index.js +49 -9
  51. package/es/components/booking/info2/index.js +3 -2
  52. package/es/components/booking/info2/serve.js +1 -6
  53. package/es/components/booking/info2/service/addService/index.js +146 -89
  54. package/es/components/booking/info2/service/addService/utils.d.ts +9 -1
  55. package/es/components/booking/info2/service/addService/utils.js +83 -14
  56. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  57. package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
  58. package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  59. package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
  60. package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
  61. package/es/components/booking/info2/service/editService/index.js +313 -57
  62. package/es/components/booking/info2/utilsByBooking.js +19 -14
  63. package/es/components/booking/locales.d.ts +36 -0
  64. package/es/components/booking/locales.js +48 -3
  65. package/es/components/booking/model.d.ts +4 -0
  66. package/es/components/booking/model.js +3 -0
  67. package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
  68. package/es/components/booking/utils/confirmHolderModal.js +318 -0
  69. package/es/components/booking/utils/confirmHolderModal.less +40 -0
  70. package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
  71. package/es/components/booking/utils/selectHolderModal.js +407 -0
  72. package/es/components/booking/utils.d.ts +16 -7
  73. package/es/components/booking/utils.js +26 -37
  74. package/es/components/checkout/PaymentModal.js +61 -30
  75. package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
  76. package/es/components/checkout/components/ScrollableList/index.js +0 -1
  77. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  78. package/es/components/checkout/locales.d.ts +3 -0
  79. package/es/components/checkout/locales.js +3 -0
  80. package/es/components/eftposPay/linkly/index.js +64 -2
  81. package/es/components/eftposPay/tyro/index.js +12 -0
  82. package/es/components/list/List.js +3 -0
  83. package/es/components/pay/toB/components/MX51/index.js +14 -44
  84. package/es/components/pay/toB/types/index.d.ts +0 -12
  85. package/es/components/pay/toB/types/index.js +0 -4
  86. package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -5
  87. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  88. package/es/components/shoppingCart/type.d.ts +1 -0
  89. package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  90. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  91. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
  92. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  93. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  94. package/es/components/ticketBooking/components/addServiceVariant/addService.js +421 -794
  95. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  96. package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
  97. package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  98. package/es/components/ticketBooking/components/menuBar/index.js +109 -12
  99. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  100. package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
  101. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
  102. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  103. package/es/components/ticketBooking/components/timeBar/index.js +1 -4
  104. package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  105. package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
  106. package/es/components/ticketBooking/index.d.ts +0 -1
  107. package/es/components/ticketBooking/index.js +0 -2
  108. package/es/components/ticketBooking/serve.js +17 -119
  109. package/es/components/ticketBooking/utils/index.d.ts +7 -1
  110. package/es/components/ticketBooking/utils/index.js +44 -28
  111. package/es/hooks/useEngineContext.d.ts +0 -1
  112. package/es/hooks/useEngineContext.js +0 -7
  113. package/es/index.d.ts +4 -0
  114. package/es/index.js +5 -1
  115. package/es/plus/clientCard/locales.js +3 -3
  116. package/es/plus/clinetSearch/index.js +28 -30
  117. package/es/plus/clinetSearch/locales.d.ts +3 -0
  118. package/es/plus/clinetSearch/locales.js +7 -4
  119. package/es/plus/clinetSearch/types.d.ts +12 -0
  120. package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  121. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  122. package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  123. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  124. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  125. package/es/plus/contactInfo/index.d.ts +6 -0
  126. package/es/plus/contactInfo/index.js +198 -0
  127. package/es/plus/contactInfo/index.less +621 -0
  128. package/es/plus/contactInfo/locales.d.ts +15 -0
  129. package/es/plus/contactInfo/locales.js +14 -0
  130. package/es/plus/contactInfo/types.d.ts +91 -0
  131. package/es/plus/contactInfo/types.js +1 -0
  132. package/es/plus/contactInfo/utils.d.ts +7 -0
  133. package/es/plus/contactInfo/utils.js +50 -0
  134. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  135. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  136. package/es/plus/contactInfoModal/index.d.ts +41 -0
  137. package/es/plus/contactInfoModal/index.js +155 -0
  138. package/es/plus/contactInfoModal/index.less +19 -0
  139. package/es/plus/contactInfoModal/locales.d.ts +66 -0
  140. package/es/plus/contactInfoModal/locales.js +65 -0
  141. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  142. package/es/plus/productSelect/ProductCard/index.js +1 -1
  143. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  144. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  145. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  146. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  147. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  148. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  149. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  150. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  151. package/es/plus/selectHolder/index.d.ts +7 -0
  152. package/es/plus/selectHolder/index.js +273 -0
  153. package/es/plus/selectHolder/index.less +137 -0
  154. package/es/plus/selectHolder/locales.d.ts +24 -0
  155. package/es/plus/selectHolder/locales.js +29 -0
  156. package/es/plus/selectHolder/types.d.ts +104 -0
  157. package/es/plus/selectHolder/types.js +1 -0
  158. package/es/plus/selectHolder/utils.d.ts +9 -0
  159. package/es/plus/selectHolder/utils.js +16 -0
  160. package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  161. package/es/pro/comprehensiveSearch/locales.js +1 -1
  162. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  163. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
  164. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  165. package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
  166. package/es/pro/multiDayTimeSelect/index.js +1 -0
  167. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  168. package/es/pro/multiDayTimeSelect/types.js +1 -0
  169. package/es/pro/skuDetailModal/types.d.ts +1 -0
  170. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  171. package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
  172. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
  173. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  174. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  175. package/lib/components/appointmentBooking/hooks.js +73 -35
  176. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  177. package/lib/components/appointmentBooking/locales.js +6 -3
  178. package/lib/components/booking/components/actionButtons/index.js +11 -2
  179. package/lib/components/booking/components/customSelect/index.js +1 -1
  180. package/lib/components/booking/components/footer/amount.js +23 -6
  181. package/lib/components/booking/components/footer/index.js +26 -5
  182. package/lib/components/booking/components/footer/utils.d.ts +7 -0
  183. package/lib/components/booking/components/footer/utils.js +120 -82
  184. package/lib/components/booking/components/voucher/index.js +10 -1
  185. package/lib/components/booking/dashboard/serve.js +1 -6
  186. package/lib/components/booking/forms/footer.js +29 -11
  187. package/lib/components/booking/forms/serve.js +2 -12
  188. package/lib/components/booking/hooks/useQuotation.js +45 -13
  189. package/lib/components/booking/info/client/index.js +14 -1
  190. package/lib/components/booking/info/client/serve.js +2 -13
  191. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
  192. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
  193. package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
  194. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  195. package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
  196. package/lib/components/booking/info/main.js +5 -4
  197. package/lib/components/booking/info/model.js +5 -0
  198. package/lib/components/booking/info/pet/serve.js +1 -6
  199. package/lib/components/booking/info/service/Lists.d.ts +1 -1
  200. package/lib/components/booking/info/service/Lists.js +5 -3
  201. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  202. package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
  203. package/lib/components/booking/info/service/serve.d.ts +14 -0
  204. package/lib/components/booking/info/service/serve.js +8 -17
  205. package/lib/components/booking/info/service2/Group/utils.js +2 -0
  206. package/lib/components/booking/info/service2/utils.d.ts +1 -33
  207. package/lib/components/booking/info/service2/utils.js +38 -29
  208. package/lib/components/booking/info/utils.js +4 -0
  209. package/lib/components/booking/info2/cartClientCard/index.js +34 -5
  210. package/lib/components/booking/info2/index.js +11 -5
  211. package/lib/components/booking/info2/serve.js +1 -6
  212. package/lib/components/booking/info2/service/addService/index.js +22 -3
  213. package/lib/components/booking/info2/service/addService/utils.d.ts +9 -1
  214. package/lib/components/booking/info2/service/addService/utils.js +48 -11
  215. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  216. package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
  217. package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  218. package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
  219. package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
  220. package/lib/components/booking/info2/service/editService/index.js +254 -32
  221. package/lib/components/booking/info2/utilsByBooking.js +26 -19
  222. package/lib/components/booking/locales.d.ts +36 -0
  223. package/lib/components/booking/locales.js +42 -3
  224. package/lib/components/booking/model.d.ts +4 -0
  225. package/lib/components/booking/model.js +3 -0
  226. package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
  227. package/lib/components/booking/utils/confirmHolderModal.js +253 -0
  228. package/lib/components/booking/utils/confirmHolderModal.less +40 -0
  229. package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
  230. package/lib/components/booking/utils/selectHolderModal.js +319 -0
  231. package/lib/components/booking/utils.d.ts +16 -7
  232. package/lib/components/booking/utils.js +18 -21
  233. package/lib/components/checkout/PaymentModal.js +41 -18
  234. package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
  235. package/lib/components/checkout/components/ScrollableList/index.js +0 -1
  236. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  237. package/lib/components/checkout/locales.d.ts +3 -0
  238. package/lib/components/checkout/locales.js +3 -0
  239. package/lib/components/eftposPay/linkly/index.js +31 -1
  240. package/lib/components/eftposPay/tyro/index.js +12 -0
  241. package/lib/components/list/List.js +3 -0
  242. package/lib/components/pay/toB/components/MX51/index.js +12 -37
  243. package/lib/components/pay/toB/types/index.d.ts +0 -12
  244. package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -8
  245. package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
  246. package/lib/components/shoppingCart/type.d.ts +1 -0
  247. package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  248. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  249. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
  250. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  251. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  252. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +281 -313
  253. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  254. package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
  255. package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  256. package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
  257. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  258. package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
  259. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
  260. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  261. package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
  262. package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  263. package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
  264. package/lib/components/ticketBooking/index.d.ts +0 -1
  265. package/lib/components/ticketBooking/index.js +0 -2
  266. package/lib/components/ticketBooking/serve.js +15 -117
  267. package/lib/components/ticketBooking/utils/index.d.ts +7 -1
  268. package/lib/components/ticketBooking/utils/index.js +29 -23
  269. package/lib/hooks/useEngineContext.d.ts +0 -1
  270. package/lib/hooks/useEngineContext.js +2 -10
  271. package/lib/index.d.ts +4 -0
  272. package/lib/index.js +12 -0
  273. package/lib/plus/clientCard/locales.js +3 -3
  274. package/lib/plus/clinetSearch/index.js +17 -8
  275. package/lib/plus/clinetSearch/locales.d.ts +3 -0
  276. package/lib/plus/clinetSearch/locales.js +7 -4
  277. package/lib/plus/clinetSearch/types.d.ts +12 -0
  278. package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  279. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  280. package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  281. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  282. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  283. package/lib/plus/contactInfo/index.d.ts +6 -0
  284. package/lib/plus/contactInfo/index.js +226 -0
  285. package/lib/plus/contactInfo/index.less +621 -0
  286. package/lib/plus/contactInfo/locales.d.ts +15 -0
  287. package/lib/plus/contactInfo/locales.js +38 -0
  288. package/lib/plus/contactInfo/types.d.ts +91 -0
  289. package/lib/plus/contactInfo/types.js +17 -0
  290. package/lib/plus/contactInfo/utils.d.ts +7 -0
  291. package/lib/plus/contactInfo/utils.js +64 -0
  292. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  293. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  294. package/lib/plus/contactInfoModal/index.d.ts +41 -0
  295. package/lib/plus/contactInfoModal/index.js +139 -0
  296. package/lib/plus/contactInfoModal/index.less +19 -0
  297. package/lib/plus/contactInfoModal/locales.d.ts +66 -0
  298. package/lib/plus/contactInfoModal/locales.js +89 -0
  299. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  300. package/lib/plus/productSelect/ProductCard/index.js +1 -1
  301. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  302. package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
  303. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  304. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  305. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  306. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  307. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  308. package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
  309. package/lib/plus/selectHolder/index.d.ts +7 -0
  310. package/lib/plus/selectHolder/index.js +223 -0
  311. package/lib/plus/selectHolder/index.less +137 -0
  312. package/lib/plus/selectHolder/locales.d.ts +24 -0
  313. package/lib/plus/selectHolder/locales.js +47 -0
  314. package/lib/plus/selectHolder/types.d.ts +104 -0
  315. package/lib/plus/selectHolder/types.js +17 -0
  316. package/lib/plus/selectHolder/utils.d.ts +9 -0
  317. package/lib/plus/selectHolder/utils.js +34 -0
  318. package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  319. package/lib/pro/comprehensiveSearch/locales.js +1 -1
  320. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  321. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
  322. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  323. package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
  324. package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
  325. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  326. package/lib/pro/multiDayTimeSelect/types.js +17 -0
  327. package/lib/pro/skuDetailModal/types.d.ts +1 -0
  328. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  329. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  330. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  331. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  332. package/lowcode/contact-info/meta.ts +199 -0
  333. package/lowcode/contact-info-modal/meta.ts +98 -0
  334. package/lowcode/event-select-holder/meta.ts +2 -2
  335. package/lowcode/select-holder/meta.ts +220 -0
  336. package/lowcode/select-holder/snippets.ts +41 -0
  337. package/package.json +13 -11
  338. package/es/hooks/printer.d.ts +0 -4
  339. package/es/hooks/printer.js +0 -35
  340. package/lib/hooks/printer.d.ts +0 -4
@@ -0,0 +1,407 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ 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."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
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
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
+ 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); }
18
+ import React, { useState, useEffect, useMemo, useRef } from 'react';
19
+ import { createPortal } from 'react-dom';
20
+ import { locales } from '@pisell/utils';
21
+ import { isWalkIn } from "../utils";
22
+ import PisellSelectHolder from "../../../plus/selectHolder";
23
+ // 全局状态管理
24
+ var modalState = null;
25
+
26
+ // 存储所有实例的 setState 函数
27
+ var allSetStateCallbacks = new Set();
28
+
29
+ // 当前渲染的实例 ID(确保只有一个实例渲染)
30
+ var renderingInstanceId = null;
31
+
32
+ // 通知所有实例更新状态
33
+ function notifyAllInstances(newState) {
34
+ modalState = newState;
35
+ allSetStateCallbacks.forEach(function (setState) {
36
+ setState(newState);
37
+ });
38
+ }
39
+
40
+ /**
41
+ * 获取 formDataConfig 和 isMinorAndWaiver
42
+ */
43
+ function getFormDataConfig(state) {
44
+ var _state$bookingConfig, _holder$form, _holder$form2;
45
+ var _holder = state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.holder;
46
+ if (!_holder) {
47
+ return {
48
+ formDataConfig: null,
49
+ isMinorAndWaiver: false
50
+ };
51
+ }
52
+ var formDataConfig = _objectSpread(_objectSpread(_objectSpread({}, _holder), _holder === null || _holder === void 0 ? void 0 : _holder.form), {}, {
53
+ options: [],
54
+ form_id: _holder === null || _holder === void 0 || (_holder$form = _holder.form) === null || _holder$form === void 0 ? void 0 : _holder$form.id,
55
+ field: _holder === null || _holder === void 0 || (_holder$form2 = _holder.form) === null || _holder$form2 === void 0 ? void 0 : _holder$form2.form_field,
56
+ relation_type: 'appointment_booking',
57
+ form_record: []
58
+ });
59
+
60
+ // 是Minor并且与Waiver关联
61
+ var isMinorAndWaiver = false;
62
+ if ((formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_type) === 'minors') {
63
+ var _formDataConfig$form_;
64
+ var detail = formDataConfig === null || formDataConfig === void 0 || (_formDataConfig$form_ = formDataConfig.form_field) === null || _formDataConfig$form_ === void 0 ? void 0 : _formDataConfig$form_.find(function (item) {
65
+ return item.filed_type === 'form_to_form' && item.status === 'hide';
66
+ });
67
+ if (detail) {
68
+ var _detail$setting;
69
+ isMinorAndWaiver = detail === null || detail === void 0 || (_detail$setting = detail.setting) === null || _detail$setting === void 0 ? void 0 : _detail$setting.linkedTable;
70
+ }
71
+ }
72
+ return {
73
+ formDataConfig: formDataConfig,
74
+ isMinorAndWaiver: isMinorAndWaiver
75
+ };
76
+ }
77
+
78
+ /**
79
+ * 获取 holder 选项列表
80
+ */
81
+ function getHolderOptions(state) {
82
+ var _state$pet, _state$bookingConfig2, _state$pet2, _state$pet3;
83
+ var holdersFromState = Array.isArray(state === null || state === void 0 || (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.holders) ? state.pet.holders : [];
84
+ var formId = (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.form_id) || 0;
85
+ var holdersFromValue = Array.isArray(state === null || state === void 0 || (_state$pet2 = state.pet) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2.value) === null || _state$pet2 === void 0 ? void 0 : _state$pet2[formId]) ? state === null || state === void 0 || (_state$pet3 = state.pet) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3.value) === null || _state$pet3 === void 0 ? void 0 : _state$pet3[formId] : [];
86
+ var rawList = holdersFromState.length > 0 ? holdersFromState : holdersFromValue;
87
+ return rawList.map(function (item) {
88
+ var id = (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id) || (item === null || item === void 0 ? void 0 : item.value);
89
+ if (id === undefined || id === null) return null;
90
+ return {
91
+ label: (item === null || item === void 0 ? void 0 : item.main_field) || (item === null || item === void 0 ? void 0 : item.label) || (item === null || item === void 0 ? void 0 : item.name) || locales.getText('pisell-select-holder-please-select'),
92
+ value: id,
93
+ avatar: item === null || item === void 0 ? void 0 : item.avatar,
94
+ subtitle: (item === null || item === void 0 ? void 0 : item.subtitle) || (item === null || item === void 0 ? void 0 : item.second_field) || (item === null || item === void 0 ? void 0 : item.sub_field)
95
+ };
96
+ }).filter(Boolean);
97
+ }
98
+
99
+ /**
100
+ * 构建 displayConfig
101
+ */
102
+ function buildDisplayConfig(state, holderOptions) {
103
+ var _state$bookingConfig3;
104
+ var maxSelectedCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
105
+ var selectType = maxSelectedCount > 1 ? 'multiple' : 'single';
106
+ return {
107
+ direction: 'vertical',
108
+ selectType: selectType,
109
+ showAvatar: true,
110
+ showTitle: true,
111
+ showSubtitle: Boolean(holderOptions.some(function (option) {
112
+ return option.subtitle;
113
+ })),
114
+ isSkipable: (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.basic) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.subject_require) === 'optional'
115
+ };
116
+ }
117
+
118
+ /**
119
+ * SelectHolderModal 组件(单例模式)
120
+ * 使用 Portal 在 body 上渲染,确保全局只有一个实例
121
+ * 可以在多个地方挂载,但实际只会渲染一个实例
122
+ */
123
+ export var SelectHolderModal = function SelectHolderModal() {
124
+ var _useState = useState(modalState),
125
+ _useState2 = _slicedToArray(_useState, 2),
126
+ localState = _useState2[0],
127
+ setLocalState = _useState2[1];
128
+ var _useState3 = useState(null),
129
+ _useState4 = _slicedToArray(_useState3, 2),
130
+ container = _useState4[0],
131
+ setContainer = _useState4[1];
132
+ var instanceIdRef = useRef(Symbol('SelectHolderModal'));
133
+ var isRenderingInstanceRef = useRef(false);
134
+ useEffect(function () {
135
+ // 创建或获取单例容器
136
+ var containerElement = document.getElementById('select-holder-modal-container');
137
+ if (!containerElement) {
138
+ containerElement = document.createElement('div');
139
+ containerElement.id = 'select-holder-modal-container';
140
+ document.body.appendChild(containerElement);
141
+ }
142
+ setContainer(containerElement);
143
+
144
+ // 如果还没有渲染实例,将当前实例设为渲染实例
145
+ if (renderingInstanceId === null) {
146
+ renderingInstanceId = instanceIdRef.current;
147
+ isRenderingInstanceRef.current = true;
148
+ } else {
149
+ isRenderingInstanceRef.current = renderingInstanceId === instanceIdRef.current;
150
+ }
151
+
152
+ // 注册当前实例的 setState
153
+ allSetStateCallbacks.add(setLocalState);
154
+
155
+ // 初始化时同步一次状态
156
+ if (modalState && modalState !== localState) {
157
+ setLocalState(modalState);
158
+ }
159
+ return function () {
160
+ // 移除当前实例的 setState
161
+ allSetStateCallbacks.delete(setLocalState);
162
+ // 如果当前实例是渲染实例,清理渲染实例标识
163
+ if (isRenderingInstanceRef.current) {
164
+ renderingInstanceId = null;
165
+ }
166
+ };
167
+ }, []);
168
+
169
+ // 如果 localState 不存在或 open 为 false,不渲染
170
+ if (!localState || !localState.open || !container) {
171
+ return null;
172
+ }
173
+
174
+ // 确保只有渲染实例才能渲染
175
+ if (!isRenderingInstanceRef.current) {
176
+ return null;
177
+ }
178
+ var state = localState.state,
179
+ dispatch = localState.dispatch,
180
+ initialValue = localState.initialValue,
181
+ maxSelectedCount = localState.maxSelectedCount,
182
+ resolve = localState.resolve;
183
+
184
+ // 使用 Portal 渲染到 body,确保单例
185
+ return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(SelectHolderModalContent, {
186
+ state: state,
187
+ dispatch: dispatch,
188
+ initialValue: initialValue,
189
+ maxSelectedCount: maxSelectedCount,
190
+ resolve: resolve,
191
+ onClose: function onClose() {
192
+ // 延迟清理全局状态,确保动画完成(300ms 动画 + 50ms 缓冲)
193
+ setTimeout(function () {
194
+ notifyAllInstances(null);
195
+ }, 350);
196
+ }
197
+ }), container);
198
+ };
199
+
200
+ /**
201
+ * SelectHolderModal 内容组件
202
+ */
203
+ var SelectHolderModalContent = function SelectHolderModalContent(_ref) {
204
+ var _stateRef$current2, _stateRef$current3, _holderConfig$form;
205
+ var state = _ref.state,
206
+ dispatch = _ref.dispatch,
207
+ initialValue = _ref.initialValue,
208
+ maxSelectedCount = _ref.maxSelectedCount,
209
+ resolve = _ref.resolve,
210
+ onClose = _ref.onClose;
211
+ var _useState5 = useState(true),
212
+ _useState6 = _slicedToArray(_useState5, 2),
213
+ open = _useState6[0],
214
+ setOpen = _useState6[1];
215
+ var _useState7 = useState(function () {
216
+ return getHolderOptions(state);
217
+ }),
218
+ _useState8 = _slicedToArray(_useState7, 2),
219
+ holderOptions = _useState8[0],
220
+ setHolderOptions = _useState8[1];
221
+ var _useState9 = useState(function () {
222
+ if (Array.isArray(initialValue)) {
223
+ return initialValue.filter(function (item) {
224
+ return item !== undefined && item !== null;
225
+ });
226
+ }
227
+ if (initialValue === undefined || initialValue === null || initialValue === '') {
228
+ return [];
229
+ }
230
+ return [initialValue];
231
+ }),
232
+ _useState10 = _slicedToArray(_useState9, 2),
233
+ selectedValues = _useState10[0],
234
+ setSelectedValues = _useState10[1];
235
+
236
+ // 使用 ref 存储最新的 state,以便在组件内部访问
237
+ var stateRef = {
238
+ current: state
239
+ };
240
+
241
+ // 更新 stateRef
242
+ useEffect(function () {
243
+ stateRef.current = state;
244
+ // 当 state 更新时,同步更新 holderOptions
245
+ var newOptions = getHolderOptions(state);
246
+ setHolderOptions(newOptions);
247
+ }, [state]);
248
+ var displayConfig = useMemo(function () {
249
+ var _stateRef$current;
250
+ return buildDisplayConfig(stateRef.current, holderOptions, maxSelectedCount || ((_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.bookingConfig) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.holder) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.maxSelectedCount) || 1);
251
+ }, [holderOptions, maxSelectedCount, state]);
252
+
253
+ // 获取 formDataConfig
254
+ var _useMemo = useMemo(function () {
255
+ return getFormDataConfig(stateRef.current);
256
+ }, [(_stateRef$current2 = stateRef.current) === null || _stateRef$current2 === void 0 || (_stateRef$current2 = _stateRef$current2.bookingConfig) === null || _stateRef$current2 === void 0 ? void 0 : _stateRef$current2.holder]),
257
+ formDataConfig = _useMemo.formDataConfig,
258
+ isMinorAndWaiver = _useMemo.isMinorAndWaiver;
259
+ var holderConfig = ((_stateRef$current3 = stateRef.current) === null || _stateRef$current3 === void 0 || (_stateRef$current3 = _stateRef$current3.bookingConfig) === null || _stateRef$current3 === void 0 ? void 0 : _stateRef$current3.holder) || {};
260
+ var title = (holderConfig === null || holderConfig === void 0 || (_holderConfig$form = holderConfig.form) === null || _holderConfig$form === void 0 ? void 0 : _holderConfig$form.title) || (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.title) || locales.getText('pisell2.text.holder');
261
+
262
+ // 更新 state 中的 holders
263
+ var updateStateHolders = function updateStateHolders(holders) {
264
+ dispatch({
265
+ type: 'setPet',
266
+ payload: {
267
+ holders: holders
268
+ }
269
+ });
270
+ };
271
+ var handleClose = function handleClose() {
272
+ setOpen(false);
273
+ // 先调用 resolve,再关闭
274
+ if (resolve) {
275
+ resolve(null);
276
+ }
277
+ // 延迟关闭,确保动画完成
278
+ setTimeout(function () {
279
+ onClose();
280
+ }, 300);
281
+ };
282
+ var handleConfirm = function handleConfirm(nextValues) {
283
+ setOpen(false);
284
+ // 先调用 resolve,再关闭
285
+ if (resolve) {
286
+ if (nextValues && nextValues.length > 0) {
287
+ var selectedIds = nextValues.map(function (val) {
288
+ return Number(val);
289
+ });
290
+ resolve(selectedIds);
291
+ } else {
292
+ resolve(null);
293
+ }
294
+ }
295
+ // 延迟关闭,确保动画完成
296
+ setTimeout(function () {
297
+ onClose();
298
+ }, 300);
299
+ };
300
+ var handleAdd = function handleAdd() {
301
+ var _currentState$pet, _currentState$client, _currentState$client2, _currentState$pet$for, _currentState$pet$for2;
302
+ var currentState = stateRef.current;
303
+ var waiverForm = currentState === null || currentState === void 0 || (_currentState$pet = currentState.pet) === null || _currentState$pet === void 0 ? void 0 : _currentState$pet.waiverForm;
304
+ currentState.action({
305
+ type: 'pisell1.goCustomFormAddData',
306
+ data: {
307
+ zIndex: 1101,
308
+ customerId: (_currentState$client = currentState.client) === null || _currentState$client === void 0 || (_currentState$client = _currentState$client.value) === null || _currentState$client === void 0 ? void 0 : _currentState$client.id,
309
+ formDataConfig: isMinorAndWaiver ? _objectSpread(_objectSpread({}, waiverForm), {}, {
310
+ customer_id: (_currentState$client2 = currentState.client) === null || _currentState$client2 === void 0 || (_currentState$client2 = _currentState$client2.value) === null || _currentState$client2 === void 0 ? void 0 : _currentState$client2.id,
311
+ is_franchisor: (_currentState$pet$for = currentState.pet.formData) === null || _currentState$pet$for === void 0 || (_currentState$pet$for = _currentState$pet$for[0]) === null || _currentState$pet$for === void 0 ? void 0 : _currentState$pet$for.is_franchisor
312
+ }) : _objectSpread({}, ((_currentState$pet$for2 = currentState.pet.formData) === null || _currentState$pet$for2 === void 0 ? void 0 : _currentState$pet$for2[0]) || {})
313
+ },
314
+ callback: function callback(res) {
315
+ var _currentState$client3;
316
+ var obj = {};
317
+ var _iterator = _createForOfIteratorHelper(res),
318
+ _step;
319
+ try {
320
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
321
+ var item = _step.value;
322
+ obj[item.key] = item.value;
323
+ }
324
+ } catch (err) {
325
+ _iterator.e(err);
326
+ } finally {
327
+ _iterator.f();
328
+ }
329
+ var isWalkInBol = isWalkIn((_currentState$client3 = currentState.client) === null || _currentState$client3 === void 0 || (_currentState$client3 = _currentState$client3.value) === null || _currentState$client3 === void 0 ? void 0 : _currentState$client3.id);
330
+ var newHolders = !isWalkInBol ? [obj].concat(_toConsumableArray(currentState.pet.holders || [])) : currentState.pet.holders || [];
331
+ updateStateHolders(newHolders);
332
+
333
+ // 更新 stateRef 和 holderOptions
334
+ var updatedState = _objectSpread(_objectSpread({}, currentState), {}, {
335
+ pet: _objectSpread(_objectSpread({}, currentState.pet), {}, {
336
+ holders: newHolders
337
+ })
338
+ });
339
+ stateRef.current = updatedState;
340
+
341
+ // 更新 holderOptions
342
+ var newOptions = getHolderOptions(updatedState);
343
+ setHolderOptions(newOptions);
344
+ }
345
+ });
346
+ // 添加 holder 后,弹窗保持打开状态,等待用户选择新添加的 holder
347
+ };
348
+ var handleSkip = function handleSkip() {
349
+ setOpen(false);
350
+ // 先调用 resolve,再关闭
351
+ if (resolve) {
352
+ resolve(null);
353
+ }
354
+ // 延迟关闭,确保动画完成
355
+ setTimeout(function () {
356
+ onClose();
357
+ }, 300);
358
+ };
359
+ return /*#__PURE__*/React.createElement(PisellSelectHolder, {
360
+ open: open,
361
+ modalConfig: {
362
+ title: "".concat(locales.getText('pisell-select-holder-please-select'), " ").concat(maxSelectedCount || 1, " ").concat(title),
363
+ confirmText: locales.getText('pisell2.text.confirm')
364
+ },
365
+ dataSource: holderOptions,
366
+ value: selectedValues,
367
+ displayConfig: displayConfig,
368
+ maxSelectedCount: maxSelectedCount,
369
+ allowAdd: true,
370
+ onClose: handleClose,
371
+ onConfirm: handleConfirm,
372
+ onAdd: handleAdd,
373
+ onSkip: handleSkip
374
+ });
375
+ };
376
+
377
+ /**
378
+ * 通过 await 调用的 Holder 选择弹窗
379
+ * @param options 配置选项
380
+ * @returns Promise,resolve 时返回选中的 holder ID 数组,或 null(用户取消时)
381
+ */
382
+ export function selectHolderModal(options) {
383
+ var state = options.state,
384
+ dispatch = options.dispatch,
385
+ initialValue = options.initialValue,
386
+ maxSelectedCount = options.maxSelectedCount;
387
+ return new Promise(function (resolve) {
388
+ // 先清理之前的状态,确保没有残留的 resolve
389
+ if (modalState && modalState.resolve) {
390
+ // 如果之前的状态还有未完成的 resolve,先 resolve null
391
+ modalState.resolve(null);
392
+ }
393
+
394
+ // 设置全局状态
395
+ var newState = {
396
+ open: true,
397
+ state: state,
398
+ dispatch: dispatch,
399
+ initialValue: initialValue,
400
+ maxSelectedCount: maxSelectedCount,
401
+ resolve: resolve
402
+ };
403
+
404
+ // 通知所有实例更新状态
405
+ notifyAllInstances(newState);
406
+ });
407
+ }
@@ -1,8 +1,4 @@
1
1
  import dayjs from 'dayjs';
2
- /**
3
- * @title: 高阶函数结果缓存(Memoization)
4
- */
5
- export declare function memoize<T extends (...args: any[]) => any>(fn: T): T;
6
2
  declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
7
3
  declare class Request {
8
4
  private request;
@@ -27,8 +23,21 @@ export declare const request: Request;
27
23
  */
28
24
  export declare const getDiscountTime: (service_times: number, isDay?: boolean) => string;
29
25
  /**
30
- * @title: 时间切片(带缓存版本)
31
- * @description: 使用 memoize 高阶函数包裹 sliceDayIntoFiveMinutes,相同参数时直接返回缓存结果
26
+ * @title: 格式化跨日预约的时长用于展示
27
+ * @description:
28
+ * @param {number} days
29
+ * @param {number} minutes
30
+ * @return {*}
31
+ */
32
+ export declare const getDiscountTimeByDayMinutes: (days: number, minutes: number) => string;
33
+ /**
34
+ * @title: 时间切片
35
+ * @description:
36
+ * @param {any} config
37
+ * @param {string} locale
38
+ * @return {*}
39
+ * @Author: zhiwei.Wang
40
+ * @Date: 2024-04-26 13:59
32
41
  */
33
42
  export declare const sliceDayIntoFiveMinutes: (config: any, locale: string, isDay?: boolean) => {
34
43
  timeSlices: {
@@ -112,7 +121,7 @@ export declare const flexibleObj: {
112
121
  export declare const getEndDate: (startDate: any, duration: string | number, endDate: any) => any;
113
122
  export declare const getServiceTimes: (service: any) => {
114
123
  startDate: dayjs.Dayjs;
115
- endDate: dayjs.Dayjs;
124
+ endDate: any;
116
125
  };
117
126
  export declare const getErrorList: (resource: any, cacheItem: any, isDay?: boolean) => {
118
127
  label: any;
@@ -19,31 +19,7 @@ import { isDayBooking, formatDayDate } from "./info/service2/utils";
19
19
  import { intersectionBy } from 'lodash';
20
20
  import { getAppointmentTimingPreference } from "./info2/utilsByBooking";
21
21
  import Decimal from 'decimal.js';
22
-
23
- /**
24
- * @title: 高阶函数结果缓存(Memoization)
25
- */
26
- export function memoize(fn) {
27
- // 使用 Map 存储缓存,支持任意类型的 key
28
- var cache = new Map();
29
- return function () {
30
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
32
- }
33
- // 将参数序列化为字符串作为缓存的 key
34
- var key = JSON.stringify(args);
35
-
36
- // 如果缓存中存在该 key,直接返回缓存的结果
37
- if (cache.has(key)) {
38
- return cache.get(key);
39
- }
40
-
41
- // 否则执行函数并缓存结果
42
- var result = fn.apply(this, args);
43
- cache.set(key, result);
44
- return result;
45
- };
46
- }
22
+ import { isMultiDayProduct } from "./info2/service/addService/utils";
47
23
  var Request = /*#__PURE__*/function () {
48
24
  function Request() {
49
25
  _classCallCheck(this, Request);
@@ -95,6 +71,20 @@ export var getDiscountTime = function getDiscountTime(service_times, isDay) {
95
71
  }
96
72
  };
97
73
 
74
+ /**
75
+ * @title: 格式化跨日预约的时长用于展示
76
+ * @description:
77
+ * @param {number} days
78
+ * @param {number} minutes
79
+ * @return {*}
80
+ */
81
+ export var getDiscountTimeByDayMinutes = function getDiscountTimeByDayMinutes(days, minutes) {
82
+ if (days === 0) {
83
+ return getDiscountTime(minutes);
84
+ }
85
+ return "".concat(days, " ").concat(locales.getText('pisell2.text.day')(days), " ").concat(getDiscountTime(minutes));
86
+ };
87
+
98
88
  /**
99
89
  * @title: 时间切片
100
90
  * @description:
@@ -104,7 +94,7 @@ export var getDiscountTime = function getDiscountTime(service_times, isDay) {
104
94
  * @Author: zhiwei.Wang
105
95
  * @Date: 2024-04-26 13:59
106
96
  */
107
- var _sliceDayIntoFiveMinutes = function _sliceDayIntoFiveMinutes(config, locale, isDay) {
97
+ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, locale, isDay) {
108
98
  var _locale = locale;
109
99
  var dayjsLocale = _locale === 'en-US' || _locale === 'en' ? 'en' : 'zh-cn';
110
100
  dayjs.locale(dayjsLocale);
@@ -167,12 +157,6 @@ var _sliceDayIntoFiveMinutes = function _sliceDayIntoFiveMinutes(config, locale,
167
157
  };
168
158
  };
169
159
 
170
- /**
171
- * @title: 时间切片(带缓存版本)
172
- * @description: 使用 memoize 高阶函数包裹 sliceDayIntoFiveMinutes,相同参数时直接返回缓存结果
173
- */
174
- export var sliceDayIntoFiveMinutes = memoize(_sliceDayIntoFiveMinutes);
175
-
176
160
  // 获取当前时间
177
161
  export var getNowTime = function getNowTime() {
178
162
  return dayjs().format('HH:mm');
@@ -235,15 +219,12 @@ export var findNextSlice = function findNextSlice(_ref) {
235
219
  return timeSlices[index].value;
236
220
  };
237
221
  export var findNextDuration = function findNextDuration(current, array, defaultValue) {
238
- if (defaultValue) {
239
- return defaultValue;
240
- }
241
222
  for (var i = 0; i < array.length; i++) {
242
223
  if (array[i].value == (current === null || current === void 0 ? void 0 : current.value)) {
243
224
  return array[i].value;
244
225
  }
245
226
  }
246
- return array[0].value;
227
+ return defaultValue || array[0].value;
247
228
  };
248
229
  export var formatProductListByCategory = function formatProductListByCategory(list, filterItem) {
249
230
  var _list = list || [];
@@ -524,6 +505,14 @@ export var getEndDate = function getEndDate(startDate, duration, endDate) {
524
505
  export var getServiceTimes = function getServiceTimes(service) {
525
506
  var _service$_extend;
526
507
  var startDate = dayjs(dayjs(service._extend.start_date).format('YYYY-MM-DD ') + getServeStartTime(service._extend.start_time));
508
+
509
+ // 跨日预约
510
+ if (isMultiDayProduct(service)) {
511
+ return {
512
+ startDate: startDate,
513
+ endDate: service._extend.end_date
514
+ };
515
+ }
527
516
  var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), 'minute');
528
517
  var session = service === null || service === void 0 || (_service$_extend = service._extend) === null || _service$_extend === void 0 || (_service$_extend = _service$_extend.other) === null || _service$_extend === void 0 ? void 0 : _service$_extend.session;
529
518
  if (isSessionProduct(service) && session) {
@@ -634,7 +623,7 @@ export var formatResource = function formatResource(resourceItem, cacheItem, for
634
623
 
635
624
  // 获取最后一个服务商品
636
625
  export var getLastServer = function getLastServer(list) {
637
- return list === null || list === void 0 ? void 0 : list[0];
626
+ return list[list.length - 1];
638
627
  };
639
628
  export var getCacheParams = function getCacheParams() {
640
629
  // 从缓存里读默认参数, 如果有 则需要默认选中某些参数, 添加完商品后则删除