@pisell/private-materials 3.3.32 → 3.3.33

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 (420) 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 +1 -1
  6. package/build/lowcode/render/default/view.css +1 -1
  7. package/build/lowcode/render/default/view.js +6 -6
  8. package/build/lowcode/view.css +1 -1
  9. package/build/lowcode/view.js +6 -6
  10. package/es/businessModel/SalesModel/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +45 -25
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Content/index.js +53 -36
  16. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  17. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  18. package/es/components/appointmentBooking/components/Form/index.js +61 -161
  19. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  20. package/es/components/appointmentBooking/components/Header/index.js +64 -50
  21. package/es/components/appointmentBooking/components/Resource/index.js +119 -102
  22. package/es/components/appointmentBooking/components/TimeSlicing/index.js +5 -12
  23. package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  24. package/es/components/appointmentBooking/context.js +43 -3
  25. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  26. package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
  27. package/es/components/appointmentBooking/hooks.d.ts +2 -3
  28. package/es/components/appointmentBooking/hooks.js +293 -209
  29. package/es/components/appointmentBooking/utils.d.ts +88 -2
  30. package/es/components/appointmentBooking/utils.js +325 -63
  31. package/es/components/booking/addons/model.js +5 -5
  32. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  33. package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  34. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  35. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  36. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  37. package/es/components/booking/components/browserSelect/index.js +1 -1
  38. package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
  39. package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
  40. package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  41. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  42. package/es/components/booking/components/voucher/index.d.ts +1 -0
  43. package/es/components/booking/forms/model.js +5 -5
  44. package/es/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
  45. package/es/components/booking/forms/single/index.d.ts +1 -0
  46. package/es/components/booking/forms/table/index.d.ts +1 -0
  47. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  48. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  49. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  50. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  51. package/es/components/booking/info/date/index.d.ts +1 -0
  52. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  53. package/es/components/booking/info/header/index.d.ts +1 -0
  54. package/es/components/booking/info/notes/index.d.ts +1 -0
  55. package/es/components/booking/info/service/actions/index.d.ts +1 -0
  56. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  57. package/es/components/booking/info/service/like/index.d.ts +1 -0
  58. package/es/components/booking/info/service/like/index.js +1 -1
  59. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  60. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  61. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  62. package/es/components/booking/info2/service/actions/index.d.ts +1 -0
  63. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  64. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  65. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  66. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  67. package/es/components/booking/materiels/duration/index.d.ts +1 -0
  68. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  69. package/es/components/booking/materiels/startTime/index.d.ts +1 -0
  70. package/es/components/booking/materiels/startTime/index.js +1 -1
  71. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  72. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  73. package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
  74. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  75. package/es/components/booking/notes/addNote/index.d.ts +1 -0
  76. package/es/components/booking/notes/model.js +5 -5
  77. package/es/components/booking/payments/model.js +5 -5
  78. package/es/components/booking/utils.d.ts +2 -2
  79. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  80. package/es/components/eftpos/form/index.d.ts +1 -0
  81. package/es/components/eftpos/group/index.d.ts +1 -0
  82. package/es/components/eftpos/hooks.d.ts +1 -0
  83. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  84. package/es/components/eftpos/icon/device.d.ts +1 -0
  85. package/es/components/eftpos/index.d.ts +1 -0
  86. package/es/components/eftpos/pos.d.ts +1 -0
  87. package/es/components/eftpos/receipt/index.d.ts +1 -0
  88. package/es/components/eftpos/surcharge/index.d.ts +1 -0
  89. package/es/components/eftposPay/amount.d.ts +2 -1
  90. package/es/components/eftposPay/app.d.ts +2 -1
  91. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  92. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  93. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  94. package/es/components/eftposPay/component/fail/network.d.ts +1 -0
  95. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  96. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  97. package/es/components/eftposPay/component/manual/index.d.ts +1 -0
  98. package/es/components/eftposPay/component/signature/index.d.ts +1 -0
  99. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  100. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  101. package/es/components/eftposPay/device.d.ts +2 -1
  102. package/es/components/eftposPay/hooks.d.ts +1 -1
  103. package/es/components/eftposPay/index.d.ts +1 -0
  104. package/es/components/eftposPay/pay.d.ts +1 -0
  105. package/es/components/eftposPay/payo/config.d.ts +1 -0
  106. package/es/components/eftposPay/store/index.d.ts +2 -2
  107. package/es/components/eftposPay/tip.d.ts +1 -0
  108. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  109. package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  110. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  111. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  112. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  113. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  114. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  115. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  116. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  117. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  118. package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  119. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  120. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  121. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  122. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  123. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  124. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
  125. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  126. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  127. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  128. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  129. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  130. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  131. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  132. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  133. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  134. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  135. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  136. package/es/components/listComponent/index.js +5 -5
  137. package/es/components/login/index.d.ts +1 -0
  138. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  139. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  140. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  141. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  142. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  143. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  144. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  145. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  146. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  147. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  148. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  149. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  150. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  151. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  152. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  153. package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
  154. package/es/components/productExtension/card/index.js +3 -3
  155. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  156. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  157. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  158. package/es/components/productExtension/fields/Forms/index.js +12 -12
  159. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  160. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  161. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  162. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  163. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  164. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  165. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  166. package/es/components/productExtension/index.d.ts +1 -0
  167. package/es/components/productExtension/server.js +2 -2
  168. package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
  169. package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
  170. package/es/components/ruleSetting/index.d.ts +1 -0
  171. package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  172. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  173. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  174. package/es/components/schedules/calendar/index.d.ts +1 -0
  175. package/es/components/schedules/calendar/index.js +4 -4
  176. package/es/components/schedules/calendar/serve.js +2 -2
  177. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  178. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  179. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  180. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  181. package/es/components/schedules/components/ResourceList/index.js +1 -1
  182. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  183. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  184. package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
  185. package/es/components/schedules/components/Search/index.js +5 -5
  186. package/es/components/schedules/model.js +5 -5
  187. package/es/components/schedules/openHours/index.js +1 -1
  188. package/es/components/schedules/openHours/serve.js +2 -2
  189. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  190. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  191. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  192. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  193. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  194. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  195. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  196. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  197. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  198. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  199. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  200. package/es/components/schedules/products/index.d.ts +1 -0
  201. package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  202. package/es/components/schedules/products/list/index.d.ts +1 -0
  203. package/es/components/schedules/products/serve.js +2 -2
  204. package/es/components/schedules/products/utils.js +5 -5
  205. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  206. package/es/components/schedules/resources/detail/index.js +10 -10
  207. package/es/components/schedules/resources/index.d.ts +1 -0
  208. package/es/components/schedules/resources/list/index.d.ts +1 -0
  209. package/es/components/schedules/resources/list/index.js +2 -2
  210. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  211. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  212. package/es/components/schedules/resources/serve.js +2 -2
  213. package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  214. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  215. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  216. package/es/components/schedules/schedules/index.d.ts +1 -0
  217. package/es/components/schedules/utils.d.ts +1 -1
  218. package/es/components/schedules/utils.js +4 -4
  219. package/es/components/selectModal/index.js +2 -2
  220. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  221. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  222. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  223. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  224. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  225. package/es/components/shoppingCart/index.d.ts +1 -0
  226. package/es/components/taxSelect/index.d.ts +1 -0
  227. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  228. package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  229. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  230. package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  231. package/es/components/ticketBooking/index.d.ts +1 -0
  232. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  233. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  234. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  235. package/es/hooks/useComponents.js +1 -1
  236. package/es/utils/index.d.ts +1 -1
  237. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  238. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
  239. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  240. package/lib/components/appointmentBooking/components/Cart/Item/index.js +33 -9
  241. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  242. package/lib/components/appointmentBooking/components/Content/index.js +35 -21
  243. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  244. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  245. package/lib/components/appointmentBooking/components/Form/index.js +54 -98
  246. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  247. package/lib/components/appointmentBooking/components/Header/index.js +39 -20
  248. package/lib/components/appointmentBooking/components/Resource/index.js +41 -59
  249. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
  250. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
  251. package/lib/components/appointmentBooking/context.js +48 -4
  252. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
  253. package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
  254. package/lib/components/appointmentBooking/hooks.d.ts +2 -3
  255. package/lib/components/appointmentBooking/hooks.js +143 -57
  256. package/lib/components/appointmentBooking/utils.d.ts +88 -2
  257. package/lib/components/appointmentBooking/utils.js +191 -51
  258. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  259. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
  260. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
  261. package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
  262. package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
  263. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
  264. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  265. package/lib/components/booking/components/voucher/index.d.ts +1 -0
  266. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +2 -1
  267. package/lib/components/booking/forms/single/index.d.ts +1 -0
  268. package/lib/components/booking/forms/table/index.d.ts +1 -0
  269. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  270. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  271. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
  272. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  273. package/lib/components/booking/info/date/index.d.ts +1 -0
  274. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  275. package/lib/components/booking/info/header/index.d.ts +1 -0
  276. package/lib/components/booking/info/notes/index.d.ts +1 -0
  277. package/lib/components/booking/info/service/actions/index.d.ts +1 -0
  278. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  279. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  280. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  281. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  282. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  283. package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
  284. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  285. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  286. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  287. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  288. package/lib/components/booking/materiels/duration/index.d.ts +1 -0
  289. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  290. package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
  291. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
  292. package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
  293. package/lib/components/booking/notes/addNote/index.d.ts +1 -0
  294. package/lib/components/booking/utils.d.ts +2 -2
  295. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  296. package/lib/components/eftpos/form/index.d.ts +1 -0
  297. package/lib/components/eftpos/group/index.d.ts +1 -0
  298. package/lib/components/eftpos/hooks.d.ts +1 -0
  299. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  300. package/lib/components/eftpos/icon/device.d.ts +1 -0
  301. package/lib/components/eftpos/index.d.ts +1 -0
  302. package/lib/components/eftpos/pos.d.ts +1 -0
  303. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  304. package/lib/components/eftpos/surcharge/index.d.ts +1 -0
  305. package/lib/components/eftposPay/amount.d.ts +2 -1
  306. package/lib/components/eftposPay/app.d.ts +2 -1
  307. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  308. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  309. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  310. package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
  311. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  312. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  313. package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
  314. package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
  315. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  316. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  317. package/lib/components/eftposPay/device.d.ts +2 -1
  318. package/lib/components/eftposPay/hooks.d.ts +1 -1
  319. package/lib/components/eftposPay/index.d.ts +1 -0
  320. package/lib/components/eftposPay/pay.d.ts +1 -0
  321. package/lib/components/eftposPay/payo/config.d.ts +1 -0
  322. package/lib/components/eftposPay/store/index.d.ts +2 -2
  323. package/lib/components/eftposPay/tip.d.ts +1 -0
  324. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  325. package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
  326. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  327. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  328. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
  329. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  330. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  331. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  332. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  333. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  334. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
  335. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  336. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  337. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  338. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  339. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  340. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
  341. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  342. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  343. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  344. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  345. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  346. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  347. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  348. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  349. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  350. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  351. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
  352. package/lib/components/login/index.d.ts +1 -0
  353. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
  354. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
  355. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
  356. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  357. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
  358. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
  359. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  360. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  361. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  362. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
  363. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
  364. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  365. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  366. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  367. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  368. package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
  369. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  370. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  371. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
  372. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
  373. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  374. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  375. package/lib/components/productExtension/index.d.ts +1 -0
  376. package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
  377. package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
  378. package/lib/components/ruleSetting/index.d.ts +1 -0
  379. package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
  380. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  381. package/lib/components/schedules/calendar/index.d.ts +1 -0
  382. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  383. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
  384. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
  385. package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
  386. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
  387. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
  388. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
  389. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
  390. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  391. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  392. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
  393. package/lib/components/schedules/products/index.d.ts +1 -0
  394. package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
  395. package/lib/components/schedules/products/list/index.d.ts +1 -0
  396. package/lib/components/schedules/resources/index.d.ts +1 -0
  397. package/lib/components/schedules/resources/list/index.d.ts +1 -0
  398. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  399. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
  400. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
  401. package/lib/components/schedules/schedules/index.d.ts +1 -0
  402. package/lib/components/schedules/utils.d.ts +1 -1
  403. package/lib/components/schedules/utils.js +1 -1
  404. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  405. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  406. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  407. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  408. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  409. package/lib/components/shoppingCart/index.d.ts +1 -0
  410. package/lib/components/taxSelect/index.d.ts +1 -0
  411. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
  412. package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
  413. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  414. package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  415. package/lib/components/ticketBooking/index.d.ts +1 -0
  416. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  417. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  418. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
  419. package/lib/utils/index.d.ts +1 -1
  420. package/package.json +2 -2
