@pisell/private-materials 6.5.4 → 6.5.6

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 (249) 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 +160 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/booking/addons/model.d.ts +1 -10
  12. package/es/components/booking/components/actionButtons/index.js +37 -42
  13. package/es/components/booking/components/actionButtons/index.less +0 -28
  14. package/es/components/booking/components/footer/amount.d.ts +3 -3
  15. package/es/components/booking/components/footer/amount.js +51 -31
  16. package/es/components/booking/components/footer/index.js +177 -68
  17. package/es/components/booking/components/footer/utils.js +62 -33
  18. package/es/components/booking/forms/model.d.ts +1 -10
  19. package/es/components/booking/info/model.d.ts +1 -10
  20. package/es/components/booking/info/model.js +5 -0
  21. package/es/components/booking/info/service/addService/index.js +2 -1
  22. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info/service2/utils.d.ts +1 -1
  24. package/es/components/booking/info2/index.js +42 -2
  25. package/es/components/booking/info2/service/addService/index.js +2 -1
  26. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  27. package/es/components/booking/info2/service/editService/index.js +12 -4
  28. package/es/components/booking/model.d.ts +1 -9
  29. package/es/components/booking/notes/model.d.ts +1 -10
  30. package/es/components/booking/payments/model.d.ts +1 -10
  31. package/es/components/booking/utils.js +10 -5
  32. package/es/components/checkout/PaymentModal.d.ts +2 -0
  33. package/es/components/checkout/PaymentModal.js +462 -263
  34. package/es/components/checkout/components/AdditionalModule/index.less +1 -1
  35. package/es/components/checkout/components/AmountSummary/index.js +176 -65
  36. package/es/components/checkout/components/AmountSummary/index.less +13 -0
  37. package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  38. package/es/components/checkout/components/CashPaymentModule/index.js +110 -132
  39. package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
  40. package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
  41. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  42. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +214 -0
  43. package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  44. package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
  45. package/es/components/checkout/components/PaymentOptionsModule/index.less +23 -0
  46. package/es/components/checkout/components/PaymentResultToast/index.js +38 -8
  47. package/es/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
  48. package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  49. package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
  50. package/es/components/checkout/components/WalletPassModule/index.js +4 -3
  51. package/es/components/checkout/components/WalletPassModule/utils.js +10 -4
  52. package/es/components/checkout/hooks/useWalletPass.js +11 -4
  53. package/es/components/checkout/index.less +1 -1
  54. package/es/components/checkout/locales.d.ts +36 -0
  55. package/es/components/checkout/locales.js +43 -4
  56. package/es/components/checkout/types.d.ts +1 -0
  57. package/es/components/eftposPay/amount.d.ts +1 -1
  58. package/es/components/eftposPay/device.d.ts +1 -1
  59. package/es/components/eftposPay/hooks.d.ts +1 -1
  60. package/es/components/eftposPay/store/index.d.ts +3 -3
  61. package/es/components/pay/toC/model.d.ts +1 -9
  62. package/es/components/schedules/model.d.ts +1 -9
  63. package/es/components/shoppingCart/components/Cart/Product.js +143 -71
  64. package/es/components/shoppingCart/components/Cart/index.js +1 -1
  65. package/es/components/shoppingCart/components/Cart/index.less +31 -0
  66. package/es/components/shoppingCart/locales.d.ts +3 -0
  67. package/es/components/shoppingCart/locales.js +12 -3
  68. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
  69. package/es/components/ticketBooking/components/addServiceVariant/addService.js +9 -12
  70. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  71. package/es/components/ticketBooking/components/menuBar/index.js +3 -1
  72. package/es/components/ticketBooking/components/menuBar/index.less +7 -0
  73. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  74. package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
  75. package/es/components/ticketBooking/index.d.ts +0 -1
  76. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  77. package/es/components/ticketBooking/utils/index.js +2 -1
  78. package/es/components/wallet/Detail/model.d.ts +1 -13
  79. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  80. package/es/components/wallet/PointCard/model.d.ts +1 -13
  81. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  82. package/es/components/wallet/Voucher/model.d.ts +1 -13
  83. package/es/components/wallet/model.d.ts +1 -9
  84. package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
  85. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  86. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
  87. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  88. package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  89. package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
  90. package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  91. package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
  92. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
  93. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +331 -0
  94. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  95. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
  96. package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
  97. package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
  98. package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  99. package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  100. package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
  101. package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  102. package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
  103. package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  104. package/es/pro/priceKeyboard/components/discountKeyboard/index.js +465 -0
  105. package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  106. package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  107. package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
  108. package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  109. package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
  110. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
  111. package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
  112. package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  113. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  114. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
  115. package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  116. package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
  117. package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  118. package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
  119. package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  120. package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  121. package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
  122. package/es/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
  123. package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
  124. package/es/pro/priceKeyboard/index.d.ts +3 -0
  125. package/es/pro/priceKeyboard/index.js +3 -0
  126. package/es/pro/priceKeyboard/index.less +215 -0
  127. package/es/pro/priceKeyboard/utils.d.ts +31 -0
  128. package/es/pro/priceKeyboard/utils.js +51 -0
  129. package/es/pro/skuDetailModal/index.js +19 -16
  130. package/lib/components/booking/addons/model.d.ts +1 -10
  131. package/lib/components/booking/components/actionButtons/index.js +31 -28
  132. package/lib/components/booking/components/actionButtons/index.less +0 -28
  133. package/lib/components/booking/components/footer/amount.d.ts +3 -3
  134. package/lib/components/booking/components/footer/amount.js +49 -34
  135. package/lib/components/booking/components/footer/index.js +114 -40
  136. package/lib/components/booking/components/footer/utils.js +35 -7
  137. package/lib/components/booking/forms/model.d.ts +1 -10
  138. package/lib/components/booking/info/model.d.ts +1 -10
  139. package/lib/components/booking/info/model.js +3 -0
  140. package/lib/components/booking/info/service/addService/index.js +2 -1
  141. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  142. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  143. package/lib/components/booking/info2/index.js +18 -1
  144. package/lib/components/booking/info2/service/addService/index.js +2 -1
  145. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  146. package/lib/components/booking/info2/service/editService/index.js +12 -4
  147. package/lib/components/booking/model.d.ts +1 -9
  148. package/lib/components/booking/notes/model.d.ts +1 -10
  149. package/lib/components/booking/payments/model.d.ts +1 -10
  150. package/lib/components/booking/utils.js +10 -5
  151. package/lib/components/checkout/PaymentModal.d.ts +2 -0
  152. package/lib/components/checkout/PaymentModal.js +208 -91
  153. package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
  154. package/lib/components/checkout/components/AmountSummary/index.js +120 -50
  155. package/lib/components/checkout/components/AmountSummary/index.less +13 -0
  156. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  157. package/lib/components/checkout/components/CashPaymentModule/index.js +101 -134
  158. package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
  159. package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
  160. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  161. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +163 -0
  162. package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  163. package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
  164. package/lib/components/checkout/components/PaymentOptionsModule/index.less +23 -0
  165. package/lib/components/checkout/components/PaymentResultToast/index.js +26 -1
  166. package/lib/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
  167. package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  168. package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
  169. package/lib/components/checkout/components/WalletPassModule/index.js +4 -3
  170. package/lib/components/checkout/components/WalletPassModule/utils.js +8 -4
  171. package/lib/components/checkout/hooks/useWalletPass.js +11 -6
  172. package/lib/components/checkout/index.less +1 -1
  173. package/lib/components/checkout/locales.d.ts +36 -0
  174. package/lib/components/checkout/locales.js +43 -4
  175. package/lib/components/checkout/types.d.ts +1 -0
  176. package/lib/components/eftposPay/amount.d.ts +1 -1
  177. package/lib/components/eftposPay/device.d.ts +1 -1
  178. package/lib/components/eftposPay/hooks.d.ts +1 -1
  179. package/lib/components/eftposPay/store/index.d.ts +3 -3
  180. package/lib/components/pay/toC/model.d.ts +1 -9
  181. package/lib/components/schedules/model.d.ts +1 -9
  182. package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
  183. package/lib/components/shoppingCart/components/Cart/index.js +1 -1
  184. package/lib/components/shoppingCart/components/Cart/index.less +31 -0
  185. package/lib/components/shoppingCart/locales.d.ts +3 -0
  186. package/lib/components/shoppingCart/locales.js +6 -3
  187. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
  188. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -4
  189. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  190. package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
  191. package/lib/components/ticketBooking/components/menuBar/index.less +7 -0
  192. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  193. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
  194. package/lib/components/ticketBooking/index.d.ts +0 -1
  195. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  196. package/lib/components/ticketBooking/utils/index.js +2 -1
  197. package/lib/components/wallet/Detail/model.d.ts +1 -13
  198. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  199. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  200. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  201. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  202. package/lib/components/wallet/model.d.ts +1 -9
  203. package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
  204. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  205. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
  206. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  207. package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  208. package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
  209. package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  210. package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
  211. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
  212. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +360 -0
  213. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  214. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
  215. package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
  216. package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
  217. package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  218. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  219. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
  220. package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  221. package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
  222. package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  223. package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +504 -0
  224. package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  225. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  226. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
  227. package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  228. package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
  229. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
  230. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
  231. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  232. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  233. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
  234. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  235. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
  236. package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  237. package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
  238. package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  239. package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  240. package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
  241. package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
  242. package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
  243. package/lib/pro/priceKeyboard/index.d.ts +3 -0
  244. package/lib/pro/priceKeyboard/index.js +45 -0
  245. package/lib/pro/priceKeyboard/index.less +215 -0
  246. package/lib/pro/priceKeyboard/utils.d.ts +31 -0
  247. package/lib/pro/priceKeyboard/utils.js +75 -0
  248. package/lib/pro/skuDetailModal/index.js +18 -22
  249. package/package.json +12 -12
