@pisell/private-materials 6.6.60 → 6.6.62

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 (133) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/booking/components/footer/amount.js +3 -4
  12. package/es/components/booking/components/footer/utils.js +82 -85
  13. package/es/components/booking/components/voucher/index.js +1 -1
  14. package/es/components/booking/dashboard/index.d.ts +5 -0
  15. package/es/components/booking/dashboard/index.js +9 -6
  16. package/es/components/booking/info/service2/Group/utils.js +30 -1
  17. package/es/components/booking/info2/service/editService/index.js +6 -49
  18. package/es/components/booking/info2/service/editService/utils.d.ts +0 -1
  19. package/es/components/booking/info2/service/editService/utils.js +0 -16
  20. package/es/components/booking/payments/index.js +1 -1
  21. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  22. package/es/components/checkout/hooks/useWalletPass.js +23 -15
  23. package/es/components/index.d.ts +2 -1
  24. package/es/components/index.js +2 -1
  25. package/es/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  26. package/es/components/pisellCashCounting/PisellCashCounting.js +121 -0
  27. package/es/components/pisellCashCounting/PisellCashCounting.less +263 -0
  28. package/es/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  29. package/es/components/pisellCashCounting/components/CashCountingModal/index.js +250 -0
  30. package/es/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  31. package/es/components/pisellCashCounting/hooks.d.ts +21 -0
  32. package/es/components/pisellCashCounting/hooks.js +193 -0
  33. package/es/components/pisellCashCounting/index.d.ts +2 -0
  34. package/es/components/pisellCashCounting/index.js +1 -0
  35. package/es/components/pisellCashCounting/locales.d.ts +118 -0
  36. package/es/components/pisellCashCounting/locales.js +117 -0
  37. package/es/components/pisellCashCounting/types.d.ts +85 -0
  38. package/es/components/pisellCashCounting/types.js +1 -0
  39. package/es/components/pisellCashCounting/utils.d.ts +10 -0
  40. package/es/components/pisellCashCounting/utils.js +40 -0
  41. package/es/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  42. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  43. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +5 -2
  44. package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  45. package/es/components/ticketBooking/components/bookingDataPanel/index.js +5 -2
  46. package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +2 -1
  47. package/es/components/ticketBooking/components/ticketBooking/index.js +156 -37
  48. package/es/components/ticketBooking/index.js +7 -1
  49. package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
  50. package/es/hooks/useResponsive.d.ts +8 -0
  51. package/es/hooks/useResponsive.js +43 -0
  52. package/es/hooks/useThemeTokens.d.ts +7 -0
  53. package/es/hooks/useThemeTokens.js +20 -0
  54. package/es/index.d.ts +1 -0
  55. package/es/index.js +2 -1
  56. package/es/pro/Login2.0/components/phoneValidation.js +65 -58
  57. package/es/pro/NumericStepper/index.d.ts +75 -0
  58. package/es/pro/NumericStepper/index.js +301 -0
  59. package/es/pro/NumericStepper/index.less +364 -0
  60. package/es/pro/keyboards/index.d.ts +2 -0
  61. package/es/pro/keyboards/index.js +1 -0
  62. package/es/pro/keyboards/locales.d.ts +38 -0
  63. package/es/pro/keyboards/locales.js +57 -0
  64. package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  65. package/es/pro/keyboards/numberKeyboard/index.js +523 -0
  66. package/es/pro/keyboards/numberKeyboard/index.less +59 -0
  67. package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  68. package/es/pro/keyboards/numberKeyboard/types.js +1 -0
  69. package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  70. package/es/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  71. package/lib/components/booking/components/footer/amount.js +3 -3
  72. package/lib/components/booking/components/footer/utils.js +11 -15
  73. package/lib/components/booking/components/voucher/index.js +1 -1
  74. package/lib/components/booking/dashboard/index.d.ts +5 -0
  75. package/lib/components/booking/dashboard/index.js +6 -5
  76. package/lib/components/booking/info/service2/Group/utils.js +42 -3
  77. package/lib/components/booking/info2/service/editService/index.js +5 -39
  78. package/lib/components/booking/info2/service/editService/utils.d.ts +0 -1
  79. package/lib/components/booking/info2/service/editService/utils.js +0 -16
  80. package/lib/components/booking/payments/index.js +1 -1
  81. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  82. package/lib/components/checkout/hooks/useWalletPass.js +23 -16
  83. package/lib/components/index.d.ts +2 -1
  84. package/lib/components/index.js +3 -0
  85. package/lib/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  86. package/lib/components/pisellCashCounting/PisellCashCounting.js +168 -0
  87. package/lib/components/pisellCashCounting/PisellCashCounting.less +263 -0
  88. package/lib/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  89. package/lib/components/pisellCashCounting/components/CashCountingModal/index.js +171 -0
  90. package/lib/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  91. package/lib/components/pisellCashCounting/hooks.d.ts +21 -0
  92. package/lib/components/pisellCashCounting/hooks.js +189 -0
  93. package/lib/components/pisellCashCounting/index.d.ts +2 -0
  94. package/lib/components/pisellCashCounting/index.js +35 -0
  95. package/lib/components/pisellCashCounting/locales.d.ts +118 -0
  96. package/lib/components/pisellCashCounting/locales.js +141 -0
  97. package/lib/components/pisellCashCounting/types.d.ts +85 -0
  98. package/lib/components/pisellCashCounting/types.js +17 -0
  99. package/lib/components/pisellCashCounting/utils.d.ts +10 -0
  100. package/lib/components/pisellCashCounting/utils.js +59 -0
  101. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  102. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +2 -0
  103. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.js +3 -2
  104. package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +2 -0
  105. package/lib/components/ticketBooking/components/bookingDataPanel/index.js +10 -3
  106. package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.js +10 -1
  107. package/lib/components/ticketBooking/components/ticketBooking/index.js +114 -14
  108. package/lib/components/ticketBooking/index.js +11 -1
  109. package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
  110. package/lib/hooks/useResponsive.d.ts +8 -0
  111. package/lib/hooks/useResponsive.js +48 -0
  112. package/lib/hooks/useThemeTokens.d.ts +7 -0
  113. package/lib/hooks/useThemeTokens.js +40 -0
  114. package/lib/index.d.ts +1 -0
  115. package/lib/index.js +3 -0
  116. package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
  117. package/lib/pro/NumericStepper/index.d.ts +75 -0
  118. package/lib/pro/NumericStepper/index.js +338 -0
  119. package/lib/pro/NumericStepper/index.less +364 -0
  120. package/lib/pro/keyboards/index.d.ts +2 -0
  121. package/lib/pro/keyboards/index.js +39 -0
  122. package/lib/pro/keyboards/locales.d.ts +38 -0
  123. package/lib/pro/keyboards/locales.js +61 -0
  124. package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  125. package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
  126. package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
  127. package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  128. package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
  129. package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  130. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  131. package/lowcode/pisell-cash-counting/meta.ts +167 -0
  132. package/lowcode/pisell-cash-counting/snippets.ts +13 -0
  133. package/package.json +4 -4
