@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
@@ -39,10 +39,8 @@ var import_materials = require("@pisell/materials");
39
39
  var import_hooks = require("../../hooks");
40
40
  var import_context = require("../../context");
41
41
  var import_utils = require("../../utils");
42
- var import_utils2 = require("../../components/Cart/utils");
43
- var import_utils3 = require("./utils");
44
42
  var import_guests = __toESM(require("../../assets/guests.svg"));
45
- var import_utils4 = require("@pisell/utils");
43
+ var import_utils2 = require("@pisell/utils");
46
44
  var import_index = require("./index.less");
47
45
  var Resource = (0, import_react.forwardRef)((props, ref) => {
48
46
  const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
@@ -50,17 +48,12 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
50
48
  appointmentBooking,
51
49
  carts,
52
50
  resourceOtherParams,
53
- setCarts,
54
51
  currentStep,
55
52
  setResourceOtherParams,
56
- setIsErrorHolder,
57
- setPolicyIds
53
+ setPolicyIds,
54
+ currentStepParams
58
55
  } = (0, import_context.useAppointmentBookingContext)();
59
- const {
60
- getResourceList,
61
- autoSelectAllProductResources,
62
- getResourceTimeSlot
63
- } = (0, import_hooks.useAppointmentBookingResource)();
56
+ const { getResourceList, getResourceTimeSlot } = (0, import_hooks.useAppointmentBookingResource)();
64
57
  const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
65
58
  const { updateStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
66
59
  const { openLoginModal, isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
@@ -70,42 +63,13 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
70
63
  (0, import_react.useImperativeHandle)(ref, () => ({
71
64
  next: async () => {
72
65
  var _a, _b, _c;
73
- const result = (0, import_utils2.checkResource)({ carts, resources });
74
- if (result) {
75
- setCarts(result);
76
- }
77
- setIsErrorHolder(!!result);
78
- if (!!result) {
79
- (0, import_utils3.scrollToFirstErrorCard)();
80
- return;
81
- }
82
66
  const resultCarts = (0, import_utils.formatCartsResources)(carts, resources, setPolicyIds);
83
67
  const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
84
68
  const accountLists = await appointmentBooking.getAccounts();
85
- const checkResult = (0, import_utils.checkHasFormStep)({
86
- nextStep,
87
- hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0,
88
- currentStep,
89
- stepList,
90
- appointmentBooking,
91
- locales: import_utils4.locales,
92
- openLoginModal,
93
- utils,
94
- accountLists,
95
- getHolders,
96
- checkHolder: import_utils2.checkHolder,
97
- checkAccount,
98
- setCarts,
99
- carts,
100
- isFormSubject,
101
- isLogin
102
- });
103
- if (checkResult) return;
104
69
  setResourceOtherParams({
105
70
  ...resourceOtherParams,
106
71
  errorList: null
107
72
  });
108
- getResourceTimeSlot();
109
73
  nextStep();
110
74
  }
111
75
  }));
@@ -118,8 +82,6 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
118
82
  var _a;
119
83
  try {
120
84
  const _resources = getResourceList();
121
- await autoSelectAllProductResources();
122
- getResourceList();
123
85
  const skipResourceStep = await checkSkipResourceStep();
124
86
  const key = (_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key;
125
87
  updateStep(key, {
@@ -139,32 +101,52 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
139
101
  {
140
102
  id: 0,
141
103
  image: import_guests.default,
142
- title: import_utils4.locales.getText("pisell2.appointment.any.professional"),
143
- subtitle: import_utils4.locales.getText("pisell2.appointment.for.maximum.availability")
104
+ title: import_utils2.locales.getText("pisell2.appointment.any.professional"),
105
+ subtitle: import_utils2.locales.getText("pisell2.appointment.for.maximum.availability")
144
106
  }
145
107
  ];
146
- const currentResource = (0, import_react.useMemo)(() => {
147
- var _a, _b;
148
- if (resources.length && carts.length) {
149
- if (carts.length === 1) {
150
- return (_b = (_a = resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0];
151
- } else {
152
- return {
153
- renderList: []
154
- };
108
+ const appointmentBoard = (0, import_react.useMemo)(() => {
109
+ return (0, import_utils.currentAppointmentBoard)(
110
+ currentStepParams.key,
111
+ resources,
112
+ appointmentBooking
113
+ );
114
+ }, [currentStepParams.key, resources]);
115
+ const renderLists = (0, import_react.useMemo)(() => {
116
+ return (0, import_utils.currentRenderLists)(resources, appointmentBoard == null ? void 0 : appointmentBoard.form_code);
117
+ }, [resources, appointmentBoard == null ? void 0 : appointmentBoard.form_code]);
118
+ (0, import_react.useEffect)(() => {
119
+ const autoSelectResources = async () => {
120
+ if ((appointmentBoard == null ? void 0 : appointmentBoard.isRequired) || !(appointmentBoard == null ? void 0 : appointmentBoard.form_code)) {
121
+ return;
155
122
  }
156
- }
157
- }, [resources, carts]);
123
+ const res = await appointmentBooking.autoSelectAllProductResources(
124
+ appointmentBoard == null ? void 0 : appointmentBoard.form_code
125
+ );
126
+ setResourceOtherParams({
127
+ ...resourceOtherParams,
128
+ ...res
129
+ });
130
+ getResourceList();
131
+ const cartItem = carts == null ? void 0 : carts[0];
132
+ appointmentBooking.updateCart({
133
+ _id: cartItem == null ? void 0 : cartItem._id,
134
+ ...cartItem
135
+ });
136
+ };
137
+ autoSelectResources();
138
+ }, [appointmentBoard]);
158
139
  const resourcesResult = (0, import_react.useMemo)(() => {
159
- return anyResource.concat((currentResource == null ? void 0 : currentResource.renderList) || []);
160
- }, [currentResource]);
140
+ let _anyResource = (appointmentBoard == null ? void 0 : appointmentBoard.isRequired) ? [] : [...anyResource];
141
+ return _anyResource.concat(renderLists || []);
142
+ }, [renderLists, appointmentBoard]);
161
143
  const onClick = (e) => {
162
144
  var _a;
163
145
  setSelectedResource(e.id);
164
146
  if (e.id) {
165
147
  return appointmentBooking.updateCart({
166
148
  _id: (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._id,
167
- resources: [e]
149
+ resources: (0, import_utils.updateCartResources)(carts == null ? void 0 : carts[0], e)
168
150
  });
169
151
  }
170
152
  };
@@ -187,7 +169,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
187
169
  }
188
170
  );
189
171
  },
190
- columns: (0, import_utils4.isMobile)() ? 2 : 3,
172
+ columns: (0, import_utils2.isMobile)() ? 2 : 3,
191
173
  horizontalGap: 16,
192
174
  verticalGap: 16,
193
175
  onClick: (e) => onClick && onClick(e)
@@ -65,13 +65,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
65
65
  }, []);
66
66
  const getAutoSelect = async (val) => {
67
67
  setSelectedTime(val);
68
- const { resourceCodes } = getResourceList();
69
- const { errorList } = await appointmentBooking.autoSelectAllProductResources(
70
- resourceCodes == null ? void 0 : resourceCodes[1],
71
- val
72
- );
73
68
  const result = await appointmentBooking.submitTimeSlot(val);
74
- console.log(errorList, result, "wh9896788");
75
69
  };
76
70
  (0, import_react.useEffect)(() => {
77
71
  var _a, _b, _c;
@@ -81,7 +75,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
81
75
  if ((_c = carts == null ? void 0 : carts[0]) == null ? void 0 : _c.start_time) return;
82
76
  getAutoSelect(times == null ? void 0 : times[0]);
83
77
  }
84
- }, [times]);
78
+ }, [times, carts]);
85
79
  const onClick = async (e) => {
86
80
  setSelectedResource(e == null ? void 0 : e.start_time);
87
81
  getAutoSelect(e);
@@ -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;
@@ -37,11 +37,13 @@ var import_react = __toESM(require("react"));
37
37
  var import_hooks = require("./hooks");
38
38
  var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
39
39
  var import_tasks = require("../../utils/tasks");
40
+ var import_utils = require("./utils");
40
41
  var AppointmentBookingContext = (0, import_react.createContext)(void 0);
41
42
  var AppointmentBookingProvider = ({
42
43
  children
43
44
  }) => {
44
- var _a, _b, _c, _d, _e;
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
46
+ const currentSelectedResourcesRef = (0, import_react.useRef)(null);
45
47
  const policyIdsRef = (0, import_react.useRef)([]);
46
48
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
47
49
  const [summary, setSummary] = (0, import_react.useState)({});
@@ -75,14 +77,54 @@ var AppointmentBookingProvider = ({
75
77
  policyParams.callback();
76
78
  }
77
79
  };
80
+ const stepLists = (0, import_react.useMemo)(() => {
81
+ var _a2, _b2, _c2;
82
+ return ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
83
+ }, [(_d = (_c = (_b = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _b.step) == null ? void 0 : _c.store) == null ? void 0 : _d.stepList]);
78
84
  const isLastStep = (0, import_react.useMemo)(() => {
79
85
  var _a2;
80
86
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
81
87
  return key === "confirm-information";
82
88
  }, [
83
- (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key,
84
- (_e = (_d = (_c = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _c.step) == null ? void 0 : _d.store) == null ? void 0 : _e.stepList
89
+ (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key,
90
+ (_h = (_g = (_f = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _f.step) == null ? void 0 : _g.store) == null ? void 0 : _h.stepList
85
91
  ]);
92
+ const currentStepParams = (0, import_react.useMemo)(() => {
93
+ var _a2;
94
+ const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
95
+ const index = stepLists.findIndex((item) => item.key === key);
96
+ return {
97
+ key,
98
+ index,
99
+ stepLists
100
+ };
101
+ }, [(_i = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _i.key, stepLists]);
102
+ (0, import_react.useEffect)(() => {
103
+ var _a2;
104
+ if ((_a2 = currentStepParams == null ? void 0 : currentStepParams.key) == null ? void 0 : _a2.startsWith("select-resource")) {
105
+ const currentSelectedResources = carts.map((item) => {
106
+ return {
107
+ _id: item == null ? void 0 : item._id,
108
+ currentSelectedResource: (0, import_utils.getCartCurrentResourceData)(
109
+ item,
110
+ currentStepParams == null ? void 0 : currentStepParams.key,
111
+ resources
112
+ )
113
+ };
114
+ });
115
+ currentSelectedResourcesRef.current = currentSelectedResources;
116
+ appointmentBooking.setOtherData(
117
+ "current_selected_resources",
118
+ currentSelectedResources
119
+ );
120
+ }
121
+ }, [currentStepParams == null ? void 0 : currentStepParams.key, resources, carts]);
122
+ (0, import_react.useEffect)(() => {
123
+ const currentSelectedResources = appointmentBooking.getOtherData(
124
+ "current_selected_resources"
125
+ );
126
+ currentSelectedResourcesRef.current = currentSelectedResources || [];
127
+ }, []);
86
128
  const value = {
87
129
  appointmentBooking,
88
130
  times,
@@ -116,7 +158,9 @@ var AppointmentBookingProvider = ({
116
158
  policyIdsRef,
117
159
  setPolicyIds,
118
160
  openPolicy,
119
- closePolicy
161
+ closePolicy,
162
+ currentStepParams,
163
+ currentSelectedResourcesRef
120
164
  };
121
165
  return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
122
166
  };
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Deposit: (props: any) => JSX.Element;
3
4
  export default Deposit;
@@ -14,7 +14,7 @@ export declare const useAppointmentBookingStep: () => {
14
14
  removeStep: (key: string) => any;
15
15
  addStep: (props: any, stepKey?: string) => any;
16
16
  updateStep: (key: string, step: any) => void;
17
- nextStep: () => void;
17
+ nextStep: () => any;
18
18
  };
19
19
  /**
20
20
  * @title: 获取商品数据
@@ -75,7 +75,6 @@ export declare const useAppointmentBookingResource: () => {
75
75
  resources: any;
76
76
  resourceCodes: any;
77
77
  };
78
- autoSelectAllProductResources: (index?: number) => Promise<any>;
79
78
  };
80
79
  /**
81
80
  * @title: 是否跳过资源选择步骤
@@ -85,7 +84,7 @@ export declare const useAppointmentBookingResource: () => {
85
84
  * @Date: 2025-04-21 11:47
86
85
  */
87
86
  export declare const useIsSkipResourceStep: () => {
88
- checkSkipResourceStep: (isSkipUpdateFormStep?: boolean) => Promise<boolean>;
87
+ checkSkipResourceStep: () => Promise<boolean>;
89
88
  };
90
89
  /**
91
90
  * @title: 获取预约配置
@@ -48,7 +48,7 @@ var import_useEngineContext = require("../../hooks/useEngineContext");
48
48
  var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
49
49
  var import_utils2 = require("./utils");
50
50
  var import_context = require("./context");
51
- var import_utils3 = require("./components/Cart/utils");
51
+ var import_utils3 = require("./components/Resource/utils");
52
52
  var useAppointmentBooking = () => {
53
53
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
54
54
  return pisellOS.getModule("appointmentBooking");
@@ -66,8 +66,13 @@ var contextUtils = () => {
66
66
  var useAppointmentBookingStep = () => {
67
67
  var _a, _b, _c;
68
68
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
69
- const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
69
+ const { appointmentBooking, setCurrentStep, carts, openPolicy, setCarts, setLoading, currentSelectedResourcesRef, currentStepParams, setIsErrorHolder } = (0, import_context.useAppointmentBookingContext)();
70
70
  const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
71
+ const { isLogin, openLoginModal } = useAppointmentBookingLogin();
72
+ const { isFormSubject } = useAppointmentBookingSetting();
73
+ const { accountLists, getHolders, checkAccount } = useAppointmentBookingAccount();
74
+ const { getResourceList } = useAppointmentBookingResource();
75
+ const utils = contextUtils();
71
76
  const getCurrentAndLastStep = () => {
72
77
  const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
73
78
  setCurrentStep(currentStep);
@@ -114,34 +119,113 @@ var useAppointmentBookingStep = () => {
114
119
  });
115
120
  };
116
121
  const nextStep = () => {
117
- var _a2, _b2, _c2, _d;
118
- const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
119
- const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
120
- if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
121
- if ((_d = policyIdsRef == null ? void 0 : policyIdsRef.current) == null ? void 0 : _d.length) {
122
- let idx = 0;
123
- const showNextPolicy = () => {
124
- if (idx < policyIdsRef.current.length) {
125
- openPolicy({ id: policyIdsRef.current[idx] }, () => {
126
- idx++;
127
- showNextPolicy();
128
- });
129
- } else {
130
- appointmentBooking.next();
131
- }
132
- };
133
- showNextPolicy();
122
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h;
123
+ let stepList2 = (currentStepParams == null ? void 0 : currentStepParams.stepLists) || [];
124
+ const currentKey = currentStepParams == null ? void 0 : currentStepParams.key;
125
+ if (currentKey == null ? void 0 : currentKey.startsWith("select-resource")) {
126
+ const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)((currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) || [], appointmentBooking, utils);
127
+ if (hasError) {
128
+ (0, import_utils3.scrollToFirstErrorCard)();
134
129
  return;
135
130
  }
131
+ (_a2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _a2.forEach((cart) => {
132
+ var _a3, _b3;
133
+ const selectedResource2 = cart == null ? void 0 : cart.currentSelectedResource;
134
+ const resourceItem = (selectedResource2 == null ? void 0 : selectedResource2.resourceItem) || {};
135
+ const formId = (_a3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _a3.resource_form_id;
136
+ const policyId = (_b3 = selectedResource2 == null ? void 0 : selectedResource2.renderItem) == null ? void 0 : _b3.policy_id;
137
+ const formKey = `fill-form_@${resourceItem == null ? void 0 : resourceItem.form_id}-${resourceItem == null ? void 0 : resourceItem.code}-${cart == null ? void 0 : cart._id}-${formId}-${policyId}`;
138
+ if (formId) {
139
+ const description = import_utils.locales.getText("pisell2.appointment.fill-form");
140
+ const beforeKey = (0, import_utils2.getFormInsertBeforeKey)(currentKey, stepList2);
141
+ appointmentBooking.addStep({ key: formKey, description }, beforeKey);
142
+ } else {
143
+ appointmentBooking.removeStep(formKey);
144
+ }
145
+ });
146
+ const selectedResource = (_c2 = (_b2 = currentSelectedResourcesRef == null ? void 0 : currentSelectedResourcesRef.current) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.currentSelectedResource;
147
+ if (selectedResource) {
148
+ const originRenderLists = ((_d = selectedResource == null ? void 0 : selectedResource.resourceItem) == null ? void 0 : _d.originRenderLists) || [];
149
+ const currentResourceIndex = originRenderLists == null ? void 0 : originRenderLists.findIndex((item) => {
150
+ var _a3;
151
+ return item.id === ((_a3 = selectedResource == null ? void 0 : selectedResource.renderItem) == null ? void 0 : _a3.form_id);
152
+ });
153
+ const nextResource = originRenderLists == null ? void 0 : originRenderLists[currentResourceIndex + 1];
154
+ const resourceKey = `select-resource_@${nextResource == null ? void 0 : nextResource.form_id}-${nextResource == null ? void 0 : nextResource.code}`;
155
+ if (nextResource) {
156
+ const beforeKey = (_e = stepList2[stepList2.length - 2]) == null ? void 0 : _e.key;
157
+ appointmentBooking.addStep({ key: resourceKey, description: "" }, beforeKey);
158
+ } else {
159
+ appointmentBooking.removeStep(resourceKey);
160
+ }
161
+ }
162
+ }
163
+ const nextStep2 = stepList2[(currentStepParams == null ? void 0 : currentStepParams.index) + 1];
164
+ if (((_f = nextStep2 == null ? void 0 : nextStep2.key) == null ? void 0 : _f.startsWith("select-resource_")) || (nextStep2 == null ? void 0 : nextStep2.key) === "confirm-information") {
165
+ const selectedResource = (_h = (_g = currentSelectedResourcesRef.current) == null ? void 0 : _g[0]) == null ? void 0 : _h.currentSelectedResource;
166
+ const renderItem = (selectedResource == null ? void 0 : selectedResource.renderItem) || {};
167
+ const checkHolder = () => {
168
+ setLoading(false);
169
+ const { hasError, updatedCartList } = (0, import_utils2.checkAndGoNext)(isFormSubject, checkAccount, carts);
170
+ if (hasError) {
171
+ setIsErrorHolder(hasError);
172
+ setCarts(updatedCartList);
173
+ return;
174
+ }
175
+ if (!!(renderItem == null ? void 0 : renderItem.policy_id)) {
176
+ openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
177
+ return appointmentBooking.next();
178
+ });
179
+ } else {
180
+ return appointmentBooking.next();
181
+ }
182
+ };
183
+ const checkLogin = () => {
184
+ if (!isLogin) {
185
+ return openLoginModal({
186
+ callback: (status) => {
187
+ var _a3;
188
+ if (status === "success") {
189
+ if (!isFormSubject) {
190
+ const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
191
+ const currentUser = (0, import_utils2.formatCustomer)(user);
192
+ const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
193
+ appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
194
+ } else {
195
+ getHolders();
196
+ }
197
+ checkHolder();
198
+ }
199
+ }
200
+ });
201
+ } else {
202
+ return checkHolder();
203
+ }
204
+ };
205
+ if ((nextStep2 == null ? void 0 : nextStep2.key) !== "confirm-information") {
206
+ if (!(renderItem == null ? void 0 : renderItem.policy_id)) {
207
+ return appointmentBooking.next();
208
+ }
209
+ return openPolicy({ id: renderItem == null ? void 0 : renderItem.policy_id }, () => {
210
+ const cartItem = carts == null ? void 0 : carts[0];
211
+ appointmentBooking.updateCart({
212
+ _id: cartItem == null ? void 0 : cartItem._id,
213
+ ...cartItem
214
+ });
215
+ appointmentBooking.next();
216
+ });
217
+ } else {
218
+ return checkLogin();
219
+ }
136
220
  }
137
221
  appointmentBooking.next();
138
222
  };
139
223
  return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
140
224
  };
141
225
  var useAppointmentBookingProduct = () => {
142
- const { appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
226
+ const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
143
227
  const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
144
- const { bookingProcess, bookingSubject } = productModuleParams || {};
228
+ const { bookingProcess } = productModuleParams || {};
145
229
  const getProducts = async () => {
146
230
  var _a;
147
231
  if (bookingProcess === "date_first") {
@@ -170,14 +254,29 @@ var useAppointmentBookingCart = () => {
170
254
  var _a;
171
255
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
172
256
  const utils = contextUtils();
173
- const { appointmentBooking, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
257
+ const { appointmentBooking, isErrorHolder, setCarts, setSummary, setIsAgreeDepositPolicy } = (0, import_context.useAppointmentBookingContext)();
174
258
  const { bookingSubject } = ((_a = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a.productModuleParams) || {};
175
259
  const getCartAndSummary = async () => {
260
+ var _a2;
261
+ const locale = ((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("umi_locale")) || "en-US";
262
+ const symbol = (utils == null ? void 0 : utils.getSymbolic()) || "$";
176
263
  const carts = await appointmentBooking.getCart();
264
+ const accountLists = await appointmentBooking.getAccounts();
177
265
  const newCarts = carts == null ? void 0 : carts.map((item) => {
266
+ var _a3;
178
267
  return {
179
268
  ...item,
180
- addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name)
269
+ addHolderButtonText: utils == null ? void 0 : utils.translation(bookingSubject == null ? void 0 : bookingSubject.form_name),
270
+ format: ["HH:mm", "HH:mm"],
271
+ show_time: true,
272
+ duration_type: ((_a3 = item == null ? void 0 : item.duration) == null ? void 0 : _a3.type) || "minutes",
273
+ locale,
274
+ symbol,
275
+ holders: (0, import_utils2.formatHolder)(accountLists),
276
+ allowClearHolder: true,
277
+ allowClearResource: true,
278
+ isErrorHolder: isErrorHolder || false,
279
+ isMultipleResource: true
181
280
  };
182
281
  });
183
282
  setCarts(newCarts || []);
@@ -270,7 +369,7 @@ var useAppointmentBookingAccount = () => {
270
369
  return { accountLists, getHolders, form_id, addAccount, checkAccount };
271
370
  };
272
371
  var useAppointmentBookingResource = () => {
273
- const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
372
+ const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
274
373
  const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
275
374
  const getResourceList = () => {
276
375
  var _a;
@@ -292,53 +391,40 @@ var useAppointmentBookingResource = () => {
292
391
  const data = await appointmentBooking.getTimeSlotByAllResources(code);
293
392
  setTimes(data || []);
294
393
  };
295
- const autoSelectAllProductResources = async (index) => {
296
- const { resourceCodes } = getResourceList();
297
- const code = resourceCodes == null ? void 0 : resourceCodes[index || 0];
298
- const data = await appointmentBooking.getTimeSlotByAllResources(code);
299
- let res = await appointmentBooking.autoSelectAllProductResources(code);
300
- setResourceOtherParams({
301
- ...resourceOtherParams,
302
- ...res,
303
- resourceCodes
304
- });
305
- return res;
306
- };
307
- return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
394
+ return { getResourceTimeSlot, getResourceList };
308
395
  };
309
396
  var useIsSkipResourceStep = () => {
310
- var _a, _b, _c;
311
- const { currentStep, setCarts, setPolicyIds } = (0, import_context.useAppointmentBookingContext)();
312
- const { getResourceList, autoSelectAllProductResources } = useAppointmentBookingResource();
397
+ const { currentStepParams } = (0, import_context.useAppointmentBookingContext)();
398
+ const { getResourceList } = useAppointmentBookingResource();
313
399
  const { isFormSubject } = useAppointmentBookingSetting();
314
400
  const appointmentBooking = useAppointmentBooking();
315
- const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
316
- const { isLogin, openLoginModal } = useAppointmentBookingLogin();
317
- const { getHolders, checkAccount } = useAppointmentBookingAccount();
318
401
  const { nextStep } = useAppointmentBookingStep();
319
- const utils = contextUtils();
320
- const checkSkipResourceStep = async (isSkipUpdateFormStep) => {
321
- var _a2, _b2, _c2, _d, _e;
402
+ const checkSkipResourceStep = async () => {
322
403
  try {
404
+ const { resources } = getResourceList();
323
405
  const accountLists = await appointmentBooking.getAccounts();
324
- const carts = await appointmentBooking.getCart();
406
+ const { isSystem, isSkip, form_code } = (0, import_utils2.currentAppointmentBoard)(currentStepParams.key, resources, appointmentBooking);
407
+ if (isSystem) {
408
+ nextStep();
409
+ return true;
410
+ }
325
411
  if ((accountLists == null ? void 0 : accountLists.length) === 1 || isFormSubject) {
326
- const res = await autoSelectAllProductResources();
327
- const { resources } = getResourceList();
328
- if (!((_a2 = res == null ? void 0 : res.errorList) == null ? void 0 : _a2.length) && ((_e = (_d = (_c2 = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c2[0]) == null ? void 0 : _d.renderList) == null ? void 0 : _e.length) === 1) {
329
- if (!isSkipUpdateFormStep) {
330
- const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources, setPolicyIds);
331
- (0, import_utils2.checkHasFormStep)({ nextStep, isSkip: true, openLoginModal, utils, accountLists, getHolders, checkHolder: import_utils3.checkHolder, setCarts, checkAccount, carts, isFormSubject, hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0, currentStep, stepList, appointmentBooking, locales: import_utils.locales, isLogin });
332
- }
333
- return true;
412
+ const renderLists = (0, import_utils2.currentRenderLists)(resources, form_code);
413
+ let _isSkip = false;
414
+ if ((renderLists == null ? void 0 : renderLists.length) === 1) {
415
+ _isSkip = isSkip || false;
334
416
  } else {
335
- return false;
417
+ _isSkip = false;
418
+ }
419
+ if (_isSkip) {
420
+ nextStep();
421
+ return true;
336
422
  }
423
+ return _isSkip;
337
424
  } else {
338
425
  return false;
339
426
  }
340
427
  } catch (error) {
341
- console.log(error, "checkSkipResourceStep33");
342
428
  return false;
343
429
  }
344
430
  };