@pisell/private-materials 3.2.38 → 3.3.0

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 (372) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/Sales/Summary/utils.d.ts +1 -1
  8. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +6 -1
  9. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +245 -114
  10. package/es/components/appointmentBooking/components/Cart/Item/Total.js +5 -4
  11. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -2
  12. package/es/components/appointmentBooking/components/Cart/Item/index.js +98 -17
  13. package/es/components/appointmentBooking/components/Cart/Item/index.less +21 -12
  14. package/es/components/appointmentBooking/components/Cart/index.js +2 -7
  15. package/es/components/appointmentBooking/components/Cart/utils.d.ts +77 -0
  16. package/es/components/appointmentBooking/components/Cart/utils.js +408 -0
  17. package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  18. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +24 -0
  19. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +35 -0
  20. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  21. package/es/components/appointmentBooking/components/Content/index.js +76 -9
  22. package/es/components/appointmentBooking/components/Content/index.less +21 -0
  23. package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
  24. package/es/components/appointmentBooking/components/Date/index.js +131 -38
  25. package/es/components/appointmentBooking/components/Date/index.less +1 -1
  26. package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  27. package/es/components/appointmentBooking/components/Deposit/index.js +30 -0
  28. package/es/components/appointmentBooking/components/Deposit/index.less +17 -0
  29. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -1
  30. package/es/components/appointmentBooking/components/Footer/index.js +8 -2
  31. package/es/components/appointmentBooking/components/Form/index.d.ts +4 -0
  32. package/es/components/appointmentBooking/components/Form/index.js +200 -0
  33. package/es/components/appointmentBooking/components/Form/index.less +3 -0
  34. package/es/components/appointmentBooking/components/Guest/index.js +1 -1
  35. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  36. package/es/components/appointmentBooking/components/Header/index.js +53 -19
  37. package/es/components/appointmentBooking/components/Resource/index.js +67 -12
  38. package/es/components/appointmentBooking/components/Services/index.js +213 -75
  39. package/es/components/appointmentBooking/components/Services/index.less +0 -14
  40. package/es/components/appointmentBooking/components/TimeSlicing/index.js +10 -5
  41. package/es/components/appointmentBooking/components/TimeSlicing/index.less +7 -2
  42. package/es/components/appointmentBooking/components/Voucher/index.js +19 -6
  43. package/es/components/appointmentBooking/components/Voucher/index.less +93 -2
  44. package/es/components/appointmentBooking/context.d.ts +4 -4
  45. package/es/components/appointmentBooking/context.js +42 -33
  46. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  47. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +108 -0
  48. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  49. package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
  50. package/es/components/appointmentBooking/deposit/index.js +101 -0
  51. package/es/components/appointmentBooking/deposit/index.less +57 -0
  52. package/es/components/appointmentBooking/hooks.d.ts +29 -1
  53. package/es/components/appointmentBooking/hooks.js +382 -114
  54. package/es/components/appointmentBooking/index.d.ts +0 -1
  55. package/es/components/appointmentBooking/index.js +9 -4
  56. package/es/components/appointmentBooking/locales.d.ts +51 -3
  57. package/es/components/appointmentBooking/locales.js +58 -4
  58. package/es/components/appointmentBooking/utils.d.ts +66 -1
  59. package/es/components/appointmentBooking/utils.js +226 -33
  60. package/es/components/booking/addons/index.js +10 -6
  61. package/es/components/booking/components/footer/index.d.ts +0 -1
  62. package/es/components/booking/components/footer/index.js +90 -72
  63. package/es/components/booking/components/footer/utils.d.ts +11 -0
  64. package/es/components/booking/components/footer/utils.js +72 -44
  65. package/es/components/booking/components/voucher/index.js +22 -6
  66. package/es/components/booking/hooks/useCreateBookingPageHeader.js +3 -0
  67. package/es/components/booking/info/hooks/useAddHolder.d.ts +2 -0
  68. package/es/components/booking/info/hooks/useAddHolder.js +70 -0
  69. package/es/components/booking/info/hooks/useHolderConfig.d.ts +9 -0
  70. package/es/components/booking/info/hooks/useHolderConfig.js +40 -0
  71. package/es/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
  72. package/es/components/booking/info/hooks/useInfoHolder.js +99 -0
  73. package/es/components/booking/info/index.js +9 -2
  74. package/es/components/booking/info/main.js +1 -1
  75. package/es/components/booking/info/pet/index.js +18 -17
  76. package/es/components/booking/info/service/Lists.d.ts +2 -0
  77. package/es/components/booking/info/service/Lists.js +119 -0
  78. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  79. package/es/components/booking/info/service/addService/index.js +7 -5
  80. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  81. package/es/components/booking/info/service/editService/index.js +7 -5
  82. package/es/components/booking/info/service/index.js +2 -2
  83. package/es/components/booking/info/service/serviceList/index.js +1 -0
  84. package/es/components/booking/info/service/serviceManager/index.js +12 -7
  85. package/es/components/booking/info/service2/Group/utils.js +2 -1
  86. package/es/components/booking/info/service2/hooks/useSelectPet.js +13 -5
  87. package/es/components/booking/info/service2/utils.d.ts +5 -4
  88. package/es/components/booking/info/service2/utils.js +356 -88
  89. package/es/components/booking/info/utils.d.ts +2 -0
  90. package/es/components/booking/info/utils.js +45 -1
  91. package/es/components/booking/info2/index.js +9 -6
  92. package/es/components/booking/info2/serve.d.ts +2 -2
  93. package/es/components/booking/info2/serve.js +8 -15
  94. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  95. package/es/components/booking/info2/service/addService/index.js +13 -8
  96. package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
  97. package/es/components/booking/info2/service/addService/utils.js +49 -14
  98. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  99. package/es/components/booking/info2/service/addTimeModal/index.js +1 -1
  100. package/es/components/booking/info2/service/editService/Resources/index.js +6 -5
  101. package/es/components/booking/info2/service/editService/index.js +4 -3
  102. package/es/components/booking/info2/service/index.js +18 -37
  103. package/es/components/booking/info2/utils.d.ts +4 -0
  104. package/es/components/booking/info2/utils.js +43 -0
  105. package/es/components/booking/info2/utilsByBooking.js +17 -4
  106. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  107. package/es/components/booking/materiels/holder/index.js +2 -2
  108. package/es/components/booking/notes/addNote/index.d.ts +0 -1
  109. package/es/components/booking/notes/addNote/index.js +1 -1
  110. package/es/components/booking/notes/addNote/index.less +3 -0
  111. package/es/components/booking/utils.d.ts +1 -0
  112. package/es/components/booking/utils.js +20 -8
  113. package/es/components/eftposPay/amount.d.ts +1 -1
  114. package/es/components/eftposPay/device.d.ts +1 -1
  115. package/es/components/eftposPay/hooks.d.ts +1 -1
  116. package/es/components/eftposPay/store/index.d.ts +1 -1
  117. package/es/components/index.d.ts +2 -1
  118. package/es/components/index.js +2 -1
  119. package/es/components/productSelect/components/TabProduct/index.d.ts +2 -0
  120. package/es/components/productSelect/components/TabProduct/index.js +176 -0
  121. package/es/components/productSelect/components/gridLayout/index.d.ts +9 -0
  122. package/es/components/productSelect/components/gridLayout/index.js +28 -0
  123. package/es/components/productSelect/components/gridLayout/index.less +6 -0
  124. package/es/components/productSelect/components/productGroup/index.d.ts +34 -0
  125. package/es/components/productSelect/components/productGroup/index.js +145 -0
  126. package/es/components/productSelect/components/productGroup/index.less +208 -0
  127. package/es/components/productSelect/hooks/useToken.d.ts +18 -0
  128. package/es/components/productSelect/hooks/useToken.js +35 -0
  129. package/es/components/productSelect/index.d.ts +23 -0
  130. package/es/components/productSelect/index.js +93 -0
  131. package/es/components/productSelect/index.less +69 -0
  132. package/es/components/productSelect/locales.d.ts +18 -0
  133. package/es/components/productSelect/locales.js +17 -0
  134. package/es/components/productSelect/mock.d.ts +134 -0
  135. package/es/components/productSelect/mock.js +202 -0
  136. package/es/components/productSelect/theme/token.d.ts +17 -0
  137. package/es/components/productSelect/theme/token.js +19 -0
  138. package/es/components/shoppingCart/Provider.d.ts +1 -1
  139. package/es/components/shoppingCart/Provider.js +3 -1
  140. package/es/components/shoppingCart/components/Cart/Product.js +15 -3
  141. package/es/components/shoppingCart/components/Cart/index.less +15 -15
  142. package/es/components/shoppingCart/components/Render/index.less +15 -0
  143. package/es/components/shoppingCart/hooks/useAddService.js +7 -1
  144. package/es/components/shoppingCart/index.d.ts +1 -2
  145. package/es/components/shoppingCart/index.js +3 -1
  146. package/es/components/shoppingCart/status.js +4 -1
  147. package/es/components/shoppingCart/type.d.ts +5 -0
  148. package/es/components/subTotal/index.d.ts +22 -0
  149. package/es/components/subTotal/index.js +234 -0
  150. package/es/components/subTotal/index.less +70 -0
  151. package/es/components/subTotal/locales.d.ts +42 -0
  152. package/es/components/subTotal/locales.js +41 -0
  153. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  154. package/es/components/ticketBooking/components/addServiceVariant/addService.js +410 -0
  155. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +6 -0
  156. package/es/components/ticketBooking/components/addServiceVariant/index.js +28 -0
  157. package/es/components/ticketBooking/components/addServiceVariant/index.less +0 -0
  158. package/es/components/ticketBooking/components/menuBar/index.d.ts +3 -0
  159. package/es/components/ticketBooking/components/menuBar/index.js +54 -0
  160. package/es/components/ticketBooking/components/menuBar/index.less +84 -0
  161. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +3 -0
  162. package/es/components/ticketBooking/components/ticketBooking/index.js +815 -0
  163. package/es/components/ticketBooking/components/ticketBooking/index.less +18 -0
  164. package/es/components/ticketBooking/components/timeBar/index.d.ts +11 -0
  165. package/es/components/ticketBooking/components/timeBar/index.js +113 -0
  166. package/es/components/ticketBooking/components/timeBar/index.less +22 -0
  167. package/es/components/ticketBooking/data.d.ts +58 -0
  168. package/es/components/ticketBooking/data.js +58 -58
  169. package/es/components/ticketBooking/hooks/useNetworkStatus.d.ts +11 -0
  170. package/es/components/ticketBooking/hooks/useNetworkStatus.js +52 -0
  171. package/es/components/ticketBooking/index.d.ts +3 -3
  172. package/es/components/ticketBooking/index.js +139 -5
  173. package/es/components/ticketBooking/index.less +4 -0
  174. package/es/components/ticketBooking/locales.d.ts +144 -0
  175. package/es/components/ticketBooking/locales.js +143 -0
  176. package/es/components/ticketBooking/miniRedux.d.ts +22 -0
  177. package/es/components/ticketBooking/miniRedux.js +105 -0
  178. package/es/components/ticketBooking/serve.d.ts +282 -0
  179. package/es/components/ticketBooking/serve.js +957 -0
  180. package/es/components/ticketBooking/utils/index.d.ts +14 -0
  181. package/es/components/ticketBooking/utils/index.js +102 -0
  182. package/es/components/wallet/components/WalletCard.js +1 -1
  183. package/es/index.d.ts +3 -0
  184. package/es/index.js +4 -1
  185. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  186. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +6 -1
  187. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +132 -73
  188. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +31 -24
  189. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -2
  190. package/lib/components/appointmentBooking/components/Cart/Item/index.js +59 -14
  191. package/lib/components/appointmentBooking/components/Cart/Item/index.less +21 -12
  192. package/lib/components/appointmentBooking/components/Cart/index.js +2 -2
  193. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +77 -0
  194. package/lib/components/appointmentBooking/components/Cart/utils.js +273 -0
  195. package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  196. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +46 -0
  197. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +35 -0
  198. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  199. package/lib/components/appointmentBooking/components/Content/index.js +59 -5
  200. package/lib/components/appointmentBooking/components/Content/index.less +21 -0
  201. package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
  202. package/lib/components/appointmentBooking/components/Date/index.js +47 -19
  203. package/lib/components/appointmentBooking/components/Date/index.less +1 -1
  204. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  205. package/lib/components/appointmentBooking/components/Deposit/index.js +61 -0
  206. package/lib/components/appointmentBooking/components/Deposit/index.less +17 -0
  207. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -1
  208. package/lib/components/appointmentBooking/components/Footer/index.js +8 -2
  209. package/lib/components/appointmentBooking/components/Form/index.d.ts +4 -0
  210. package/lib/components/appointmentBooking/components/Form/index.js +157 -0
  211. package/lib/components/appointmentBooking/components/Form/index.less +3 -0
  212. package/lib/components/appointmentBooking/components/Guest/index.js +1 -1
  213. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  214. package/lib/components/appointmentBooking/components/Header/index.js +31 -13
  215. package/lib/components/appointmentBooking/components/Resource/index.js +36 -14
  216. package/lib/components/appointmentBooking/components/Services/index.js +86 -63
  217. package/lib/components/appointmentBooking/components/Services/index.less +0 -14
  218. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +13 -5
  219. package/lib/components/appointmentBooking/components/TimeSlicing/index.less +7 -2
  220. package/lib/components/appointmentBooking/components/Voucher/index.js +21 -6
  221. package/lib/components/appointmentBooking/components/Voucher/index.less +93 -2
  222. package/lib/components/appointmentBooking/context.d.ts +4 -4
  223. package/lib/components/appointmentBooking/context.js +15 -10
  224. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  225. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +95 -0
  226. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  227. package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
  228. package/lib/components/appointmentBooking/deposit/index.js +109 -0
  229. package/lib/components/appointmentBooking/deposit/index.less +57 -0
  230. package/lib/components/appointmentBooking/hooks.d.ts +29 -1
  231. package/lib/components/appointmentBooking/hooks.js +148 -22
  232. package/lib/components/appointmentBooking/index.d.ts +0 -1
  233. package/lib/components/appointmentBooking/index.js +6 -4
  234. package/lib/components/appointmentBooking/locales.d.ts +51 -3
  235. package/lib/components/appointmentBooking/locales.js +52 -4
  236. package/lib/components/appointmentBooking/utils.d.ts +66 -1
  237. package/lib/components/appointmentBooking/utils.js +158 -33
  238. package/lib/components/booking/addons/index.js +9 -5
  239. package/lib/components/booking/components/footer/index.d.ts +0 -1
  240. package/lib/components/booking/components/footer/index.js +94 -32
  241. package/lib/components/booking/components/footer/utils.d.ts +11 -0
  242. package/lib/components/booking/components/footer/utils.js +38 -14
  243. package/lib/components/booking/components/voucher/index.js +18 -2
  244. package/lib/components/booking/hooks/useCreateBookingPageHeader.js +3 -0
  245. package/lib/components/booking/info/hooks/useAddHolder.d.ts +2 -0
  246. package/lib/components/booking/info/hooks/useAddHolder.js +73 -0
  247. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +9 -0
  248. package/lib/components/booking/info/hooks/useHolderConfig.js +59 -0
  249. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
  250. package/lib/components/booking/info/hooks/useInfoHolder.js +106 -0
  251. package/lib/components/booking/info/index.js +5 -1
  252. package/lib/components/booking/info/main.js +1 -1
  253. package/lib/components/booking/info/pet/index.js +3 -2
  254. package/lib/components/booking/info/service/Lists.d.ts +2 -0
  255. package/lib/components/booking/info/service/Lists.js +106 -0
  256. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  257. package/lib/components/booking/info/service/addService/index.js +6 -4
  258. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  259. package/lib/components/booking/info/service/editService/index.js +5 -3
  260. package/lib/components/booking/info/service/index.js +1 -1
  261. package/lib/components/booking/info/service/serviceList/index.js +1 -0
  262. package/lib/components/booking/info/service/serviceManager/index.js +6 -1
  263. package/lib/components/booking/info/service2/Group/utils.js +2 -1
  264. package/lib/components/booking/info/service2/hooks/useSelectPet.js +13 -6
  265. package/lib/components/booking/info/service2/utils.d.ts +5 -4
  266. package/lib/components/booking/info/service2/utils.js +304 -30
  267. package/lib/components/booking/info/utils.d.ts +2 -0
  268. package/lib/components/booking/info/utils.js +40 -1
  269. package/lib/components/booking/info2/index.js +6 -1
  270. package/lib/components/booking/info2/serve.d.ts +2 -2
  271. package/lib/components/booking/info2/serve.js +3 -10
  272. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  273. package/lib/components/booking/info2/service/addService/index.js +11 -6
  274. package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
  275. package/lib/components/booking/info2/service/addService/utils.js +50 -17
  276. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  277. package/lib/components/booking/info2/service/addTimeModal/index.js +2 -2
  278. package/lib/components/booking/info2/service/editService/Resources/index.js +5 -3
  279. package/lib/components/booking/info2/service/editService/index.js +3 -1
  280. package/lib/components/booking/info2/service/index.js +18 -28
  281. package/lib/components/booking/info2/utils.d.ts +4 -0
  282. package/lib/components/booking/info2/utils.js +65 -0
  283. package/lib/components/booking/info2/utilsByBooking.js +12 -3
  284. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  285. package/lib/components/booking/materiels/holder/index.js +2 -2
  286. package/lib/components/booking/notes/addNote/index.d.ts +0 -1
  287. package/lib/components/booking/notes/addNote/index.js +1 -1
  288. package/lib/components/booking/notes/addNote/index.less +3 -0
  289. package/lib/components/booking/utils.d.ts +1 -0
  290. package/lib/components/booking/utils.js +25 -10
  291. package/lib/components/eftposPay/amount.d.ts +1 -1
  292. package/lib/components/eftposPay/device.d.ts +1 -1
  293. package/lib/components/eftposPay/hooks.d.ts +1 -1
  294. package/lib/components/eftposPay/store/index.d.ts +1 -1
  295. package/lib/components/index.d.ts +2 -1
  296. package/lib/components/index.js +3 -0
  297. package/lib/components/productSelect/components/TabProduct/index.d.ts +2 -0
  298. package/lib/components/productSelect/components/TabProduct/index.js +172 -0
  299. package/lib/components/productSelect/components/gridLayout/index.d.ts +9 -0
  300. package/lib/components/productSelect/components/gridLayout/index.js +58 -0
  301. package/lib/components/productSelect/components/gridLayout/index.less +6 -0
  302. package/lib/components/productSelect/components/productGroup/index.d.ts +34 -0
  303. package/lib/components/productSelect/components/productGroup/index.js +122 -0
  304. package/lib/components/productSelect/components/productGroup/index.less +208 -0
  305. package/lib/components/productSelect/hooks/useToken.d.ts +18 -0
  306. package/lib/components/productSelect/hooks/useToken.js +51 -0
  307. package/lib/components/productSelect/index.d.ts +23 -0
  308. package/lib/components/productSelect/index.js +119 -0
  309. package/lib/components/productSelect/index.less +69 -0
  310. package/lib/components/productSelect/locales.d.ts +18 -0
  311. package/lib/components/productSelect/locales.js +41 -0
  312. package/lib/components/productSelect/mock.d.ts +134 -0
  313. package/lib/components/productSelect/mock.js +276 -0
  314. package/lib/components/productSelect/theme/token.d.ts +17 -0
  315. package/lib/components/productSelect/theme/token.js +47 -0
  316. package/lib/components/shoppingCart/Provider.d.ts +1 -1
  317. package/lib/components/shoppingCart/Provider.js +3 -1
  318. package/lib/components/shoppingCart/components/Cart/Product.js +14 -3
  319. package/lib/components/shoppingCart/components/Cart/index.less +15 -15
  320. package/lib/components/shoppingCart/components/Render/index.less +15 -0
  321. package/lib/components/shoppingCart/hooks/useAddService.js +1 -2
  322. package/lib/components/shoppingCart/index.d.ts +1 -2
  323. package/lib/components/shoppingCart/index.js +2 -0
  324. package/lib/components/shoppingCart/status.js +4 -1
  325. package/lib/components/shoppingCart/type.d.ts +5 -0
  326. package/lib/components/subTotal/index.d.ts +22 -0
  327. package/lib/components/subTotal/index.js +175 -0
  328. package/lib/components/subTotal/index.less +70 -0
  329. package/lib/components/subTotal/locales.d.ts +42 -0
  330. package/lib/components/subTotal/locales.js +65 -0
  331. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  332. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +318 -0
  333. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +6 -0
  334. package/lib/components/ticketBooking/components/addServiceVariant/index.js +56 -0
  335. package/lib/components/ticketBooking/components/addServiceVariant/index.less +0 -0
  336. package/lib/components/ticketBooking/components/menuBar/index.d.ts +3 -0
  337. package/lib/components/ticketBooking/components/menuBar/index.js +87 -0
  338. package/lib/components/ticketBooking/components/menuBar/index.less +84 -0
  339. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +3 -0
  340. package/lib/components/ticketBooking/components/ticketBooking/index.js +769 -0
  341. package/lib/components/ticketBooking/components/ticketBooking/index.less +18 -0
  342. package/lib/components/ticketBooking/components/timeBar/index.d.ts +11 -0
  343. package/lib/components/ticketBooking/components/timeBar/index.js +148 -0
  344. package/lib/components/ticketBooking/components/timeBar/index.less +22 -0
  345. package/lib/components/ticketBooking/data.d.ts +58 -0
  346. package/lib/components/ticketBooking/hooks/useNetworkStatus.d.ts +11 -0
  347. package/lib/components/ticketBooking/hooks/useNetworkStatus.js +80 -0
  348. package/lib/components/ticketBooking/index.d.ts +3 -3
  349. package/lib/components/ticketBooking/index.js +159 -3
  350. package/lib/components/ticketBooking/index.less +4 -0
  351. package/lib/components/ticketBooking/locales.d.ts +144 -0
  352. package/lib/components/ticketBooking/locales.js +167 -0
  353. package/lib/components/ticketBooking/miniRedux.d.ts +22 -0
  354. package/lib/components/ticketBooking/miniRedux.js +96 -0
  355. package/lib/components/ticketBooking/serve.d.ts +282 -0
  356. package/lib/components/ticketBooking/serve.js +214 -0
  357. package/lib/components/ticketBooking/utils/index.d.ts +14 -0
  358. package/lib/components/ticketBooking/utils/index.js +131 -0
  359. package/lib/components/wallet/components/WalletCard.js +1 -1
  360. package/lib/index.d.ts +3 -0
  361. package/lib/index.js +9 -0
  362. package/lowcode/appointment-deposit/meta.ts +58 -0
  363. package/lowcode/product-select/meta.ts +217 -0
  364. package/lowcode/sub-total/meta.ts +134 -0
  365. package/lowcode/ticket-booking/meta.ts +29 -0
  366. package/package.json +2 -2
  367. package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +0 -47
  368. package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +0 -115
  369. package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +0 -52
  370. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +0 -47
  371. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +0 -109
  372. package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +0 -52
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from 'antd';
3
2
  interface HolderProps extends SelectProps {
4
3
  selectProps?: SelectProps;
@@ -25,12 +25,12 @@ var Holder = function Holder(props) {
25
25
  */
26
26
  var holders = useMemo(function () {
27
27
  var lists = holderLists === null || holderLists === void 0 ? void 0 : holderLists.filter(function (d) {
28
- return (d === null || d === void 0 ? void 0 : d.id) > 0;
28
+ return ((d === null || d === void 0 ? void 0 : d.id) || (d === null || d === void 0 ? void 0 : d.form_record_id)) > 0;
29
29
  });
30
30
  if (!(lists !== null && lists !== void 0 && lists.length)) return [];
31
31
  return lists.map(function (d) {
32
32
  return {
33
- value: d === null || d === void 0 ? void 0 : d.id,
33
+ value: (d === null || d === void 0 ? void 0 : d.id) || (d === null || d === void 0 ? void 0 : d.form_record_id),
34
34
  label: d === null || d === void 0 ? void 0 : d.main_field
35
35
  };
36
36
  });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const AddNote: ({ value, onChange, wait, title, placeholder }: any) => JSX.Element;
4
3
  export default AddNote;
@@ -35,7 +35,7 @@ var AddNote = function AddNote(_ref) {
35
35
  }
36
36
  }, [debouncedValue]);
37
37
  return /*#__PURE__*/React.createElement("div", {
38
- className: ""
38
+ className: "pisell-lowcode__booking-notes"
39
39
  }, /*#__PURE__*/React.createElement("div", {
40
40
  className: "pisell-lowcode__booking-notes-label"
41
41
  }, title), /*#__PURE__*/React.createElement("div", {
@@ -1,3 +1,6 @@
1
+ .pisell-lowcode__booking-notes {
2
+ padding: 20px 0;
3
+ }
1
4
  .pisell-lowcode__booking-notes-label {
2
5
  font-size: 16px;
3
6
  font-weight: 500;
@@ -140,6 +140,7 @@ export declare const deleteCacheParams: () => void;
140
140
  * @Date: 2024-12-01 22:43
141
141
  */
142
142
  export declare const getDays: (cacheItem: any, type: 'minutes' | 'days') => any;
143
+ export declare const isSessionProduct: (cacheItem: any) => boolean;
143
144
  /**
144
145
  * @title: 创建一个服务商品
145
146
  * @description:
@@ -263,8 +263,7 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
263
263
  if (time.max_participants_limit == 0) {
264
264
  isMaxLimitRange = true;
265
265
  } else {
266
- // unknown 为 未知的, 需要掉接口确认是否可用
267
- isMaxLimitRange = 'unknown';
266
+ isMaxLimitRange = time.order_event_count < time.max_participants_limit;
268
267
  }
269
268
  var timeStartDate = dayjs(time.start_date + ' ' + time.start_time).subtract(1, 'second');
270
269
  var timeEndDate = dayjs(time.end_date + ' ' + time.end_time).add(1, 'second');
@@ -555,7 +554,7 @@ export var getErrorList = function getErrorList(resource, cacheItem, isDay) {
555
554
  * @Date: 2024-01-09 13:40
556
555
  */
557
556
  export var formatResource = function formatResource(resourceItem, cacheItem, formatLabel) {
558
- var _cacheItem$_extend3;
557
+ var _resourceItem$_extend, _cacheItem$_extend3;
559
558
  // 当前资源
560
559
  var _resourceItem = _objectSpread({}, resourceItem);
561
560
 
@@ -567,12 +566,12 @@ export var formatResource = function formatResource(resourceItem, cacheItem, for
567
566
 
568
567
  // 格式化label
569
568
  _resourceItem.labelText = _resourceItem.room_name || _resourceItem.name;
570
- var usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
569
+ var usable = _resourceItem._extend.usableTime && ((_resourceItem$_extend = _resourceItem._extend.usableTime._extend) === null || _resourceItem$_extend === void 0 ? void 0 : _resourceItem$_extend.isMaxLimitRange) && _resourceItem._extend.usableProduct;
571
570
 
572
571
  // 跨日预约
573
572
  if ((cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend3 = cacheItem._extend) === null || _cacheItem$_extend3 === void 0 ? void 0 : _cacheItem$_extend3.sub_type) === 'days') {
574
- var _resourceItem$_extend, _resourceItem$_extend2;
575
- usable = ((_resourceItem$_extend = _resourceItem._extend) === null || _resourceItem$_extend === void 0 || (_resourceItem$_extend = _resourceItem$_extend.usableTime) === null || _resourceItem$_extend === void 0 ? void 0 : _resourceItem$_extend.isUsable) && ((_resourceItem$_extend2 = _resourceItem._extend) === null || _resourceItem$_extend2 === void 0 ? void 0 : _resourceItem$_extend2.usableProduct);
573
+ var _resourceItem$_extend2, _resourceItem$_extend3;
574
+ usable = ((_resourceItem$_extend2 = _resourceItem._extend) === null || _resourceItem$_extend2 === void 0 || (_resourceItem$_extend2 = _resourceItem$_extend2.usableTime) === null || _resourceItem$_extend2 === void 0 ? void 0 : _resourceItem$_extend2.isUsable) && ((_resourceItem$_extend3 = _resourceItem._extend) === null || _resourceItem$_extend3 === void 0 ? void 0 : _resourceItem$_extend3.usableProduct);
576
575
  }
577
576
  _resourceItem.usable = usable;
578
577
  if (formatLabel) {
@@ -616,6 +615,9 @@ export var getDays = function getDays(cacheItem, type) {
616
615
  var endDate = dayjs((_cacheItem$_extend5 = cacheItem._extend) === null || _cacheItem$_extend5 === void 0 ? void 0 : _cacheItem$_extend5.end_date);
617
616
  return endDate.diff(startDate, type);
618
617
  };
618
+ export var isSessionProduct = function isSessionProduct(cacheItem) {
619
+ return ['session_product', 'session_ticket'].includes(cacheItem.extension_type);
620
+ };
619
621
 
620
622
  /**
621
623
  * @title: 创建一个服务商品
@@ -627,19 +629,29 @@ export var getDays = function getDays(cacheItem, type) {
627
629
  * @Date: 2024-01-26 14:09
628
630
  */
629
631
  export var getServerItemExtend = function getServerItemExtend(state, cacheItem, timeObj) {
630
- var _cacheItem$duration;
631
632
  // 编辑直接返回原数据
632
633
  if (!cacheItem.new && cacheItem._extend.endDate) {
633
634
  return cacheItem._extend;
634
635
  }
636
+ var isSession = isSessionProduct(cacheItem);
635
637
  var isDay = isDayBooking(state);
638
+ var setDuration = function setDuration() {
639
+ var _cacheItem$duration;
640
+ if (isDay) {
641
+ return getDays(cacheItem, 'days');
642
+ }
643
+ if (isSession) {
644
+ return getDays(cacheItem, 'minutes');
645
+ }
646
+ return findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value);
647
+ };
636
648
 
637
649
  // 获取上一个服务商品
638
650
  var lastServer = isDay ? false : getLastServer(state.service.value);
639
651
 
640
652
  // 下一个商品的扩展参数
641
653
  var _extend = {
642
- duration: isDay ? getDays(cacheItem, 'days') : findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 || (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
654
+ duration: setDuration()
643
655
  };
644
656
 
645
657
  // 如果有上一个商品, 将上一个商品的某些参数 设置到新商品上
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "tyro" | "windcave" | "payo" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
301
301
  action?: "amount" | "deviceList" | "pay" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -14,4 +14,5 @@ import WalletList from './walletList';
14
14
  import WorkspaceListDetail from './workSpaceListDetail/';
15
15
  import WorkspaceList from './workSpaceList';
16
16
  import PisellSelectCustomerModal from './pisellSelectCustomerModal';
17
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, };
17
+ import SubTotal from './subTotal';
18
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, };
@@ -14,4 +14,5 @@ import WalletList from "./walletList";
14
14
  import WorkspaceListDetail from "./workSpaceListDetail/";
15
15
  import WorkspaceList from "./workSpaceList";
16
16
  import PisellSelectCustomerModal from "./pisellSelectCustomerModal";
17
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail };
17
+ import SubTotal from "./subTotal";
18
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal };
@@ -0,0 +1,2 @@
1
+ declare const TabProduct: (props: any) => JSX.Element;
2
+ export default TabProduct;
@@ -0,0 +1,176 @@
1
+ var _excluded = ["showTab", "layout", "list", "onChange", "amountSymbol", "scrollDom", "value", "loading", "emptyDescription"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
13
+ import { Skeleton } from 'antd';
14
+ import { PisellEmpty } from '@pisell/materials';
15
+ import { useMemoizedFn } from 'ahooks';
16
+ import { locales } from '@pisell/utils';
17
+ import Tabs from "../../../booking/components/TabProduct/tabs";
18
+ import ProductGroup, { ProductGroupSkeleton } from "../productGroup";
19
+ var io = null;
20
+ var TabProduct = function TabProduct(props) {
21
+ var _props$showTab = props.showTab,
22
+ showTab = _props$showTab === void 0 ? true : _props$showTab,
23
+ layout = props.layout,
24
+ list = props.list,
25
+ onChange = props.onChange,
26
+ _props$amountSymbol = props.amountSymbol,
27
+ amountSymbol = _props$amountSymbol === void 0 ? '$' : _props$amountSymbol,
28
+ scrollDom = props.scrollDom,
29
+ currentProductId = props.value,
30
+ loading = props.loading,
31
+ emptyDescription = props.emptyDescription,
32
+ rest = _objectWithoutProperties(props, _excluded);
33
+ var tabsRef = useRef();
34
+ var _useState = useState(1),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ currentGroupId = _useState2[0],
37
+ setCurrentGroupId = _useState2[1];
38
+ useEffect(function () {
39
+ if (list !== null && list !== void 0 && list.length) {
40
+ setCurrentGroupId(list[0].id);
41
+ handleObserver();
42
+ }
43
+ }, [list]);
44
+ var handleObserver = useMemoizedFn(function () {
45
+ var _marginTop = 270;
46
+ var _marginBottom = window.innerHeight - 70 - 200 - 70;
47
+ var _rootMargin = "".concat(_marginTop * -1, "px 0px ").concat(_marginBottom * -1, "px 0px");
48
+ io = new IntersectionObserver(function (entries) {
49
+ if (entries[0].isIntersecting) {
50
+ var _entries$, _tabsRef$current;
51
+ var _entries$0$target$id$ = (_entries$ = entries[0]) === null || _entries$ === void 0 || (_entries$ = _entries$.target) === null || _entries$ === void 0 || (_entries$ = _entries$.id) === null || _entries$ === void 0 ? void 0 : _entries$.split('-'),
52
+ _entries$0$target$id$2 = _slicedToArray(_entries$0$target$id$, 2),
53
+ name = _entries$0$target$id$2[0],
54
+ id = _entries$0$target$id$2[1];
55
+ setCurrentGroupId(Number(id));
56
+ tabsRef === null || tabsRef === void 0 || (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 || _tabsRef$current.scroll(id);
57
+ }
58
+ }, {
59
+ root: null,
60
+ rootMargin: _rootMargin
61
+ });
62
+ if (list !== null && list !== void 0 && list.length) {
63
+ var _iterator = _createForOfIteratorHelper(list),
64
+ _step;
65
+ try {
66
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
67
+ var item = _step.value;
68
+ var _item = document.querySelector("#list-".concat(item.id));
69
+ if (_item) {
70
+ io.observe(_item);
71
+ }
72
+ }
73
+ } catch (err) {
74
+ _iterator.e(err);
75
+ } finally {
76
+ _iterator.f();
77
+ }
78
+ }
79
+ });
80
+ var handleUnobserver = useMemoizedFn(function () {
81
+ if (list !== null && list !== void 0 && list.length && io) {
82
+ var _iterator2 = _createForOfIteratorHelper(list),
83
+ _step2;
84
+ try {
85
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
86
+ var item = _step2.value;
87
+ var _item = document.querySelector("#list-".concat(item.id));
88
+ if (_item) {
89
+ io.unobserve(_item);
90
+ }
91
+ }
92
+ } catch (err) {
93
+ _iterator2.e(err);
94
+ } finally {
95
+ _iterator2.f();
96
+ }
97
+ }
98
+ });
99
+ var renderContent = function renderContent() {
100
+ if (loading) {
101
+ return /*#__PURE__*/React.createElement(ProductGroupSkeleton, {
102
+ layout: layout
103
+ });
104
+ }
105
+ if (!(list !== null && list !== void 0 && list.length)) {
106
+ return /*#__PURE__*/React.createElement(PisellEmpty, {
107
+ description: emptyDescription || locales.getText('pisell2.product-select.empty')
108
+ });
109
+ }
110
+ return list.map(function (item, i) {
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ id: "list-".concat(item.id),
113
+ key: i
114
+ }, /*#__PURE__*/React.createElement(ProductGroup, _extends({
115
+ onSelectProduct: onChange,
116
+ currentProductId: currentProductId,
117
+ key: item.id,
118
+ data: item,
119
+ layout: layout
120
+ }, rest)));
121
+ });
122
+ };
123
+ var tabSkeleton = useMemo(function () {
124
+ return /*#__PURE__*/React.createElement("div", {
125
+ className: "booking-pisell-tabs"
126
+ }, /*#__PURE__*/React.createElement("div", {
127
+ className: "booking-pisell-tabs-btn-left",
128
+ style: {
129
+ marginLeft: 20,
130
+ width: 0
131
+ }
132
+ }), /*#__PURE__*/React.createElement("div", {
133
+ className: "booking-pisell-tabs-content"
134
+ }, /*#__PURE__*/React.createElement(Skeleton.Button, {
135
+ active: true,
136
+ size: 'large',
137
+ shape: 'round'
138
+ })));
139
+ }, []);
140
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showTab ? /*#__PURE__*/React.createElement("div", {
141
+ className: "pisell-product-select-tabs-wrapper"
142
+ }, loading ? tabSkeleton : /*#__PURE__*/React.createElement(Tabs, {
143
+ ref: tabsRef,
144
+ options: list,
145
+ rowKey: 'id',
146
+ tab: currentGroupId,
147
+ onChange: function onChange(e) {
148
+ var _document, _document2;
149
+ var comWrapper = document.querySelector(".pisell-product-select-wrapper");
150
+ var categoryDom = document.querySelector('.pisell-product-select-tabs-wrapper');
151
+ var wrapperOffsetTop = comWrapper.offsetTop;
152
+ var top = 0;
153
+ if (categoryDom) {
154
+ top = categoryDom.offsetHeight;
155
+ }
156
+ var dom = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector('#list-' + e);
157
+ var main = (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector(scrollDom);
158
+ if (dom && main) {
159
+ var _list$;
160
+ if (e === ((_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.id)) {
161
+ main.scrollTop = 0;
162
+ } else {
163
+ main.scrollTop = dom.offsetTop - top - wrapperOffsetTop;
164
+ }
165
+ }
166
+ handleUnobserver();
167
+ setCurrentGroupId(e);
168
+ setTimeout(function () {
169
+ handleObserver();
170
+ }, 1000);
171
+ }
172
+ })) : null, /*#__PURE__*/React.createElement("div", {
173
+ className: "pisell-product-select-product-list"
174
+ }, renderContent()));
175
+ };
176
+ export default TabProduct;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface GridLayoutProps {
4
+ gridConfig?: string;
5
+ items: any[];
6
+ renderItem: (item: any) => React.ReactNode;
7
+ }
8
+ declare const GridLayout: React.FC<GridLayoutProps>;
9
+ export default GridLayout;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { Row, Col } from '@pisell/materials';
3
+ import "./index.less";
4
+ var GridLayout = function GridLayout(_ref) {
5
+ var gridConfig = _ref.gridConfig,
6
+ items = _ref.items,
7
+ renderItem = _ref.renderItem;
8
+ var gridColumns = React.useMemo(function () {
9
+ if (!gridConfig) return [];
10
+ var columns = gridConfig.split(':').map(Number);
11
+ var isValid = columns.every(function (col) {
12
+ return col > 0 && Number.isInteger(col);
13
+ }) && columns.reduce(function (sum, col) {
14
+ return sum + col;
15
+ }, 0) <= 24;
16
+ return isValid ? columns : [12, 12];
17
+ }, [gridConfig]);
18
+ return /*#__PURE__*/React.createElement(Row, {
19
+ gutter: [12, 12],
20
+ className: "pisell-product-select-grid-layout"
21
+ }, items.map(function (item, index) {
22
+ return /*#__PURE__*/React.createElement(Col, {
23
+ key: index,
24
+ span: gridColumns.length > 0 ? gridColumns[index % gridColumns.length] : 12
25
+ }, renderItem(item));
26
+ }));
27
+ };
28
+ export default GridLayout;
@@ -0,0 +1,6 @@
1
+ .pisell-product-select-grid-layout {
2
+ // display: flex;
3
+ // flex-wrap: wrap;
4
+ // margin: 0 -6px;
5
+ // row-gap: 12px;
6
+ }
@@ -0,0 +1,34 @@
1
+ import './index.less';
2
+ export interface ProductCardConfig {
3
+ showImg: boolean;
4
+ imgWidth: string;
5
+ imgHeight: string;
6
+ showTitle: boolean;
7
+ showSpec: boolean;
8
+ showTags: boolean;
9
+ showPrice: boolean;
10
+ showOriginalPrice: boolean;
11
+ showZeroPrice: boolean;
12
+ showMarketingTag: boolean;
13
+ showRemark: boolean;
14
+ showStock: boolean;
15
+ }
16
+ interface ProductGroupProps {
17
+ data: {
18
+ icon: string;
19
+ id: number;
20
+ name: string;
21
+ products: any[];
22
+ slug: string;
23
+ sort: number;
24
+ };
25
+ layout: {
26
+ grid: boolean;
27
+ config?: string;
28
+ };
29
+ onSelectProduct?: (id: number) => void;
30
+ currentProductId?: number;
31
+ }
32
+ declare const ProductGroup: ({ data, layout, onSelectProduct, currentProductId, showImg, imgWidth, imgHeight, showTitle, showSpec, showTags, showPrice, showOriginalPrice, showZeroPrice, showMarketingTag, showRemark, showStock, }: ProductGroupProps & ProductCardConfig) => JSX.Element;
33
+ export declare const ProductGroupSkeleton: ({ layout }: any) => JSX.Element;
34
+ export default ProductGroup;
@@ -0,0 +1,145 @@
1
+ import React, { useMemo } from 'react';
2
+ import classNames from 'classnames';
3
+ import GridLayout from "../gridLayout";
4
+ import { PisellText } from '@pisell/materials';
5
+ import { locales } from '@pisell/utils';
6
+ import { Skeleton } from 'antd';
7
+ import "./index.less";
8
+ var ProductGroup = function ProductGroup(_ref) {
9
+ var data = _ref.data,
10
+ _ref$layout = _ref.layout,
11
+ layout = _ref$layout === void 0 ? {
12
+ grid: false
13
+ } : _ref$layout,
14
+ onSelectProduct = _ref.onSelectProduct,
15
+ currentProductId = _ref.currentProductId,
16
+ _ref$showImg = _ref.showImg,
17
+ showImg = _ref$showImg === void 0 ? true : _ref$showImg,
18
+ _ref$imgWidth = _ref.imgWidth,
19
+ imgWidth = _ref$imgWidth === void 0 ? '180px' : _ref$imgWidth,
20
+ _ref$imgHeight = _ref.imgHeight,
21
+ imgHeight = _ref$imgHeight === void 0 ? '126px' : _ref$imgHeight,
22
+ _ref$showTitle = _ref.showTitle,
23
+ showTitle = _ref$showTitle === void 0 ? true : _ref$showTitle,
24
+ _ref$showSpec = _ref.showSpec,
25
+ showSpec = _ref$showSpec === void 0 ? true : _ref$showSpec,
26
+ _ref$showTags = _ref.showTags,
27
+ showTags = _ref$showTags === void 0 ? true : _ref$showTags,
28
+ _ref$showPrice = _ref.showPrice,
29
+ showPrice = _ref$showPrice === void 0 ? true : _ref$showPrice,
30
+ _ref$showOriginalPric = _ref.showOriginalPrice,
31
+ showOriginalPrice = _ref$showOriginalPric === void 0 ? true : _ref$showOriginalPric,
32
+ _ref$showZeroPrice = _ref.showZeroPrice,
33
+ showZeroPrice = _ref$showZeroPrice === void 0 ? false : _ref$showZeroPrice,
34
+ _ref$showMarketingTag = _ref.showMarketingTag,
35
+ showMarketingTag = _ref$showMarketingTag === void 0 ? true : _ref$showMarketingTag,
36
+ _ref$showRemark = _ref.showRemark,
37
+ showRemark = _ref$showRemark === void 0 ? true : _ref$showRemark,
38
+ _ref$showStock = _ref.showStock,
39
+ showStock = _ref$showStock === void 0 ? true : _ref$showStock;
40
+ var _products = useMemo(function () {
41
+ var products = data.products;
42
+ return products;
43
+ }, [data]);
44
+ var getStockText = function getStockText(item) {
45
+ if (item.is_track === 0) {
46
+ return false;
47
+ }
48
+ return "".concat(locales.getText('pisell2.product-select.stock'), "\uFF1A").concat(item.stock_quantity);
49
+ };
50
+ var renderPrice = function renderPrice(item) {
51
+ if (!showZeroPrice && !parseFloat(item.price)) return null;
52
+ return showPrice || showOriginalPrice ? /*#__PURE__*/React.createElement("div", {
53
+ className: "price-info"
54
+ }, showPrice ? /*#__PURE__*/React.createElement("div", {
55
+ className: "price"
56
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
57
+ value: item.price
58
+ })) : null, showOriginalPrice && parseFloat(item.original_price) ? /*#__PURE__*/React.createElement("div", {
59
+ className: "original-price"
60
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
61
+ value: item.original_price
62
+ })) : null) : null;
63
+ };
64
+ var renderItem = function renderItem(item) {
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: classNames('product-card', {
67
+ selected: currentProductId && item.id === currentProductId
68
+ }),
69
+ onClick: function onClick() {
70
+ onSelectProduct === null || onSelectProduct === void 0 || onSelectProduct(item);
71
+ }
72
+ }, showImg && item.cover ? /*#__PURE__*/React.createElement("div", {
73
+ className: "card-left",
74
+ style: {
75
+ width: imgWidth || 'auto',
76
+ height: imgHeight || 'auto'
77
+ }
78
+ }, /*#__PURE__*/React.createElement("img", {
79
+ src: item.cover
80
+ })) : null, /*#__PURE__*/React.createElement("div", {
81
+ className: "card-right"
82
+ }, showTitle ? /*#__PURE__*/React.createElement("div", {
83
+ className: "title"
84
+ }, item.title) : null, showStock && !!item.is_track ? /*#__PURE__*/React.createElement("div", {
85
+ className: "stock"
86
+ }, getStockText(item)) : null, renderPrice(item)));
87
+ };
88
+ return /*#__PURE__*/React.createElement("div", {
89
+ "data-section": data.id,
90
+ className: "pisell-product-select-group"
91
+ }, /*#__PURE__*/React.createElement("div", {
92
+ className: "group-title"
93
+ }, data.name), /*#__PURE__*/React.createElement("div", {
94
+ style: {
95
+ padding: '16px 0'
96
+ }
97
+ }, layout !== null && layout !== void 0 && layout.grid && layout.config ? /*#__PURE__*/React.createElement(GridLayout, {
98
+ gridConfig: layout.config,
99
+ items: _products,
100
+ renderItem: renderItem
101
+ }) : /*#__PURE__*/React.createElement("div", {
102
+ className: "group-row"
103
+ }, _products.map(function (item) {
104
+ return renderItem(item);
105
+ }))));
106
+ };
107
+ export var ProductGroupSkeleton = function ProductGroupSkeleton(_ref2) {
108
+ var layout = _ref2.layout;
109
+ var renderItem = function renderItem() {
110
+ return /*#__PURE__*/React.createElement("div", {
111
+ className: classNames('product-card')
112
+ }, /*#__PURE__*/React.createElement(Skeleton.Image, {
113
+ active: true,
114
+ style: {
115
+ width: 180,
116
+ height: 126
117
+ }
118
+ }), /*#__PURE__*/React.createElement(Skeleton, {
119
+ active: true,
120
+ paragraph: {
121
+ rows: 2
122
+ }
123
+ }));
124
+ };
125
+ return /*#__PURE__*/React.createElement("div", {
126
+ className: "pisell-product-select-group"
127
+ }, /*#__PURE__*/React.createElement(Skeleton.Input, {
128
+ active: true,
129
+ size: "small",
130
+ block: false
131
+ }), /*#__PURE__*/React.createElement("div", {
132
+ style: {
133
+ padding: '16px 0'
134
+ }
135
+ }, layout !== null && layout !== void 0 && layout.grid && layout.config ? /*#__PURE__*/React.createElement(GridLayout, {
136
+ gridConfig: layout.config,
137
+ items: [1, 2],
138
+ renderItem: renderItem
139
+ }) : /*#__PURE__*/React.createElement("div", {
140
+ className: "group-row"
141
+ }, [1, 2, 3].map(function (item) {
142
+ return renderItem();
143
+ }))));
144
+ };
145
+ export default ProductGroup;