@pisell/private-materials 6.4.42 → 6.4.43

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 (188) 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 +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/actionButtons/index.js +37 -42
  12. package/es/components/booking/components/actionButtons/index.less +0 -28
  13. package/es/components/booking/components/footer/amount.d.ts +3 -3
  14. package/es/components/booking/components/footer/amount.js +13 -2
  15. package/es/components/booking/components/footer/index.js +168 -68
  16. package/es/components/booking/components/footer/utils.js +62 -33
  17. package/es/components/booking/info/model.js +5 -0
  18. package/es/components/booking/info/service/addService/index.js +2 -1
  19. package/es/components/booking/info2/index.js +42 -2
  20. package/es/components/booking/info2/service/addService/index.js +2 -1
  21. package/es/components/booking/info2/service/editService/index.js +12 -4
  22. package/es/components/checkout/PaymentModal.d.ts +2 -0
  23. package/es/components/checkout/PaymentModal.js +395 -240
  24. package/es/components/checkout/components/AdditionalModule/index.less +1 -1
  25. package/es/components/checkout/components/AmountSummary/index.js +161 -54
  26. package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  27. package/es/components/checkout/components/CashPaymentModule/index.js +114 -137
  28. package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
  29. package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
  30. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  31. package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +210 -0
  32. package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  33. package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
  34. package/es/components/checkout/components/PaymentOptionsModule/index.less +29 -0
  35. package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  36. package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
  37. package/es/components/checkout/components/WalletPassModule/index.js +3 -2
  38. package/es/components/checkout/components/WalletPassModule/utils.js +6 -1
  39. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  40. package/es/components/checkout/hooks/useWalletPass.js +2 -0
  41. package/es/components/checkout/index.less +1 -1
  42. package/es/components/checkout/locales.d.ts +33 -0
  43. package/es/components/checkout/locales.js +39 -3
  44. package/es/components/checkout/types.d.ts +1 -0
  45. package/es/components/eftposPay/hooks.d.ts +1 -1
  46. package/es/components/eftposPay/store/index.d.ts +2 -2
  47. package/es/components/shoppingCart/components/Cart/Product.js +143 -71
  48. package/es/components/shoppingCart/components/Cart/index.js +1 -1
  49. package/es/components/shoppingCart/components/Cart/index.less +31 -0
  50. package/es/components/shoppingCart/locales.d.ts +3 -0
  51. package/es/components/shoppingCart/locales.js +12 -3
  52. package/es/components/ticketBooking/utils/index.js +2 -1
  53. package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
  54. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  55. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
  56. package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  57. package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  58. package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
  59. package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  60. package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
  61. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
  62. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +310 -0
  63. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  64. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
  65. package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
  66. package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
  67. package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  68. package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  69. package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
  70. package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  71. package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
  72. package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  73. package/es/pro/priceKeyboard/components/discountKeyboard/index.js +442 -0
  74. package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  75. package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  76. package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
  77. package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  78. package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
  79. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
  80. package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
  81. package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  82. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  83. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
  84. package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  85. package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
  86. package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  87. package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
  88. package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  89. package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  90. package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
  91. package/es/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
  92. package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
  93. package/es/pro/priceKeyboard/index.d.ts +3 -0
  94. package/es/pro/priceKeyboard/index.js +3 -0
  95. package/es/pro/priceKeyboard/index.less +215 -0
  96. package/es/pro/priceKeyboard/utils.d.ts +31 -0
  97. package/es/pro/priceKeyboard/utils.js +51 -0
  98. package/es/pro/skuDetailModal/index.js +19 -16
  99. package/lib/components/booking/components/actionButtons/index.js +31 -28
  100. package/lib/components/booking/components/actionButtons/index.less +0 -28
  101. package/lib/components/booking/components/footer/amount.d.ts +3 -3
  102. package/lib/components/booking/components/footer/amount.js +10 -4
  103. package/lib/components/booking/components/footer/index.js +107 -40
  104. package/lib/components/booking/components/footer/utils.js +35 -7
  105. package/lib/components/booking/info/model.js +3 -0
  106. package/lib/components/booking/info/service/addService/index.js +2 -1
  107. package/lib/components/booking/info2/index.js +18 -1
  108. package/lib/components/booking/info2/service/addService/index.js +2 -1
  109. package/lib/components/booking/info2/service/editService/index.js +12 -4
  110. package/lib/components/checkout/PaymentModal.d.ts +2 -0
  111. package/lib/components/checkout/PaymentModal.js +152 -73
  112. package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
  113. package/lib/components/checkout/components/AmountSummary/index.js +114 -40
  114. package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
  115. package/lib/components/checkout/components/CashPaymentModule/index.js +103 -140
  116. package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
  117. package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
  118. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
  119. package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +172 -0
  120. package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
  121. package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
  122. package/lib/components/checkout/components/PaymentOptionsModule/index.less +29 -0
  123. package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
  124. package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
  125. package/lib/components/checkout/components/WalletPassModule/index.js +3 -2
  126. package/lib/components/checkout/components/WalletPassModule/utils.js +4 -1
  127. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  128. package/lib/components/checkout/hooks/useWalletPass.js +2 -0
  129. package/lib/components/checkout/index.less +1 -1
  130. package/lib/components/checkout/locales.d.ts +33 -0
  131. package/lib/components/checkout/locales.js +39 -3
  132. package/lib/components/checkout/types.d.ts +1 -0
  133. package/lib/components/eftposPay/hooks.d.ts +1 -1
  134. package/lib/components/eftposPay/store/index.d.ts +2 -2
  135. package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
  136. package/lib/components/shoppingCart/components/Cart/index.js +1 -1
  137. package/lib/components/shoppingCart/components/Cart/index.less +31 -0
  138. package/lib/components/shoppingCart/locales.d.ts +3 -0
  139. package/lib/components/shoppingCart/locales.js +6 -3
  140. package/lib/components/ticketBooking/index.js +5 -1
  141. package/lib/components/ticketBooking/utils/index.js +2 -1
  142. package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
  143. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
  144. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
  145. package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
  146. package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
  147. package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
  148. package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  149. package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
  150. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
  151. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +332 -0
  152. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
  153. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
  154. package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
  155. package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
  156. package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
  157. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  158. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
  159. package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
  160. package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
  161. package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
  162. package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +485 -0
  163. package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
  164. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  165. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
  166. package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  167. package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
  168. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
  169. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
  170. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
  171. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  172. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
  173. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  174. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
  175. package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
  176. package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
  177. package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
  178. package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
  179. package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
  180. package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
  181. package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
  182. package/lib/pro/priceKeyboard/index.d.ts +3 -0
  183. package/lib/pro/priceKeyboard/index.js +45 -0
  184. package/lib/pro/priceKeyboard/index.less +215 -0
  185. package/lib/pro/priceKeyboard/utils.d.ts +31 -0
  186. package/lib/pro/priceKeyboard/utils.js +75 -0
  187. package/lib/pro/skuDetailModal/index.js +18 -22
  188. package/package.json +4 -4