@@ -1,34 +1,40 @@
1
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
2
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
3
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
10
  import React, { useMemo } from 'react';
6
11
  import { locales } from '@pisell/utils';
7
12
  import ProgressBar from "../../../eventBooking/components/progressBar";
8
13
  import { useAppointmentBookingContext } from "../../context";
9
- import { useShopDiscount, useIsSkipResourceStep, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct } from "../../hooks";
14
+ import { useShopDiscount, useAppointmentBookingStep, useAppointmentBookingSetting, useAppointmentBookingProduct, contextUtils } from "../../hooks";
10
15
  import useEngineContext from "../../../../hooks/useEngineContext";
16
+ import { getResourceTitle } from "../../utils";
11
17
  import "./index.less";
12
18
  var Header = function Header() {
13
19
  var _currentStep$step3;
14
- var _useAppointmentBookin = useAppointmentBookingContext(),
15
- currentStep = _useAppointmentBookin.currentStep,
16
- appointmentBooking = _useAppointmentBookin.appointmentBooking,
17
- resources = _useAppointmentBookin.resources,
18
- setTimes = _useAppointmentBookin.setTimes,
19
- carts = _useAppointmentBookin.carts;
20
+ var _ref = useAppointmentBookingContext(),
21
+ currentStep = _ref.currentStep,
22
+ appointmentBooking = _ref.appointmentBooking,
23
+ setTimes = _ref.setTimes,
24
+ carts = _ref.carts,
25
+ currentStepParams = _ref.currentStepParams,
26
+ currentSelectedResourcesRef = _ref.currentSelectedResourcesRef;
20
27
  var shopDiscount = useShopDiscount();
21
28
  var context = useEngineContext();
22
- var _useIsSkipResourceSte = useIsSkipResourceStep(),
23
- checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
24
- var _useAppointmentBookin2 = useAppointmentBookingStep(),
25
- getStepIndex = _useAppointmentBookin2.getStepIndex,
26
- stepList = _useAppointmentBookin2.stepList,
27
- updateStep = _useAppointmentBookin2.updateStep;
28
- var _useAppointmentBookin3 = useAppointmentBookingSetting(),
29
- setOtherData = _useAppointmentBookin3.setOtherData;
30
- var _useAppointmentBookin4 = useAppointmentBookingProduct(),
31
- checkProductType = _useAppointmentBookin4.checkProductType;
29
+ var _useAppointmentBookin = useAppointmentBookingStep(),
30
+ stepList = _useAppointmentBookin.stepList,
31
+ updateStep = _useAppointmentBookin.updateStep;
32
+ var _useAppointmentBookin2 = useAppointmentBookingSetting(),
33
+ setOtherData = _useAppointmentBookin2.setOtherData,
34
+ getOtherData = _useAppointmentBookin2.getOtherData;
35
+ var _useAppointmentBookin3 = useAppointmentBookingProduct(),
36
+ checkProductType = _useAppointmentBookin3.checkProductType;
37
+ var utils = contextUtils();
32
38
 
33
39
  /**
34
40
  * @title: 获取资源名称
@@ -44,13 +50,15 @@ var Header = function Header() {
44
50
  if (!key) return '';
45
51
 
46
52
  // 选择资源则获取资源列表的第一个名称
47
- if (key === 'select-resource') {
48
- var _resources$;
49
- var name = (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.title) || '';
53
+ if (key.startsWith('select-resource')) {
54
+ var _currentSelectedResou;
55
+ var currentResource = (_currentSelectedResou = currentSelectedResourcesRef.current) === null || _currentSelectedResou === void 0 || (_currentSelectedResou = _currentSelectedResou[0]) === null || _currentSelectedResou === void 0 ? void 0 : _currentSelectedResou.currentSelectedResource;
56
+ var resourceItem = (currentResource === null || currentResource === void 0 ? void 0 : currentResource.resourceItem) || {};
57
+ var name = getResourceTitle(appointmentBooking, resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.code, utils, resourceItem);
50
58
  return locales.getText('pisell2.event.select.category')(name);
51
59
  }
52
60
  return (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description) || '';
53
- }, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, resources]);
61
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, currentSelectedResourcesRef.current]);
54
62
 
55
63
  /**
56
64
  * @title: 返回
@@ -60,9 +68,9 @@ var Header = function Header() {
60
68
  * @Date: 2025-01-18 22:28
61
69
  */
62
70
  var handleBack = /*#__PURE__*/function () {
63
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
71
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
64
72
  var _currentStep$step4;
65
- var key, types, _carts$, type, resourceStep;
73
+ var key, types, _carts$, type, form_key, booking_form, prevStepData, currentStepData, _key;
66
74
  return _regeneratorRuntime().wrap(function _callee$(_context) {
67
75
  while (1) switch (_context.prev = _context.next) {
68
76
  case 0:
@@ -99,48 +107,54 @@ var Header = function Header() {
99
107
  if (key === 'select-time') {
100
108
  setTimes([]);
101
109
  }
102
- if (key === 'fill-form') {
103
- setOtherData('booking_form', {});
104
- }
105
-
106
- // // 5. 判断是否需要跳过资源步骤
107
- // const isHasForm = stepList?.some((item: any) => item.key === 'fill-form');
108
- // const shouldCheckSkip =
109
- // (isHasForm && key === 'fill-form') || key === 'select-time';
110
110
 
111
- // if (shouldCheckSkip) {
112
- // const skipResourceStep = await checkSkipResourceStep(true);
113
- // if (skipResourceStep) {
114
- // appointmentBooking.deleteCartItemInfo('resource');
115
- // const targetIndex = getStepIndex('prev', 2);
116
- // return appointmentBooking.gotoStep(targetIndex);
117
- // }
118
- // }
111
+ // 5. 清空表单数据
112
+ if (key.startsWith('fill-form')) {
113
+ form_key = 'booking_form';
114
+ booking_form = getOtherData(form_key);
115
+ setOtherData(form_key, _objectSpread(_objectSpread({}, booking_form), {}, _defineProperty({}, key, {})));
116
+ }
119
117
 
120
118
  // 如果前一步是资源步骤,并且被跳过了,则清空资源
121
- resourceStep = stepList[(currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) - 1];
122
- if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource') {
123
- appointmentBooking.deleteCartItemInfo('resource');
124
- }
119
+ // const resourceStep = stepList[currentStep?.index - 1];
120
+ // if (resourceStep?.isSkip && resourceStep?.key === 'select-resource') {
121
+ // appointmentBooking.deleteCartItemInfo('resource');
122
+ // }
125
123
 
126
124
  // 6. 默认回退一步
127
125
  appointmentBooking.back();
128
-
129
- // 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
130
- if (resourceStep !== null && resourceStep !== void 0 && resourceStep.isSkip && ((resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-resource' || (resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key) === 'select-service')) {
131
- updateStep(resourceStep === null || resourceStep === void 0 ? void 0 : resourceStep.key, {
132
- index: currentStep === null || currentStep === void 0 ? void 0 : currentStep.index,
126
+ prevStepData = stepList[(currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index) - 1];
127
+ currentStepData = stepList[currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index];
128
+ debugger;
129
+ if (currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip || prevStepData !== null && prevStepData !== void 0 && prevStepData.isSkip) {
130
+ _key = currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip ? currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key : prevStepData === null || prevStepData === void 0 ? void 0 : prevStepData.key;
131
+ if (_key === 'select-resource') {
132
+ appointmentBooking.deleteCartItemInfo('resource');
133
+ }
134
+ updateStep(_key, {
133
135
  isSkip: false
134
136
  });
135
137
  }
136
- case 16:
138
+
139
+ // 再次将步骤更新为false, 增加这个判断为了跳过那一步没有设置holder,但是直接后退了
140
+ // if (
141
+ // resourceStep?.isSkip &&
142
+ // (resourceStep?.key === 'select-resource' ||
143
+ // resourceStep?.key === 'select-service')
144
+ // ) {
145
+ // updateStep(resourceStep?.key, {
146
+ // index: currentStep?.index,
147
+ // isSkip: false,
148
+ // });
149
+ // }
150
+ case 17:
137
151
  case "end":
138
152
  return _context.stop();
139
153
  }
140
154
  }, _callee);
141
155
  }));
142
156
  return function handleBack() {
143
- return _ref.apply(this, arguments);
157
+ return _ref2.apply(this, arguments);
144
158
  };
145
159
  }();
146
160
 
@@ -19,9 +19,7 @@ import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
19
19
  import { PisellCustomCheckboxGroup } from '@pisell/materials';
20
20
  import { useAppointmentBookingResource, useIsSkipResourceStep, useAppointmentBookingStep, useAppointmentBookingLogin, contextUtils, useAppointmentBookingAccount, useAppointmentBookingSetting } from "../../hooks";
21
21
  import { useAppointmentBookingContext } from "../../context";
22
- import { checkHasFormStep, formatCartsResources } from "../../utils";
23
- import { checkResource, checkHolder } from "../../components/Cart/utils";
24
- import { scrollToFirstErrorCard } from "./utils";
22
+ import { formatCartsResources, currentAppointmentBoard, currentRenderLists, updateCartResources } from "../../utils";
25
23
  import guestsImg from "../../assets/guests.svg";
26
24
  import { isMobile, locales } from '@pisell/utils';
27
25
  import "./index.less";
@@ -30,98 +28,87 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
30
28
  _useState2 = _slicedToArray(_useState, 2),
31
29
  selectedResource = _useState2[0],
32
30
  setSelectedResource = _useState2[1];
33
- var _useAppointmentBookin = useAppointmentBookingContext(),
34
- appointmentBooking = _useAppointmentBookin.appointmentBooking,
35
- carts = _useAppointmentBookin.carts,
36
- resourceOtherParams = _useAppointmentBookin.resourceOtherParams,
37
- setCarts = _useAppointmentBookin.setCarts,
38
- currentStep = _useAppointmentBookin.currentStep,
39
- setResourceOtherParams = _useAppointmentBookin.setResourceOtherParams,
40
- setIsErrorHolder = _useAppointmentBookin.setIsErrorHolder,
41
- setPolicyIds = _useAppointmentBookin.setPolicyIds;
42
- var _useAppointmentBookin2 = useAppointmentBookingResource(),
43
- getResourceList = _useAppointmentBookin2.getResourceList,
44
- autoSelectAllProductResources = _useAppointmentBookin2.autoSelectAllProductResources,
45
- getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot;
31
+ var _ref = useAppointmentBookingContext(),
32
+ appointmentBooking = _ref.appointmentBooking,
33
+ carts = _ref.carts,
34
+ resourceOtherParams = _ref.resourceOtherParams,
35
+ currentStep = _ref.currentStep,
36
+ setResourceOtherParams = _ref.setResourceOtherParams,
37
+ setPolicyIds = _ref.setPolicyIds,
38
+ currentStepParams = _ref.currentStepParams;
39
+ var _useAppointmentBookin = useAppointmentBookingResource(),
40
+ getResourceList = _useAppointmentBookin.getResourceList,
41
+ getResourceTimeSlot = _useAppointmentBookin.getResourceTimeSlot;
46
42
  var _useIsSkipResourceSte = useIsSkipResourceStep(),
47
43
  checkSkipResourceStep = _useIsSkipResourceSte.checkSkipResourceStep;
48
- var _useAppointmentBookin3 = useAppointmentBookingStep(),
49
- updateStep = _useAppointmentBookin3.updateStep,
50
- nextStep = _useAppointmentBookin3.nextStep;
51
- var _useAppointmentBookin4 = useAppointmentBookingLogin(),
52
- openLoginModal = _useAppointmentBookin4.openLoginModal,
53
- isLogin = _useAppointmentBookin4.isLogin;
54
- var _useAppointmentBookin5 = useAppointmentBookingAccount(),
55
- getHolders = _useAppointmentBookin5.getHolders,
56
- checkAccount = _useAppointmentBookin5.checkAccount;
57
- var _useAppointmentBookin6 = useAppointmentBookingSetting(),
58
- isFormSubject = _useAppointmentBookin6.isFormSubject;
44
+ var _useAppointmentBookin2 = useAppointmentBookingStep(),
45
+ updateStep = _useAppointmentBookin2.updateStep,
46
+ nextStep = _useAppointmentBookin2.nextStep;
47
+ var _useAppointmentBookin3 = useAppointmentBookingLogin(),
48
+ openLoginModal = _useAppointmentBookin3.openLoginModal,
49
+ isLogin = _useAppointmentBookin3.isLogin;
50
+ var _useAppointmentBookin4 = useAppointmentBookingAccount(),
51
+ getHolders = _useAppointmentBookin4.getHolders,
52
+ checkAccount = _useAppointmentBookin4.checkAccount;
53
+ var _useAppointmentBookin5 = useAppointmentBookingSetting(),
54
+ isFormSubject = _useAppointmentBookin5.isFormSubject;
59
55
  var utils = contextUtils();
60
56
  useImperativeHandle(ref, function () {
61
57
  return {
62
58
  next: function () {
63
59
  var _next2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
64
60
  var _appointmentBooking$s;
65
- var result, resultCarts, stepList, accountLists, checkResult;
61
+ var resultCarts, stepList, accountLists;
66
62
  return _regeneratorRuntime().wrap(function _callee$(_context) {
67
63
  while (1) switch (_context.prev = _context.next) {
68
64
  case 0:
69
- result = checkResource({
70
- carts: carts,
71
- resources: resources
72
- });
73
- if (result) {
74
- setCarts(result);
75
- }
76
- setIsErrorHolder(!!result);
77
-
65
+ // const result = checkResource({ carts, resources });
66
+ // if (result) {
67
+ // setCarts(result);
68
+ // }
69
+ // setIsErrorHolder(!!result);
78
70
  // 验证购物车是否有资源
79
- if (!result) {
80
- _context.next = 6;
81
- break;
82
- }
83
- scrollToFirstErrorCard();
84
- return _context.abrupt("return");
85
- case 6:
71
+ // if (!!result) {
72
+ // scrollToFirstErrorCard();
73
+ // return;
74
+ // }
86
75
  resultCarts = formatCartsResources(carts, resources, setPolicyIds);
87
76
  stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
88
- _context.next = 10;
77
+ _context.next = 4;
89
78
  return appointmentBooking.getAccounts();
90
- case 10:
79
+ case 4:
91
80
  accountLists = _context.sent;
92
- checkResult = checkHasFormStep({
93
- nextStep: nextStep,
94
- hasResourceFormId: (resultCarts === null || resultCarts === void 0 ? void 0 : resultCarts.length) > 0,
95
- currentStep: currentStep,
96
- stepList: stepList,
97
- appointmentBooking: appointmentBooking,
98
- locales: locales,
99
- openLoginModal: openLoginModal,
100
- utils: utils,
101
- accountLists: accountLists,
102
- getHolders: getHolders,
103
- checkHolder: checkHolder,
104
- checkAccount: checkAccount,
105
- setCarts: setCarts,
106
- carts: carts,
107
- isFormSubject: isFormSubject,
108
- isLogin: isLogin
109
- });
110
- if (!checkResult) {
111
- _context.next = 14;
112
- break;
113
- }
114
- return _context.abrupt("return");
115
- case 14:
81
+ // const checkResult = checkHasFormStep({
82
+ // nextStep,
83
+ // hasResourceFormId: resultCarts?.length > 0,
84
+ // currentStep,
85
+ // stepList,
86
+ // appointmentBooking,
87
+ // locales,
88
+ // openLoginModal,
89
+ // utils,
90
+ // accountLists,
91
+ // getHolders,
92
+ // checkHolder,
93
+ // checkAccount,
94
+ // setCarts,
95
+ // carts,
96
+ // isFormSubject,
97
+ // isLogin,
98
+ // });
99
+
100
+ // if (checkResult) return;
101
+
116
102
  // 清空资源分配失败数据
117
103
  setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), {}, {
118
104
  errorList: null
119
105
  }));
120
106
 
121
107
  // 获取时间切片
122
- getResourceTimeSlot();
108
+ // getResourceTimeSlot();
109
+
123
110
  nextStep();
124
- case 17:
111
+ case 7:
125
112
  case "end":
126
113
  return _context.stop();
127
114
  }
@@ -142,7 +129,7 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
142
129
  useEffect(function () {
143
130
  // 检查是否可以跳过资源选择步骤
144
131
  var checkAndSkipResourceStep = /*#__PURE__*/function () {
145
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
132
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
146
133
  var _currentStep$step, _resources, skipResourceStep, key;
147
134
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
148
135
  while (1) switch (_context2.prev = _context2.next) {
@@ -150,16 +137,13 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
150
137
  _context2.prev = 0;
151
138
  // 获取资源列表数据
152
139
  _resources = getResourceList(); // 获取自动分配资源
153
- _context2.next = 4;
154
- return autoSelectAllProductResources();
155
- case 4:
140
+ // await autoSelectAllProductResources();
156
141
  // 根据自动分配之后的资源重新拉取资源列表
157
- getResourceList();
158
-
142
+ // getResourceList();
159
143
  // 检测资源步骤是否跳过
160
- _context2.next = 7;
144
+ _context2.next = 4;
161
145
  return checkSkipResourceStep();
162
- case 7:
146
+ case 4:
163
147
  skipResourceStep = _context2.sent;
164
148
  // 更新步骤是否有跳过标识
165
149
  key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
@@ -168,23 +152,23 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
168
152
  isSkip: skipResourceStep
169
153
  });
170
154
  if (!skipResourceStep) {
171
- _context2.next = 12;
155
+ _context2.next = 9;
172
156
  break;
173
157
  }
174
158
  return _context2.abrupt("return", true);
175
- case 12:
159
+ case 9:
176
160
  return _context2.abrupt("return", false);
177
- case 15:
178
- _context2.prev = 15;
161
+ case 12:
162
+ _context2.prev = 12;
179
163
  _context2.t0 = _context2["catch"](0);
180
- case 17:
164
+ case 14:
181
165
  case "end":
182
166
  return _context2.stop();
183
167
  }
184
- }, _callee2, null, [[0, 15]]);
168
+ }, _callee2, null, [[0, 12]]);
185
169
  }));