@@ -1,4 +1,3 @@
1
- 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); }
2
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); }
3
2
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -10,17 +9,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10
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; } }
11
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
11
  import React, { useState, useEffect } from 'react';
13
- import "./index.less";
14
- import classNames from 'classnames';
15
- import { Edit05 } from '@pisell/icon';
16
- import PisellPriceKeyboardPopover from "../../../../pro/pisellPriceKeyboardPopover";
17
- // import pisellos from "@/utils/pisellos"; // 暂时注释,使用 context 中的 pisellos
18
-
19
12
  import useEngineContext from "../../../../hooks/useEngineContext";
13
+ // @ts-ignore
20
14
  import { locales, formatAmount } from '@pisell/utils';
21
15
  import checkoutLocales from "../../locales";
22
16
  import useToast from "../../../../hooks/useToast";
23
17
  import { useDebounceFn } from 'ahooks';
18
+ import { CashKeyboard } from "../../../../pro/priceKeyboard";
19
+ import "./index.less";
24
20
  export function CashPaymentModule(_ref) {
25
21
  var amountSymbol = _ref.amountSymbol,
26
22
  orderInfo = _ref.orderInfo,
@@ -32,7 +28,9 @@ export function CashPaymentModule(_ref) {
32
28
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
33
29
  roundingFunction = _ref.roundingFunction,
34
30
  _ref$balanceDueAmount = _ref.balanceDueAmount,
35
- balanceDueAmount = _ref$balanceDueAmount === void 0 ? '0' : _ref$balanceDueAmount;
31
+ balanceDueAmount = _ref$balanceDueAmount === void 0 ? '0' : _ref$balanceDueAmount,
32
+ _ref$syncingLock = _ref.syncingLock,
33
+ syncingLock = _ref$syncingLock === void 0 ? false : _ref$syncingLock;
36
34
  var _useState = useState(customAmount || ''),
37
35
  _useState2 = _slicedToArray(_useState, 2),
38
36
  amount = _useState2[0],
@@ -41,21 +39,13 @@ export function CashPaymentModule(_ref) {
41
39
  _useState4 = _slicedToArray(_useState3, 2),
42
40
  roundingAmount = _useState4[0],
43
41
  setRoundingAmount = _useState4[1];
44
- var _useState5 = useState(amountButtons.length ? amountButtons : new Array(6).fill(0)),
45
- _useState6 = _slicedToArray(_useState5, 2),
46
- amountList = _useState6[0],
47
- setAmountList = _useState6[1];
48
- useEffect(function () {
49
- setAmountList(amountButtons.length ? amountButtons : new Array(6).fill(0));
50
- }, [amountButtons]);
51
42
  var context = useEngineContext();
52
- // const { pisellos, action, token, store, getApp } = context.appHelper?.utils;
53
43
  var Toast = useToast();
54
44
 
55
45
  // 创建本地翻译函数,优先使用 checkout 语言包
56
46
  var getText = function getText(key, fallback) {
57
- var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _checkoutLocales;
58
- var currentLang = ((_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';
47
+ var _context$appHelper, _context$appHelper$ge, _context$appHelper$ge2, _context$appHelper$ut, _checkoutLocales;
48
+ var currentLang = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.call(_context$appHelper)) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.locales) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge2 = _context$appHelper$ge.getLocale) === null || _context$appHelper$ge2 === void 0 ? void 0 : _context$appHelper$ge2.call(_context$appHelper$ge)) || ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en';
59
49
  var checkoutText = (_checkoutLocales = checkoutLocales[currentLang]) === null || _checkoutLocales === void 0 ? void 0 : _checkoutLocales[key];
60
50
  if (checkoutText) {
61
51
  return checkoutText;
@@ -66,7 +56,6 @@ export function CashPaymentModule(_ref) {
66
56
  };
67
57
  useEffect(function () {
68
58
  handleKeyboardConfirm(customAmount || '');
69
- // setAmount(customAmount || '');
70
59
  }, [customAmount, balanceDueAmount]);
71
60
 
72
61
  // 检查是否应该禁用按钮:原本disabled为true 或者 订单金额为0
@@ -84,7 +73,7 @@ export function CashPaymentModule(_ref) {
84
73
  if (isAmountButtonsDisabled) return;
85
74
  if (onPaymentComplete) {
86
75
  if (Number(amount) === 0 && Math.abs(roundingAmount) === 0) {
87
- Toast.fail(getText('pisell2.amount-summary.amount-cannot-be-zero', 'The amount cannot be 0'));
76
+ Toast.fail(getText('cash-payment-amount-cannot-be-zero', 'The amount cannot be 0'));
88
77
  return;
89
78
  }
90
79
  var finalAmount = typeof amount === 'number' ? amount : Number(amount) || 0;
@@ -98,9 +87,11 @@ export function CashPaymentModule(_ref) {
98
87
  }
99
88
  };
100
89
 
101
- // 使用防抖,1000毫秒内不重复执行
90
+ // 使用防抖,500毫秒内不重复执行
102
91
  var _useDebounceFn = useDebounceFn(handleCashPayInternal, {
103
- wait: 1000
92
+ wait: 500,
93
+ leading: true,
94
+ trailing: false
104
95
  }),
105
96
  handleCashPay = _useDebounceFn.run;
106
97
 
@@ -120,24 +111,23 @@ export function CashPaymentModule(_ref) {
120
111
  setRoundingAmount(0);
121
112
  return _context.abrupt("return");
122
113
  case 4:
123
- ;
124
114
  finalValue = String(value);
125
115
  console.log('键盘确认:', finalValue);
126
116
  if (!(Number(finalValue) === 0)) {
127
- _context.next = 10;
117
+ _context.next = 9;
128
118
  break;
129
119
  }
130
- Toast.fail(getText('pisell2.amount-summary.amount-cannot-be-zero', 'The amount cannot be 0'));
120
+ Toast.fail(getText('cash-payment-amount-cannot-be-zero', 'The amount cannot be 0'));
131
121
  return _context.abrupt("return");
132
- case 10:
122
+ case 9:
133
123
  if (!(finalValue === '' || finalValue === null || finalValue === undefined)) {
134
- _context.next = 14;
124
+ _context.next = 13;
135
125
  break;
136
126
  }
137
127
  setAmount('');
138
- _context.next = 33;
128
+ _context.next = 32;
139
129
  break;
140
- case 14:
130
+ case 13:
141
131
  // 移除可能的货币符号和多余空格
142
132
  cleanValue = finalValue.replace(/[$\s]/g, '');
143
133
  numValue = parseFloat(cleanValue); // 检查当前金额是否等于剩余支付金额
@@ -146,22 +136,22 @@ export function CashPaymentModule(_ref) {
146
136
  finalAmount = numValue;
147
137
  roundingDiff = 0;
148
138
  if (!(shouldApplyRounding && roundingFunction)) {
149
- _context.next = 30;
139
+ _context.next = 29;
150
140
  break;
151
141
  }
152
- _context.next = 23;
142
+ _context.next = 22;
153
143
  return roundingFunction(numValue);
154
- case 23:
144
+ case 22:
155
145
  _result = _context.sent;
156
146
  _ref3 = _result || {}, _ref3$roundedAmount = _ref3.roundedAmount, roundedAmount = _ref3$roundedAmount === void 0 ? numValue : _ref3$roundedAmount, _ref3$roundingDiffere = _ref3.roundingDifference, roundingDifference = _ref3$roundingDiffere === void 0 ? 0 : _ref3$roundingDiffere;
157
147
  finalAmount = roundedAmount;
158
148
  roundingDiff = roundingDifference;
159
149
  console.log('应用抹零:', numValue, '->', roundedAmount, '差额:', roundingDifference);
160
- _context.next = 31;
150
+ _context.next = 30;
161
151
  break;
162
- case 30:
152
+ case 29:
163
153
  console.log('不应用抹零,用户输入金额:', numValue, '剩余支付金额:', balanceDue);
164
- case 31:
154
+ case 30:
165
155
  setRoundingAmount(roundingDiff);
166
156
  if (isNaN(numValue)) {
167
157
  setAmount('');
@@ -169,7 +159,7 @@ export function CashPaymentModule(_ref) {
169
159
  setAmount(finalAmount.toString());
170
160
  console.log('设置金额为:', finalAmount);
171
161
  }
172
- case 33:
162
+ case 32:
173
163
  case "end":
174
164
  return _context.stop();
175
165
  }
@@ -180,103 +170,91 @@ export function CashPaymentModule(_ref) {
180
170
  };
181
171
  }();
182
172
 
183
- // 处理键盘取消
184
- var handleKeyboardCancel = function handleKeyboardCancel() {
185
- console.log('键盘取消');
186
- };
187
-
188
- // 处理键盘输入变化
189
- var handleKeyboardChange = function handleKeyboardChange(value) {
190
- if (isInputDisabled) return;
191
- var stringValue = String(value);
192
- console.log('键盘输入变化:', stringValue, '类型:', _typeof(stringValue));
193
- // 在实时输入过程中更新amount状态
194
- setAmount(stringValue);
195
- };
196
- return /*#__PURE__*/React.createElement("div", {
197
- className: classNames('cash-pay-container', {
198
- 'cash-pay-container--disabled': disabled
199
- })
200
- }, /*#__PURE__*/React.createElement("div", {
201
- className: classNames('cash-pay-header')
202
- }, /*#__PURE__*/React.createElement("div", {
203
- className: classNames('cash-pay-header-title')
204
- }, getText('cash') || 'Cash'), Math.abs(roundingAmount) > 0 && /*#__PURE__*/React.createElement("div", {
205
- className: classNames('cash-pay-header-rounding')
206
- }, getText('rounding') || 'Rounding', ":", ' ', formatAmount(roundingAmount, 2, amountSymbol))), /*#__PURE__*/React.createElement("div", {
207
- className: classNames('cash-pay-main-content', {
208
- 'cash-pay-main-content--disabled': disabled
209
- })
210
- }, /*#__PURE__*/React.createElement("div", {
211
- className: classNames('cash-pay-payment-area')
212
- }, /*#__PURE__*/React.createElement(PisellPriceKeyboardPopover, {
213
- value: amount || '0'
214
- // onChange={handleKeyboardChange}
173
+ // 重置功能 - 重置为待支付金额,保留抹零
174
+ var handleReset = /*#__PURE__*/function () {
175
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
176
+ var resetAmount, cleanValue, numValue, balanceDue, shouldApplyRounding, finalAmount, roundingDiff, _result2, _ref5, _ref5$roundedAmount, roundedAmount, _ref5$roundingDiffere, roundingDifference;
177
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
178
+ while (1) switch (_context2.prev = _context2.next) {
179
+ case 0:
180
+ if (!isAmountButtonsDisabled) {
181
+ _context2.next = 2;
182
+ break;
183
+ }
184
+ return _context2.abrupt("return");
185
+ case 2:
186
+ resetAmount = balanceDueAmount || '0'; // 移除可能的货币符号和多余空格
187
+ cleanValue = resetAmount.replace(/[$\s]/g, '');
188
+ numValue = parseFloat(cleanValue); // 检查当前金额是否等于剩余支付金额
189
+ balanceDue = parseFloat(balanceDueAmount);
190
+ shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01; // 使用小数精度比较
191
+ finalAmount = numValue;
192
+ roundingDiff = 0;
193
+ if (!(shouldApplyRounding && roundingFunction)) {
194
+ _context2.next = 19;
195
+ break;
196
+ }
197
+ _context2.next = 12;
198
+ return roundingFunction(finalAmount);
199
+ case 12:
200
+ _result2 = _context2.sent;
201
+ _ref5 = _result2 || {}, _ref5$roundedAmount = _ref5.roundedAmount, roundedAmount = _ref5$roundedAmount === void 0 ? numValue : _ref5$roundedAmount, _ref5$roundingDiffere = _ref5.roundingDifference, roundingDifference = _ref5$roundingDiffere === void 0 ? 0 : _ref5$roundingDiffere;
202
+ finalAmount = roundedAmount;
203
+ roundingDiff = roundingDifference;
204
+ console.log('应用抹零:', numValue, '->', roundedAmount, '差额:', roundingDifference);
205
+ _context2.next = 20;
206
+ break;
207
+ case 19:
208
+ console.log('不应用抹零,用户输入金额:', numValue, '剩余支付金额:', balanceDue);
209
+ case 20:
210
+ setAmount(finalAmount.toString());
211
+ setRoundingAmount(roundingDiff);
212
+ case 22:
213
+ case "end":
214
+ return _context2.stop();
215
+ }
216
+ }, _callee2);
217
+ }));
218
+ return function handleReset() {
219
+ return _ref4.apply(this, arguments);
220
+ };
221
+ }();
222
+ return /*#__PURE__*/React.createElement(CashKeyboard, {
223
+ variant: "intact"
224
+ // 原价格:订单的待支付金额
215
225
  ,
216
- onConfirm: handleKeyboardConfirm,
217
- onCancel: handleKeyboardCancel,
218
- showCurrencySymbol: true,
219
- useThousandsSeparator: true,
220
- selectType: "dark",
221
- overlayClassName: "cash-payment-keyboard-popover",
222
- disabled: isInputDisabled
223
- }, /*#__PURE__*/React.createElement("div", {
224
- className: classNames('cash-pay-amount-input-area', {
225
- 'cash-pay-amount-input-area--disabled': isInputDisabled
226
- })
227
- }, /*#__PURE__*/React.createElement(Edit05, {
228
- className: classNames('cash-pay-amount-edit-icon', {
229
- 'cash-pay-amount-edit-icon--disabled': isInputDisabled
230
- })
231
- }), /*#__PURE__*/React.createElement("div", {
232
- className: classNames('cash-pay-amount-input-wrapper', {
233
- 'cash-pay-amount-input-wrapper--disabled': isInputDisabled
234
- })
235
- }, /*#__PURE__*/React.createElement("span", {
236
- className: classNames('cash-pay-currency-symbol', {
237
- 'cash-pay-currency-symbol--disabled': isInputDisabled
238
- })
239
- }, amountSymbol), /*#__PURE__*/React.createElement("div", {
240
- className: classNames('cash-pay-amount-display', {
241
- 'cash-pay-amount-display--disabled': isInputDisabled
242
- })
243
- }, amount || '0.00')))), /*#__PURE__*/React.createElement("div", _extends({
244
- className: classNames('cash-pay-button', {
245
- 'cash-pay-button--disabled': isAmountButtonsDisabled
246
- })
247
- }, isAmountButtonsDisabled ? {} : {
248
- onClick: handleCashPay
249
- }, {
250
- style: {
251
- cursor: isAmountButtonsDisabled ? 'not-allowed' : 'pointer'
252
- }
253
- }), /*#__PURE__*/React.createElement("div", {
254
- className: classNames('cash-pay-button-text', {
255
- 'cash-pay-button-text--disabled': isAmountButtonsDisabled
256
- })
257
- }, getText('cash.payment') || 'Cash Pay'))), /*#__PURE__*/React.createElement("div", {
258
- className: classNames('cash-pay-amount-button-grid', {
259
- 'cash-pay-amount-button-grid--disabled': isAmountButtonsDisabled
260
- })
261
- }, amountList.slice(0, 6).map(function (amount, index) {
262
- return /*#__PURE__*/React.createElement("div", _extends({
263
- key: index,
264
- className: classNames('cash-pay-amount-button', {
265
- 'cash-pay-amount-button--disabled': isAmountButtonsDisabled
266
- })
267
- }, isAmountButtonsDisabled ? {} : {
268
- onClick: function onClick() {
269
- return handleAmountClick(amount);
270
- }
271
- }, {
272
- style: {
273
- cursor: isAmountButtonsDisabled ? 'not-allowed' : 'pointer'
226
+ originalValue: customAmount
227
+ // 当前值:实收现金(cash recevie)
228
+ ,
229
+ value: amount,
230
+ disabled: disabled,
231
+ hiddenChangeDue: roundingAmount > 0,
232
+ onChange: function onChange(value) {
233
+ setAmount(value);
234
+ setRoundingAmount(0);
235
+ },
236
+ titleArea: {
237
+ visible: true,
238
+ title: {
239
+ text: getText('cash-payment-title', 'Cash Payment')
240
+ },
241
+ subtitle: {
242
+ visible: Math.abs(roundingAmount) > 0,
243
+ text: "".concat(getText('cash-payment-rounding', 'Rounding'), ": ").concat(formatAmount(roundingAmount, 2, amountSymbol))
274
244
  }
275
- }), /*#__PURE__*/React.createElement("div", {
276
- className: classNames('cash-pay-amount-button-text', {
277
- 'cash-pay-amount-button-text--disabled': isAmountButtonsDisabled
278
- })
279
- }, formatAmount(amount, 2, amountSymbol)));
280
- }))));
245
+ },
246
+ style: {
247
+ width: '100%',
248
+ backgroundColor: 'transparent'
249
+ },
250
+ presets: amountButtons.slice(0, 5).map(function (buttonAmount) {
251
+ return {
252
+ label: formatAmount(buttonAmount, 2, amountSymbol),
253
+ value: buttonAmount
254
+ };
255
+ }),
256
+ onReset: handleReset,
257
+ onEnter: syncingLock ? undefined : handleCashPay
258
+ });
281
259
  }
282
260
  export default CashPaymentModule;