@pisell/private-materials 6.5.3 → 6.5.5

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 (461) 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/preview.js +150 -150
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  12. package/es/components/booking/addons/model.d.ts +10 -1
  13. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  14. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  15. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  16. package/es/components/booking/components/actionButtons/index.js +37 -42
  17. package/es/components/booking/components/actionButtons/index.less +0 -28
  18. package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
  19. package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
  20. package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  21. package/es/components/booking/components/footer/amount.d.ts +3 -3
  22. package/es/components/booking/components/footer/amount.js +52 -31
  23. package/es/components/booking/components/footer/index.js +168 -68
  24. package/es/components/booking/components/footer/utils.js +62 -33
  25. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  26. package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  27. package/es/components/booking/deposit/index.d.ts +0 -1
  28. package/es/components/booking/forms/model.d.ts +10 -1
  29. package/es/components/booking/forms/single/index.d.ts +0 -1
  30. package/es/components/booking/forms/table/index.d.ts +0 -1
  31. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  32. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  33. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  34. package/es/components/booking/info/date/index.d.ts +0 -1
  35. package/es/components/booking/info/header/index.d.ts +0 -1
  36. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  37. package/es/components/booking/info/index.d.ts +0 -1
  38. package/es/components/booking/info/model.d.ts +10 -1
  39. package/es/components/booking/info/model.js +5 -0
  40. package/es/components/booking/info/notes/index.d.ts +0 -1
  41. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  42. package/es/components/booking/info/service/addService/index.js +2 -1
  43. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  44. package/es/components/booking/info/service/like/index.d.ts +0 -1
  45. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  46. package/es/components/booking/info/service2/utils.d.ts +1 -1
  47. package/es/components/booking/info2/index.js +42 -2
  48. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  49. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  50. package/es/components/booking/info2/service/addService/index.js +2 -1
  51. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  52. package/es/components/booking/info2/service/editService/index.js +12 -4
  53. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  54. package/es/components/booking/materiels/contacts/index.d.ts +0 -1
  55. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  56. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  57. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  58. package/es/components/booking/model.d.ts +9 -1
  59. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  60. package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
  61. package/es/components/booking/notes/addNote/index.d.ts +0 -1
  62. package/es/components/booking/notes/model.d.ts +10 -1
  63. package/es/components/booking/payments/model.d.ts +10 -1
  64. package/es/components/booking/utils.js +10 -5
  65. package/es/components/checkout/PaymentModal.d.ts +2 -0
  66. package/es/components/checkout/PaymentModal.js +402 -241
  67. package/es/components/checkout/PaymentPlugin.d.ts +0 -1
  68. package/es/components/checkout/components/AdditionalModule/index.less +1 -1
  69. package/es/components/checkout/components/AmountSummary/index.js +161 -54
  70. package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  71. package/es/components/checkout/components/CashPaymentModule/index.js +114 -131
  72. package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
  73. package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
  74. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  75. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +210 -0
  76. package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  77. package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
  78. package/es/components/checkout/components/PaymentOptionsModule/index.less +29 -0
  79. package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  80. package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
  81. package/es/components/checkout/components/WalletPassModule/index.js +4 -3
  82. package/es/components/checkout/components/WalletPassModule/utils.js +6 -1
  83. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  84. package/es/components/checkout/hooks/useWalletPass.js +2 -0
  85. package/es/components/checkout/index.less +1 -1
  86. package/es/components/checkout/locales.d.ts +33 -0
  87. package/es/components/checkout/locales.js +39 -3
  88. package/es/components/checkout/types.d.ts +1 -0
  89. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  90. package/es/components/eftpos/form/index.d.ts +0 -1
  91. package/es/components/eftpos/group/index.d.ts +0 -1
  92. package/es/components/eftpos/hooks.d.ts +0 -1
  93. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  94. package/es/components/eftpos/icon/device.d.ts +0 -1
  95. package/es/components/eftpos/index.d.ts +0 -1
  96. package/es/components/eftpos/pos.d.ts +0 -1
  97. package/es/components/eftpos/receipt/index.d.ts +0 -1
  98. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  99. package/es/components/eftposPay/amount.d.ts +1 -2
  100. package/es/components/eftposPay/app.d.ts +0 -1
  101. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  102. package/es/components/eftposPay/component/fail/network.d.ts +0 -1
  103. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  104. package/es/components/eftposPay/component/manual/index.d.ts +0 -1
  105. package/es/components/eftposPay/component/signature/index.d.ts +0 -1
  106. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  107. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  108. package/es/components/eftposPay/device.d.ts +1 -1
  109. package/es/components/eftposPay/hooks.d.ts +2 -2
  110. package/es/components/eftposPay/payo/config.d.ts +0 -1
  111. package/es/components/eftposPay/store/index.d.ts +5 -5
  112. package/es/components/eftposPay/tip.d.ts +0 -1
  113. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  114. package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  115. package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
  116. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  117. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  118. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  119. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  120. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  121. package/es/components/login/index.d.ts +0 -1
  122. package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  123. package/es/components/pay/toB/components/Content/Header.d.ts +0 -1
  124. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  125. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  126. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  127. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  128. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  129. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  130. package/es/components/pay/toC/model.d.ts +9 -1
  131. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  132. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  133. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  134. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  135. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  136. package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  137. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  138. package/es/components/schedules/calendar/index.d.ts +0 -1
  139. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  140. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  141. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  142. package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
  143. package/es/components/schedules/model.d.ts +9 -1
  144. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  145. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  146. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  147. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  148. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  149. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  150. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  151. package/es/components/schedules/products/index.d.ts +0 -1
  152. package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  153. package/es/components/schedules/products/list/index.d.ts +0 -1
  154. package/es/components/schedules/resources/index.d.ts +0 -1
  155. package/es/components/schedules/resources/list/index.d.ts +0 -1
  156. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  157. package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  158. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  159. package/es/components/schedules/schedules/index.d.ts +0 -1
  160. package/es/components/schedules/utils.d.ts +1 -1
  161. package/es/components/shoppingCart/components/Cart/Product.js +143 -71
  162. package/es/components/shoppingCart/components/Cart/index.js +1 -1
  163. package/es/components/shoppingCart/components/Cart/index.less +31 -0
  164. package/es/components/shoppingCart/locales.d.ts +3 -0
  165. package/es/components/shoppingCart/locales.js +12 -3
  166. package/es/components/taxSelect/index.d.ts +0 -1
  167. package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
  168. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  169. package/es/components/ticketBooking/utils/index.js +2 -1
  170. package/es/components/wallet/Detail/model.d.ts +13 -1
  171. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  172. package/es/components/wallet/PointCard/model.d.ts +13 -1
  173. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  174. package/es/components/wallet/Voucher/model.d.ts +13 -1
  175. package/es/components/wallet/model.d.ts +9 -1
  176. package/es/hooks/usePaymentLogger.d.ts +0 -1
  177. package/es/plus/clientName/index.d.ts +0 -1
  178. package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
  179. package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
  180. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  181. package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  182. package/es/plus/saasCreateOrganization/index.d.ts +0 -1
  183. package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  184. package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  185. package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
  186. package/es/plus/saasRegister/components/Header.d.ts +0 -1
  187. package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
  188. package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  189. package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
  190. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  191. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
  192. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  193. package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  194. package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
  195. package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  196. package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
  197. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
  198. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +310 -0
  199. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  200. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
  201. package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
  202. package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
  203. package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  204. package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  205. package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
  206. package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  207. package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
  208. package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  209. package/es/pro/priceKeyboard/components/discountKeyboard/index.js +442 -0
  210. package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  211. package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  212. package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
  213. package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  214. package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
  215. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
  216. package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
  217. package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  218. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  219. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
  220. package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  221. package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
  222. package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  223. package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
  224. package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  225. package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  226. package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
  227. package/es/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
  228. package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
  229. package/es/pro/priceKeyboard/index.d.ts +3 -0
  230. package/es/pro/priceKeyboard/index.js +3 -0
  231. package/es/pro/priceKeyboard/index.less +215 -0
  232. package/es/pro/priceKeyboard/utils.d.ts +31 -0
  233. package/es/pro/priceKeyboard/utils.js +51 -0
  234. package/es/pro/skuDetailModal/index.js +19 -16
  235. package/es/utils/index.d.ts +1 -1
  236. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  237. package/lib/components/booking/addons/model.d.ts +10 -1
  238. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  239. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  240. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  241. package/lib/components/booking/components/actionButtons/index.js +31 -28
  242. package/lib/components/booking/components/actionButtons/index.less +0 -28
  243. package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
  244. package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
  245. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  246. package/lib/components/booking/components/footer/amount.d.ts +3 -3
  247. package/lib/components/booking/components/footer/amount.js +50 -34
  248. package/lib/components/booking/components/footer/index.js +107 -40
  249. package/lib/components/booking/components/footer/utils.js +35 -7
  250. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  251. package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  252. package/lib/components/booking/deposit/index.d.ts +0 -1
  253. package/lib/components/booking/forms/model.d.ts +10 -1
  254. package/lib/components/booking/forms/single/index.d.ts +0 -1
  255. package/lib/components/booking/forms/table/index.d.ts +0 -1
  256. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  257. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  258. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  259. package/lib/components/booking/info/date/index.d.ts +0 -1
  260. package/lib/components/booking/info/header/index.d.ts +0 -1
  261. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  262. package/lib/components/booking/info/index.d.ts +0 -1
  263. package/lib/components/booking/info/model.d.ts +10 -1
  264. package/lib/components/booking/info/model.js +3 -0
  265. package/lib/components/booking/info/notes/index.d.ts +0 -1
  266. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  267. package/lib/components/booking/info/service/addService/index.js +2 -1
  268. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  269. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  270. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  271. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  272. package/lib/components/booking/info2/index.js +18 -1
  273. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  274. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  275. package/lib/components/booking/info2/service/addService/index.js +2 -1
  276. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  277. package/lib/components/booking/info2/service/editService/index.js +12 -4
  278. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  279. package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
  280. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  281. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  282. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  283. package/lib/components/booking/model.d.ts +9 -1
  284. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  285. package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
  286. package/lib/components/booking/notes/addNote/index.d.ts +0 -1
  287. package/lib/components/booking/notes/model.d.ts +10 -1
  288. package/lib/components/booking/payments/model.d.ts +10 -1
  289. package/lib/components/booking/utils.js +10 -5
  290. package/lib/components/checkout/PaymentModal.d.ts +2 -0
  291. package/lib/components/checkout/PaymentModal.js +160 -73
  292. package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
  293. package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
  294. package/lib/components/checkout/components/AmountSummary/index.js +114 -40
  295. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  296. package/lib/components/checkout/components/CashPaymentModule/index.js +103 -134
  297. package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
  298. package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
  299. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  300. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +172 -0
  301. package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  302. package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
  303. package/lib/components/checkout/components/PaymentOptionsModule/index.less +29 -0
  304. package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  305. package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
  306. package/lib/components/checkout/components/WalletPassModule/index.js +4 -3
  307. package/lib/components/checkout/components/WalletPassModule/utils.js +4 -1
  308. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  309. package/lib/components/checkout/hooks/useWalletPass.js +2 -0
  310. package/lib/components/checkout/index.less +1 -1
  311. package/lib/components/checkout/locales.d.ts +33 -0
  312. package/lib/components/checkout/locales.js +39 -3
  313. package/lib/components/checkout/types.d.ts +1 -0
  314. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  315. package/lib/components/eftpos/form/index.d.ts +0 -1
  316. package/lib/components/eftpos/group/index.d.ts +0 -1
  317. package/lib/components/eftpos/hooks.d.ts +0 -1
  318. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  319. package/lib/components/eftpos/icon/device.d.ts +0 -1
  320. package/lib/components/eftpos/index.d.ts +0 -1
  321. package/lib/components/eftpos/pos.d.ts +0 -1
  322. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  323. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  324. package/lib/components/eftposPay/amount.d.ts +1 -2
  325. package/lib/components/eftposPay/app.d.ts +0 -1
  326. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  327. package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
  328. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  329. package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
  330. package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
  331. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  332. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  333. package/lib/components/eftposPay/device.d.ts +1 -1
  334. package/lib/components/eftposPay/hooks.d.ts +2 -2
  335. package/lib/components/eftposPay/payo/config.d.ts +0 -1
  336. package/lib/components/eftposPay/store/index.d.ts +5 -5
  337. package/lib/components/eftposPay/tip.d.ts +0 -1
  338. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  339. package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  340. package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
  341. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  342. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  343. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  344. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  345. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  346. package/lib/components/login/index.d.ts +0 -1
  347. package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  348. package/lib/components/pay/toB/components/Content/Header.d.ts +0 -1
  349. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  350. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  351. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  352. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  353. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  354. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  355. package/lib/components/pay/toC/model.d.ts +9 -1
  356. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  357. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  358. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  359. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  360. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  361. package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  362. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  363. package/lib/components/schedules/calendar/index.d.ts +0 -1
  364. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  365. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  366. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  367. package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
  368. package/lib/components/schedules/model.d.ts +9 -1
  369. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  370. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  371. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  372. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  373. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  374. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  375. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  376. package/lib/components/schedules/products/index.d.ts +0 -1
  377. package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  378. package/lib/components/schedules/products/list/index.d.ts +0 -1
  379. package/lib/components/schedules/resources/index.d.ts +0 -1
  380. package/lib/components/schedules/resources/list/index.d.ts +0 -1
  381. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  382. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  383. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  384. package/lib/components/schedules/schedules/index.d.ts +0 -1
  385. package/lib/components/schedules/utils.d.ts +1 -1
  386. package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
  387. package/lib/components/shoppingCart/components/Cart/index.js +1 -1
  388. package/lib/components/shoppingCart/components/Cart/index.less +31 -0
  389. package/lib/components/shoppingCart/locales.d.ts +3 -0
  390. package/lib/components/shoppingCart/locales.js +6 -3
  391. package/lib/components/taxSelect/index.d.ts +0 -1
  392. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
  393. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  394. package/lib/components/ticketBooking/utils/index.js +2 -1
  395. package/lib/components/wallet/Detail/model.d.ts +13 -1
  396. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  397. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  398. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  399. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  400. package/lib/components/wallet/model.d.ts +9 -1
  401. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  402. package/lib/plus/clientName/index.d.ts +0 -1
  403. package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
  404. package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
  405. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  406. package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  407. package/lib/plus/saasCreateOrganization/index.d.ts +0 -1
  408. package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  409. package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  410. package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
  411. package/lib/plus/saasRegister/components/Header.d.ts +0 -1
  412. package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
  413. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  414. package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
  415. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  416. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
  417. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  418. package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  419. package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
  420. package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  421. package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
  422. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
  423. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +332 -0
  424. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  425. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
  426. package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
  427. package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
  428. package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  429. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  430. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
  431. package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  432. package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
  433. package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  434. package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +485 -0
  435. package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  436. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  437. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
  438. package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  439. package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
  440. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
  441. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
  442. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  443. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  444. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
  445. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  446. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
  447. package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  448. package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
  449. package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  450. package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  451. package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
  452. package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
  453. package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
  454. package/lib/pro/priceKeyboard/index.d.ts +3 -0
  455. package/lib/pro/priceKeyboard/index.js +45 -0
  456. package/lib/pro/priceKeyboard/index.less +215 -0
  457. package/lib/pro/priceKeyboard/utils.d.ts +31 -0
  458. package/lib/pro/priceKeyboard/utils.js +75 -0
  459. package/lib/pro/skuDetailModal/index.js +18 -22
  460. package/lib/utils/index.d.ts +1 -1
  461. package/package.json +12 -12
