@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
@@ -0,0 +1,360 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.tsx
30
+ var CashKeyboardIntact_exports = {};
31
+ __export(CashKeyboardIntact_exports, {
32
+ default: () => CashKeyboardIntact_default
33
+ });
34
+ module.exports = __toCommonJS(CashKeyboardIntact_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_ahooks = require("ahooks");
37
+ var import_lodash = require("lodash");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_materials = require("@pisell/materials");
40
+ var import_shortcuts = __toESM(require("../shortcuts"));
41
+ var import_CashKeyboardSimple = __toESM(require("./CashKeyboardSimple"));
42
+ var import_utils2 = require("../../utils");
43
+ var import_index = require("./index.less");
44
+ var import_decimal = __toESM(require("decimal.js"));
45
+ var import_materials2 = require("@pisell/materials");
46
+ var import_utils3 = require("@pisell/utils");
47
+ var CashKeyboardIntact = (props) => {
48
+ var _a, _b, _c;
49
+ const {
50
+ amountSymbol,
51
+ titleArea = {},
52
+ displayField = {},
53
+ originalValue,
54
+ presets,
55
+ style,
56
+ selectType = "light",
57
+ placeholder,
58
+ doneText,
59
+ resetText,
60
+ disabled,
61
+ hiddenChangeDue
62
+ } = props;
63
+ const [internalValue, setInternalValue] = (0, import_ahooks.useControllableValue)(props);
64
+ const [isShowModal, setIsShowModal] = (0, import_react.useState)(false);
65
+ const changeDue = (0, import_react.useMemo)(() => {
66
+ return Math.max(
67
+ 0,
68
+ new import_decimal.default(internalValue || 0).minus(new import_decimal.default(originalValue || 0)).toNumber()
69
+ );
70
+ }, [internalValue, originalValue]);
71
+ const _restProps = (0, import_react.useMemo)(() => {
72
+ return (0, import_lodash.omit)(props, [
73
+ "defaultValue",
74
+ "value",
75
+ "onChange",
76
+ "onEnter",
77
+ "onReset",
78
+ "style"
79
+ ]);
80
+ }, [props]);
81
+ (0, import_react.useEffect)(() => {
82
+ (0, import_utils2.setKeyboardTheme)(selectType);
83
+ }, [selectType]);
84
+ const getDefaultPresets = () => {
85
+ const defaultEndPresets = [
86
+ {
87
+ label: import_utils.locales.getText("cash-keyboard-other"),
88
+ value: "other",
89
+ style: {
90
+ color: "#344054",
91
+ backgroundColor: "white"
92
+ },
93
+ onClick: () => {
94
+ setIsShowModal(true);
95
+ },
96
+ render: () => /* @__PURE__ */ import_react.default.createElement(
97
+ "div",
98
+ {
99
+ style: {
100
+ position: "absolute",
101
+ left: 0,
102
+ top: 0,
103
+ bottom: 0,
104
+ right: 0,
105
+ display: "flex",
106
+ alignItems: "center",
107
+ justifyContent: "center"
108
+ }
109
+ },
110
+ import_utils.locales.getText("cash-keyboard-other")
111
+ )
112
+ },
113
+ {
114
+ label: resetText || import_utils.locales.getText("cash-keyboard-reset"),
115
+ value: "reset",
116
+ style: {
117
+ color: "#D92D20",
118
+ backgroundColor: "white"
119
+ },
120
+ onClick: () => {
121
+ var _a2;
122
+ setInternalValue(String(originalValue) || "");
123
+ (_a2 = props == null ? void 0 : props.onReset) == null ? void 0 : _a2.call(props);
124
+ }
125
+ },
126
+ {
127
+ label: doneText || import_utils.locales.getText("cash-keyboard-pay"),
128
+ value: "pay",
129
+ style: {
130
+ color: "white",
131
+ backgroundColor: "#7F56DA"
132
+ },
133
+ onClick: () => {
134
+ var _a2;
135
+ (_a2 = props.onEnter) == null ? void 0 : _a2.call(props, internalValue);
136
+ }
137
+ }
138
+ ];
139
+ const userPresets = presets || [];
140
+ const maxUserPresets = 8 - defaultEndPresets.length;
141
+ const limitedUserPresets = userPresets.slice(0, maxUserPresets);
142
+ return [...limitedUserPresets, ...defaultEndPresets];
143
+ };
144
+ const getDefaultDisplayField = () => {
145
+ return {
146
+ cashReceived: {
147
+ visible: true,
148
+ label: import_utils.locales.getText("cash-keyboard-cash-received")
149
+ },
150
+ balanceDue: {
151
+ visible: true,
152
+ label: import_utils.locales.getText("cash-keyboard-balance-due")
153
+ },
154
+ changeDue: {
155
+ visible: true,
156
+ label: import_utils.locales.getText("cash-keyboard-change-due")
157
+ },
158
+ gridRatio: [1, 2, 1]
159
+ // 左中右布局,中间占 2 份
160
+ };
161
+ };
162
+ const defaultTitleArea = {
163
+ visible: true,
164
+ title: {
165
+ visible: true
166
+ },
167
+ subtitle: {
168
+ visible: true
169
+ },
170
+ alignment: "space-between",
171
+ padding: "0px"
172
+ };
173
+ const mergedTitleArea = (0, import_lodash.merge)({}, defaultTitleArea, titleArea);
174
+ const mergedDisplayField = (0, import_lodash.merge)({}, getDefaultDisplayField(), displayField);
175
+ const renderTitleArea = () => {
176
+ var _a2, _b2;
177
+ const { title, subtitle } = mergedTitleArea || {};
178
+ if (!(title == null ? void 0 : title.visible) && !(subtitle == null ? void 0 : subtitle.visible)) {
179
+ return null;
180
+ }
181
+ if (!(title == null ? void 0 : title.text) && !(subtitle == null ? void 0 : subtitle.text)) {
182
+ return null;
183
+ }
184
+ const titleStyle = {
185
+ display: "flex",
186
+ justifyContent: mergedTitleArea.alignment,
187
+ alignItems: "center",
188
+ padding: mergedTitleArea.padding,
189
+ marginBottom: "8"
190
+ };
191
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: titleStyle }, ((_a2 = mergedTitleArea.title) == null ? void 0 : _a2.visible) && /* @__PURE__ */ import_react.default.createElement(
192
+ "div",
193
+ {
194
+ className: "pisell-cash-keyboard-title",
195
+ style: {
196
+ fontSize: mergedTitleArea.title.fontSize,
197
+ color: mergedTitleArea.title.color,
198
+ fontWeight: mergedTitleArea.title.fontWeight
199
+ }
200
+ },
201
+ mergedTitleArea.title.text
202
+ ), ((_b2 = mergedTitleArea.subtitle) == null ? void 0 : _b2.visible) && /* @__PURE__ */ import_react.default.createElement(
203
+ "div",
204
+ {
205
+ className: "pisell-cash-keyboard-subtitle",
206
+ style: {
207
+ fontSize: mergedTitleArea.subtitle.fontSize,
208
+ color: mergedTitleArea.subtitle.color,
209
+ fontWeight: mergedTitleArea.subtitle.fontWeight
210
+ }
211
+ },
212
+ mergedTitleArea.subtitle.text
213
+ ));
214
+ };
215
+ const getGridStyle = (index) => {
216
+ if (!mergedDisplayField.gridRatio) {
217
+ return { flex: 1 };
218
+ }
219
+ const ratio = mergedDisplayField.gridRatio[index] || 1;
220
+ return { flex: ratio };
221
+ };
222
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
223
+ "div",
224
+ {
225
+ className: `pisell-cash-keyboard pisell-cash-keyboard-intact ${disabled ? "disabled" : ""}`,
226
+ style: { ...style || {} }
227
+ },
228
+ renderTitleArea(),
229
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container" }, /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "16px" } }, ((_a = mergedDisplayField.balanceDue) == null ? void 0 : _a.visible) && /* @__PURE__ */ import_react.default.createElement(
230
+ "div",
231
+ {
232
+ className: "pisell-cash-keyboard-intact-container-top",
233
+ style: { ...getGridStyle(0), overflow: "hidden" }
234
+ },
235
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.balanceDue.label),
236
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
237
+ import_materials2.AutoResizeText,
238
+ {
239
+ minFontSizePx: 10,
240
+ maxFontSizePx: 14,
241
+ fontSizePrecisionPx: 0.5
242
+ },
243
+ (0, import_utils3.formatAmountWithOptions)(originalValue || "", "", {
244
+ precision: 2,
245
+ hideDecimalForWholeNumbers: false
246
+ })
247
+ ))
248
+ ), ((_b = mergedDisplayField.cashReceived) == null ? void 0 : _b.visible) && /* @__PURE__ */ import_react.default.createElement(
249
+ "div",
250
+ {
251
+ style: {
252
+ ...getGridStyle(1),
253
+ padding: "6px 16px",
254
+ borderRadius: "8px",
255
+ backgroundColor: "white",
256
+ boxShadow: "0px 1px 2px rgba(16, 24, 40, 0.06)",
257
+ overflow: "hidden",
258
+ maxWidth: 188,
259
+ cursor: "pointer"
260
+ },
261
+ onClick: () => {
262
+ setIsShowModal(true);
263
+ }
264
+ },
265
+ /* @__PURE__ */ import_react.default.createElement(
266
+ import_materials.VirtualInput,
267
+ {
268
+ showCursor: false,
269
+ focused: true,
270
+ wrapperStyle: {
271
+ width: "100%"
272
+ },
273
+ topContent: /* @__PURE__ */ import_react.default.createElement(
274
+ "div",
275
+ {
276
+ style: {
277
+ fontSize: "14px",
278
+ color: "#667085"
279
+ }
280
+ },
281
+ mergedDisplayField.cashReceived.label
282
+ ),
283
+ value: internalValue ? /* @__PURE__ */ import_react.default.createElement(
284
+ import_materials2.AutoResizeText,
285
+ {
286
+ minFontSizePx: 10,
287
+ maxFontSizePx: 14,
288
+ fontSizePrecisionPx: 0.5
289
+ },
290
+ (0, import_utils3.formatAmountWithOptions)(internalValue || "", "", {
291
+ value: internalValue,
292
+ hideDecimalForWholeNumbers: false,
293
+ precision: 2
294
+ })
295
+ ) : "",
296
+ height: 30,
297
+ fontSize: 20,
298
+ placeholder,
299
+ style: {
300
+ fontSize: "24px",
301
+ fontWeight: "bold",
302
+ border: "none",
303
+ background: "transparent",
304
+ width: "100%"
305
+ }
306
+ }
307
+ )
308
+ ), ((_c = mergedDisplayField.changeDue) == null ? void 0 : _c.visible) && /* @__PURE__ */ import_react.default.createElement(
309
+ "div",
310
+ {
311
+ className: "pisell-cash-keyboard-intact-container-top",
312
+ style: { ...getGridStyle(2), overflow: "hidden" }
313
+ },
314
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.changeDue.label),
315
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
316
+ import_materials2.AutoResizeText,
317
+ {
318
+ minFontSizePx: 10,
319
+ maxFontSizePx: 14,
320
+ fontSizePrecisionPx: 0.5
321
+ },
322
+ (0, import_utils3.formatAmountWithOptions)(hiddenChangeDue ? 0 : changeDue, "", {
323
+ value: hiddenChangeDue ? 0 : changeDue,
324
+ hideDecimalForWholeNumbers: false,
325
+ precision: 2
326
+ })
327
+ ))
328
+ )), /* @__PURE__ */ import_react.default.createElement(
329
+ import_shortcuts.default,
330
+ {
331
+ presets: getDefaultPresets(),
332
+ onChange: setInternalValue,
333
+ disabled
334
+ }
335
+ ))
336
+ ), /* @__PURE__ */ import_react.default.createElement(
337
+ import_CashKeyboardSimple.default,
338
+ {
339
+ containerProps: {
340
+ renderType: "modal",
341
+ open: isShowModal,
342
+ onCancel: () => setIsShowModal(false)
343
+ },
344
+ ..._restProps,
345
+ titleArea: {
346
+ ...mergedTitleArea,
347
+ subtitle: { visible: false }
348
+ },
349
+ selectType: "dark",
350
+ value: internalValue,
351
+ onChange: setInternalValue,
352
+ onEnter: () => {
353
+ var _a2;
354
+ (_a2 = props.onEnter) == null ? void 0 : _a2.call(props, internalValue);
355
+ setIsShowModal(false);
356
+ }
357
+ }
358
+ ));
359
+ };
360
+ var CashKeyboardIntact_default = CashKeyboardIntact;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CashKeyboardBaseProps } from './types';
3
+ import './index.less';
4
+ export interface CashKeyboardSimpleProps extends CashKeyboardBaseProps {
5
+ containerProps?: {
6
+ renderType: 'modal' | 'popover';
7
+ open: boolean;
8
+ [key: string]: any;
9
+ };
10
+ children?: React.ReactNode;
11
+ }
12
+ declare const CashKeyboardSimple: (props: CashKeyboardSimpleProps) => JSX.Element | null;
13
+ export default CashKeyboardSimple;