@@ -0,0 +1,35 @@
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/pisellSimplePriceKeyboardPopover/index.tsx
30
+ var pisellSimplePriceKeyboardPopover_exports = {};
31
+ __export(pisellSimplePriceKeyboardPopover_exports, {
32
+ default: () => import_PisellPriceKeyboardPopover.default
33
+ });
34
+ module.exports = __toCommonJS(pisellSimplePriceKeyboardPopover_exports);
35
+ var import_PisellPriceKeyboardPopover = __toESM(require("./PisellPriceKeyboardPopover"));
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ export interface PisellPriceKeyboardPopoverProps {
3
+ /** 触发元素 */
4
+ children: React.ReactNode;
5
+ /** 当前价格值 */
6
+ value?: string | number;
7
+ /** 价格变化回调(合并了 onChange 和 onEnter) */
8
+ onChange?: (value: string | number) => void;
9
+ /** 确认回调 */
10
+ onConfirm?: (value: string | number) => void;
11
+ /** 取消回调 */
12
+ onCancel?: () => void;
13
+ /** 货币符号显示 */
14
+ showCurrencySymbol?: boolean;
15
+ /** 是否使用千分位分隔符 */
16
+ useThousandsSeparator?: boolean;
17
+ /** 键盘主题 */
18
+ selectType?: 'light' | 'dark';
19
+ /** 是否禁用 */
20
+ disabled?: boolean;
21
+ /** Popover 额外的类名 */
22
+ overlayClassName?: string;
23
+ /** 自定义样式 */
24
+ style?: React.CSSProperties;
25
+ }
26
+ export interface PisellPriceKeyboardPopoverRef {
27
+ /** 打开键盘 */
28
+ open: () => void;
29
+ /** 关闭键盘 */
30
+ close: () => void;
31
+ /** 获取当前是否打开 */
32
+ isOpen: () => boolean;
33
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/pro/pisellSimplePriceKeyboardPopover/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,4 @@
1
+ import { CashKeyboardBaseProps } from './types';
2
+ import './index.less';
3
+ declare const CashKeyboardIntact: (props: CashKeyboardBaseProps) => JSX.Element;
4
+ export default CashKeyboardIntact;
@@ -0,0 +1,332 @@
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 CashKeyboardIntact = (props) => {
46
+ var _a, _b, _c;
47
+ const {
48
+ amountSymbol,
49
+ titleArea = {},
50
+ displayField = {},
51
+ originalValue,
52
+ presets,
53
+ style,
54
+ selectType = "light",
55
+ placeholder,
56
+ doneText,
57
+ resetText,
58
+ disabled,
59
+ hiddenChangeDue
60
+ } = props;
61
+ const [internalValue, setInternalValue] = (0, import_ahooks.useControllableValue)(props);
62
+ const [isShowModal, setIsShowModal] = (0, import_react.useState)(false);
63
+ const changeDue = (0, import_react.useMemo)(() => {
64
+ return Math.max(
65
+ 0,
66
+ new import_decimal.default(internalValue || 0).minus(new import_decimal.default(originalValue || 0)).toNumber()
67
+ );
68
+ }, [internalValue, originalValue]);
69
+ const _restProps = (0, import_react.useMemo)(() => {
70
+ return (0, import_lodash.omit)(props, [
71
+ "defaultValue",
72
+ "value",
73
+ "onChange",
74
+ "onEnter",
75
+ "onReset",
76
+ "style"
77
+ ]);
78
+ }, [props]);
79
+ (0, import_react.useEffect)(() => {
80
+ (0, import_utils2.setKeyboardTheme)(selectType);
81
+ }, [selectType]);
82
+ const getDefaultPresets = () => {
83
+ const defaultEndPresets = [
84
+ {
85
+ label: import_utils.locales.getText("cash-keyboard-other"),
86
+ value: "other",
87
+ style: {
88
+ color: "#344054",
89
+ backgroundColor: "white"
90
+ },
91
+ onClick: () => {
92
+ setIsShowModal(true);
93
+ },
94
+ render: () => /* @__PURE__ */ import_react.default.createElement(
95
+ "div",
96
+ {
97
+ style: {
98
+ position: "absolute",
99
+ left: 0,
100
+ top: 0,
101
+ bottom: 0,
102
+ right: 0,
103
+ display: "flex",
104
+ alignItems: "center",
105
+ justifyContent: "center"
106
+ }
107
+ },
108
+ import_utils.locales.getText("cash-keyboard-other")
109
+ )
110
+ },
111
+ {
112
+ label: resetText || import_utils.locales.getText("cash-keyboard-reset"),
113
+ value: "reset",
114
+ style: {
115
+ color: "#D92D20",
116
+ backgroundColor: "white"
117
+ },
118
+ onClick: () => {
119
+ var _a2;
120
+ setInternalValue(String(originalValue) || "");
121
+ (_a2 = props == null ? void 0 : props.onReset) == null ? void 0 : _a2.call(props);
122
+ }
123
+ },
124
+ {
125
+ label: doneText || import_utils.locales.getText("cash-keyboard-pay"),
126
+ value: "pay",
127
+ style: {
128
+ color: "white",
129
+ backgroundColor: "#7F56DA"
130
+ },
131
+ onClick: () => {
132
+ var _a2;
133
+ (_a2 = props.onEnter) == null ? void 0 : _a2.call(props, internalValue);
134
+ }
135
+ }
136
+ ];
137
+ const userPresets = presets || [];
138
+ const maxUserPresets = 8 - defaultEndPresets.length;
139
+ const limitedUserPresets = userPresets.slice(0, maxUserPresets);
140
+ return [...limitedUserPresets, ...defaultEndPresets];
141
+ };
142
+ const getDefaultDisplayField = () => {
143
+ return {
144
+ cashReceived: {
145
+ visible: true,
146
+ label: import_utils.locales.getText("cash-keyboard-cash-received")
147
+ },
148
+ balanceDue: {
149
+ visible: true,
150
+ label: import_utils.locales.getText("cash-keyboard-balance-due")
151
+ },
152
+ changeDue: {
153
+ visible: true,
154
+ label: import_utils.locales.getText("cash-keyboard-change-due")
155
+ },
156
+ gridRatio: [1, 2, 1]
157
+ // 左中右布局,中间占 2 份
158
+ };
159
+ };
160
+ const defaultTitleArea = {
161
+ visible: true,
162
+ title: {
163
+ visible: true
164
+ },
165
+ subtitle: {
166
+ visible: true
167
+ },
168
+ alignment: "space-between",
169
+ padding: "0px"
170
+ };
171
+ const mergedTitleArea = (0, import_lodash.merge)({}, defaultTitleArea, titleArea);
172
+ const mergedDisplayField = (0, import_lodash.merge)({}, getDefaultDisplayField(), displayField);
173
+ const renderTitleArea = () => {
174
+ var _a2, _b2;
175
+ const { title, subtitle } = mergedTitleArea || {};
176
+ if (!(title == null ? void 0 : title.visible) && !(subtitle == null ? void 0 : subtitle.visible)) {
177
+ return null;
178
+ }
179
+ if (!(title == null ? void 0 : title.text) && !(subtitle == null ? void 0 : subtitle.text)) {
180
+ return null;
181
+ }
182
+ const titleStyle = {
183
+ display: "flex",
184
+ justifyContent: mergedTitleArea.alignment,
185
+ alignItems: "center",
186
+ padding: mergedTitleArea.padding,
187
+ marginBottom: "8"
188
+ };
189
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: titleStyle }, ((_a2 = mergedTitleArea.title) == null ? void 0 : _a2.visible) && /* @__PURE__ */ import_react.default.createElement(
190
+ "div",
191
+ {
192
+ className: "pisell-cash-keyboard-title",
193
+ style: {
194
+ fontSize: mergedTitleArea.title.fontSize,
195
+ color: mergedTitleArea.title.color,
196
+ fontWeight: mergedTitleArea.title.fontWeight
197
+ }
198
+ },
199
+ mergedTitleArea.title.text
200
+ ), ((_b2 = mergedTitleArea.subtitle) == null ? void 0 : _b2.visible) && /* @__PURE__ */ import_react.default.createElement(
201
+ "div",
202
+ {
203
+ className: "pisell-cash-keyboard-subtitle",
204
+ style: {
205
+ fontSize: mergedTitleArea.subtitle.fontSize,
206
+ color: mergedTitleArea.subtitle.color,
207
+ fontWeight: mergedTitleArea.subtitle.fontWeight
208
+ }
209
+ },
210
+ mergedTitleArea.subtitle.text
211
+ ));
212
+ };
213
+ const getGridStyle = (index) => {
214
+ if (!mergedDisplayField.gridRatio) {
215
+ return { flex: 1 };
216
+ }
217
+ const ratio = mergedDisplayField.gridRatio[index] || 1;
218
+ return { flex: ratio };
219
+ };
220
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
221
+ "div",
222
+ {
223
+ className: `pisell-cash-keyboard pisell-cash-keyboard-intact ${disabled ? "disabled" : ""}`,
224
+ style: { ...style || {} }
225
+ },
226
+ renderTitleArea(),
227
+ /* @__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(
228
+ "div",
229
+ {
230
+ className: "pisell-cash-keyboard-intact-container-top",
231
+ style: { ...getGridStyle(0), overflow: "hidden" }
232
+ },
233
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.balanceDue.label),
234
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
235
+ import_materials.PisellText.Amount,
236
+ {
237
+ value: originalValue || "",
238
+ hideDecimalForWholeNumbers: false,
239
+ precision: 2
240
+ }
241
+ ))
242
+ ), ((_b = mergedDisplayField.cashReceived) == null ? void 0 : _b.visible) && /* @__PURE__ */ import_react.default.createElement(
243
+ import_materials.VirtualInput,
244
+ {
245
+ showCursor: false,
246
+ focused: true,
247
+ wrapperStyle: {
248
+ ...getGridStyle(1),
249
+ padding: "6px 16px",
250
+ borderRadius: "8px",
251
+ backgroundColor: "white",
252
+ boxShadow: "0px 1px 2px rgba(16, 24, 40, 0.06)",
253
+ overflow: "hidden",
254
+ maxWidth: 188
255
+ },
256
+ topContent: /* @__PURE__ */ import_react.default.createElement(
257
+ "div",
258
+ {
259
+ style: {
260
+ fontSize: "14px",
261
+ color: "#667085"
262
+ }
263
+ },
264
+ mergedDisplayField.cashReceived.label
265
+ ),
266
+ value: internalValue ? /* @__PURE__ */ import_react.default.createElement(
267
+ import_materials.PisellText.Amount,
268
+ {
269
+ value: internalValue,
270
+ hideDecimalForWholeNumbers: false,
271
+ precision: 2
272
+ }
273
+ ) : "",
274
+ height: 30,
275
+ fontSize: 20,
276
+ placeholder,
277
+ style: {
278
+ fontSize: "24px",
279
+ fontWeight: "bold",
280
+ border: "none",
281
+ background: "transparent",
282
+ width: "100%"
283
+ }
284
+ }
285
+ ), ((_c = mergedDisplayField.changeDue) == null ? void 0 : _c.visible) && /* @__PURE__ */ import_react.default.createElement(
286
+ "div",
287
+ {
288
+ className: "pisell-cash-keyboard-intact-container-top",
289
+ style: { ...getGridStyle(2), overflow: "hidden" }
290
+ },
291
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-label" }, mergedDisplayField.changeDue.label),
292
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-cash-keyboard-intact-container-top-value" }, /* @__PURE__ */ import_react.default.createElement(
293
+ import_materials.PisellText.Amount,
294
+ {
295
+ value: hiddenChangeDue ? 0 : changeDue,
296
+ hideDecimalForWholeNumbers: false,
297
+ precision: 2
298
+ }
299
+ ))
300
+ )), /* @__PURE__ */ import_react.default.createElement(
301
+ import_shortcuts.default,
302
+ {
303
+ presets: getDefaultPresets(),
304
+ onChange: setInternalValue,
305
+ disabled
306
+ }
307
+ ))
308
+ ), /* @__PURE__ */ import_react.default.createElement(
309
+ import_CashKeyboardSimple.default,
310
+ {
311
+ containerProps: {
312
+ renderType: "modal",
313
+ open: isShowModal,
314
+ onCancel: () => setIsShowModal(false)
315
+ },
316
+ ..._restProps,
317
+ titleArea: {
318
+ ...mergedTitleArea,
319
+ subtitle: { visible: false }
320
+ },
321
+ selectType: "dark",
322
+ value: internalValue,
323
+ onChange: setInternalValue,
324
+ onEnter: () => {
325
+ var _a2;
326
+ (_a2 = props.onEnter) == null ? void 0 : _a2.call(props, internalValue);
327
+ setIsShowModal(false);
328
+ }
329
+ }
330
+ ));
331
+ };
332
+ 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;