@pisell/private-materials 6.8.6 → 6.8.8

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 (382) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -0
  12. package/es/components/appointmentBooking/components/Voucher/index.js +16 -0
  13. package/es/components/booking/addons/model.d.ts +1 -10
  14. package/es/components/booking/components/actionButtons/index.js +34 -16
  15. package/es/components/booking/components/footer/amount.js +25 -8
  16. package/es/components/booking/components/footer/index.js +67 -35
  17. package/es/components/booking/components/footer/utils.d.ts +7 -0
  18. package/es/components/booking/components/footer/utils.js +66 -42
  19. package/es/components/booking/components/voucher/index.js +58 -14
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  22. package/es/components/booking/hooks/useQuotation.js +69 -21
  23. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  24. package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  25. package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
  26. package/es/components/booking/info/model.d.ts +1 -10
  27. package/es/components/booking/info/service/Lists.d.ts +1 -1
  28. package/es/components/booking/info/service/Lists.js +8 -2
  29. package/es/components/booking/info/service/serve.d.ts +14 -0
  30. package/es/components/booking/info/service/serve.js +21 -0
  31. package/es/components/booking/info/service2/Group/utils.js +2 -0
  32. package/es/components/booking/info/service2/utils.d.ts +1 -33
  33. package/es/components/booking/info/service2/utils.js +84 -36
  34. package/es/components/booking/info/utils.js +5 -0
  35. package/es/components/booking/info2/cartClientCard/index.js +23 -5
  36. package/es/components/booking/info2/service/addService/index.js +146 -88
  37. package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
  38. package/es/components/booking/info2/service/addService/utils.js +78 -9
  39. package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  40. package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
  41. package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
  42. package/es/components/booking/info2/service/editService/index.js +332 -76
  43. package/es/components/booking/info2/utilsByBooking.js +14 -5
  44. package/es/components/booking/locales.d.ts +30 -0
  45. package/es/components/booking/locales.js +39 -3
  46. package/es/components/booking/model.d.ts +1 -9
  47. package/es/components/booking/notes/model.d.ts +1 -10
  48. package/es/components/booking/payments/model.d.ts +1 -10
  49. package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
  50. package/es/components/booking/utils/confirmHolderModal.js +318 -0
  51. package/es/components/booking/utils/confirmHolderModal.less +40 -0
  52. package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
  53. package/es/components/booking/utils/selectHolderModal.js +407 -0
  54. package/es/components/booking/utils.d.ts +11 -3
  55. package/es/components/booking/utils.js +24 -1
  56. package/es/components/checkout/PaymentModal.js +15 -10
  57. package/es/components/eftpos/hooks.d.ts +0 -1
  58. package/es/components/eftposPay/amount.d.ts +1 -1
  59. package/es/components/eftposPay/device.d.ts +1 -1
  60. package/es/components/eftposPay/store/index.d.ts +2 -2
  61. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  62. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  63. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  69. package/es/components/index.d.ts +1 -2
  70. package/es/components/index.js +1 -2
  71. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  72. package/es/components/pay/toC/model.d.ts +1 -9
  73. package/es/components/schedules/model.d.ts +1 -9
  74. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  75. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  76. package/es/components/shoppingCart/type.d.ts +1 -0
  77. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  78. package/es/components/{wallet/Detail/serve.js → ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js} +112 -57
  79. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  80. package/es/components/ticketBooking/components/addServiceVariant/addService.js +29 -15
  81. package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -0
  82. package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
  83. package/es/components/ticketBooking/utils/index.d.ts +10 -2
  84. package/es/components/ticketBooking/utils/index.js +37 -7
  85. package/es/components/walletList/index.d.ts +0 -24
  86. package/es/components/walletList/index.js +173 -41
  87. package/es/components/walletList/locales.d.ts +9 -0
  88. package/es/components/walletList/locales.js +12 -3
  89. package/es/components/walletList/serve.d.ts +19 -0
  90. package/es/components/walletList/serve.js +94 -5
  91. package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
  92. package/es/components/walletList/tempHolderSelector/index.js +196 -0
  93. package/es/components/walletList/tempHolderSelector/index.less +63 -0
  94. package/es/hooks/usePaymentLogger.d.ts +0 -1
  95. package/es/index.d.ts +2 -1
  96. package/es/index.js +2 -1
  97. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
  98. package/es/plus/productSelect/index.js +1 -4
  99. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  100. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  101. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  102. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  103. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  104. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  105. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  106. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  107. package/es/plus/selectHolder/index.d.ts +7 -0
  108. package/es/plus/selectHolder/index.js +273 -0
  109. package/es/plus/selectHolder/index.less +137 -0
  110. package/es/plus/selectHolder/locales.d.ts +24 -0
  111. package/es/plus/selectHolder/locales.js +29 -0
  112. package/es/plus/selectHolder/types.d.ts +104 -0
  113. package/es/plus/selectHolder/types.js +1 -0
  114. package/es/plus/selectHolder/utils.d.ts +9 -0
  115. package/es/plus/selectHolder/utils.js +16 -0
  116. package/es/plus/walletEditor/WalletEditor.js +60 -2
  117. package/es/plus/walletEditor/locales.d.ts +9 -0
  118. package/es/plus/walletEditor/locales.js +12 -3
  119. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  120. package/es/plus/walletPassGallery/components/passList/index.js +17 -5
  121. package/es/plus/walletPassGallery/index.js +223 -41
  122. package/es/plus/walletPassGallery/locales.d.ts +15 -0
  123. package/es/plus/walletPassGallery/locales.js +29 -5
  124. package/es/plus/walletPassGallery/serve.d.ts +15 -1
  125. package/es/plus/walletPassGallery/serve.js +59 -2
  126. package/es/plus/walletPassGallery/utils.d.ts +48 -0
  127. package/es/plus/walletPassGallery/utils.js +342 -0
  128. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  129. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -0
  130. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  131. package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
  132. package/es/pro/multiDayTimeSelect/index.js +1 -0
  133. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  134. package/es/pro/multiDayTimeSelect/types.js +1 -0
  135. package/es/pro/skuDetailModal/types.d.ts +1 -0
  136. package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -0
  137. package/lib/components/appointmentBooking/components/Voucher/index.js +17 -0
  138. package/lib/components/booking/addons/model.d.ts +1 -10
  139. package/lib/components/booking/components/actionButtons/index.js +11 -0
  140. package/lib/components/booking/components/footer/amount.js +23 -6
  141. package/lib/components/booking/components/footer/index.js +25 -4
  142. package/lib/components/booking/components/footer/utils.d.ts +7 -0
  143. package/lib/components/booking/components/footer/utils.js +41 -29
  144. package/lib/components/booking/components/voucher/index.js +48 -6
  145. package/lib/components/booking/forms/model.d.ts +1 -10
  146. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  147. package/lib/components/booking/hooks/useQuotation.js +45 -13
  148. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  149. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  150. package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
  151. package/lib/components/booking/info/model.d.ts +1 -10
  152. package/lib/components/booking/info/service/Lists.d.ts +1 -1
  153. package/lib/components/booking/info/service/Lists.js +4 -2
  154. package/lib/components/booking/info/service/serve.d.ts +14 -0
  155. package/lib/components/booking/info/service/serve.js +5 -0
  156. package/lib/components/booking/info/service2/Group/utils.js +2 -0
  157. package/lib/components/booking/info/service2/utils.d.ts +1 -33
  158. package/lib/components/booking/info/service2/utils.js +32 -16
  159. package/lib/components/booking/info/utils.js +4 -0
  160. package/lib/components/booking/info2/cartClientCard/index.js +11 -0
  161. package/lib/components/booking/info2/service/addService/index.js +22 -2
  162. package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
  163. package/lib/components/booking/info2/service/addService/utils.js +47 -9
  164. package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  165. package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
  166. package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
  167. package/lib/components/booking/info2/service/editService/index.js +273 -38
  168. package/lib/components/booking/info2/utilsByBooking.js +19 -8
  169. package/lib/components/booking/locales.d.ts +30 -0
  170. package/lib/components/booking/locales.js +33 -3
  171. package/lib/components/booking/model.d.ts +1 -9
  172. package/lib/components/booking/notes/model.d.ts +1 -10
  173. package/lib/components/booking/payments/model.d.ts +1 -10
  174. package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
  175. package/lib/components/booking/utils/confirmHolderModal.js +253 -0
  176. package/lib/components/booking/utils/confirmHolderModal.less +40 -0
  177. package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
  178. package/lib/components/booking/utils/selectHolderModal.js +319 -0
  179. package/lib/components/booking/utils.d.ts +11 -3
  180. package/lib/components/booking/utils.js +15 -0
  181. package/lib/components/checkout/PaymentModal.js +5 -2
  182. package/lib/components/eftpos/hooks.d.ts +0 -1
  183. package/lib/components/eftposPay/amount.d.ts +1 -1
  184. package/lib/components/eftposPay/device.d.ts +1 -1
  185. package/lib/components/eftposPay/store/index.d.ts +2 -2
  186. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  187. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  188. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  189. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  190. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  191. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  192. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  193. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  194. package/lib/components/index.d.ts +1 -2
  195. package/lib/components/index.js +0 -3
  196. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  197. package/lib/components/pay/toC/model.d.ts +1 -9
  198. package/lib/components/schedules/model.d.ts +1 -9
  199. package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
  200. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  201. package/lib/components/shoppingCart/type.d.ts +1 -0
  202. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  203. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
  204. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  205. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +23 -9
  206. package/lib/components/ticketBooking/components/addServiceVariant/index.js +4 -0
  207. package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
  208. package/lib/components/ticketBooking/utils/index.d.ts +10 -2
  209. package/lib/components/ticketBooking/utils/index.js +31 -6
  210. package/lib/components/walletList/index.d.ts +0 -24
  211. package/lib/components/walletList/index.js +100 -4
  212. package/lib/components/walletList/locales.d.ts +9 -0
  213. package/lib/components/walletList/locales.js +12 -3
  214. package/lib/components/walletList/serve.d.ts +19 -0
  215. package/lib/components/walletList/serve.js +26 -3
  216. package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
  217. package/lib/components/walletList/tempHolderSelector/index.js +166 -0
  218. package/lib/components/walletList/tempHolderSelector/index.less +63 -0
  219. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  220. package/lib/index.d.ts +2 -1
  221. package/lib/index.js +6 -3
  222. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
  223. package/lib/plus/productSelect/index.js +1 -2
  224. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  225. package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
  226. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  227. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  228. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  229. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  230. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  231. package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
  232. package/lib/plus/selectHolder/index.d.ts +7 -0
  233. package/lib/plus/selectHolder/index.js +223 -0
  234. package/lib/plus/selectHolder/index.less +137 -0
  235. package/lib/plus/selectHolder/locales.d.ts +24 -0
  236. package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +17 -14
  237. package/lib/plus/selectHolder/types.d.ts +104 -0
  238. package/lib/plus/selectHolder/types.js +17 -0
  239. package/lib/plus/selectHolder/utils.d.ts +9 -0
  240. package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
  241. package/lib/plus/walletEditor/WalletEditor.js +53 -0
  242. package/lib/plus/walletEditor/locales.d.ts +9 -0
  243. package/lib/plus/walletEditor/locales.js +12 -3
  244. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  245. package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
  246. package/lib/plus/walletPassGallery/index.js +154 -27
  247. package/lib/plus/walletPassGallery/locales.d.ts +15 -0
  248. package/lib/plus/walletPassGallery/locales.js +32 -5
  249. package/lib/plus/walletPassGallery/serve.d.ts +15 -1
  250. package/lib/plus/walletPassGallery/serve.js +17 -5
  251. package/lib/plus/walletPassGallery/utils.d.ts +48 -0
  252. package/lib/plus/walletPassGallery/utils.js +287 -0
  253. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  254. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +290 -0
  255. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  256. package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
  257. package/lib/{components/wallet/components → pro/multiDayTimeSelect}/index.js +6 -16
  258. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  259. package/lib/pro/multiDayTimeSelect/types.js +17 -0
  260. package/lib/pro/skuDetailModal/types.d.ts +1 -0
  261. package/lowcode/event-select-holder/meta.ts +2 -2
  262. package/lowcode/select-holder/meta.ts +220 -0
  263. package/lowcode/select-holder/snippets.ts +41 -0
  264. package/package.json +3 -3
  265. package/es/components/wallet/Detail/index.d.ts +0 -42
  266. package/es/components/wallet/Detail/index.js +0 -1182
  267. package/es/components/wallet/Detail/index.less +0 -386
  268. package/es/components/wallet/Detail/locales.d.ts +0 -153
  269. package/es/components/wallet/Detail/locales.js +0 -170
  270. package/es/components/wallet/Detail/model.d.ts +0 -13
  271. package/es/components/wallet/Detail/model.js +0 -22
  272. package/es/components/wallet/Detail/serve.d.ts +0 -39
  273. package/es/components/wallet/DetailContext.d.ts +0 -25
  274. package/es/components/wallet/DetailContext.js +0 -162
  275. package/es/components/wallet/DiscountCard/index.d.ts +0 -3
  276. package/es/components/wallet/DiscountCard/index.js +0 -218
  277. package/es/components/wallet/DiscountCard/index.less +0 -9
  278. package/es/components/wallet/DiscountCard/model.d.ts +0 -14
  279. package/es/components/wallet/DiscountCard/model.js +0 -22
  280. package/es/components/wallet/PointCard/index.d.ts +0 -3
  281. package/es/components/wallet/PointCard/index.js +0 -169
  282. package/es/components/wallet/PointCard/index.less +0 -9
  283. package/es/components/wallet/PointCard/model.d.ts +0 -13
  284. package/es/components/wallet/PointCard/model.js +0 -22
  285. package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
  286. package/es/components/wallet/RechargeableCard/index.js +0 -463
  287. package/es/components/wallet/RechargeableCard/index.less +0 -108
  288. package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
  289. package/es/components/wallet/RechargeableCard/model.js +0 -28
  290. package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
  291. package/es/components/wallet/RechargeableCard/serve.js +0 -32
  292. package/es/components/wallet/Voucher/index.d.ts +0 -12
  293. package/es/components/wallet/Voucher/index.js +0 -131
  294. package/es/components/wallet/Voucher/index.less +0 -9
  295. package/es/components/wallet/Voucher/locales.d.ts +0 -21
  296. package/es/components/wallet/Voucher/locales.js +0 -20
  297. package/es/components/wallet/Voucher/model.d.ts +0 -13
  298. package/es/components/wallet/Voucher/model.js +0 -22
  299. package/es/components/wallet/carouselArrow.png +0 -0
  300. package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
  301. package/es/components/wallet/components/FooterButtons/index.js +0 -81
  302. package/es/components/wallet/components/FooterButtons/index.less +0 -91
  303. package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
  304. package/es/components/wallet/components/UsageRules/index.js +0 -147
  305. package/es/components/wallet/components/UsageRules/index.less +0 -157
  306. package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
  307. package/es/components/wallet/components/WalletBar/index.js +0 -19
  308. package/es/components/wallet/components/WalletBar/index.less +0 -36
  309. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  310. package/es/components/wallet/components/WalletCard.js +0 -91
  311. package/es/components/wallet/components/index.d.ts +0 -3
  312. package/es/components/wallet/components/index.js +0 -4
  313. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
  314. package/es/components/wallet/hooks/useWalletCard.js +0 -147
  315. package/es/components/wallet/index.d.ts +0 -10
  316. package/es/components/wallet/index.js +0 -807
  317. package/es/components/wallet/index.less +0 -151
  318. package/es/components/wallet/locales.d.ts +0 -132
  319. package/es/components/wallet/locales.js +0 -139
  320. package/es/components/wallet/model.d.ts +0 -37
  321. package/es/components/wallet/model.js +0 -86
  322. package/es/components/wallet/serve.d.ts +0 -150
  323. package/es/components/wallet/serve.js +0 -205
  324. package/es/components/wallet/utils/formatUtils.d.ts +0 -36
  325. package/es/components/wallet/utils/formatUtils.js +0 -73
  326. package/lib/components/wallet/Detail/index.d.ts +0 -42
  327. package/lib/components/wallet/Detail/index.js +0 -874
  328. package/lib/components/wallet/Detail/index.less +0 -386
  329. package/lib/components/wallet/Detail/locales.d.ts +0 -153
  330. package/lib/components/wallet/Detail/locales.js +0 -194
  331. package/lib/components/wallet/Detail/model.d.ts +0 -13
  332. package/lib/components/wallet/Detail/model.js +0 -43
  333. package/lib/components/wallet/Detail/serve.d.ts +0 -39
  334. package/lib/components/wallet/Detail/serve.js +0 -44
  335. package/lib/components/wallet/DetailContext.d.ts +0 -25
  336. package/lib/components/wallet/DetailContext.js +0 -118
  337. package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
  338. package/lib/components/wallet/DiscountCard/index.js +0 -209
  339. package/lib/components/wallet/DiscountCard/index.less +0 -9
  340. package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
  341. package/lib/components/wallet/DiscountCard/model.js +0 -43
  342. package/lib/components/wallet/PointCard/index.d.ts +0 -3
  343. package/lib/components/wallet/PointCard/index.js +0 -190
  344. package/lib/components/wallet/PointCard/index.less +0 -9
  345. package/lib/components/wallet/PointCard/model.d.ts +0 -13
  346. package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
  347. package/lib/components/wallet/RechargeableCard/index.js +0 -380
  348. package/lib/components/wallet/RechargeableCard/index.less +0 -108
  349. package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
  350. package/lib/components/wallet/RechargeableCard/model.js +0 -49
  351. package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
  352. package/lib/components/wallet/Voucher/index.d.ts +0 -12
  353. package/lib/components/wallet/Voucher/index.js +0 -146
  354. package/lib/components/wallet/Voucher/index.less +0 -9
  355. package/lib/components/wallet/Voucher/locales.d.ts +0 -21
  356. package/lib/components/wallet/Voucher/model.d.ts +0 -13
  357. package/lib/components/wallet/Voucher/model.js +0 -43
  358. package/lib/components/wallet/carouselArrow.png +0 -0
  359. package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
  360. package/lib/components/wallet/components/FooterButtons/index.js +0 -109
  361. package/lib/components/wallet/components/FooterButtons/index.less +0 -91
  362. package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
  363. package/lib/components/wallet/components/UsageRules/index.js +0 -113
  364. package/lib/components/wallet/components/UsageRules/index.less +0 -157
  365. package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
  366. package/lib/components/wallet/components/WalletBar/index.less +0 -36
  367. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
  368. package/lib/components/wallet/components/WalletCard.js +0 -97
  369. package/lib/components/wallet/components/index.d.ts +0 -3
  370. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
  371. package/lib/components/wallet/hooks/useWalletCard.js +0 -111
  372. package/lib/components/wallet/index.d.ts +0 -10
  373. package/lib/components/wallet/index.js +0 -580
  374. package/lib/components/wallet/index.less +0 -151
  375. package/lib/components/wallet/locales.d.ts +0 -132
  376. package/lib/components/wallet/locales.js +0 -163
  377. package/lib/components/wallet/model.d.ts +0 -37
  378. package/lib/components/wallet/model.js +0 -91
  379. package/lib/components/wallet/serve.d.ts +0 -150
  380. package/lib/components/wallet/serve.js +0 -85
  381. package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
  382. package/lib/components/wallet/utils/formatUtils.js +0 -73
