@pisell/private-materials 6.5.27 → 6.6.1

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 (338) 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/sendModal/useSendModal.d.ts +1 -1
  29. package/es/components/booking/forms/serve.js +2 -12
  30. package/es/components/booking/hooks/useQuotation.js +69 -21
  31. package/es/components/booking/info/client/index.js +28 -13
  32. package/es/components/booking/info/client/serve.js +2 -11
  33. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
  34. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
  35. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  36. package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  37. package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
  38. package/es/components/booking/info/main.js +3 -2
  39. package/es/components/booking/info/model.js +5 -0
  40. package/es/components/booking/info/pet/serve.js +1 -6
  41. package/es/components/booking/info/service/Lists.d.ts +1 -1
  42. package/es/components/booking/info/service/Lists.js +10 -4
  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 +8 -0
  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/locales.d.ts +3 -0
  78. package/es/components/checkout/locales.js +3 -0
  79. package/es/components/eftposPay/linkly/index.js +64 -2
  80. package/es/components/eftposPay/tyro/index.js +12 -0
  81. package/es/components/list/List.js +3 -0
  82. package/es/components/pay/toB/components/MX51/index.js +14 -44
  83. package/es/components/pay/toB/types/index.d.ts +0 -12
  84. package/es/components/pay/toB/types/index.js +0 -4
  85. package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -5
  86. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  87. package/es/components/shoppingCart/type.d.ts +1 -0
  88. package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  89. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  90. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
  91. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  92. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  93. package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
  94. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  95. package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
  96. package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  97. package/es/components/ticketBooking/components/menuBar/index.js +109 -12
  98. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  99. package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
  100. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
  101. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  102. package/es/components/ticketBooking/components/timeBar/index.js +1 -4
  103. package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  104. package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
  105. package/es/components/ticketBooking/index.d.ts +0 -1
  106. package/es/components/ticketBooking/index.js +0 -2
  107. package/es/components/ticketBooking/serve.js +17 -119
  108. package/es/components/ticketBooking/utils/index.d.ts +7 -1
  109. package/es/components/ticketBooking/utils/index.js +44 -28
  110. package/es/hooks/useEngineContext.d.ts +0 -1
  111. package/es/hooks/useEngineContext.js +0 -7
  112. package/es/index.d.ts +4 -0
  113. package/es/index.js +5 -1
  114. package/es/plus/clientCard/locales.js +3 -3
  115. package/es/plus/clinetSearch/index.js +28 -30
  116. package/es/plus/clinetSearch/locales.d.ts +3 -0
  117. package/es/plus/clinetSearch/locales.js +7 -4
  118. package/es/plus/clinetSearch/types.d.ts +12 -0
  119. package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  120. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  121. package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  122. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  123. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  124. package/es/plus/contactInfo/index.d.ts +6 -0
  125. package/es/plus/contactInfo/index.js +198 -0
  126. package/es/plus/contactInfo/index.less +621 -0
  127. package/es/plus/contactInfo/locales.d.ts +15 -0
  128. package/es/plus/contactInfo/locales.js +14 -0
  129. package/es/plus/contactInfo/types.d.ts +91 -0
  130. package/es/plus/contactInfo/types.js +1 -0
  131. package/es/plus/contactInfo/utils.d.ts +7 -0
  132. package/es/plus/contactInfo/utils.js +50 -0
  133. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  134. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  135. package/es/plus/contactInfoModal/index.d.ts +41 -0
  136. package/es/plus/contactInfoModal/index.js +155 -0
  137. package/es/plus/contactInfoModal/index.less +19 -0
  138. package/es/plus/contactInfoModal/locales.d.ts +66 -0
  139. package/es/plus/contactInfoModal/locales.js +65 -0
  140. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  141. package/es/plus/productSelect/ProductCard/index.js +1 -1
  142. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  143. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  144. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  145. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  146. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  147. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  148. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  149. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  150. package/es/plus/selectHolder/index.d.ts +7 -0
  151. package/es/plus/selectHolder/index.js +273 -0
  152. package/es/plus/selectHolder/index.less +137 -0
  153. package/es/plus/selectHolder/locales.d.ts +24 -0
  154. package/es/plus/selectHolder/locales.js +29 -0
  155. package/es/plus/selectHolder/types.d.ts +104 -0
  156. package/es/plus/selectHolder/types.js +1 -0
  157. package/es/plus/selectHolder/utils.d.ts +9 -0
  158. package/es/plus/selectHolder/utils.js +16 -0
  159. package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  160. package/es/pro/comprehensiveSearch/locales.js +1 -1
  161. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  162. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
  163. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  164. package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
  165. package/es/pro/multiDayTimeSelect/index.js +1 -0
  166. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  167. package/es/pro/multiDayTimeSelect/types.js +1 -0
  168. package/es/pro/skuDetailModal/types.d.ts +1 -0
  169. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  170. package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
  171. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
  172. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  173. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  174. package/lib/components/appointmentBooking/hooks.js +73 -35
  175. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  176. package/lib/components/appointmentBooking/locales.js +6 -3
  177. package/lib/components/booking/components/actionButtons/index.js +11 -2
  178. package/lib/components/booking/components/customSelect/index.js +1 -1
  179. package/lib/components/booking/components/footer/amount.js +23 -6
  180. package/lib/components/booking/components/footer/index.js +26 -5
  181. package/lib/components/booking/components/footer/utils.d.ts +7 -0
  182. package/lib/components/booking/components/footer/utils.js +120 -82
  183. package/lib/components/booking/components/voucher/index.js +10 -1
  184. package/lib/components/booking/dashboard/serve.js +1 -6
  185. package/lib/components/booking/forms/footer.js +29 -11
  186. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  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/addTimeModal/serve.js +1 -7
  202. package/lib/components/booking/info/service/serve.d.ts +14 -0
  203. package/lib/components/booking/info/service/serve.js +8 -17
  204. package/lib/components/booking/info/service2/Group/utils.js +2 -0
  205. package/lib/components/booking/info/service2/utils.d.ts +1 -33
  206. package/lib/components/booking/info/service2/utils.js +38 -29
  207. package/lib/components/booking/info/utils.js +4 -0
  208. package/lib/components/booking/info2/cartClientCard/index.js +34 -5
  209. package/lib/components/booking/info2/index.js +11 -5
  210. package/lib/components/booking/info2/serve.js +1 -6
  211. package/lib/components/booking/info2/service/addService/index.js +22 -3
  212. package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
  213. package/lib/components/booking/info2/service/addService/utils.js +48 -11
  214. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  215. package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
  216. package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  217. package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
  218. package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
  219. package/lib/components/booking/info2/service/editService/index.js +254 -32
  220. package/lib/components/booking/info2/utilsByBooking.js +26 -19
  221. package/lib/components/booking/locales.d.ts +36 -0
  222. package/lib/components/booking/locales.js +42 -3
  223. package/lib/components/booking/model.d.ts +4 -0
  224. package/lib/components/booking/model.js +3 -0
  225. package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
  226. package/lib/components/booking/utils/confirmHolderModal.js +253 -0
  227. package/lib/components/booking/utils/confirmHolderModal.less +40 -0
  228. package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
  229. package/lib/components/booking/utils/selectHolderModal.js +319 -0
  230. package/lib/components/booking/utils.d.ts +16 -7
  231. package/lib/components/booking/utils.js +18 -21
  232. package/lib/components/checkout/PaymentModal.js +41 -18
  233. package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
  234. package/lib/components/checkout/components/ScrollableList/index.js +0 -1
  235. package/lib/components/checkout/locales.d.ts +3 -0
  236. package/lib/components/checkout/locales.js +3 -0
  237. package/lib/components/eftposPay/linkly/index.js +31 -1
  238. package/lib/components/eftposPay/tyro/index.js +12 -0
  239. package/lib/components/list/List.js +3 -0
  240. package/lib/components/pay/toB/components/MX51/index.js +12 -37
  241. package/lib/components/pay/toB/types/index.d.ts +0 -12
  242. package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -8
  243. package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
  244. package/lib/components/shoppingCart/type.d.ts +1 -0
  245. package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  246. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  247. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
  248. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  249. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  250. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
  251. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  252. package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
  253. package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  254. package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
  255. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  256. package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
  257. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
  258. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  259. package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
  260. package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  261. package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
  262. package/lib/components/ticketBooking/index.d.ts +0 -1
  263. package/lib/components/ticketBooking/index.js +0 -2
  264. package/lib/components/ticketBooking/serve.js +15 -117
  265. package/lib/components/ticketBooking/utils/index.d.ts +7 -1
  266. package/lib/components/ticketBooking/utils/index.js +29 -23
  267. package/lib/hooks/useEngineContext.d.ts +0 -1
  268. package/lib/hooks/useEngineContext.js +2 -10
  269. package/lib/index.d.ts +4 -0
  270. package/lib/index.js +12 -0
  271. package/lib/plus/clientCard/locales.js +3 -3
  272. package/lib/plus/clinetSearch/index.js +17 -8
  273. package/lib/plus/clinetSearch/locales.d.ts +3 -0
  274. package/lib/plus/clinetSearch/locales.js +7 -4
  275. package/lib/plus/clinetSearch/types.d.ts +12 -0
  276. package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  277. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  278. package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  279. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  280. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  281. package/lib/plus/contactInfo/index.d.ts +6 -0
  282. package/lib/plus/contactInfo/index.js +226 -0
  283. package/lib/plus/contactInfo/index.less +621 -0
  284. package/lib/plus/contactInfo/locales.d.ts +15 -0
  285. package/lib/plus/contactInfo/locales.js +38 -0
  286. package/lib/plus/contactInfo/types.d.ts +91 -0
  287. package/lib/plus/contactInfo/types.js +17 -0
  288. package/lib/plus/contactInfo/utils.d.ts +7 -0
  289. package/lib/plus/contactInfo/utils.js +64 -0
  290. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  291. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  292. package/lib/plus/contactInfoModal/index.d.ts +41 -0
  293. package/lib/plus/contactInfoModal/index.js +139 -0
  294. package/lib/plus/contactInfoModal/index.less +19 -0
  295. package/lib/plus/contactInfoModal/locales.d.ts +66 -0
  296. package/lib/plus/contactInfoModal/locales.js +89 -0
  297. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  298. package/lib/plus/productSelect/ProductCard/index.js +1 -1
  299. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  300. package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
  301. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  302. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  303. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  304. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  305. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  306. package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
  307. package/lib/plus/selectHolder/index.d.ts +7 -0
  308. package/lib/plus/selectHolder/index.js +223 -0
  309. package/lib/plus/selectHolder/index.less +137 -0
  310. package/lib/plus/selectHolder/locales.d.ts +24 -0
  311. package/lib/plus/selectHolder/locales.js +47 -0
  312. package/lib/plus/selectHolder/types.d.ts +104 -0
  313. package/lib/plus/selectHolder/types.js +17 -0
  314. package/lib/plus/selectHolder/utils.d.ts +9 -0
  315. package/lib/plus/selectHolder/utils.js +34 -0
  316. package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  317. package/lib/pro/comprehensiveSearch/locales.js +1 -1
  318. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  319. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
  320. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  321. package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
  322. package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
  323. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  324. package/lib/pro/multiDayTimeSelect/types.js +17 -0
  325. package/lib/pro/skuDetailModal/types.d.ts +1 -0
  326. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  327. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  328. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  329. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  330. package/lowcode/contact-info/meta.ts +199 -0
  331. package/lowcode/contact-info-modal/meta.ts +98 -0
  332. package/lowcode/event-select-holder/meta.ts +2 -2
  333. package/lowcode/select-holder/meta.ts +220 -0
  334. package/lowcode/select-holder/snippets.ts +41 -0
  335. package/package.json +13 -11
  336. package/es/hooks/printer.d.ts +0 -4
  337. package/es/hooks/printer.js +0 -35
  338. package/lib/hooks/printer.d.ts +0 -4
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export interface SelectHolderModalOptions {
3
+ /** 状态对象 */
4
+ state: any;
5
+ /** dispatch 函数 */
6
+ dispatch: any;
7
+ /** 初始选中的值 */
8
+ initialValue?: string | number | (string | number)[];
9
+ /** 最大可选数量,用于决定单选或多选模式 */
10
+ maxSelectedCount?: number;
11
+ }
12
+ export declare type SelectHolderResult = number[] | null;
13
+ /**
14
+ * SelectHolderModal 组件(单例模式)
15
+ * 使用 Portal 在 body 上渲染,确保全局只有一个实例
16
+ * 可以在多个地方挂载,但实际只会渲染一个实例
17
+ */
18
+ export declare const SelectHolderModal: React.FC;
19
+ /**
20
+ * 通过 await 调用的 Holder 选择弹窗
21
+ * @param options 配置选项
22
+ * @returns Promise,resolve 时返回选中的 holder ID 数组,或 null(用户取消时)
23
+ */
24
+ export declare function selectHolderModal(options: SelectHolderModalOptions): Promise<SelectHolderResult>;
@@ -0,0 +1,319 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/utils/selectHolderModal.tsx
30
+ var selectHolderModal_exports = {};
31
+ __export(selectHolderModal_exports, {
32
+ SelectHolderModal: () => SelectHolderModal,
33
+ selectHolderModal: () => selectHolderModal
34
+ });
35
+ module.exports = __toCommonJS(selectHolderModal_exports);
36
+ var import_react = __toESM(require("react"));
37
+ var import_react_dom = require("react-dom");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_utils2 = require("../utils");
40
+ var import_selectHolder = __toESM(require("../../../plus/selectHolder"));
41
+ var modalState = null;
42
+ var allSetStateCallbacks = /* @__PURE__ */ new Set();
43
+ var renderingInstanceId = null;
44
+ function notifyAllInstances(newState) {
45
+ modalState = newState;
46
+ allSetStateCallbacks.forEach((setState) => {
47
+ setState(newState);
48
+ });
49
+ }
50
+ function getFormDataConfig(state) {
51
+ var _a, _b, _c, _d, _e;
52
+ let _holder = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.holder;
53
+ if (!_holder) {
54
+ return { formDataConfig: null, isMinorAndWaiver: false };
55
+ }
56
+ const formDataConfig = {
57
+ ..._holder,
58
+ ..._holder == null ? void 0 : _holder.form,
59
+ options: [],
60
+ form_id: (_b = _holder == null ? void 0 : _holder.form) == null ? void 0 : _b.id,
61
+ field: (_c = _holder == null ? void 0 : _holder.form) == null ? void 0 : _c.form_field,
62
+ relation_type: "appointment_booking",
63
+ form_record: []
64
+ };
65
+ let isMinorAndWaiver = false;
66
+ if ((formDataConfig == null ? void 0 : formDataConfig.form_type) === "minors") {
67
+ const detail = (_d = formDataConfig == null ? void 0 : formDataConfig.form_field) == null ? void 0 : _d.find(
68
+ (item) => item.filed_type === "form_to_form" && item.status === "hide"
69
+ );
70
+ if (detail) {
71
+ isMinorAndWaiver = (_e = detail == null ? void 0 : detail.setting) == null ? void 0 : _e.linkedTable;
72
+ }
73
+ }
74
+ return { formDataConfig, isMinorAndWaiver };
75
+ }
76
+ function getHolderOptions(state) {
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
78
+ const holdersFromState = Array.isArray((_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.holders) ? state.pet.holders : [];
79
+ const formId = ((_e = (_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject) == null ? void 0 : _e.form_id) || 0;
80
+ const holdersFromValue = Array.isArray((_g = (_f = state == null ? void 0 : state.pet) == null ? void 0 : _f.value) == null ? void 0 : _g[formId]) ? (_i = (_h = state == null ? void 0 : state.pet) == null ? void 0 : _h.value) == null ? void 0 : _i[formId] : [];
81
+ const rawList = holdersFromState.length > 0 ? holdersFromState : holdersFromValue;
82
+ return rawList.map((item) => {
83
+ const id = (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id) || (item == null ? void 0 : item.value);
84
+ if (id === void 0 || id === null) return null;
85
+ return {
86
+ label: (item == null ? void 0 : item.main_field) || (item == null ? void 0 : item.label) || (item == null ? void 0 : item.name) || import_utils.locales.getText("pisell-select-holder-please-select"),
87
+ value: id,
88
+ avatar: item == null ? void 0 : item.avatar,
89
+ subtitle: (item == null ? void 0 : item.subtitle) || (item == null ? void 0 : item.second_field) || (item == null ? void 0 : item.sub_field)
90
+ };
91
+ }).filter(Boolean);
92
+ }
93
+ function buildDisplayConfig(state, holderOptions, maxSelectedCount = 1) {
94
+ var _a, _b, _c;
95
+ const selectType = maxSelectedCount > 1 ? "multiple" : "single";
96
+ return {
97
+ direction: "vertical",
98
+ selectType,
99
+ showAvatar: true,
100
+ showTitle: true,
101
+ showSubtitle: Boolean(holderOptions.some((option) => option.subtitle)),
102
+ isSkipable: ((_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.subject_require) === "optional"
103
+ };
104
+ }
105
+ var SelectHolderModal = () => {
106
+ const [localState, setLocalState] = (0, import_react.useState)(modalState);
107
+ const [container, setContainer] = (0, import_react.useState)(null);
108
+ const instanceIdRef = (0, import_react.useRef)(Symbol("SelectHolderModal"));
109
+ const isRenderingInstanceRef = (0, import_react.useRef)(false);
110
+ (0, import_react.useEffect)(() => {
111
+ let containerElement = document.getElementById("select-holder-modal-container");
112
+ if (!containerElement) {
113
+ containerElement = document.createElement("div");
114
+ containerElement.id = "select-holder-modal-container";
115
+ document.body.appendChild(containerElement);
116
+ }
117
+ setContainer(containerElement);
118
+ if (renderingInstanceId === null) {
119
+ renderingInstanceId = instanceIdRef.current;
120
+ isRenderingInstanceRef.current = true;
121
+ } else {
122
+ isRenderingInstanceRef.current = renderingInstanceId === instanceIdRef.current;
123
+ }
124
+ allSetStateCallbacks.add(setLocalState);
125
+ if (modalState && modalState !== localState) {
126
+ setLocalState(modalState);
127
+ }
128
+ return () => {
129
+ allSetStateCallbacks.delete(setLocalState);
130
+ if (isRenderingInstanceRef.current) {
131
+ renderingInstanceId = null;
132
+ }
133
+ };
134
+ }, []);
135
+ if (!localState || !localState.open || !container) {
136
+ return null;
137
+ }
138
+ if (!isRenderingInstanceRef.current) {
139
+ return null;
140
+ }
141
+ const { state, dispatch, initialValue, maxSelectedCount, resolve } = localState;
142
+ return (0, import_react_dom.createPortal)(
143
+ /* @__PURE__ */ import_react.default.createElement(
144
+ SelectHolderModalContent,
145
+ {
146
+ state,
147
+ dispatch,
148
+ initialValue,
149
+ maxSelectedCount,
150
+ resolve,
151
+ onClose: () => {
152
+ setTimeout(() => {
153
+ notifyAllInstances(null);
154
+ }, 350);
155
+ }
156
+ }
157
+ ),
158
+ container
159
+ );
160
+ };
161
+ var SelectHolderModalContent = ({ state, dispatch, initialValue, maxSelectedCount, resolve, onClose }) => {
162
+ var _a, _b, _c, _d, _e;
163
+ const [open, setOpen] = (0, import_react.useState)(true);
164
+ const [holderOptions, setHolderOptions] = (0, import_react.useState)(
165
+ () => getHolderOptions(state)
166
+ );
167
+ const [selectedValues, setSelectedValues] = (0, import_react.useState)(() => {
168
+ if (Array.isArray(initialValue)) {
169
+ return initialValue.filter(
170
+ (item) => item !== void 0 && item !== null
171
+ );
172
+ }
173
+ if (initialValue === void 0 || initialValue === null || initialValue === "") {
174
+ return [];
175
+ }
176
+ return [initialValue];
177
+ });
178
+ const stateRef = { current: state };
179
+ (0, import_react.useEffect)(() => {
180
+ stateRef.current = state;
181
+ const newOptions = getHolderOptions(state);
182
+ setHolderOptions(newOptions);
183
+ }, [state]);
184
+ const displayConfig = (0, import_react.useMemo)(
185
+ () => {
186
+ var _a2, _b2, _c2;
187
+ return buildDisplayConfig(
188
+ stateRef.current,
189
+ holderOptions,
190
+ maxSelectedCount || ((_c2 = (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.holder) == null ? void 0 : _c2.maxSelectedCount) || 1
191
+ );
192
+ },
193
+ [holderOptions, maxSelectedCount, state]
194
+ );
195
+ const { formDataConfig, isMinorAndWaiver } = (0, import_react.useMemo)(
196
+ () => getFormDataConfig(stateRef.current),
197
+ [(_b = (_a = stateRef.current) == null ? void 0 : _a.bookingConfig) == null ? void 0 : _b.holder]
198
+ );
199
+ const holderConfig = ((_d = (_c = stateRef.current) == null ? void 0 : _c.bookingConfig) == null ? void 0 : _d.holder) || {};
200
+ const title = ((_e = holderConfig == null ? void 0 : holderConfig.form) == null ? void 0 : _e.title) || (holderConfig == null ? void 0 : holderConfig.title) || import_utils.locales.getText("pisell2.text.holder");
201
+ const updateStateHolders = (holders) => {
202
+ dispatch({
203
+ type: "setPet",
204
+ payload: {
205
+ holders
206
+ }
207
+ });
208
+ };
209
+ const handleClose = () => {
210
+ setOpen(false);
211
+ if (resolve) {
212
+ resolve(null);
213
+ }
214
+ setTimeout(() => {
215
+ onClose();
216
+ }, 300);
217
+ };
218
+ const handleConfirm = (nextValues) => {
219
+ setOpen(false);
220
+ if (resolve) {
221
+ if (nextValues && nextValues.length > 0) {
222
+ const selectedIds = nextValues.map((val) => Number(val));
223
+ resolve(selectedIds);
224
+ } else {
225
+ resolve(null);
226
+ }
227
+ }
228
+ setTimeout(() => {
229
+ onClose();
230
+ }, 300);
231
+ };
232
+ const handleAdd = () => {
233
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h;
234
+ const currentState = stateRef.current;
235
+ const waiverForm = (_a2 = currentState == null ? void 0 : currentState.pet) == null ? void 0 : _a2.waiverForm;
236
+ currentState.action({
237
+ type: "pisell1.goCustomFormAddData",
238
+ data: {
239
+ zIndex: 1101,
240
+ customerId: (_c2 = (_b2 = currentState.client) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id,
241
+ formDataConfig: isMinorAndWaiver ? {
242
+ ...waiverForm,
243
+ customer_id: (_e2 = (_d2 = currentState.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
244
+ is_franchisor: (_g = (_f = currentState.pet.formData) == null ? void 0 : _f[0]) == null ? void 0 : _g.is_franchisor
245
+ } : { ...((_h = currentState.pet.formData) == null ? void 0 : _h[0]) || {} }
246
+ },
247
+ callback: (res) => {
248
+ var _a3, _b3;
249
+ let obj = {};
250
+ for (let item of res) {
251
+ obj[item.key] = item.value;
252
+ }
253
+ const isWalkInBol = (0, import_utils2.isWalkIn)((_b3 = (_a3 = currentState.client) == null ? void 0 : _a3.value) == null ? void 0 : _b3.id);
254
+ const newHolders = !isWalkInBol ? [obj, ...currentState.pet.holders || []] : currentState.pet.holders || [];
255
+ updateStateHolders(newHolders);
256
+ const updatedState = {
257
+ ...currentState,
258
+ pet: {
259
+ ...currentState.pet,
260
+ holders: newHolders
261
+ }
262
+ };
263
+ stateRef.current = updatedState;
264
+ const newOptions = getHolderOptions(updatedState);
265
+ setHolderOptions(newOptions);
266
+ }
267
+ });
268
+ };
269
+ const handleSkip = () => {
270
+ setOpen(false);
271
+ if (resolve) {
272
+ resolve(null);
273
+ }
274
+ setTimeout(() => {
275
+ onClose();
276
+ }, 300);
277
+ };
278
+ return /* @__PURE__ */ import_react.default.createElement(
279
+ import_selectHolder.default,
280
+ {
281
+ open,
282
+ modalConfig: {
283
+ title: `${import_utils.locales.getText("pisell-select-holder-please-select")} ${maxSelectedCount || 1} ${title}`,
284
+ confirmText: import_utils.locales.getText("pisell2.text.confirm")
285
+ },
286
+ dataSource: holderOptions,
287
+ value: selectedValues,
288
+ displayConfig,
289
+ maxSelectedCount,
290
+ allowAdd: true,
291
+ onClose: handleClose,
292
+ onConfirm: handleConfirm,
293
+ onAdd: handleAdd,
294
+ onSkip: handleSkip
295
+ }
296
+ );
297
+ };
298
+ function selectHolderModal(options) {
299
+ const { state, dispatch, initialValue, maxSelectedCount } = options;
300
+ return new Promise((resolve) => {
301
+ if (modalState && modalState.resolve) {
302
+ modalState.resolve(null);
303
+ }
304
+ const newState = {
305
+ open: true,
306
+ state,
307
+ dispatch,
308
+ initialValue,
309
+ maxSelectedCount,
310
+ resolve
311
+ };
312
+ notifyAllInstances(newState);
313
+ });
314
+ }
315
+ // Annotate the CommonJS export names for ESM import in node:
316
+ 0 && (module.exports = {
317
+ SelectHolderModal,
318
+ selectHolderModal
319
+ });
@@ -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;
@@ -39,6 +39,7 @@ __export(utils_exports, {
39
39
  getCacheParams: () => getCacheParams,
40
40
  getDays: () => getDays,
41
41
  getDiscountTime: () => getDiscountTime,
42
+ getDiscountTimeByDayMinutes: () => getDiscountTimeByDayMinutes,
42
43
  getDuration: () => getDuration,
43
44
  getEndDate: () => getEndDate,
44
45
  getErrorList: () => getErrorList,
@@ -57,7 +58,6 @@ __export(utils_exports, {
57
58
  isNowTime: () => isNowTime,
58
59
  isSessionProduct: () => isSessionProduct,
59
60
  isWalkIn: () => isWalkIn,
60
- memoize: () => memoize,
61
61
  request: () => request,
62
62
  sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
63
63
  });
@@ -68,18 +68,7 @@ var import_utils2 = require("./info/service2/utils");
68
68
  var import_lodash = require("lodash");
69
69
  var import_utilsByBooking = require("./info2/utilsByBooking");
70
70
  var import_decimal = __toESM(require("decimal.js"));
71
- function memoize(fn) {
72
- const cache = /* @__PURE__ */ new Map();
73
- return function(...args) {
74
- const key = JSON.stringify(args);
75
- if (cache.has(key)) {
76
- return cache.get(key);
77
- }
78
- const result = fn.apply(this, args);
79
- cache.set(key, result);
80
- return result;
81
- };
82
- }
71
+ var import_utils3 = require("./info2/service/addService/utils");
83
72
  var Request = class {
84
73
  request = {};
85
74
  constructor() {
@@ -112,7 +101,13 @@ var getDiscountTime = (service_times, isDay) => {
112
101
  return str;
113
102
  }
114
103
  };
115
- var _sliceDayIntoFiveMinutes = (config, locale, isDay) => {
104
+ var getDiscountTimeByDayMinutes = (days, minutes) => {
105
+ if (days === 0) {
106
+ return getDiscountTime(minutes);
107
+ }
108
+ return `${days} ${import_utils.locales.getText("pisell2.text.day")(days)} ${getDiscountTime(minutes)}`;
109
+ };
110
+ var sliceDayIntoFiveMinutes = (config, locale, isDay) => {
116
111
  let _locale = locale;
117
112
  let dayjsLocale = _locale === "en-US" || _locale === "en" ? "en" : "zh-cn";
118
113
  import_dayjs.default.locale(dayjsLocale);
@@ -161,7 +156,6 @@ var _sliceDayIntoFiveMinutes = (config, locale, isDay) => {
161
156
  }
162
157
  return { timeSlices, durationSlicesBasedOnTime };
163
158
  };
164
- var sliceDayIntoFiveMinutes = memoize(_sliceDayIntoFiveMinutes);
165
159
  var getNowTime = () => {
166
160
  return (0, import_dayjs.default)().format("HH:mm");
167
161
  };
@@ -199,15 +193,12 @@ var findNextSlice = ({
199
193
  return timeSlices[index].value;
200
194
  };
201
195
  var findNextDuration = (current, array, defaultValue) => {
202
- if (defaultValue) {
203
- return defaultValue;
204
- }
205
196
  for (let i = 0; i < array.length; i++) {
206
197
  if (array[i].value == (current == null ? void 0 : current.value)) {
207
198
  return array[i].value;
208
199
  }
209
200
  }
210
- return array[0].value;
201
+ return defaultValue || array[0].value;
211
202
  };
212
203
  var formatProductListByCategory = (list, filterItem) => {
213
204
  let _list = list || [];
@@ -425,6 +416,12 @@ var getServiceTimes = (service) => {
425
416
  const startDate = (0, import_dayjs.default)(
426
417
  (0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time)
427
418
  );
419
+ if ((0, import_utils3.isMultiDayProduct)(service)) {
420
+ return {
421
+ startDate,
422
+ endDate: service._extend.end_date
423
+ };
424
+ }
428
425
  const endDate = startDate.add(
429
426
  flexibleObj.getValue(service._extend.duration),
430
427
  "minute"
@@ -520,7 +517,7 @@ var formatResource = (resourceItem, cacheItem, formatLabel) => {
520
517
  return _resourceItem;
521
518
  };
522
519
  var getLastServer = (list) => {
523
- return list == null ? void 0 : list[0];
520
+ return list[list.length - 1];
524
521
  };
525
522
  var getCacheParams = () => {
526
523
  const sessionData = sessionStorage.getItem("pisell2.booking.serviceParams");
@@ -713,6 +710,7 @@ var getIsEdit = (state) => {
713
710
  getCacheParams,
714
711
  getDays,
715
712
  getDiscountTime,
713
+ getDiscountTimeByDayMinutes,
716
714
  getDuration,
717
715
  getEndDate,
718
716
  getErrorList,
@@ -731,7 +729,6 @@ var getIsEdit = (state) => {
731
729
  isNowTime,
732
730
  isSessionProduct,
733
731
  isWalkIn,
734
- memoize,
735
732
  request,
736
733
  sliceDayIntoFiveMinutes
737
734
  });
@@ -63,7 +63,6 @@ var import_lodash = require("lodash");
63
63
  var import_utils2 = require("./utils");
64
64
  var import_usePaymentLogger = __toESM(require("./hooks/usePaymentLogger"));
65
65
  var import_antd = require("antd");
66
- var import_printer = __toESM(require("../../hooks/printer"));
67
66
  var import_priceKeyboard = require("../../pro/priceKeyboard");
68
67
  var import_pisellos = require("../ticketBooking/hooks/pisellos");
69
68
  var CheckoutHooks = {
@@ -123,7 +122,6 @@ var PaymentContent = (0, import_react.forwardRef)(
123
122
  const walletPassRef = (0, import_react.useRef)(null);
124
123
  const [paymentItems, setPaymentItems] = (0, import_react.useState)([]);
125
124
  const [walletPassData, setWalletPassData] = (0, import_react.useState)({});
126
- const { nativePrint } = (0, import_printer.default)();
127
125
  const [syncingLock, setSyncingLock] = (0, import_react.useState)(false);
128
126
  const isOrderFree = (0, import_react.useMemo)(() => {
129
127
  if (!customAmount) return false;
@@ -420,13 +418,11 @@ var PaymentContent = (0, import_react.forwardRef)(
420
418
  );
421
419
  const orderSubmitStartUnsubscribe = core.effects.on(
422
420
  CheckoutHooks.OnOrderSubmitStart,
423
- executeIfActive(
424
- () => {
425
- var _a2;
426
- setSyncingLock(true);
427
- (_a2 = Toast == null ? void 0 : Toast.loading) == null ? void 0 : _a2.call(Toast, "", 0);
428
- }
429
- )
421
+ executeIfActive(() => {
422
+ var _a2;
423
+ setSyncingLock(true);
424
+ (_a2 = Toast == null ? void 0 : Toast.loading) == null ? void 0 : _a2.call(Toast, "", 0);
425
+ })
430
426
  );
431
427
  const orderSubmitEndUnsubscribe = core.effects.on(
432
428
  CheckoutHooks.OnOrderSubmitEnd,
@@ -594,12 +590,11 @@ var PaymentContent = (0, import_react.forwardRef)(
594
590
  data: {
595
591
  order_id: responseData.order_id,
596
592
  machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
597
- small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data,
598
- machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
593
+ small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data
599
594
  }
600
595
  };
601
596
  console.log("print_order_onOrderSynced_params>>>>", params);
602
- nativePrint(params, (res) => {
597
+ (0, import_utils.webPrint)(params, (res) => {
603
598
  console.log("print_order_onOrderSynced_res>>>>", res);
604
599
  });
605
600
  } catch (error) {
@@ -765,7 +760,7 @@ var PaymentContent = (0, import_react.forwardRef)(
765
760
  data: { order_id: data.orderId }
766
761
  };
767
762
  try {
768
- nativePrint(params, (res) => {
763
+ (0, import_utils.webPrint)(params, (res) => {
769
764
  console.log("handleButtonClick_print-receipt_res>>>>", res);
770
765
  if (!(res == null ? void 0 : res.result)) {
771
766
  Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
@@ -1068,10 +1063,10 @@ var PaymentModal = ({
1068
1063
  const [actualShowCashPayment, setActualShowCashPayment] = (0, import_react.useState)(true);
1069
1064
  const [windowHeight, setWindowHeight] = (0, import_react.useState)(0);
1070
1065
  const [showRetryModal, setShowRetryModal] = (0, import_react.useState)(false);
1066
+ const [showCreateErrorModal, setShowCreateErrorModal] = (0, import_react.useState)(false);
1071
1067
  const [currentEditOrderId, setCurrentEditOrderId] = (0, import_react.useState)(editOrderId || 0);
1072
1068
  const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
1073
1069
  const Toast = (0, import_materials.useToast)();
1074
- const { nativePrint } = (0, import_printer.default)();
1075
1070
  const handleRetry = async () => {
1076
1071
  const checkoutModule = pisellos == null ? void 0 : pisellos.getModule("checkout");
1077
1072
  const res = await (checkoutModule == null ? void 0 : checkoutModule.manualSyncOrderAsync());
@@ -1506,8 +1501,7 @@ var PaymentModal = ({
1506
1501
  data: {
1507
1502
  order_id: responseData.order_id,
1508
1503
  machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
1509
- small_ticket_data: (_c3 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c3.small_ticket_data,
1510
- machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
1504
+ small_ticket_data: (_c3 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c3.small_ticket_data
1511
1505
  }
1512
1506
  };
1513
1507
  console.log("print_order_onOrderSynced_params>>>>", params);
@@ -1518,7 +1512,7 @@ var PaymentModal = ({
1518
1512
  params
1519
1513
  }
1520
1514
  });
1521
- nativePrint(params, (res) => {
1515
+ (0, import_utils.webPrint)(params, (res) => {
1522
1516
  console.log("print_order_onOrderSynced_res>>>>", res);
1523
1517
  logger == null ? void 0 : logger.addLog({
1524
1518
  type: "info",
@@ -1627,6 +1621,7 @@ var PaymentModal = ({
1627
1621
  error
1628
1622
  }
1629
1623
  });
1624
+ setShowCreateErrorModal(true);
1630
1625
  }
1631
1626
  };
1632
1627
  if (data) {
@@ -1694,7 +1689,7 @@ var PaymentModal = ({
1694
1689
  data: { order_id: data2.orderId }
1695
1690
  };
1696
1691
  try {
1697
- nativePrint(params, (res) => {
1692
+ (0, import_utils.webPrint)(params, (res) => {
1698
1693
  console.log("handleButtonClick_print-receipt_res>>>>", res);
1699
1694
  if (!(res == null ? void 0 : res.result)) {
1700
1695
  Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
@@ -2059,6 +2054,34 @@ var PaymentModal = ({
2059
2054
  },
2060
2055
  import_utils.locales.getText("retry") || "重试"
2061
2056
  ))
2057
+ ), /* @__PURE__ */ import_react.default.createElement(
2058
+ import_materials.PisellContainer,
2059
+ {
2060
+ renderType: "modal",
2061
+ props: {
2062
+ open: showCreateErrorModal,
2063
+ title: import_utils.locales.getText("pisell2.checkout.tips"),
2064
+ footer: null,
2065
+ keyboard: false,
2066
+ onCancel: () => {
2067
+ setShowCreateErrorModal(false);
2068
+ }
2069
+ // 禁用关闭
2070
+ }
2071
+ },
2072
+ /* @__PURE__ */ import_react.default.createElement("div", { style: { textAlign: "center", padding: "20px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "16px", fontSize: "16px" } }, import_utils.locales.getText("pisell2.checkout.order-create-failed")), /* @__PURE__ */ import_react.default.createElement(
2073
+ import_antd.Button,
2074
+ {
2075
+ type: "primary",
2076
+ size: "large",
2077
+ onClick: () => {
2078
+ setShowCreateErrorModal(false);
2079
+ window.location.reload();
2080
+ },
2081
+ style: { width: "100%", marginTop: "80px" }
2082
+ },
2083
+ import_utils.locales.getText("confirm") || "确认"
2084
+ ))
2062
2085
  ));
2063
2086
  };
2064
2087
  var PaymentModal_default = PaymentModal;
@@ -38,8 +38,8 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
38
38
  var import_utils = require("@pisell/utils");
39
39
  var import_locales = __toESM(require("../../locales"));
40
40
  var import_useToast = __toESM(require("../../../../hooks/useToast"));
41
- var import_ahooks = require("ahooks");
42
41
  var import_priceKeyboard = require("../../../../pro/priceKeyboard");
42
+ var import_ahooks = require("ahooks");
43
43
  var import_index = require("./index.less");
44
44
  function CashPaymentModule({
45
45
  amountSymbol,
@@ -76,12 +76,6 @@ function CashPaymentModule({
76
76
  }, [customAmount, balanceDueAmount, orderInfo == null ? void 0 : orderInfo.isDeposit]);
77
77
  const isAmountButtonsDisabled = disabled || Number(customAmount || 0) === 0;
78
78
  const isInputDisabled = disabled || Number(customAmount || 0) === 0;
79
- const handleAmountClick = (clickedAmount) => {
80
- if (isAmountButtonsDisabled) return;
81
- const amountStr = clickedAmount.toString();
82
- setAmount(amountStr);
83
- setRoundingAmount(0);
84
- };
85
79
  const handleCashPayInternal = () => {
86
80
  if (isAmountButtonsDisabled) return;
87
81
  if (onPaymentComplete) {
@@ -216,7 +216,6 @@ var ScrollableList = ({
216
216
  {
217
217
  style: {
218
218
  ...bottomGradientStyle,
219
- width: "100%",
220
219
  border: "none",
221
220
  background: "linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #A78BE1 100%)",
222
221
  ...gradientStyle