@@ -0,0 +1,141 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/pisellCashCounting/locales.ts
20
+ var locales_exports = {};
21
+ __export(locales_exports, {
22
+ default: () => locales_default
23
+ });
24
+ module.exports = __toCommonJS(locales_exports);
25
+ var locales_default = {
26
+ en: {
27
+ "pisell-cash-counting.countCash": "Count cash",
28
+ "pisell-cash-counting.subtitle": "Enter the quantity for each denomination. The total will be calculated automatically.",
29
+ "pisell-cash-counting.currency": "Currency",
30
+ "pisell-cash-counting.bills": "Bills",
31
+ "pisell-cash-counting.coins": "Coins",
32
+ "pisell-cash-counting.billsSubtotal": "Bills subtotal",
33
+ "pisell-cash-counting.coinsSubtotal": "Coins subtotal",
34
+ "pisell-cash-counting.subtotal": "Subtotal",
35
+ "pisell-cash-counting.total": "Total",
36
+ "pisell-cash-counting.clearAll": "Clear all",
37
+ "pisell-cash-counting.cancel": "Cancel",
38
+ "pisell-cash-counting.confirm": "Confirm",
39
+ "pisell-cash-counting.placeholder": "Please enter",
40
+ "pisell-cash-counting.empty": "No denomination config for this currency.",
41
+ "pisell-cash-counting.no-country-config": "No denomination data is configured for this region. Please contact your system administrator.",
42
+ "pisell-cash-counting.manual-vs-count-message-title": "Tip",
43
+ "pisell-cash-counting.manual-vs-count-message": "The actual amount was edited manually and no longer matches the cash count details.",
44
+ "pisell-cash-counting.use-count-total": "Use counted total",
45
+ "pisell-cash-counting.keep-manual-amount": "Keep manual amount",
46
+ "pisell2.customise-item.save": "Save",
47
+ "pisell2.booking.info.text.clear": "Clear"
48
+ },
49
+ "zh-CN": {
50
+ "pisell-cash-counting.countCash": "数钱",
51
+ "pisell-cash-counting.subtitle": "请输入每个面额的数量,系统将自动计算现金总额。",
52
+ "pisell-cash-counting.currency": "币种",
53
+ "pisell-cash-counting.bills": "纸币",
54
+ "pisell-cash-counting.coins": "硬币",
55
+ "pisell-cash-counting.billsSubtotal": "纸币小计",
56
+ "pisell-cash-counting.coinsSubtotal": "硬币小计",
57
+ "pisell-cash-counting.subtotal": "小计",
58
+ "pisell-cash-counting.total": "合计",
59
+ "pisell-cash-counting.clearAll": "清空",
60
+ "pisell-cash-counting.cancel": "取消",
61
+ "pisell-cash-counting.confirm": "确认",
62
+ "pisell-cash-counting.placeholder": "请输入",
63
+ "pisell-cash-counting.empty": "当前币种暂无面额配置。",
64
+ "pisell-cash-counting.no-country-config": "该国家未配置数据,请联系系统人员",
65
+ "pisell-cash-counting.manual-vs-count-message-title": "提示",
66
+ "pisell-cash-counting.manual-vs-count-message": "实际金额已被手动修改,当前金额与数钱明细不一致。",
67
+ "pisell-cash-counting.use-count-total": "使用数钱金额",
68
+ "pisell-cash-counting.keep-manual-amount": "保留手动金额",
69
+ "pisell2.customise-item.save": "保存",
70
+ "pisell2.booking.info.text.clear": "清空"
71
+ },
72
+ "zh-HK": {
73
+ "pisell-cash-counting.countCash": "數錢",
74
+ "pisell-cash-counting.subtitle": "請輸入每個面額的數量,系統會自動計算現金總額。",
75
+ "pisell-cash-counting.currency": "幣種",
76
+ "pisell-cash-counting.bills": "紙幣",
77
+ "pisell-cash-counting.coins": "硬幣",
78
+ "pisell-cash-counting.billsSubtotal": "紙幣小計",
79
+ "pisell-cash-counting.coinsSubtotal": "硬幣小計",
80
+ "pisell-cash-counting.subtotal": "小計",
81
+ "pisell-cash-counting.total": "合計",
82
+ "pisell-cash-counting.clearAll": "清空",
83
+ "pisell-cash-counting.cancel": "取消",
84
+ "pisell-cash-counting.confirm": "確認",
85
+ "pisell-cash-counting.placeholder": "請輸入",
86
+ "pisell-cash-counting.empty": "目前幣種暫無面額配置。",
87
+ "pisell-cash-counting.no-country-config": "該國家未配置數據,請聯繫系統人員",
88
+ "pisell-cash-counting.manual-vs-count-message-title": "提示",
89
+ "pisell-cash-counting.manual-vs-count-message": "實際金額已被手動修改,當前金額與數錢明細不一致。",
90
+ "pisell-cash-counting.use-count-total": "使用數錢金額",
91
+ "pisell-cash-counting.keep-manual-amount": "保留手動金額",
92
+ "pisell2.customise-item.save": "保存",
93
+ "pisell2.booking.info.text.clear": "清空"
94
+ },
95
+ ja: {
96
+ "pisell-cash-counting.countCash": "現金を数える",
97
+ "pisell-cash-counting.subtitle": "各金種の数量を入力すると、合計金額が自動計算されます。",
98
+ "pisell-cash-counting.currency": "通貨",
99
+ "pisell-cash-counting.bills": "紙幣",
100
+ "pisell-cash-counting.coins": "硬貨",
101
+ "pisell-cash-counting.billsSubtotal": "紙幣小計",
102
+ "pisell-cash-counting.coinsSubtotal": "硬貨小計",
103
+ "pisell-cash-counting.subtotal": "小計",
104
+ "pisell-cash-counting.total": "合計",
105
+ "pisell-cash-counting.clearAll": "クリア",
106
+ "pisell-cash-counting.cancel": "キャンセル",
107
+ "pisell-cash-counting.confirm": "確認",
108
+ "pisell-cash-counting.placeholder": "入力してください",
109
+ "pisell-cash-counting.empty": "この通貨の金種設定がありません。",
110
+ "pisell-cash-counting.no-country-config": "この国・地域の金種データが設定されていません。システム管理者にお問い合わせください。",
111
+ "pisell-cash-counting.manual-vs-count-message-title": "ヒント",
112
+ "pisell-cash-counting.manual-vs-count-message": "実際の金額が手入力で変更され、現在の金額が現金集計の内訳と一致しません。",
113
+ "pisell-cash-counting.use-count-total": "集計金額を使う",
114
+ "pisell-cash-counting.keep-manual-amount": "手入力の金額を残す",
115
+ "pisell2.customise-item.save": "保存",
116
+ "pisell2.booking.info.text.clear": "清空"
117
+ },
118
+ pt: {
119
+ "pisell-cash-counting.countCash": "Contar dinheiro",
120
+ "pisell-cash-counting.subtitle": "Insira a quantidade de cada denominação. O total será calculado automaticamente.",
121
+ "pisell-cash-counting.currency": "Moeda",
122
+ "pisell-cash-counting.bills": "Notas",
123
+ "pisell-cash-counting.coins": "Moedas",
124
+ "pisell-cash-counting.billsSubtotal": "Subtotal de notas",
125
+ "pisell-cash-counting.coinsSubtotal": "Subtotal de moedas",
126
+ "pisell-cash-counting.subtotal": "Subtotal",
127
+ "pisell-cash-counting.total": "Total",
128
+ "pisell-cash-counting.clearAll": "Limpar",
129
+ "pisell-cash-counting.cancel": "Cancelar",
130
+ "pisell-cash-counting.confirm": "Confirmar",
131
+ "pisell-cash-counting.placeholder": "Insira",
132
+ "pisell-cash-counting.empty": "Nenhuma configuração de denominação para esta moeda.",
133
+ "pisell-cash-counting.no-country-config": "Não há dados de denominação configurados para esta região. Contacte o administrador do sistema.",
134
+ "pisell-cash-counting.manual-vs-count-message-title": "Dica",
135
+ "pisell-cash-counting.manual-vs-count-message": "O valor real foi editado manualmente e já não coincide com os detalhes da contagem de numerário.",
136
+ "pisell-cash-counting.use-count-total": "Usar total contado",
137
+ "pisell-cash-counting.keep-manual-amount": "Manter valor manual",
138
+ "pisell2.customise-item.save": "Salvar",
139
+ "pisell2.booking.info.text.clear": "Limpar"
140
+ }
141
+ };
@@ -0,0 +1,85 @@
1
+ import React from 'react';
2
+ import { ButtonProps, InputNumberProps } from 'antd';
3
+ export declare type CashDenominationType = 'bill' | 'coin';
4
+ /** 金额输入与数钱按钮的排列:`vertical` 上下,`horizontal` 左右 */
5
+ export declare type PisellCashCountingLayout = 'vertical' | 'horizontal';
6
+ export interface CurrencyDenominationConfig {
7
+ /** 币种编码,例如 AUD、JPY、USD */
8
+ currency_code: string;
9
+ /** 面额数值 */
10
+ denomination_value: number;
11
+ /** 展示文案,例如 $100、¥10,000、50¢ */
12
+ denomination_label: string;
13
+ /** 面额类型:纸币或硬币 */
14
+ denomination_type: CashDenominationType;
15
+ /** 展示顺序 */
16
+ sort_order: number;
17
+ /** 金额小数位,JPY 为 0,AUD 为 2 */
18
+ decimal_places: number;
19
+ /** 是否启用 */
20
+ is_enabled: boolean;
21
+ /** 国家/地区,可选扩展字段 */
22
+ country_region?: string;
23
+ /** 当前是否生效,可选扩展字段 */
24
+ effective_status?: boolean | 'active' | 'inactive';
25
+ }
26
+ export interface CashCountingDetail {
27
+ denomination: CurrencyDenominationConfig;
28
+ quantity: number;
29
+ amount: number;
30
+ }
31
+ export interface CashCountingConfirmPayload {
32
+ amount: number | string;
33
+ currencyCode: string;
34
+ decimalPlaces: number;
35
+ billSubtotal: number | string;
36
+ coinSubtotal: number | string;
37
+ details: CashCountingDetail[];
38
+ quantities: Record<string, number>;
39
+ }
40
+ export interface PisellCashCountingProps {
41
+ /** 当前金额,受控模式 */
42
+ value?: number;
43
+ /** 默认金额,非受控模式 */
44
+ defaultValue?: number | string;
45
+ /** 币种编码 */
46
+ currencyCode?: string;
47
+ /** 货币符号,不传时按币种默认推断 */
48
+ currencySymbol?: string;
49
+ /** 金额小数位,不传时按面额配置推断 */
50
+ amountPrecision?: number;
51
+ /** 可扩展的币种面额 JSON 配置 */
52
+ denominations?: CurrencyDenominationConfig[];
53
+ /** 禁用整体输入 */
54
+ disabled?: boolean;
55
+ /** 禁用数钱按钮 */
56
+ countDisabled?: boolean;
57
+ /** 金额输入占位 */
58
+ placeholder?: string;
59
+ /** 输入框与数钱按钮的布局,默认上下排列 */
60
+ layout?: PisellCashCountingLayout;
61
+ /** 数钱按钮文案 */
62
+ countCashButtonText?: React.ReactNode;
63
+ /** 弹窗宽度 */
64
+ modalWidth?: number | string;
65
+ /** 价格键盘是否显示货币符号 */
66
+ showCurrencySymbol?: boolean;
67
+ /** 价格键盘是否使用千分位 */
68
+ useThousandsSeparator?: boolean;
69
+ /** 输入框透传属性 */
70
+ inputNumberProps?: Omit<InputNumberProps, 'value' | 'defaultValue' | 'onChange'>;
71
+ /** 数钱按钮透传属性 */
72
+ buttonProps?: ButtonProps;
73
+ /** 自定义类名 */
74
+ className?: string;
75
+ /** 自定义样式 */
76
+ style?: React.CSSProperties;
77
+ /** 金额变化 */
78
+ onChange?: (value: number | string, meta?: {
79
+ source: 'manual' | 'count';
80
+ }) => void;
81
+ /** 点钞确认 */
82
+ onCountConfirm?: (payload: CashCountingConfirmPayload) => void;
83
+ /** 取消点钞 */
84
+ onCountCancel?: () => void;
85
+ }
@@ -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/components/pisellCashCounting/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,10 @@
1
+ import { CurrencyDenominationConfig } from './types';
2
+ /** 面额配置唯一键,用于数量映射 */
3
+ export declare const getDenominationId: (item: CurrencyDenominationConfig) => string;
4
+ /** 按小数位规范化金额,避免浮点误差 */
5
+ export declare const normalizeAmount: (value: string | number | null | undefined, precision: number) => number;
6
+ /** 业务规则:是否可作为有效面额参与点钞 */
7
+ export declare const isEffectiveDenomination: (item: CurrencyDenominationConfig) => boolean;
8
+ /** 当前币种下已启用且排序后的面额列表 */
9
+ export declare const getEffectiveDenominationsForCurrency: (denominations: CurrencyDenominationConfig[], currencyCode: string) => CurrencyDenominationConfig[];
10
+ export declare const buildEmptyQuantities: (items: CurrencyDenominationConfig[]) => Record<string, number>;
@@ -0,0 +1,59 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/pisellCashCounting/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ buildEmptyQuantities: () => buildEmptyQuantities,
23
+ getDenominationId: () => getDenominationId,
24
+ getEffectiveDenominationsForCurrency: () => getEffectiveDenominationsForCurrency,
25
+ isEffectiveDenomination: () => isEffectiveDenomination,
26
+ normalizeAmount: () => normalizeAmount
27
+ });
28
+ module.exports = __toCommonJS(utils_exports);
29
+ var getDenominationId = (item) => `${item.currency_code}-${item.denomination_type}-${item.denomination_value}`;
30
+ var normalizeAmount = (value, precision) => {
31
+ const numberValue = Number(String(value ?? 0).replace(/,/g, ""));
32
+ if (!Number.isFinite(numberValue)) {
33
+ return 0;
34
+ }
35
+ const factor = Math.pow(10, precision);
36
+ return Math.round(numberValue * factor) / factor;
37
+ };
38
+ var isEffectiveDenomination = (item) => {
39
+ if (item.is_enabled === false) {
40
+ return false;
41
+ }
42
+ if (item.effective_status === false || item.effective_status === "inactive") {
43
+ return false;
44
+ }
45
+ return true;
46
+ };
47
+ var getEffectiveDenominationsForCurrency = (denominations, currencyCode) => denominations.filter((item) => item.currency_code === currencyCode && isEffectiveDenomination(item)).sort((a, b) => a.sort_order - b.sort_order);
48
+ var buildEmptyQuantities = (items) => items.reduce((acc, item) => {
49
+ acc[getDenominationId(item)] = 0;
50
+ return acc;
51
+ }, {});
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ buildEmptyQuantities,
55
+ getDenominationId,
56
+ getEffectiveDenominationsForCurrency,
57
+ isEffectiveDenomination,
58
+ normalizeAmount
59
+ });
@@ -118,7 +118,6 @@ var AddSerivce = (props) => {
118
118
  const handler = (event) => {
119
119
  var _a2;
120
120
  const cacheItem = (_a2 = event == null ? void 0 : event.detail) == null ? void 0 : _a2.cacheItem;
121
- console.log("Modal closed with result:", event.detail.cacheItem);
122
121
  if (!(cacheItem == null ? void 0 : cacheItem.id)) return;
123
122
  (0, import_utils6.addServiceScroll)(String(cacheItem.id), cacheItem);
124
123
  };
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  import './index.less';
3
3
  interface BookingDashboardProps {
4
4
  bookingTimeStartBetween: string[];
5
+ /** 组件是否可见,不可见时内部会暂停 interval,默认 true */
6
+ isVisible?: boolean;
5
7
  }
6
8
  declare const BookingDashboard: React.ForwardRefExoticComponent<BookingDashboardProps & React.RefAttributes<unknown>>;
7
9
  export default BookingDashboard;
@@ -37,7 +37,7 @@ var import_react2 = require("react");
37
37
  var import_dashboard = __toESM(require("../../../../booking/dashboard"));
38
38
  var import_index = require("./index.less");
39
39
  var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
40
- const { bookingTimeStartBetween } = props;
40
+ const { bookingTimeStartBetween, isVisible = true } = props;
41
41
  const bookingDashboardRef = (0, import_react.useRef)(null);
42
42
  const cptProps = (0, import_react.useMemo)(() => {
43
43
  return {
@@ -45,6 +45,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
45
45
  padding: "16px"
46
46
  },
47
47
  otherParams: { booking_time_start_between: bookingTimeStartBetween },
48
+ isVisible,
48
49
  backgroundColors: [
49
50
  "rgba(224, 79, 22, 0.20)",
50
51
  "rgba(217, 45, 32, 0.14)",
@@ -56,7 +57,7 @@ var BookingDashboard = (0, import_react.forwardRef)((props, ref) => {
56
57
  "var(--Gray-true-800, #292929)"
57
58
  ]
58
59
  };
59
- }, [bookingTimeStartBetween]);
60
+ }, [bookingTimeStartBetween, isVisible]);
60
61
  (0, import_react2.useImperativeHandle)(ref, () => ({
61
62
  refresh: () => {
62
63
  var _a;
@@ -4,6 +4,8 @@ interface BookingDataPanelProps {
4
4
  currentDate: string;
5
5
  onBookingClick: (booking: any) => void;
6
6
  bookingId?: number;
7
+ /** 面板是否可见,透传给内部 Dashboard 控制 interval 是否启动 */
8
+ isVisible?: boolean;
7
9
  }
8
10
  declare const BookingDataPanel: React.ForwardRefExoticComponent<BookingDataPanelProps & React.RefAttributes<unknown>>;
9
11
  export default BookingDataPanel;
@@ -41,7 +41,7 @@ var import_bookingList = __toESM(require("./bookingList"));
41
41
  var import_materials2 = require("@pisell/materials");
42
42
  var import_index = require("./index.less");
43
43
  var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
44
- const { currentDate, onBookingClick, bookingId } = props;
44
+ const { currentDate, onBookingClick, bookingId, isVisible = true } = props;
45
45
  const Toast = (0, import_materials2.useToast)();
46
46
  const bookingListRef = (0, import_react.useRef)(null);
47
47
  const bookingDashboardRef = (0, import_react.useRef)(null);
@@ -53,7 +53,14 @@ var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
53
53
  {
54
54
  label: import_utils.locales.getText("pisell2.ticket-booking.dashboard"),
55
55
  key: "data-board",
56
- children: /* @__PURE__ */ import_react.default.createElement(import_bookingDashboard.default, { bookingTimeStartBetween, ref: bookingDashboardRef })
56
+ children: /* @__PURE__ */ import_react.default.createElement(
57
+ import_bookingDashboard.default,
58
+ {
59
+ bookingTimeStartBetween,
60
+ isVisible,
61
+ ref: bookingDashboardRef
62
+ }
63
+ )
57
64
  },
58
65
  {
59
66
  label: import_utils.locales.getText("pisell2.ticket-booking.booking-list"),
@@ -69,7 +76,7 @@ var BookingDataPanel = (0, import_react.forwardRef)((props, ref) => {
69
76
  )
70
77
  }
71
78
  ];
72
- }, [currentDate, bookingId]);
79
+ }, [currentDate, bookingId, isVisible]);
73
80
  (0, import_react.useImperativeHandle)(ref, () => ({
74
81
  refresh: () => {
75
82
  var _a, _b;
@@ -79,6 +79,15 @@ var PisellFloatingPanel = (0, import_react.forwardRef)((props, ref) => {
79
79
  return isOpen;
80
80
  }
81
81
  }));
82
- return /* @__PURE__ */ import_react.default.createElement(import_materials.PisellFloatingPanel, { ...floationgPanelProps, open: isOpen }, /* @__PURE__ */ import_react.default.createElement(import__.default, { currentDate, bookingId, onBookingClick, ref: bookingDataPanelRef }));
82
+ return /* @__PURE__ */ import_react.default.createElement(import_materials.PisellFloatingPanel, { ...floationgPanelProps, open: isOpen }, isOpen && /* @__PURE__ */ import_react.default.createElement(
83
+ import__.default,
84
+ {
85
+ currentDate,
86
+ bookingId,
87
+ onBookingClick,
88
+ isVisible: isOpen,
89
+ ref: bookingDataPanelRef
90
+ }
91
+ ));
83
92
  });