@@ -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
+ }
@@ -26,6 +26,14 @@ export declare const request: Request;
26
26
  * @Date: 2024-04-26 14:00
27
27
  */
28
28
  export declare const getDiscountTime: (service_times: number, isDay?: boolean) => string;
29
+ /**
30
+ * @title: 格式化跨日预约的时长用于展示
31
+ * @description:
32
+ * @param {number} days
33
+ * @param {number} minutes
34
+ * @return {*}
35
+ */
36
+ export declare const getDiscountTimeByDayMinutes: (days: number, minutes: number) => string;
29
37
  /**
30
38
  * @title: 时间切片(带缓存版本)
31
39
  * @description: 使用 memoize 高阶函数包裹 sliceDayIntoFiveMinutes,相同参数时直接返回缓存结果
@@ -112,7 +120,7 @@ export declare const flexibleObj: {
112
120
  export declare const getEndDate: (startDate: any, duration: string | number, endDate: any) => any;
113
121
  export declare const getServiceTimes: (service: any) => {
114
122
  startDate: dayjs.Dayjs;
115
- endDate: dayjs.Dayjs;
123
+ endDate: any;
116
124
  };
117
125
  export declare const getErrorList: (resource: any, cacheItem: any, isDay?: boolean) => {
118
126
  label: any;
@@ -165,10 +173,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
173
  export declare const getDuration: (duration: number | {
166
174
  type: string;
167
175
  value: number;
168
- }) => number | "flexible" | {
176
+ }) => number | {
169
177
  type: string;
170
178
  value: number;
171
- };
179
+ } | "flexible";
172
180
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
181
  export declare const getIsEdit: (state: any) => boolean;
174
182
  export {};
@@ -18,7 +18,8 @@ import { locales } from '@pisell/utils';
18
18
  import { isDayBooking, formatDayDate } from "./info/service2/utils";
19
19
  import { intersectionBy } from 'lodash';
20
20
  import { getAppointmentTimingPreference } from "./info2/utilsByBooking";
21
- import Decimal from "decimal.js";
21
+ import Decimal from 'decimal.js';
22
+ import { isMultiDayProduct } from "./info2/service/addService/utils";
22
23
 
23
24
  /**
24
25
  * @title: 高阶函数结果缓存(Memoization)
@@ -95,6 +96,20 @@ export var getDiscountTime = function getDiscountTime(service_times, isDay) {
95
96
  }
96
97
  };
97
98
 
99
+ /**
100
+ * @title: 格式化跨日预约的时长用于展示
101
+ * @description:
102
+ * @param {number} days
103
+ * @param {number} minutes
104
+ * @return {*}
105
+ */
106
+ export var getDiscountTimeByDayMinutes = function getDiscountTimeByDayMinutes(days, minutes) {
107
+ if (days === 0) {
108
+ return getDiscountTime(minutes);
109
+ }
110
+ return "".concat(days, " ").concat(locales.getText('pisell2.text.day')(days), " ").concat(getDiscountTime(minutes));
111
+ };
112
+
98
113
  /**
99
114
  * @title: 时间切片
100
115
  * @description:
@@ -524,6 +539,14 @@ export var getEndDate = function getEndDate(startDate, duration, endDate) {
524
539
  export var getServiceTimes = function getServiceTimes(service) {
525
540
  var _service$_extend;
526
541
  var startDate = dayjs(dayjs(service._extend.start_date).format('YYYY-MM-DD ') + getServeStartTime(service._extend.start_time));
542
+
543
+ // 跨日预约
544
+ if (isMultiDayProduct(service)) {
545
+ return {
546
+ startDate: startDate,
547
+ endDate: service._extend.end_date
548
+ };
549
+ }
527
550
  var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), 'minute');
528
551
  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
552
  if (isSessionProduct(service) && session) {
@@ -2020,7 +2020,7 @@ var PaymentModal = function PaymentModal(_ref18) {
2020
2020
  useEffect(function () {
2021
2021
  var initCheckoutData = /*#__PURE__*/function () {
2022
2022
  var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2023
- var checkout, shop_wallet_pass_id, newData, existPayment, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4;
2023
+ var checkout, _getData, shop_wallet_pass_id, newData, existPayment, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4, domain;
2024
2024
  return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2025
2025
  while (1) switch (_context23.prev = _context23.next) {
2026
2026
  case 0:
@@ -2037,7 +2037,7 @@ var PaymentModal = function PaymentModal(_ref18) {
2037
2037
  case 6:
2038
2038
  shop_wallet_pass_id = _context23.sent;
2039
2039
  checkout.setOtherParams({
2040
- is_price_include_tax: getData('is_price_include_tax'),
2040
+ is_price_include_tax: (_getData = getData('is_price_include_tax')) !== null && _getData !== void 0 ? _getData : 1,
2041
2041
  tax_rate: getData('tax_rate') || '10',
2042
2042
  surcharge_list: getData('surcharge_list'),
2043
2043
  currency_format: getData('currency_format'),
@@ -2255,11 +2255,11 @@ var PaymentModal = function PaymentModal(_ref18) {
2255
2255
  return _ref29.apply(this, arguments);
2256
2256
  };
2257
2257
  }()));
2258
- _context23.next = 43;
2258
+ _context23.next = 46;
2259
2259
  break;
2260
2260
  case 26:
2261
2261
  if (!isLocalOrderCreated.current) {
2262
- _context23.next = 43;
2262
+ _context23.next = 45;
2263
2263
  break;
2264
2264
  }
2265
2265
  // // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
@@ -2306,27 +2306,32 @@ var PaymentModal = function PaymentModal(_ref18) {
2306
2306
  }
2307
2307
  setOrderInfo(_orderInfo4);
2308
2308
  isLocalOrderCreated.current = true;
2309
- case 43:
2310
- _context23.next = 50;
2309
+ _context23.next = 46;
2311
2310
  break;
2312
2311
  case 45:
2313
- _context23.prev = 45;
2312
+ throw new Error('pisellos is not available');
2313
+ case 46:
2314
+ _context23.next = 54;
2315
+ break;
2316
+ case 48:
2317
+ _context23.prev = 48;
2314
2318
  _context23.t0 = _context23["catch"](0);
2315
2319
  console.error('Failed to initialize checkout data:', _context23.t0);
2320
+ domain = window.location.hostname;
2316
2321
  logger === null || logger === void 0 || logger.addLog({
2317
2322
  type: 'error',
2318
- title: 'Failed to initialize checkout data',
2323
+ title: "".concat(domain, ": Failed to initialize checkout data"),
2319
2324
  metadata: {
2320
2325
  error: _context23.t0
2321
2326
  }
2322
2327
  });
2323
2328
  // 如果订单创建失败,弹出提示让重新加载 app
2324
2329
  setShowCreateErrorModal(true);
2325
- case 50:
2330
+ case 54:
2326
2331
  case "end":
2327
2332
  return _context23.stop();
2328
2333
  }
2329
- }, _callee23, null, [[0, 45]]);
2334
+ }, _callee23, null, [[0, 48]]);
2330
2335
  }));
2331
2336
  return function initCheckoutData() {
2332
2337
  return _ref28.apply(this, arguments);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Eftpos } from './const';
3
2
  /**
4
3
  * @title: tyro 设备连接
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "print" | "page" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "print" | "page" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
- action?: "deviceList" | "amount" | "pay" | undefined;
301
+ action?: "pay" | "amount" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @title: 获取 Tyro 资源
4
3
  * @description:
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => import("react").JSX.Element;
4
3
  export default ErrorTip;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => import("react").JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const DayItem: (props: any) => import("react").JSX.Element;
4
3
  export default DayItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { CalendarItemProps } from '../../../../../type';
4
3
  declare const Item: (props: CalendarItemProps) => import("react").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => import("react").JSX.Element;
4
3
  export default Status;