@@ -0,0 +1,97 @@
1
+ /// <reference types="react" />
2
+ export interface RightItemsStyleProps {
3
+ buttonBackgroundColor?: string;
4
+ textColor?: string;
5
+ resetButtonBackgroundColor?: string;
6
+ resetButtonTextColor?: string;
7
+ isDoneButtonFollowTheme?: boolean;
8
+ doneButtonBackgroundColor?: string;
9
+ doneButtonTextColor?: string;
10
+ }
11
+ export declare type ItemValue = string | number;
12
+ export interface Item {
13
+ value: ItemValue;
14
+ label: React.ReactNode;
15
+ disabled: boolean;
16
+ type: 'text' | 'primary';
17
+ style?: React.CSSProperties;
18
+ size?: number;
19
+ }
20
+ export interface KeyboardProps {
21
+ className?: string;
22
+ style?: React.CSSProperties;
23
+ onChange?: (value?: ItemValue) => void;
24
+ items?: Item[];
25
+ rightItems?: Item[];
26
+ keydown?: boolean;
27
+ }
28
+ export interface TitleAreaConfig {
29
+ visible?: boolean;
30
+ title?: {
31
+ visible?: boolean;
32
+ text?: string;
33
+ fontSize?: string | number;
34
+ color?: string;
35
+ fontWeight?: string | number;
36
+ };
37
+ subtitle?: {
38
+ visible?: boolean;
39
+ text?: string;
40
+ fontSize?: string | number;
41
+ color?: string;
42
+ fontWeight?: string | number;
43
+ };
44
+ alignment?: 'left' | 'right' | 'center' | 'space-between';
45
+ spacing?: string | number;
46
+ }
47
+ export interface DisplayFieldConfig {
48
+ cashReceived?: {
49
+ visible?: boolean;
50
+ };
51
+ balanceDue?: {
52
+ visible?: boolean;
53
+ };
54
+ changeDue?: {
55
+ visible?: boolean;
56
+ };
57
+ gridRatio?: number[];
58
+ }
59
+ export interface CashKeyboardBaseProps {
60
+ amountSymbol?: string;
61
+ value?: string;
62
+ /** 默认值,非受控模式 */
63
+ defaultValue?: string;
64
+ /** 原始值,多用于重置, 当前对应 Balance Due */
65
+ originalValue?: string;
66
+ placeholder?: string;
67
+ max?: number;
68
+ min?: number;
69
+ disabled?: boolean;
70
+ doneText?: string;
71
+ resetText?: string;
72
+ presets?: any;
73
+ hiddenChangeDue?: boolean;
74
+ onChange?: (val: string) => void;
75
+ onEnter?: (val: string) => void;
76
+ onReset?: () => void;
77
+ onPay?: () => void;
78
+ rightItemsStyle?: RightItemsStyleProps;
79
+ titleArea?: TitleAreaConfig;
80
+ displayField?: DisplayFieldConfig;
81
+ keyboardProps?: KeyboardProps;
82
+ style?: React.CSSProperties;
83
+ selectType?: 'light' | 'dark';
84
+ backgroundColor?: string;
85
+ containerBackgroundColor?: string;
86
+ buttonBackgroundColor?: string;
87
+ textColor?: string;
88
+ resetButtonBackgroundColor?: string;
89
+ resetButtonTextColor?: string;
90
+ isDoneButtonFollowTheme?: boolean;
91
+ doneButtonBackgroundColor?: string;
92
+ doneButtonTextColor?: string;
93
+ keyboardBackgroundColor?: string;
94
+ keyboardButtonBackgroundColor?: string;
95
+ keyboardButtonTextColor?: string;
96
+ keyboardButtonHoverColor?: string;
97
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { DiscountKeyboardBaseProps } from './types';
3
+ import './index.less';
4
+ export interface DiscountKeyboardProps extends DiscountKeyboardBaseProps {
5
+ containerProps?: {
6
+ renderType: 'modal' | 'popover';
7
+ open?: boolean;
8
+ [key: string]: any;
9
+ };
10
+ children?: React.ReactNode;
11
+ }
12
+ declare const DiscountKeyboard: {
13
+ (props: DiscountKeyboardProps): JSX.Element | null;
14
+ InputNumber: (props: DiscountKeyboardInputNumberProps) => JSX.Element;
15
+ };
16
+ interface DiscountKeyboardInputNumberProps {
17
+ value?: number;
18
+ onChange?: (val: number) => void;
19
+ keyboardProps?: DiscountKeyboardProps;
20
+ [key: string]: any;
21
+ }
22
+ export default DiscountKeyboard;
@@ -0,0 +1,442 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["containerProps", "children"],
3
+ _excluded2 = ["renderType", "open"],
4
+ _excluded3 = ["originalValue", "value", "onChange", "keyboardProps"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ 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); }
11
+ 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; }
12
+ 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; }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ import React, { useEffect, useMemo, useState, useId, useCallback } from 'react';
20
+ import { Popover, Segmented, InputNumber } from 'antd';
21
+ import Decimal from 'decimal.js';
22
+ //@ts-ignore
23
+ import { locales } from '@pisell/utils';
24
+ import { PisellText, Keyboard, VirtualInput, PisellModal } from '@pisell/materials';
25
+ import { useControllableValue } from 'ahooks';
26
+ import useRightItems from "../../hooks/rightItems";
27
+ import useKeyActions from "../../hooks/keyActions";
28
+ import { setKeyboardTheme } from "../../utils";
29
+ import useEngineContext from "../../../../hooks/useEngineContext";
30
+ import localeTexts from "./locales";
31
+ import "./index.less";
32
+
33
+ /**
34
+ * originalValue: 当前订单原始值
35
+ * defaultValue: 折扣后金额
36
+ * onEnter: 折扣金额回调
37
+ */
38
+ var DiscountKeyboardBase = function DiscountKeyboardBase(props) {
39
+ var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4;
40
+ var defaultValue = props.defaultValue,
41
+ originalValue = props.originalValue,
42
+ _props$selectType = props.selectType,
43
+ selectType = _props$selectType === void 0 ? 'light' : _props$selectType,
44
+ resetText = props.resetText,
45
+ doneText = props.doneText,
46
+ onEnter = props.onEnter,
47
+ onReset = props.onReset,
48
+ _props$enableExceedMa = props.enableExceedMaxAmount,
49
+ enableExceedMaxAmount = _props$enableExceedMa === void 0 ? false : _props$enableExceedMa;
50
+ var context = useEngineContext();
51
+ var _useState = useState(true),
52
+ _useState2 = _slicedToArray(_useState, 2),
53
+ isFirstInput = _useState2[0],
54
+ setIsFirstInput = _useState2[1];
55
+ locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get('umi_locale')) || 'en');
56
+ var getData = context.appHelper.utils.getData;
57
+ var amountSymbol = props.amountSymbol || (getData === null || getData === void 0 ? void 0 : getData('shop_symbol')) || '$';
58
+ var uniqueId = useId();
59
+ var uniqueKeyboardId = "virtual-keyboard-".concat(uniqueId.replace(/:/g, '-'));
60
+ // 一口价或者折扣
61
+ var _useState3 = useState('priceOverride'),
62
+ _useState4 = _slicedToArray(_useState3, 2),
63
+ updateMode = _useState4[0],
64
+ setUpdateMode = _useState4[1];
65
+ // 折扣模式分为 金额 和 百分比
66
+ var _useState5 = useState('amount'),
67
+ _useState6 = _slicedToArray(_useState5, 2),
68
+ discountMode = _useState6[0],
69
+ setDiscountMode = _useState6[1];
70
+ var _useState7 = useState(defaultValue ? String(defaultValue) : ''),
71
+ _useState8 = _slicedToArray(_useState7, 2),
72
+ internalValue = _useState8[0],
73
+ setInternalValue = _useState8[1];
74
+ var _useState9 = useState(''),
75
+ _useState10 = _slicedToArray(_useState9, 2),
76
+ discountValue = _useState10[0],
77
+ setDiscountValue = _useState10[1];
78
+ useEffect(function () {
79
+ document.body.id = 'body';
80
+ }, []);
81
+
82
+ // 设置主题
83
+ useEffect(function () {
84
+ setKeyboardTheme(selectType);
85
+ }, [selectType]);
86
+ var _onReset = useCallback(function () {
87
+ if (updateMode === 'priceOverride') {
88
+ // 重置为最初价格
89
+ setInternalValue(originalValue ? String(originalValue) : '');
90
+ setIsFirstInput(true);
91
+ } else {
92
+ setDiscountValue('');
93
+ }
94
+ onReset === null || onReset === void 0 || onReset();
95
+ }, [originalValue, onReset, updateMode]);
96
+ var _handleChange = useCallback(function (val) {
97
+ if (updateMode === 'priceOverride') {
98
+ setIsFirstInput(false);
99
+ setInternalValue(val);
100
+ } else {
101
+ setDiscountValue(val);
102
+ }
103
+ }, [updateMode]);
104
+
105
+ // 计算折扣金额和符号
106
+ var discountAmount = useMemo(function () {
107
+ var originalPrice = new Decimal(originalValue || 0);
108
+ var discountAmount = new Decimal(0);
109
+ if (updateMode === 'priceOverride') {
110
+ discountAmount = originalPrice.minus(new Decimal(internalValue || 0));
111
+ } else {
112
+ // discount 模式
113
+ if (discountMode === 'amount') {
114
+ discountAmount = new Decimal(discountValue || 0);
115
+ } else {
116
+ // percentage 模式
117
+ var percentage = new Decimal(discountValue || 0);
118
+ discountAmount = originalPrice.times(percentage.dividedBy(100));
119
+ }
120
+ }
121
+ return discountAmount.toNumber();
122
+ }, [updateMode, discountMode, internalValue, discountValue, originalValue]);
123
+ var isDiscountError = useMemo(function () {
124
+ var _discountAmount = new Decimal(discountAmount || 0);
125
+ return _discountAmount.lessThan(0) || _discountAmount.greaterThan(new Decimal(originalValue || 0));
126
+ }, [discountAmount, originalValue]);
127
+ var payableAmount = useMemo(function () {
128
+ return new Decimal(originalValue || 0).minus(discountAmount).toNumber();
129
+ }, [originalValue, discountAmount]);
130
+ var handleEnter = function handleEnter() {
131
+ // 改价模式下,且允许超出原价,那么直接返回
132
+ if (updateMode === 'priceOverride' && enableExceedMaxAmount) {
133
+ onEnter === null || onEnter === void 0 || onEnter(String(discountAmount));
134
+ return;
135
+ }
136
+ // 折扣模式、或一口价有限额,则进行折扣值的校验
137
+ if (isDiscountError) {
138
+ return;
139
+ }
140
+ onEnter === null || onEnter === void 0 || onEnter(String(discountAmount));
141
+ };
142
+ var _max = useMemo(function () {
143
+ return updateMode === 'discount' && discountMode === 'percentage' ? 100 : undefined;
144
+ }, [updateMode, discountMode]);
145
+ var _useKeyActions = useKeyActions({
146
+ onEnter: handleEnter,
147
+ onReset: _onReset,
148
+ onChange: _handleChange,
149
+ value: updateMode === 'priceOverride' ? internalValue : discountValue,
150
+ max: _max,
151
+ mode: isFirstInput && updateMode === 'priceOverride' ? 'replace' : 'append',
152
+ scale: 2
153
+ }),
154
+ handleChange = _useKeyActions.handleChange;
155
+ var rightItems = useRightItems({
156
+ rightItemsStyle: {
157
+ doneButtonStyle: {
158
+ boxShadow: '0px 0px 1px #898A8D'
159
+ }
160
+ },
161
+ doneText: doneText || locales.getText('discount-keyboard-done'),
162
+ resetText: resetText || locales.getText('discount-keyboard-reset')
163
+ });
164
+ var formattedVal = useMemo(function () {
165
+ if (updateMode === 'priceOverride') {
166
+ return internalValue ? "".concat(amountSymbol).concat(internalValue) : '';
167
+ }
168
+ if (discountMode === 'amount') {
169
+ return discountValue ? "".concat(amountSymbol).concat(discountValue) : '';
170
+ } else {
171
+ return discountValue ? "".concat(discountValue, "%") : '';
172
+ }
173
+ }, [updateMode, discountMode, internalValue, discountValue, amountSymbol]);
174
+ var placeholder = useMemo(function () {
175
+ if (updateMode === 'priceOverride') {
176
+ return "".concat(amountSymbol, "0");
177
+ } else {
178
+ if (discountMode === 'amount') {
179
+ return '0';
180
+ }
181
+ return '%';
182
+ }
183
+ }, [amountSymbol, updateMode, discountMode]);
184
+ var renderBottomContent = function renderBottomContent() {
185
+ var style = {
186
+ color: isDiscountError ? '#D92D20' : '#079455'
187
+ };
188
+ var sign = new Decimal(discountAmount).greaterThan(0) ? '+' : new Decimal(discountAmount).lessThan(0) ? '-' : '';
189
+ var _maxDiscount = /*#__PURE__*/React.createElement("div", {
190
+ style: isDiscountError && !isFirstInput ? style : {},
191
+ className: "ellipsis"
192
+ }, locales.getText('discount-keyboard-max-discount'), ":", ' ', /*#__PURE__*/React.createElement(PisellText.Amount, {
193
+ hideDecimalForWholeNumbers: false,
194
+ precision: 2,
195
+ value: originalValue
196
+ }));
197
+ var _discountText = /*#__PURE__*/React.createElement("div", {
198
+ style: style,
199
+ className: "ellipsis"
200
+ }, locales.getText('discount-keyboard-discount-amount'), ":", ' ', /*#__PURE__*/React.createElement("span", null, sign, /*#__PURE__*/React.createElement(PisellText.Amount, {
201
+ hideDecimalForWholeNumbers: false,
202
+ precision: 2,
203
+ value: Math.abs(discountAmount)
204
+ })));
205
+ if (updateMode === 'priceOverride') {
206
+ if (isFirstInput) {
207
+ return _maxDiscount;
208
+ } else {
209
+ return _discountText;
210
+ }
211
+ }
212
+ if (updateMode === 'discount' && discountMode === 'amount') {
213
+ return _maxDiscount;
214
+ }
215
+ return _discountText;
216
+ };
217
+ var customDisplay = function customDisplay() {
218
+ return /*#__PURE__*/React.createElement("div", {
219
+ style: {
220
+ display: 'flex',
221
+ gap: 8
222
+ }
223
+ }, /*#__PURE__*/React.createElement(VirtualInput, {
224
+ focused: true,
225
+ value: formattedVal,
226
+ wrapperStyle: {
227
+ padding: '12px 20px',
228
+ borderRadius: '8px',
229
+ backgroundColor: 'white',
230
+ boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.06)',
231
+ flex: '2',
232
+ overflow: 'hidden'
233
+ },
234
+ placeholder: placeholder,
235
+ bottomContent: renderBottomContent()
236
+ }), /*#__PURE__*/React.createElement("div", {
237
+ style: {
238
+ flex: '1',
239
+ display: 'flex',
240
+ flexDirection: 'column',
241
+ borderRadius: '8px',
242
+ backgroundColor: '#ffffff',
243
+ padding: 8,
244
+ boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.06)',
245
+ overflow: 'hidden'
246
+ }
247
+ }, /*#__PURE__*/React.createElement("div", {
248
+ style: {
249
+ flex: 1
250
+ }
251
+ }, /*#__PURE__*/React.createElement("div", {
252
+ style: {
253
+ color: '#667085',
254
+ fontSize: 12,
255
+ fontWeight: 500,
256
+ wordWrap: 'break-word'
257
+ }
258
+ }, locales.getText('discount-keyboard-total')), /*#__PURE__*/React.createElement("div", {
259
+ style: {
260
+ color: '#475467',
261
+ fontSize: 14,
262
+ fontWeight: 700,
263
+ wordWrap: 'break-word'
264
+ }
265
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
266
+ value: originalValue
267
+ }))), /*#__PURE__*/React.createElement("div", {
268
+ style: {
269
+ flex: 1
270
+ }
271
+ }, /*#__PURE__*/React.createElement("div", {
272
+ style: {
273
+ color: '#667085',
274
+ fontSize: 12,
275
+ fontWeight: 500,
276
+ wordWrap: 'break-word'
277
+ }
278
+ }, locales.getText('discount-keyboard-payable')), /*#__PURE__*/React.createElement("div", {
279
+ style: {
280
+ color: isDiscountError ? '#f56565' : '#475467',
281
+ fontSize: 14,
282
+ fontWeight: 700,
283
+ wordWrap: 'break-word'
284
+ }
285
+ }, /*#__PURE__*/React.createElement(PisellText.Amount, {
286
+ value: payableAmount
287
+ })))));
288
+ };
289
+ return /*#__PURE__*/React.createElement("div", {
290
+ className: "pisell-pro-price-keyboard-discount"
291
+ }, /*#__PURE__*/React.createElement(Segmented, {
292
+ size: "large",
293
+ style: {
294
+ padding: 6
295
+ },
296
+ options: [{
297
+ label: locales.getText('discount-keyboard-price-override'),
298
+ value: 'priceOverride'
299
+ }, {
300
+ label: locales.getText('discount-keyboard-discount'),
301
+ value: 'discount'
302
+ }],
303
+ value: updateMode,
304
+ onChange: function onChange(val) {
305
+ return setUpdateMode(val);
306
+ },
307
+ block: true
308
+ }), updateMode === 'discount' && /*#__PURE__*/React.createElement(Segmented, {
309
+ size: "large",
310
+ style: {
311
+ padding: 6
312
+ },
313
+ options: [{
314
+ label: locales.getText('discount-keyboard-amount') + " (".concat(amountSymbol, ")"),
315
+ value: 'amount'
316
+ }, {
317
+ label: locales.getText('discount-keyboard-percentage') + ' (%)',
318
+ value: 'percentage'
319
+ }],
320
+ value: discountMode,
321
+ onChange: function onChange(val) {
322
+ setDiscountMode(val);
323
+ setDiscountValue('');
324
+ },
325
+ block: true
326
+ }), /*#__PURE__*/React.createElement("div", {
327
+ className: "pisell-pro-price-keyboard-content"
328
+ }, customDisplay(), /*#__PURE__*/React.createElement(Keyboard, {
329
+ rightItems: rightItems,
330
+ onChange: handleChange,
331
+ id: uniqueKeyboardId
332
+ })));
333
+ };
334
+ var DiscountKeyboard = function DiscountKeyboard(props) {
335
+ var containerProps = props.containerProps,
336
+ children = props.children,
337
+ keyboardProps = _objectWithoutProperties(props, _excluded);
338
+ if (!containerProps) {
339
+ return /*#__PURE__*/React.createElement(DiscountKeyboardBase, keyboardProps);
340
+ }
341
+ var _ref = containerProps || {},
342
+ renderType = _ref.renderType,
343
+ open = _ref.open,
344
+ restProps = _objectWithoutProperties(_ref, _excluded2);
345
+
346
+ // 暂时只支持受控模式
347
+ if (renderType === 'popover') {
348
+ return /*#__PURE__*/React.createElement(Popover, _extends({
349
+ key: "".concat(open),
350
+ open: open,
351
+ trigger: "click",
352
+ className: "pisell-discount-keyboard-popover"
353
+ }, restProps, {
354
+ content: /*#__PURE__*/React.createElement(DiscountKeyboardBase, keyboardProps)
355
+ }), children);
356
+ }
357
+
358
+ // 暂时只支持受控模式
359
+ if (renderType === 'modal') {
360
+ return open ? /*#__PURE__*/React.createElement(PisellModal, _extends({
361
+ platform: 'pc',
362
+ open: true,
363
+ width: "unset",
364
+ header: null,
365
+ footer: false,
366
+ mask: false,
367
+ maskClosable: true,
368
+ bodyStyle: {
369
+ padding: '0px',
370
+ backgroundColor: 'transparent'
371
+ },
372
+ closeIcon: null,
373
+ className: "pisell-discount-keyboard-modal",
374
+ destroyOnHidden: true
375
+ }, restProps), /*#__PURE__*/React.createElement(DiscountKeyboardBase, keyboardProps)) : null;
376
+ }
377
+ return /*#__PURE__*/React.createElement(DiscountKeyboardBase, keyboardProps);
378
+ };
379
+ // 基于 DiscountKeyboard 的输入框组件
380
+ var DiscountKeyboardInputNumber = function DiscountKeyboardInputNumber(props) {
381
+ var _keyboardProps$contai;
382
+ var originalValue = props.originalValue,
383
+ value = props.value,
384
+ onChange = props.onChange,
385
+ keyboardProps = props.keyboardProps,
386
+ rest = _objectWithoutProperties(props, _excluded3);
387
+ var _useControllableValue = useControllableValue(props),
388
+ _useControllableValue2 = _slicedToArray(_useControllableValue, 2),
389
+ internalValue = _useControllableValue2[0],
390
+ setInternalValue = _useControllableValue2[1];
391
+ var _useState11 = useState(false),
392
+ _useState12 = _slicedToArray(_useState11, 2),
393
+ isOpen = _useState12[0],
394
+ setIsOpen = _useState12[1];
395
+ var renderType = (keyboardProps === null || keyboardProps === void 0 || (_keyboardProps$contai = keyboardProps.containerProps) === null || _keyboardProps$contai === void 0 ? void 0 : _keyboardProps$contai.renderType) || 'popover';
396
+ if (renderType === 'modal') {
397
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputNumber, _extends({
398
+ value: value,
399
+ readOnly: true
400
+ }, rest, {
401
+ onClick: function onClick() {
402
+ return setIsOpen(true);
403
+ }
404
+ })), /*#__PURE__*/React.createElement(DiscountKeyboard, _extends({}, keyboardProps || {}, {
405
+ containerProps: _objectSpread(_objectSpread({}, keyboardProps === null || keyboardProps === void 0 ? void 0 : keyboardProps.containerProps), {}, {
406
+ open: isOpen,
407
+ onCancel: function onCancel() {
408
+ return setIsOpen(false);
409
+ },
410
+ renderType: 'modal'
411
+ }),
412
+ enableExceedMaxAmount: true,
413
+ defaultValue: internalValue,
414
+ onEnter: function onEnter(val) {
415
+ setInternalValue(new Decimal(originalValue).minus(Number(val)).toNumber());
416
+ setIsOpen(false);
417
+ },
418
+ originalValue: originalValue
419
+ })));
420
+ }
421
+ return /*#__PURE__*/React.createElement(DiscountKeyboard, _extends({}, keyboardProps || {}, {
422
+ containerProps: _objectSpread(_objectSpread({}, keyboardProps === null || keyboardProps === void 0 ? void 0 : keyboardProps.containerProps), {}, {
423
+ open: isOpen,
424
+ onOpenChange: function onOpenChange(val) {
425
+ return setIsOpen(val);
426
+ },
427
+ renderType: 'popover'
428
+ }),
429
+ enableExceedMaxAmount: true,
430
+ defaultValue: internalValue,
431
+ onEnter: function onEnter(val) {
432
+ setInternalValue(new Decimal(originalValue).minus(Number(val)).toNumber());
433
+ setIsOpen(false);
434
+ },
435
+ originalValue: originalValue
436
+ }), /*#__PURE__*/React.createElement(InputNumber, _extends({
437
+ value: value,
438
+ readOnly: true
439
+ }, rest)));
440
+ };
441
+ DiscountKeyboard.InputNumber = DiscountKeyboardInputNumber;
442
+ export default DiscountKeyboard;
@@ -0,0 +1,47 @@
1
+ .pisell-pro-price-keyboard-discount {
2
+ width: 360px;
3
+ border-radius: 10px;
4
+ padding: 10px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 10px;
8
+ background-color: var(--pisell-pro-price-keyboard-bg-color, #ffffff);
9
+
10
+ .ellipsis {
11
+ overflow: hidden;
12
+ text-overflow: ellipsis;
13
+ white-space: nowrap;
14
+ }
15
+
16
+ // 复写Segmented样式
17
+ .pisell-lowcode-segmented {
18
+ background-color: var(
19
+ --pisell-pro-price-keyboard-bg-color-gray-200,
20
+ #eaecf0
21
+ );
22
+ color: var(--pisell-pro-price-keyboard-text-gray-500, #667085);
23
+ }
24
+
25
+ .pisell-pro-price-keyboard-content {
26
+ width: 100%;
27
+ padding: 10px;
28
+ border-radius: 10px;
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 8px;
32
+ background-color: var(
33
+ --pisell-pro-price-keyboard-bg-color-gray-300,
34
+ #d0d5dd
35
+ );
36
+ }
37
+ }
38
+
39
+ .pisell-discount-keyboard-modal {
40
+ .pisell-lowcode-modal-content {
41
+ background-color: transparent;
42
+ }
43
+
44
+ .pisell-lowcode-modal-close {
45
+ display: none;
46
+ }
47
+ }
@@ -0,0 +1,42 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'discount-keyboard-price-override': string;
4
+ 'discount-keyboard-discount': string;
5
+ 'discount-keyboard-amount': string;
6
+ 'discount-keyboard-percentage': string;
7
+ 'discount-keyboard-max-discount': string;
8
+ 'discount-keyboard-discount-amount': string;
9
+ 'discount-keyboard-total': string;
10
+ 'discount-keyboard-payable': string;
11
+ 'discount-keyboard-reset': string;
12
+ 'discount-keyboard-done': string;
13
+ 'discount-keyboard-pay': string;
14
+ };
15
+ 'zh-CN': {
16
+ 'discount-keyboard-price-override': string;
17
+ 'discount-keyboard-discount': string;
18
+ 'discount-keyboard-amount': string;
19
+ 'discount-keyboard-percentage': string;
20
+ 'discount-keyboard-max-discount': string;
21
+ 'discount-keyboard-discount-amount': string;
22
+ 'discount-keyboard-total': string;
23
+ 'discount-keyboard-payable': string;
24
+ 'discount-keyboard-reset': string;
25
+ 'discount-keyboard-done': string;
26
+ 'discount-keyboard-pay': string;
27
+ };
28
+ 'zh-HK': {
29
+ 'discount-keyboard-price-override': string;
30
+ 'discount-keyboard-discount': string;
31
+ 'discount-keyboard-amount': string;
32
+ 'discount-keyboard-percentage': string;
33
+ 'discount-keyboard-max-discount': string;
34
+ 'discount-keyboard-discount-amount': string;
35
+ 'discount-keyboard-total': string;
36
+ 'discount-keyboard-payable': string;
37
+ 'discount-keyboard-reset': string;
38
+ 'discount-keyboard-done': string;
39
+ 'discount-keyboard-pay': string;
40
+ };
41
+ };
42
+ export default _default;