84
93
  var pisellFloatingPanel_default = (0, import_react.memo)(PisellFloatingPanel);
@@ -63,6 +63,24 @@ var import_ahooks2 = require("ahooks");
63
63
  var import_context = require("../../context");
64
64
  var import_IsActiveContext = require("../../context/IsActiveContext");
65
65
  var import_useShopDiscountModule = require("../../hooks/pisellos/useShopDiscountModule");
66
+ var MEM_STATS_KEY = "__pisellTicketBookingMemStats";
67
+ var getMemStats = () => {
68
+ const g = globalThis;
69
+ if (!g[MEM_STATS_KEY]) {
70
+ g[MEM_STATS_KEY] = {
71
+ mountedAt: Date.now(),
72
+ storeCreateCount: 0,
73
+ intervalDateSetCount: 0,
74
+ intervalDateTickCount: 0,
75
+ postCartUpdateCount: 0,
76
+ postCartUpdateBytes: 0,
77
+ lastHeartbeatHeapMB: 0,
78
+ crossedThresholdsMB: []
79
+ };
80
+ }
81
+ return g[MEM_STATS_KEY];
82
+ };
83
+ var HEAP_CROSS_THRESHOLDS_MB = [800, 1200, 1500, 2e3, 2500];
66
84
  var _formatBookingDetail = (data, modalState) => {
67
85
  var _a, _b, _c, _d;
68
86
  let {
@@ -263,6 +281,8 @@ var TicketBooking = (props) => {
263
281
  const Toast = (0, import_materials.useToast)();
264
282
  const _persistentRef = (0, import_react.useRef)(false);
265
283
  const _initStateRef = (0, import_react.useRef)({});
284
+ const _memStateRef = (0, import_react.useRef)(null);
285
+ _memStateRef.current = state;
266
286
  const _listTimerRef = (0, import_react.useRef)();
267
287
  const _timerRef = (0, import_react.useRef)();
268
288
  const _callbackFnRef = (0, import_react.useRef)();
@@ -444,6 +464,79 @@ var TicketBooking = (props) => {
444
464
  if (_listTimerRef.current) clearInterval(_listTimerRef.current);
445
465
  };
446
466
  }, []);
467
+ (0, import_react.useEffect)(() => {
468
+ const stats = getMemStats();
469
+ if (!stats.mountedAt || Date.now() - stats.mountedAt > 24 * 60 * 60 * 1e3) {
470
+ stats.mountedAt = Date.now();
471
+ stats.crossedThresholdsMB = [];
472
+ }
473
+ const buildPayload = (extra) => {
474
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i;
475
+ const s = _memStateRef.current || {};
476
+ const perfMem = performance.memory || {};
477
+ const shopId = ((_d2 = (_c2 = (_b2 = (_a2 = store == null ? void 0 : store.getState) == null ? void 0 : _a2.call(store)) == null ? void 0 : _b2.global) == null ? void 0 : _c2.globalConfig) == null ? void 0 : _d2.id) ?? "";
478
+ const jsHeapUsedMB = perfMem.usedJSHeapSize ? +(perfMem.usedJSHeapSize / 1024 / 1024).toFixed(2) : -1;
479
+ const jsHeapTotalMB = perfMem.totalJSHeapSize ? +(perfMem.totalJSHeapSize / 1024 / 1024).toFixed(2) : -1;
480
+ const jsHeapLimitMB = perfMem.jsHeapSizeLimit ? +(perfMem.jsHeapSizeLimit / 1024 / 1024).toFixed(2) : -1;
481
+ const payload = {
482
+ page_alive_sec: Math.round((Date.now() - stats.mountedAt) / 1e3),
483
+ shop_id: shopId,
484
+ url: typeof location !== "undefined" ? location.href.slice(0, 200) : "",
485
+ js_heap_used_mb: jsHeapUsedMB,
486
+ js_heap_total_mb: jsHeapTotalMB,
487
+ js_heap_limit_mb: jsHeapLimitMB,
488
+ dom_nodes_count: typeof document !== "undefined" ? document.getElementsByTagName("*").length : -1,
489
+ cart_items_count: ((_g = (_f = (_e2 = s == null ? void 0 : s.modalState) == null ? void 0 : _e2.service) == null ? void 0 : _f.value) == null ? void 0 : _g.length) ?? 0,
490
+ booking_list_count: ((_i = (_h = s == null ? void 0 : s.list) == null ? void 0 : _h.bookingList) == null ? void 0 : _i.length) ?? 0,
491
+ modal_open: !!(s == null ? void 0 : s.open),
492
+ booking_id: (s == null ? void 0 : s.bookingId) ?? 0,
493
+ board_config_loaded: !!(s == null ? void 0 : s.bookingConfig),
494
+ store_create_count: stats.storeCreateCount,
495
+ interval_date_set_count: stats.intervalDateSetCount,
496
+ interval_date_tick_count: stats.intervalDateTickCount,
497
+ post_cart_update_count: stats.postCartUpdateCount,
498
+ post_cart_update_mb: +(stats.postCartUpdateBytes / 1024 / 1024).toFixed(2),
499
+ ua: typeof navigator !== "undefined" ? navigator.userAgent.slice(0, 120) : ""
500
+ };
501
+ if (extra) Object.assign(payload, extra);
502
+ return payload;
503
+ };
504
+ const doSend = (title, extra) => {
505
+ try {
506
+ const payload = buildPayload(extra);
507
+ (0, import_utils.sendWarningLog)({
508
+ title,
509
+ content: Object.entries(payload).map(([key, value]) => ({
510
+ key,
511
+ value: String(value ?? "")
512
+ }))
513
+ });
514
+ } catch (e) {
515
+ }
516
+ };
517
+ doSend("TicketBookingMemHeartbeat", { reason: "mounted" });
518
+ const heartbeatTimer = setInterval(() => {
519
+ const perfMem = performance.memory || {};
520
+ const heapMB = perfMem.usedJSHeapSize ? perfMem.usedJSHeapSize / 1024 / 1024 : -1;
521
+ stats.lastHeartbeatHeapMB = heapMB;
522
+ doSend("TicketBookingMemHeartbeat", { reason: "heartbeat" });
523
+ if (heapMB > 0) {
524
+ for (const th of HEAP_CROSS_THRESHOLDS_MB) {
525
+ if (heapMB >= th && !stats.crossedThresholdsMB.includes(th)) {
526
+ stats.crossedThresholdsMB.push(th);
527
+ doSend("TicketBookingMemHeapCross", {
528
+ reason: "heap_cross",
529
+ threshold_mb: th,
530
+ current_heap_mb: +heapMB.toFixed(2)
531
+ });
532
+ }
533
+ }
534
+ }
535
+ }, 5 * 60 * 1e3);
536
+ return () => {
537
+ clearInterval(heartbeatTimer);
538
+ };
539
+ }, []);
447
540
  const _onDateChange = (date, dateString) => {
448
541
  _setIntervalTime(false);
449
542
  setState({
@@ -454,6 +547,11 @@ var TicketBooking = (props) => {
454
547
  const _setIntervalTime = (isInterval) => {
455
548
  clearInterval(_timerRef.current);
456
549
  if (isInterval) {
550
+ try {
551
+ const _s = getMemStats();
552
+ _s.intervalDateSetCount = (_s.intervalDateSetCount || 0) + 1;
553
+ } catch (e) {
554
+ }
457
555
  setState({
458
556
  isTimeChange: false,
459
557
  isDateChange: false
@@ -463,6 +561,11 @@ var TicketBooking = (props) => {
463
561
  }
464
562
  _setDataChange((0, import_dayjs.default)());
465
563
  _timerRef.current = setInterval(() => {
564
+ try {
565
+ const _s = getMemStats();
566
+ _s.intervalDateTickCount = (_s.intervalDateTickCount || 0) + 1;
567
+ } catch (e) {
568
+ }
466
569
  _setDataChange((0, import_dayjs.default)());
467
570
  }, 1e3 * 60);
468
571
  }
@@ -531,7 +634,6 @@ var TicketBooking = (props) => {
531
634
  } catch (error) {
532
635
  console.error(error);
533
636
  }
534
- console.log("formatedProducts", total, formatedProducts);
535
637
  let fees = [];
536
638
  let products = [];
537
639
  for (const item of formatedProducts) {
@@ -585,37 +687,37 @@ var TicketBooking = (props) => {
585
687
  )
586
688
  });
587
689
  }
588
- console.log("start post message, config:", {
690
+ (_j = (_i = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _i.postMessageToApp) == null ? void 0 : _j.call(_i, {
589
691
  module: "cds",
590
692
  key: "cartUpdate",
591
693
  data: {
592
694
  currency_symbol: getSymbolic(),
593
- total: total.productAmount,
695
+ total: total.expectAmount,
594
696
  // 小计
595
697
  products,
596
698
  fees
597
699
  }
598
700
  });
599
- (_j = (_i = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _i.postMessageToApp) == null ? void 0 : _j.call(_i, {
600
- module: "cds",
601
- key: "cartUpdate",
602
- data: {
701
+ try {
702
+ const _s = getMemStats();
703
+ _s.postCartUpdateCount = (_s.postCartUpdateCount || 0) + 1;
704
+ const _payload = {
603
705
  currency_symbol: getSymbolic(),
604
706
  total: total.expectAmount,
605
- // 小计
606
707
  products,
607
708
  fees
608
- }
609
- });
709
+ };
710
+ _s.postCartUpdateBytes = (_s.postCartUpdateBytes || 0) + JSON.stringify(_payload).length;
711
+ } catch (e) {
712
+ }
610
713
  }, [(_c = (_b = state == null ? void 0 : state.modalState) == null ? void 0 : _b.service) == null ? void 0 : _c.value]);
611
714
  const _setModalState = (props2) => {
612
- var _a2, _b2;
715
+ var _a2;
613
716
  console.log("同步state到外层", props2);
614
717
  let newVal = { ...props2 };
615
718
  if (newVal.service) {
616
719
  newVal.service.value = ((_a2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _a2.value) || [];
617
720
  }
618
- console.log((_b2 = newVal == null ? void 0 : newVal.service) == null ? void 0 : _b2.value, "newVal.service.value");
619
721
  setState({
620
722
  modalState: {
621
723
  ...state.modalState,
@@ -823,7 +925,6 @@ var TicketBooking = (props) => {
823
925
  if (data == null ? void 0 : data.eventBookingServiceParams) {
824
926
  }
825
927
  }
826
- console.log(initState, "initState");
827
928
  setState({
828
929
  ...initState,
829
930
  [state.renderType === "eventBooking" ? "eventOpen" : "open"]: true,
@@ -857,7 +958,6 @@ var TicketBooking = (props) => {
857
958
  }
858
959
  };
859
960
  }
860
- console.log("getBookingDetail", data);
861
961
  _initBookingData("edit", data);
862
962
  if (openRebook) {
863
963
  setTimeout(() => {
@@ -243,13 +243,23 @@ var ticketBooking_default = (props) => {
243
243
  import_utils2.request.setRequest(context.appHelper.utils.request);
244
244
  }, []);
245
245
  (0, import_react.useMemo)(() => {
246
+ try {
247
+ const g = globalThis;
248
+ if (g.__pisellTicketBookingMemStats) {
249
+ g.__pisellTicketBookingMemStats.storeCreateCount = (g.__pisellTicketBookingMemStats.storeCreateCount || 0) + 1;
250
+ }
251
+ } catch (e) {
252
+ }
246
253
  const store = (0, import_miniRedux.createStore)({
247
254
  ...(0, import_lodash.cloneDeep)(initialState),
248
255
  bookingConfigParams,
249
256
  productExtensionType
250
257
  });
251
258
  storeRef.current = store;
252
- }, [bookingConfigParams, productExtensionType]);
259
+ }, [
260
+ JSON.stringify(bookingConfigParams),
261
+ JSON.stringify(productExtensionType)
262
+ ]);
253
263
  (0, import_react.useMemo)(() => {
254
264
  var _a2;
255
265
  if (BookingTicket) {