186
170
  return function checkAndSkipResourceStep() {
187
- return _ref.apply(this, arguments);
171
+ return _ref2.apply(this, arguments);
188
172
  };
189
173
  }();
190
174
  checkAndSkipResourceStep();
@@ -195,28 +179,61 @@ var Resource = /*#__PURE__*/forwardRef(function (props, ref) {
195
179
  title: locales.getText('pisell2.appointment.any.professional'),
196
180
  subtitle: locales.getText('pisell2.appointment.for.maximum.availability')
197
181
  }];
198
- var currentResource = useMemo(function () {
199
- if (resources.length && carts.length) {
200
- if (carts.length === 1) {
201
- var _resources$;
202
- return (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 ? void 0 : _resources$[0];
203
- } else {
204
- return {
205
- renderList: []
206
- };
207
- }
208
- }
209
- }, [resources, carts]);
182
+ var appointmentBoard = useMemo(function () {
183
+ return currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking);
184
+ }, [currentStepParams.key, resources]);
185
+ var renderLists = useMemo(function () {
186
+ return currentRenderLists(resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
187
+ }, [resources, appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code]);
188
+ useEffect(function () {
189
+ var autoSelectResources = /*#__PURE__*/function () {
190
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
191
+ var res, cartItem;
192
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
193
+ while (1) switch (_context3.prev = _context3.next) {
194
+ case 0:
195
+ if (!(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.isRequired || !(appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.form_code))) {
196
+ _context3.next = 2;
197
+ break;
198
+ }
199
+ return _context3.abrupt("return");
200
+ case 2:
201
+ _context3.next = 4;
202
+ return appointmentBooking.autoSelectAllProductResources(appointmentBoard === null || appointmentBoard === void 0 ? void 0 : appointmentBoard.form_code);
203
+ case 4:
204
+ res = _context3.sent;
205
+ setResourceOtherParams(_objectSpread(_objectSpread({}, resourceOtherParams), res));
206
+
207
+ // 自动分派之后获取重新获取资源列表数据;
208
+ getResourceList();
209
+ cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
210
+ appointmentBooking.updateCart(_objectSpread({
211
+ _id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
212
+ }, cartItem));
213
+ case 9:
214
+ case "end":
215
+ return _context3.stop();
216
+ }
217
+ }, _callee3);
218
+ }));
219
+ return function autoSelectResources() {
220
+ return _ref3.apply(this, arguments);
221
+ };
222
+ }();
223
+ autoSelectResources();
224
+ }, [appointmentBoard]);
210
225
  var resourcesResult = useMemo(function () {
211
- return anyResource.concat((currentResource === null || currentResource === void 0 ? void 0 : currentResource.renderList) || []);
212
- }, [currentResource]);
226
+ // 如果是必选资源,则不显示随机分配选项
227
+ var _anyResource = appointmentBoard !== null && appointmentBoard !== void 0 && appointmentBoard.isRequired ? [] : [].concat(anyResource);
228
+ return _anyResource.concat(renderLists || []);
229
+ }, [renderLists, appointmentBoard]);
213
230
  var _onClick = function onClick(e) {
214
231
  setSelectedResource(e.id);
215
232
  if (e.id) {
216
233
  var _carts$;
217
234
  return appointmentBooking.updateCart({
218
235
  _id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
219
- resources: [e]
236
+ resources: updateCartResources(carts === null || carts === void 0 ? void 0 : carts[0], e)
220
237
  });
221
238
  }
222
239
  };
