@pisell/private-materials 6.3.70 → 6.3.72

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 (312) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/Sales/Cart/index.js +20 -3
  12. package/es/components/Sales/Cart/utils.d.ts +5 -0
  13. package/es/components/Sales/Cart/utils.js +16 -0
  14. package/es/components/Sales/Summary/utils.js +5 -4
  15. package/es/components/booking/addons/model.d.ts +1 -10
  16. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  17. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  18. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  19. package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
  20. package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
  21. package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  22. package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  23. package/es/components/booking/components/voucher/index.js +8 -7
  24. package/es/components/booking/forms/model.d.ts +1 -10
  25. package/es/components/booking/forms/single/index.d.ts +0 -1
  26. package/es/components/booking/forms/table/index.d.ts +0 -1
  27. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  28. package/es/components/booking/info/date/index.d.ts +0 -1
  29. package/es/components/booking/info/model.d.ts +1 -10
  30. package/es/components/booking/info/notes/index.d.ts +0 -1
  31. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  32. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  33. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  34. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  35. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
  36. package/es/components/booking/materiels/contacts/index.d.ts +0 -1
  37. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  38. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  39. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  40. package/es/components/booking/model.d.ts +1 -9
  41. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  42. package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
  43. package/es/components/booking/notes/model.d.ts +1 -10
  44. package/es/components/booking/payments/model.d.ts +1 -10
  45. package/es/components/booking/utils.d.ts +2 -2
  46. package/es/components/eftpos/index.d.ts +0 -1
  47. package/es/components/eftpos/pos.d.ts +0 -1
  48. package/es/components/eftposPay/amount.d.ts +1 -2
  49. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  50. package/es/components/eftposPay/component/fail/network.d.ts +0 -1
  51. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  52. package/es/components/eftposPay/component/manual/index.d.ts +0 -1
  53. package/es/components/eftposPay/component/signature/index.d.ts +0 -1
  54. package/es/components/eftposPay/device.d.ts +1 -1
  55. package/es/components/eftposPay/hooks.d.ts +2 -2
  56. package/es/components/eftposPay/pay.d.ts +0 -1
  57. package/es/components/eftposPay/payo/config.d.ts +0 -1
  58. package/es/components/eftposPay/store/index.d.ts +4 -4
  59. package/es/components/eftposPay/tip.d.ts +0 -1
  60. package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  61. package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  64. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  67. package/es/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  68. package/es/components/eventBooking/components/Voucher/components/Voucher.js +99 -0
  69. package/es/components/eventBooking/components/Voucher/components/index.less +124 -0
  70. package/es/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  71. package/es/components/eventBooking/components/Voucher/components/locales.js +38 -0
  72. package/es/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  73. package/es/components/eventBooking/components/Voucher/hooks.js +212 -0
  74. package/es/components/eventBooking/components/Voucher/index.d.ts +2 -0
  75. package/es/components/eventBooking/components/Voucher/index.js +266 -0
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  80. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  81. package/es/components/kioskSkuDetail/index.d.ts +39 -0
  82. package/es/components/kioskSkuDetail/index.js +531 -0
  83. package/es/components/kioskSkuDetail/index.less +196 -0
  84. package/es/components/kioskSkuDetail/locales.d.ts +27 -0
  85. package/es/components/kioskSkuDetail/locales.js +26 -0
  86. package/es/components/login/index.d.ts +0 -1
  87. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
  88. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  89. package/es/components/pay/toC/model.d.ts +1 -9
  90. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  92. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  95. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  96. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  97. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  98. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  99. package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  100. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  101. package/es/components/schedules/calendar/index.d.ts +0 -1
  102. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  103. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  104. package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
  105. package/es/components/schedules/model.d.ts +1 -9
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  110. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  111. package/es/components/schedules/products/index.d.ts +0 -1
  112. package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  113. package/es/components/schedules/products/list/index.d.ts +0 -1
  114. package/es/components/schedules/resources/index.d.ts +0 -1
  115. package/es/components/schedules/resources/list/index.d.ts +0 -1
  116. package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  117. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  118. package/es/components/schedules/schedules/index.d.ts +0 -1
  119. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  120. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  121. package/es/components/shoppingCart/index.d.ts +0 -1
  122. package/es/components/walletList/index.js +7 -2
  123. package/es/hooks/usePaymentLogger.d.ts +0 -1
  124. package/es/index.d.ts +3 -1
  125. package/es/index.js +3 -1
  126. package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  127. package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  128. package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  129. package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
  130. package/es/plus/saasRegister/components/Header.d.ts +0 -1
  131. package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
  132. package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  133. package/es/plus/skuOptionsSelection/components/VariantCard/index.js +30 -1
  134. package/es/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
  135. package/es/plus/skuOptionsSelection/locales.d.ts +3 -0
  136. package/es/plus/skuOptionsSelection/locales.js +3 -0
  137. package/es/plus/skuOptionsSelection/store/actions.js +17 -2
  138. package/es/plus/skuOptionsSelection/types.d.ts +5 -0
  139. package/es/plus/skuOptionsSelection/types.js +2 -1
  140. package/es/plus/skuOptionsSelection/utils/transformVariantGroup.js +70 -3
  141. package/es/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
  142. package/es/plus/walletPassGallery/components/passDetail/index.js +6 -5
  143. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  144. package/es/plus/walletPassGallery/components/timelineSection/index.js +9 -3
  145. package/es/plus/walletPassGallery/index.js +2 -2
  146. package/es/plus/walletPassGallery/serve.d.ts +8 -0
  147. package/es/plus/walletPassGallery/serve.js +78 -52
  148. package/es/pro/Selector/Selector.d.ts +1 -1
  149. package/es/pro/numberKeyboard/index.d.ts +28 -0
  150. package/es/pro/numberKeyboard/index.js +155 -0
  151. package/es/pro/numberKeyboard/index.less +25 -0
  152. package/es/pro/numberKeyboard/locales.d.ts +12 -0
  153. package/es/pro/numberKeyboard/locales.js +11 -0
  154. package/es/pro/pisellNumberSelector/example.d.ts +3 -0
  155. package/es/pro/pisellNumberSelector/example.js +68 -0
  156. package/es/pro/pisellNumberSelector/index.d.ts +29 -0
  157. package/es/pro/pisellNumberSelector/index.js +257 -0
  158. package/es/pro/pisellNumberSelector/index.less +235 -0
  159. package/es/pro/skuDetailModal/index.d.ts +4 -0
  160. package/es/pro/skuDetailModal/index.js +1031 -0
  161. package/lib/components/Sales/Cart/index.js +25 -7
  162. package/lib/components/Sales/Cart/utils.d.ts +5 -0
  163. package/lib/components/Sales/Cart/utils.js +13 -1
  164. package/lib/components/Sales/Summary/utils.js +2 -4
  165. package/lib/components/booking/addons/model.d.ts +1 -10
  166. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  167. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  168. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  169. package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
  170. package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
  171. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  172. package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  173. package/lib/components/booking/components/voucher/index.js +0 -1
  174. package/lib/components/booking/forms/model.d.ts +1 -10
  175. package/lib/components/booking/forms/single/index.d.ts +0 -1
  176. package/lib/components/booking/forms/table/index.d.ts +0 -1
  177. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  178. package/lib/components/booking/info/date/index.d.ts +0 -1
  179. package/lib/components/booking/info/model.d.ts +1 -10
  180. package/lib/components/booking/info/notes/index.d.ts +0 -1
  181. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  182. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  183. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  184. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  185. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
  186. package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
  187. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  188. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  189. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  190. package/lib/components/booking/model.d.ts +1 -9
  191. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  192. package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
  193. package/lib/components/booking/notes/model.d.ts +1 -10
  194. package/lib/components/booking/payments/model.d.ts +1 -10
  195. package/lib/components/booking/utils.d.ts +2 -2
  196. package/lib/components/eftpos/index.d.ts +0 -1
  197. package/lib/components/eftpos/pos.d.ts +0 -1
  198. package/lib/components/eftposPay/amount.d.ts +1 -2
  199. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  200. package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
  201. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  202. package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
  203. package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
  204. package/lib/components/eftposPay/device.d.ts +1 -1
  205. package/lib/components/eftposPay/hooks.d.ts +2 -2
  206. package/lib/components/eftposPay/pay.d.ts +0 -1
  207. package/lib/components/eftposPay/payo/config.d.ts +0 -1
  208. package/lib/components/eftposPay/store/index.d.ts +4 -4
  209. package/lib/components/eftposPay/tip.d.ts +0 -1
  210. package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  211. package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
  212. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  213. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  214. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  215. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  216. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  217. package/lib/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  218. package/lib/components/eventBooking/components/Voucher/components/Voucher.js +116 -0
  219. package/lib/components/eventBooking/components/Voucher/components/index.less +124 -0
  220. package/lib/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  221. package/lib/components/eventBooking/components/Voucher/components/locales.js +59 -0
  222. package/lib/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  223. package/lib/components/eventBooking/components/Voucher/hooks.js +176 -0
  224. package/lib/components/eventBooking/components/Voucher/index.d.ts +2 -0
  225. package/lib/components/eventBooking/components/Voucher/index.js +197 -0
  226. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  227. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  228. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  229. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  230. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  231. package/lib/components/kioskSkuDetail/index.d.ts +39 -0
  232. package/lib/components/kioskSkuDetail/index.js +393 -0
  233. package/lib/components/kioskSkuDetail/index.less +196 -0
  234. package/lib/components/kioskSkuDetail/locales.d.ts +27 -0
  235. package/lib/components/kioskSkuDetail/locales.js +50 -0
  236. package/lib/components/login/index.d.ts +0 -1
  237. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
  238. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  239. package/lib/components/pay/toC/model.d.ts +1 -9
  240. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  241. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  242. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  243. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  244. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  245. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  246. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  247. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  248. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  249. package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  250. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  251. package/lib/components/schedules/calendar/index.d.ts +0 -1
  252. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  253. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  254. package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
  255. package/lib/components/schedules/model.d.ts +1 -9
  256. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  257. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  258. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  259. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  260. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  261. package/lib/components/schedules/products/index.d.ts +0 -1
  262. package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  263. package/lib/components/schedules/products/list/index.d.ts +0 -1
  264. package/lib/components/schedules/resources/index.d.ts +0 -1
  265. package/lib/components/schedules/resources/list/index.d.ts +0 -1
  266. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  267. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  268. package/lib/components/schedules/schedules/index.d.ts +0 -1
  269. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  270. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  271. package/lib/components/shoppingCart/index.d.ts +0 -1
  272. package/lib/components/walletList/index.js +5 -1
  273. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  274. package/lib/index.d.ts +3 -1
  275. package/lib/index.js +7 -1
  276. package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  277. package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  278. package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  279. package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
  280. package/lib/plus/saasRegister/components/Header.d.ts +0 -1
  281. package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
  282. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  283. package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +32 -3
  284. package/lib/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
  285. package/lib/plus/skuOptionsSelection/locales.d.ts +3 -0
  286. package/lib/plus/skuOptionsSelection/locales.js +3 -0
  287. package/lib/plus/skuOptionsSelection/store/actions.js +25 -1
  288. package/lib/plus/skuOptionsSelection/types.d.ts +5 -0
  289. package/lib/plus/skuOptionsSelection/types.js +2 -1
  290. package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.js +51 -5
  291. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
  292. package/lib/plus/walletPassGallery/components/passDetail/index.js +24 -6
  293. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  294. package/lib/plus/walletPassGallery/components/timelineSection/index.js +17 -10
  295. package/lib/plus/walletPassGallery/index.js +2 -2
  296. package/lib/plus/walletPassGallery/serve.d.ts +8 -0
  297. package/lib/plus/walletPassGallery/serve.js +23 -10
  298. package/lib/pro/Selector/Selector.d.ts +1 -1
  299. package/lib/pro/numberKeyboard/index.d.ts +28 -0
  300. package/lib/pro/numberKeyboard/index.js +182 -0
  301. package/lib/pro/numberKeyboard/index.less +25 -0
  302. package/lib/pro/numberKeyboard/locales.d.ts +12 -0
  303. package/lib/pro/numberKeyboard/locales.js +35 -0
  304. package/lib/pro/pisellNumberSelector/example.d.ts +3 -0
  305. package/lib/pro/pisellNumberSelector/example.js +93 -0
  306. package/lib/pro/pisellNumberSelector/index.d.ts +29 -0
  307. package/lib/pro/pisellNumberSelector/index.js +275 -0
  308. package/lib/pro/pisellNumberSelector/index.less +235 -0
  309. package/lib/pro/skuDetailModal/index.d.ts +4 -0
  310. package/lib/pro/skuDetailModal/index.js +736 -0
  311. package/lowcode/kiosk-sku-detail/meta.ts +264 -0
  312. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface NumberKeyboardProps {
4
+ /** 输入框的值 */
5
+ value?: string;
6
+ /** 输入框的placeholder */
7
+ placeholder?: string;
8
+ /** 输入框的最大长度 */
9
+ maxLength?: number;
10
+ /** 最大值 */
11
+ max?: number;
12
+ /** 确认按钮的文本 */
13
+ okText?: string;
14
+ /** 删除按钮的文本 */
15
+ deleteText?: string | React.ReactNode;
16
+ /** 输入框的值发生变化时回调 */
17
+ onChange?: (num: string) => void;
18
+ /** 确认按钮点击时回调 */
19
+ onOk?: () => void;
20
+ /** 删除按钮点击时回调 */
21
+ onDelete?: (num: string) => void;
22
+ /** 键盘整体样式 */
23
+ style?: React.CSSProperties;
24
+ /** 输入框的样式 */
25
+ inputStyle?: React.CSSProperties;
26
+ }
27
+ declare const NumberKeyboard: (props: NumberKeyboardProps) => JSX.Element;
28
+ export default NumberKeyboard;
@@ -0,0 +1,155 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useState, useMemo } from 'react';
14
+ import { VirtualKeyboard } from '@pisell/materials';
15
+ import Delete from '@pisell/icon/es/Delete';
16
+ import { locales } from '@pisell/utils';
17
+ import useEngineContext from "../../hooks/useEngineContext";
18
+ import localeTexts from "./locales";
19
+ import "./index.less";
20
+ var NumberKeyboard = function NumberKeyboard(props) {
21
+ var _context$engine;
22
+ var context = useEngineContext();
23
+ locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
24
+ var _useState = useState((props === null || props === void 0 ? void 0 : props.value) || ''),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ num = _useState2[0],
27
+ setNum = _useState2[1];
28
+ var KeyboardItems = useMemo(function () {
29
+ return [{
30
+ value: 1,
31
+ label: '1',
32
+ disabled: false,
33
+ type: 'text'
34
+ }, {
35
+ value: 2,
36
+ label: '2',
37
+ disabled: false,
38
+ type: 'text'
39
+ }, {
40
+ value: 3,
41
+ label: '3',
42
+ disabled: false,
43
+ type: 'text'
44
+ }, {
45
+ value: 4,
46
+ label: '4',
47
+ disabled: false,
48
+ type: 'text'
49
+ }, {
50
+ value: 5,
51
+ label: '5',
52
+ disabled: false,
53
+ type: 'text'
54
+ }, {
55
+ value: 6,
56
+ label: '6',
57
+ disabled: false,
58
+ type: 'text'
59
+ }, {
60
+ value: 7,
61
+ label: '7',
62
+ disabled: false,
63
+ type: 'text'
64
+ }, {
65
+ value: 8,
66
+ label: '8',
67
+ disabled: false,
68
+ type: 'text'
69
+ }, {
70
+ value: 9,
71
+ label: '9',
72
+ disabled: false,
73
+ type: 'text'
74
+ }, {
75
+ value: 'delete',
76
+ label: (props === null || props === void 0 ? void 0 : props.deleteText) || /*#__PURE__*/React.createElement(Delete, {
77
+ className: "virtual-keyboard-input-delete-icon-num"
78
+ }),
79
+ disabled: false,
80
+ type: 'text'
81
+ }, {
82
+ value: 0,
83
+ label: '0',
84
+ disabled: false,
85
+ type: 'text'
86
+ }, {
87
+ value: 'ok',
88
+ label: (props === null || props === void 0 ? void 0 : props.okText) || locales.getText('pisell2.number.keyboard.ok'),
89
+ disabled: false,
90
+ type: 'primary'
91
+ }];
92
+ }, [locales, props === null || props === void 0 ? void 0 : props.okText, props === null || props === void 0 ? void 0 : props.deleteText]);
93
+ var handleKeyboardChange = function handleKeyboardChange(e) {
94
+ if (e === 'ok') {
95
+ var _props$onOk;
96
+ props === null || props === void 0 || (_props$onOk = props.onOk) === null || _props$onOk === void 0 || _props$onOk.call(props);
97
+ } else if (e === 'delete') {
98
+ var _props$onDelete;
99
+ if (num.length === 0) {
100
+ return;
101
+ }
102
+ var newNum = num.slice(0, -1);
103
+ setNum(newNum);
104
+ props === null || props === void 0 || (_props$onDelete = props.onDelete) === null || _props$onDelete === void 0 || _props$onDelete.call(props, newNum);
105
+ } else {
106
+ var _props$onChange;
107
+ // 如果输入框的最大长度大于0,则限制输入框的长度
108
+ if (props !== null && props !== void 0 && props.maxLength && num.length >= (props === null || props === void 0 ? void 0 : props.maxLength)) {
109
+ console.log('input_maxLength_over', props === null || props === void 0 ? void 0 : props.maxLength, num);
110
+ return;
111
+ }
112
+ var _newNum = num + e;
113
+
114
+ // 检查最大值限制
115
+ if (props !== null && props !== void 0 && props.max && parseInt(_newNum) > props.max) {
116
+ console.log('input_maxValue_over', props === null || props === void 0 ? void 0 : props.max, _newNum);
117
+ return;
118
+ }
119
+ setNum(_newNum);
120
+ props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, _newNum);
121
+ }
122
+ };
123
+ var handleInputChange = function handleInputChange(e) {
124
+ var _props$onChange2;
125
+ var newNum = e.target.value;
126
+
127
+ // 检查最大值限制
128
+ if (props !== null && props !== void 0 && props.max && parseInt(newNum) > props.max) {
129
+ return;
130
+ }
131
+ setNum(newNum);
132
+ props === null || props === void 0 || (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, newNum);
133
+ };
134
+ return /*#__PURE__*/React.createElement("div", {
135
+ className: "pisell-pro-number-keyboard"
136
+ }, /*#__PURE__*/React.createElement(VirtualKeyboard, {
137
+ style: _objectSpread({}, (props === null || props === void 0 ? void 0 : props.style) || {}),
138
+ selectType: "dark",
139
+ keyboardProps: {
140
+ keydown: false,
141
+ items: KeyboardItems,
142
+ onChange: handleKeyboardChange
143
+ },
144
+ virtualKeyInputProps: {
145
+ value: num,
146
+ onChange: handleInputChange,
147
+ placeholder: (props === null || props === void 0 ? void 0 : props.placeholder) || '',
148
+ style: _objectSpread({
149
+ height: '65px',
150
+ fontSize: '36px'
151
+ }, (props === null || props === void 0 ? void 0 : props.inputStyle) || {})
152
+ }
153
+ }));
154
+ };
155
+ export default NumberKeyboard;
@@ -0,0 +1,25 @@
1
+ .pisell-pro-number-keyboard {
2
+ zoom: 0.8;
3
+
4
+ .virtual-keyboard-wrap
5
+ .virtual-keyboard-content
6
+ .virtual-keyboard-item
7
+ .virtual-keyboard-item-button {
8
+ padding: 0 !important;
9
+ }
10
+
11
+ .virtual-keyboard-input-delete {
12
+ font-size: 30px !important;
13
+ color: #000 !important;
14
+ }
15
+
16
+ .virtual-keyboard-input-delete-icon-num {
17
+ padding-top: 6px;
18
+ font-size: 30px !important;
19
+ color: #000 !important;
20
+ }
21
+
22
+ .virtual-keyboard-component-left {
23
+ // background-color: rgba(29, 41, 57, 0.80) !important;
24
+ }
25
+ }
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.number.keyboard.ok': string;
4
+ };
5
+ 'zh-CN': {
6
+ 'pisell2.number.keyboard.ok': string;
7
+ };
8
+ 'zh-HK': {
9
+ 'pisell2.number.keyboard.ok': string;
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export default {
2
+ en: {
3
+ 'pisell2.number.keyboard.ok': 'OK'
4
+ },
5
+ 'zh-CN': {
6
+ 'pisell2.number.keyboard.ok': '确认'
7
+ },
8
+ 'zh-HK': {
9
+ 'pisell2.number.keyboard.ok': '確認'
10
+ }
11
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Example: React.FC;
3
+ export default Example;
@@ -0,0 +1,68 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useState } from 'react';
8
+ import PisellNumberSelector from "./index";
9
+ var Example = function Example() {
10
+ var _useState = useState(1),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ value1 = _useState2[0],
13
+ setValue1 = _useState2[1];
14
+ var _useState3 = useState(50),
15
+ _useState4 = _slicedToArray(_useState3, 2),
16
+ value2 = _useState4[0],
17
+ setValue2 = _useState4[1];
18
+ var _useState5 = useState(99),
19
+ _useState6 = _slicedToArray(_useState5, 2),
20
+ value3 = _useState6[0],
21
+ setValue3 = _useState6[1];
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ style: {
24
+ padding: '20px',
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ gap: '20px'
28
+ }
29
+ }, /*#__PURE__*/React.createElement("h3", null, "PisellNumberSelector \u4F7F\u7528\u793A\u4F8B"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u57FA\u7840\u7528\u6CD5"), /*#__PURE__*/React.createElement(PisellNumberSelector, {
30
+ value: value1,
31
+ onChange: setValue1,
32
+ min: 0,
33
+ max: 10,
34
+ size: "middle"
35
+ }), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C: ", value1)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u4E0D\u540C\u5C3A\u5BF8"), /*#__PURE__*/React.createElement("div", {
36
+ style: {
37
+ display: 'flex',
38
+ gap: '10px',
39
+ alignItems: 'center'
40
+ }
41
+ }, /*#__PURE__*/React.createElement(PisellNumberSelector, {
42
+ value: value2,
43
+ onChange: setValue2,
44
+ size: "small"
45
+ }), /*#__PURE__*/React.createElement(PisellNumberSelector, {
46
+ value: value2,
47
+ onChange: setValue2,
48
+ size: "middle"
49
+ }), /*#__PURE__*/React.createElement(PisellNumberSelector, {
50
+ value: value2,
51
+ onChange: setValue2,
52
+ size: "large"
53
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u542F\u7528\u4EF7\u683C\u8C03\u6574\u529F\u80FD"), /*#__PURE__*/React.createElement(PisellNumberSelector, {
54
+ value: value3,
55
+ onChange: setValue3,
56
+ min: 0,
57
+ max: 999,
58
+ size: "large",
59
+ enablePriceAdjust: true,
60
+ originValue: 100
61
+ }), /*#__PURE__*/React.createElement("p", null, "\u70B9\u51FB\u6570\u5B57\u53EF\u4EE5\u6253\u5F00\u4EF7\u683C\u8C03\u6574\u9762\u677F"), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C: ", value3)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u7981\u7528\u72B6\u6001"), /*#__PURE__*/React.createElement(PisellNumberSelector, {
62
+ value: 50,
63
+ onChange: function onChange() {},
64
+ disabled: true,
65
+ size: "middle"
66
+ })));
67
+ };
68
+ export default Example;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface PisellNumberSelectorProps {
4
+ /** 当前值 */
5
+ value?: number;
6
+ /** 最小值 */
7
+ min?: number;
8
+ /** 最大值 */
9
+ max?: number;
10
+ /** 步长 */
11
+ step?: number;
12
+ /** 强制宽度 */
13
+ width?: string;
14
+ styleType?: 'capsule' | 'separation';
15
+ /** 是否禁用 */
16
+ disabled?: boolean;
17
+ /** 值变化回调 */
18
+ onChange?: (value: number) => void;
19
+ /** 组件尺寸 */
20
+ size?: 'small' | 'middle' | 'large';
21
+ /** 自定义类名 */
22
+ className?: string;
23
+ /** 是否启用价格调整面板 */
24
+ enablePriceAdjust?: boolean;
25
+ /** 原始价格(用于价格调整) */
26
+ originValue?: number;
27
+ }
28
+ declare const PisellNumberSelector: React.FC<PisellNumberSelectorProps>;
29
+ export default PisellNumberSelector;
@@ -0,0 +1,257 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ 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); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useMemo, useState } from 'react';
12
+ import { Popover } from 'antd';
13
+ import Delete from '@pisell/icon/es/Delete';
14
+ import Plus from '@pisell/icon/es/Plus';
15
+ import Minus from '@pisell/icon/es/Minus';
16
+ // import { VirtualKeyboard } from '@pisell/materials';
17
+ import NumberKeyBoard from "../numberKeyboard";
18
+ import classNames from 'classnames';
19
+ import { locales } from '@pisell/utils';
20
+ import "./index.less";
21
+ var PisellNumberSelector = function PisellNumberSelector(_ref) {
22
+ var _ref$value = _ref.value,
23
+ value = _ref$value === void 0 ? 0 : _ref$value,
24
+ _ref$min = _ref.min,
25
+ min = _ref$min === void 0 ? 0 : _ref$min,
26
+ _ref$max = _ref.max,
27
+ max = _ref$max === void 0 ? 999 : _ref$max,
28
+ _ref$step = _ref.step,
29
+ step = _ref$step === void 0 ? 1 : _ref$step,
30
+ _ref$width = _ref.width,
31
+ width = _ref$width === void 0 ? '112px' : _ref$width,
32
+ _ref$styleType = _ref.styleType,
33
+ styleType = _ref$styleType === void 0 ? 'capsule' : _ref$styleType,
34
+ _ref$disabled = _ref.disabled,
35
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
36
+ onChange = _ref.onChange,
37
+ _ref$size = _ref.size,
38
+ size = _ref$size === void 0 ? 'middle' : _ref$size,
39
+ className = _ref.className,
40
+ _ref$enablePriceAdjus = _ref.enablePriceAdjust,
41
+ enablePriceAdjust = _ref$enablePriceAdjus === void 0 ? false : _ref$enablePriceAdjus,
42
+ _ref$originValue = _ref.originValue,
43
+ originValue = _ref$originValue === void 0 ? 0 : _ref$originValue;
44
+ var _useState = useState(false),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ open = _useState2[0],
47
+ setOpen = _useState2[1];
48
+ var _useState3 = useState(value.toString()),
49
+ _useState4 = _slicedToArray(_useState3, 2),
50
+ inputValue = _useState4[0],
51
+ setInputValue = _useState4[1];
52
+ var _useState5 = useState(value.toString()),
53
+ _useState6 = _slicedToArray(_useState5, 2),
54
+ tempValue = _useState6[0],
55
+ setTempValue = _useState6[1]; // 添加临时值状态
56
+
57
+ var KeyboardItems = useMemo(function () {
58
+ return [{
59
+ value: 1,
60
+ label: '1',
61
+ disabled: false,
62
+ type: 'text'
63
+ }, {
64
+ value: 2,
65
+ label: '2',
66
+ disabled: false,
67
+ type: 'text'
68
+ }, {
69
+ value: 3,
70
+ label: '3',
71
+ disabled: false,
72
+ type: 'text'
73
+ }, {
74
+ value: 4,
75
+ label: '4',
76
+ disabled: false,
77
+ type: 'text'
78
+ }, {
79
+ value: 5,
80
+ label: '5',
81
+ disabled: false,
82
+ type: 'text'
83
+ }, {
84
+ value: 6,
85
+ label: '6',
86
+ disabled: false,
87
+ type: 'text'
88
+ }, {
89
+ value: 7,
90
+ label: '7',
91
+ disabled: false,
92
+ type: 'text'
93
+ }, {
94
+ value: 8,
95
+ label: '8',
96
+ disabled: false,
97
+ type: 'text'
98
+ }, {
99
+ value: 9,
100
+ label: '9',
101
+ disabled: false,
102
+ type: 'text'
103
+ }, {
104
+ value: 'delete',
105
+ label: /*#__PURE__*/React.createElement(Delete, {
106
+ className: "virtual-keyboard-input-delete-icon"
107
+ }),
108
+ disabled: false,
109
+ type: 'text'
110
+ }, {
111
+ value: 0,
112
+ label: '0',
113
+ disabled: false,
114
+ type: 'text'
115
+ }, {
116
+ value: 'verify',
117
+ label: locales.getText('confirm') || '确认',
118
+ disabled: false,
119
+ type: 'primary'
120
+ }];
121
+ }, []);
122
+
123
+ // 减少数值
124
+ var handleDecrease = function handleDecrease(e) {
125
+ if (disabled) return;
126
+ e.stopPropagation(); // 阻止事件冒泡,避免触发键盘
127
+ var newValue = Math.max(min, value - step);
128
+ onChange === null || onChange === void 0 || onChange(newValue);
129
+ };
130
+
131
+ // 增加数值
132
+ var handleIncrease = function handleIncrease(e) {
133
+ if (disabled) return;
134
+ e.stopPropagation(); // 阻止事件冒泡,避免触发键盘
135
+ var newValue = Math.min(max, value + step);
136
+ onChange === null || onChange === void 0 || onChange(newValue);
137
+ };
138
+ var handleChange = function handleChange(e) {
139
+ if (!e) {
140
+ setTempValue(min.toString());
141
+ return;
142
+ }
143
+ if (e === 'delete') {
144
+ // 删除最后一位数字
145
+ var newTempValue = tempValue.slice(0, -1);
146
+ setTempValue(newTempValue || '0');
147
+ return;
148
+ } else if (e === 'verify') {
149
+ // 确认时提交暂存的值
150
+ var newValue = parseInt(tempValue) || 0;
151
+ var clampedValue = Math.max(min, Math.min(max, newValue));
152
+ onChange === null || onChange === void 0 || onChange(clampedValue);
153
+ setOpen(false); // 手动关闭弹窗
154
+ return;
155
+ } else {
156
+ // 更新暂存值,不直接触发onChange
157
+ setTempValue(e);
158
+ }
159
+ };
160
+
161
+ // 价格调整面板内容
162
+ var adjustPriceContent = useMemo(function () {
163
+ if (!enablePriceAdjust) return null;
164
+ return /*#__PURE__*/React.createElement(NumberKeyBoard, {
165
+ value: tempValue // 使用临时值
166
+ ,
167
+ max: max,
168
+ onChange: handleChange,
169
+ onOk: function onOk() {
170
+ var newValue = parseInt(tempValue) || 0;
171
+ var clampedValue = Math.max(min, Math.min(max, newValue));
172
+ onChange === null || onChange === void 0 || onChange(clampedValue);
173
+ setOpen(false);
174
+ }
175
+ });
176
+ }, [enablePriceAdjust, tempValue, max, handleChange]);
177
+
178
+ // 点击数字的处理
179
+ var handleNumberClick = function handleNumberClick() {
180
+ if (disabled) return;
181
+ if (enablePriceAdjust) {
182
+ // Popover 会自动处理打开,我们只需要设置初始值
183
+ setTempValue(value.toString()); // 设置临时值为当前值
184
+ }
185
+ };
186
+
187
+ // 处理弹窗开关时的值同步
188
+ var handleOpenChange = function handleOpenChange(visible) {
189
+ setOpen(visible);
190
+ if (visible) {
191
+ // 打开时设置临时值为当前值
192
+ setTempValue(value.toString());
193
+ } else {
194
+ // 关闭时检查是否需要提交值
195
+ var tempNumber = parseInt(tempValue) || 0;
196
+ var clampedValue = Math.max(min, Math.min(max, tempNumber));
197
+ if (clampedValue !== value) {
198
+ onChange === null || onChange === void 0 || onChange(clampedValue);
199
+ }
200
+ // 重置临时值为当前值,确保下次打开时显示正确的值
201
+ setTempValue(value.toString());
202
+ }
203
+ };
204
+
205
+ // 数字显示区域
206
+ var numberDisplayElement = enablePriceAdjust ? /*#__PURE__*/React.createElement("button", {
207
+ type: "button",
208
+ className: classNames('pisell-number-selector-number', {
209
+ 'pisell-number-selector-number-clickable': enablePriceAdjust && !disabled
210
+ }),
211
+ onClick: handleNumberClick,
212
+ disabled: disabled
213
+ }, value) : /*#__PURE__*/React.createElement("div", {
214
+ className: classNames('pisell-number-selector-number', {
215
+ 'pisell-number-selector-number-clickable': enablePriceAdjust && !disabled
216
+ })
217
+ }, value);
218
+
219
+ // 如果启用价格调整,只包装数字区域
220
+ var numberElement = enablePriceAdjust ? /*#__PURE__*/React.createElement(Popover, {
221
+ open: open,
222
+ content: adjustPriceContent,
223
+ trigger: ['click'] // 恢复点击触发
224
+ ,
225
+ overlayInnerStyle: {
226
+ padding: 0
227
+ },
228
+ destroyTooltipOnHide: true,
229
+ arrow: false,
230
+ align: {
231
+ offset: [0, 0]
232
+ },
233
+ overlayClassName: "pisell-number-selector-popover",
234
+ onOpenChange: handleOpenChange
235
+ }, numberDisplayElement) : numberDisplayElement;
236
+ return /*#__PURE__*/React.createElement("div", {
237
+ className: classNames('pisell-number-selector-new', className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "pisell-number-selector-".concat(size), size), 'pisell-number-selector-disabled', disabled), 'pisell-number-selector-capsule', styleType === 'capsule'), 'pisell-number-selector-separation', styleType === 'separation')),
238
+ style: {
239
+ width: width
240
+ }
241
+ }, /*#__PURE__*/React.createElement("button", {
242
+ type: "button",
243
+ className: "pisell-number-selector-btn pisell-number-selector-minus",
244
+ onClick: handleDecrease,
245
+ disabled: disabled || value <= min
246
+ }, /*#__PURE__*/React.createElement(Minus, {
247
+ size: 16
248
+ })), numberElement, /*#__PURE__*/React.createElement("button", {
249
+ type: "button",
250
+ className: "pisell-number-selector-btn pisell-number-selector-plus",
251
+ onClick: handleIncrease,
252
+ disabled: disabled || value >= max
253
+ }, /*#__PURE__*/React.createElement(Plus, {
254
+ size: 16
255
+ })));
256
+ };
257
+ export default PisellNumberSelector;