@@ -48,23 +48,16 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
48
48
  }, []);
49
49
  var getAutoSelect = /*#__PURE__*/function () {
50
50
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
51
- var _getResourceList, resourceCodes, _yield$appointmentBoo, errorList, result;
51
+ var result;
52
52
  return _regeneratorRuntime().wrap(function _callee$(_context) {
53
53
  while (1) switch (_context.prev = _context.next) {
54
54
  case 0:
55
55
  setSelectedTime(val);
56
- _getResourceList = getResourceList(), resourceCodes = _getResourceList.resourceCodes;
57
- _context.next = 4;
58
- return appointmentBooking.autoSelectAllProductResources(resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[1], val);
59
- case 4:
60
- _yield$appointmentBoo = _context.sent;
61
- errorList = _yield$appointmentBoo.errorList;
62
- _context.next = 8;
56
+ _context.next = 3;
63
57
  return appointmentBooking.submitTimeSlot(val);
64
- case 8:
58
+ case 3:
65
59
  result = _context.sent;
66
- console.log(errorList, result, 'wh9896788');
67
- case 10:
60
+ case 4:
68
61
  case "end":
69
62
  return _context.stop();
70
63
  }
@@ -84,7 +77,7 @@ var TimeSlicing = /*#__PURE__*/forwardRef(function (props, ref) {
84
77
  // 如果没有选择时间,则默认选中第一个时间
85
78
  getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
86
79
  }
87
- }, [times]);
80
+ }, [times, carts]);
88
81
  var _onClick = /*#__PURE__*/function () {
89
82
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
90
83
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../booking/components/voucher/index.less';
2
3
  import './index.less';
3
4
  declare const VoucherCard: (props: any) => JSX.Element;
@@ -8,10 +8,12 @@ import React, { createContext, useContext, useState, useEffect, useMemo, useRef
8
8
  import { useAppointmentBooking } from "./hooks";
9
9
  import useEngineContext from "../../hooks/useEngineContext";
10
10
  import { TasksManager } from "../../utils/tasks";
11
+ import { getCartCurrentResourceData } from "./utils";
11
12
  var AppointmentBookingContext = /*#__PURE__*/createContext(undefined);
12
13
  export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref) {
13
- var _appHelper$utils, _currentStep$step2, _appointmentBooking$s;
14
+ var _appHelper$utils, _appointmentBooking$s2, _currentStep$step2, _appointmentBooking$s3, _currentStep$step4;
14
15
  var children = _ref.children;
16
+ var currentSelectedResourcesRef = useRef(null);
15
17
  var policyIdsRef = useRef([]);
16
18
  var appointmentBooking = useAppointmentBooking();
17
19
  // 总计计算
@@ -124,6 +126,10 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
124
126
  policyParams.callback();
125
127
  }
126
128
  };
129
+ var stepLists = useMemo(function () {
130
+ var _appointmentBooking$s;
131
+ return (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
132
+ }, [appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList]);
127
133
 
128
134
  /**
129
135
  * @title: 是否是最后一步
@@ -137,7 +143,39 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
137
143
  var _currentStep$step;
138
144
  var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
139
145
  return key === 'confirm-information';
140
- }, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList]);
146
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
147
+ var currentStepParams = useMemo(function () {
148
+ var _currentStep$step3;
149
+ var key = currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key;
150
+ var index = stepLists.findIndex(function (item) {
151
+ return item.key === key;
152
+ });
153
+ return {
154
+ key: key,
155
+ index: index,
156
+ stepLists: stepLists
157
+ };
158
+ }, [currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key, stepLists]);
159
+ useEffect(function () {
160
+ var _currentStepParams$ke;
161
+ // 如果当前步骤是选择资源,则更新当前资源的数据
162
+ if (currentStepParams !== null && currentStepParams !== void 0 && (_currentStepParams$ke = currentStepParams.key) !== null && _currentStepParams$ke !== void 0 && _currentStepParams$ke.startsWith('select-resource')) {
163
+ var currentSelectedResources = carts.map(function (item) {
164
+ return {
165
+ _id: item === null || item === void 0 ? void 0 : item._id,
166
+ currentSelectedResource: getCartCurrentResourceData(item, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources)
167
+ };
168
+ });
169
+ currentSelectedResourcesRef.current = currentSelectedResources;
170
+
171
+ // 并且将当前资源的数据设置到本地
172
+ appointmentBooking.setOtherData('current_selected_resources', currentSelectedResources);
173
+ }
174
+ }, [currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key, resources, carts]);
175
+ useEffect(function () {
176
+ var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
177
+ currentSelectedResourcesRef.current = currentSelectedResources || [];
178
+ }, []);
141
179
  var value = {
142
180
  appointmentBooking: appointmentBooking,
143
181
  times: times,
@@ -171,7 +209,9 @@ export var AppointmentBookingProvider = function AppointmentBookingProvider(_ref
171
209
  policyIdsRef: policyIdsRef,
172
210
  setPolicyIds: setPolicyIds,
173
211
  openPolicy: openPolicy,
174
- closePolicy: closePolicy
212
+ closePolicy: closePolicy,
213
+ currentStepParams: currentStepParams,
214
+ currentSelectedResourcesRef: currentSelectedResourcesRef
175
215
  };
176
216
  return /*#__PURE__*/React.createElement(AppointmentBookingContext.Provider, {
177
217
  value: value
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const DepositModal: (props: any) => JSX.Element;
3
4
  export default DepositModal;