@pisell/private-materials 6.6.59 → 6.6.61

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 (95) 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 +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/components/footer/utils.js +79 -75
  12. package/es/components/eftposPay/hooks.d.ts +1 -1
  13. package/es/components/eftposPay/store/index.d.ts +2 -2
  14. package/es/components/index.d.ts +2 -1
  15. package/es/components/index.js +2 -1
  16. package/es/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  17. package/es/components/pisellCashCounting/PisellCashCounting.js +121 -0
  18. package/es/components/pisellCashCounting/PisellCashCounting.less +263 -0
  19. package/es/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  20. package/es/components/pisellCashCounting/components/CashCountingModal/index.js +250 -0
  21. package/es/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  22. package/es/components/pisellCashCounting/hooks.d.ts +21 -0
  23. package/es/components/pisellCashCounting/hooks.js +193 -0
  24. package/es/components/pisellCashCounting/index.d.ts +2 -0
  25. package/es/components/pisellCashCounting/index.js +1 -0
  26. package/es/components/pisellCashCounting/locales.d.ts +118 -0
  27. package/es/components/pisellCashCounting/locales.js +117 -0
  28. package/es/components/pisellCashCounting/types.d.ts +85 -0
  29. package/es/components/pisellCashCounting/types.js +1 -0
  30. package/es/components/pisellCashCounting/utils.d.ts +10 -0
  31. package/es/components/pisellCashCounting/utils.js +40 -0
  32. package/es/hooks/useResponsive.d.ts +8 -0
  33. package/es/hooks/useResponsive.js +43 -0
  34. package/es/hooks/useThemeTokens.d.ts +7 -0
  35. package/es/hooks/useThemeTokens.js +20 -0
  36. package/es/index.d.ts +1 -0
  37. package/es/index.js +2 -1
  38. package/es/pro/NumericStepper/index.d.ts +75 -0
  39. package/es/pro/NumericStepper/index.js +301 -0
  40. package/es/pro/NumericStepper/index.less +364 -0
  41. package/es/pro/keyboards/index.d.ts +2 -0
  42. package/es/pro/keyboards/index.js +1 -0
  43. package/es/pro/keyboards/locales.d.ts +38 -0
  44. package/es/pro/keyboards/locales.js +57 -0
  45. package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  46. package/es/pro/keyboards/numberKeyboard/index.js +523 -0
  47. package/es/pro/keyboards/numberKeyboard/index.less +59 -0
  48. package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  49. package/es/pro/keyboards/numberKeyboard/types.js +1 -0
  50. package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  51. package/es/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  52. package/lib/components/booking/components/footer/utils.js +6 -3
  53. package/lib/components/eftposPay/hooks.d.ts +1 -1
  54. package/lib/components/eftposPay/store/index.d.ts +2 -2
  55. package/lib/components/index.d.ts +2 -1
  56. package/lib/components/index.js +3 -0
  57. package/lib/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
  58. package/lib/components/pisellCashCounting/PisellCashCounting.js +168 -0
  59. package/lib/components/pisellCashCounting/PisellCashCounting.less +263 -0
  60. package/lib/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
  61. package/lib/components/pisellCashCounting/components/CashCountingModal/index.js +171 -0
  62. package/lib/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
  63. package/lib/components/pisellCashCounting/hooks.d.ts +21 -0
  64. package/lib/components/pisellCashCounting/hooks.js +189 -0
  65. package/lib/components/pisellCashCounting/index.d.ts +2 -0
  66. package/lib/components/pisellCashCounting/index.js +35 -0
  67. package/lib/components/pisellCashCounting/locales.d.ts +118 -0
  68. package/lib/components/pisellCashCounting/locales.js +141 -0
  69. package/lib/components/pisellCashCounting/types.d.ts +85 -0
  70. package/lib/components/pisellCashCounting/types.js +17 -0
  71. package/lib/components/pisellCashCounting/utils.d.ts +10 -0
  72. package/lib/components/pisellCashCounting/utils.js +59 -0
  73. package/lib/hooks/useResponsive.d.ts +8 -0
  74. package/lib/hooks/useResponsive.js +48 -0
  75. package/lib/hooks/useThemeTokens.d.ts +7 -0
  76. package/lib/hooks/useThemeTokens.js +40 -0
  77. package/lib/index.d.ts +1 -0
  78. package/lib/index.js +3 -0
  79. package/lib/pro/NumericStepper/index.d.ts +75 -0
  80. package/lib/pro/NumericStepper/index.js +338 -0
  81. package/lib/pro/NumericStepper/index.less +364 -0
  82. package/lib/pro/keyboards/index.d.ts +2 -0
  83. package/lib/pro/keyboards/index.js +39 -0
  84. package/lib/pro/keyboards/locales.d.ts +38 -0
  85. package/lib/pro/keyboards/locales.js +61 -0
  86. package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  87. package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
  88. package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
  89. package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  90. package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
  91. package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
  92. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
  93. package/lowcode/pisell-cash-counting/meta.ts +167 -0
  94. package/lowcode/pisell-cash-counting/snippets.ts +13 -0
  95. package/package.json +4 -4
@@ -0,0 +1,263 @@
1
+ .pisell-private-cash-counting {
2
+ &__field {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 10px;
6
+
7
+ &--horizontal {
8
+ flex-direction: row;
9
+ align-items: center;
10
+ flex-wrap: nowrap;
11
+
12
+ .pisell-private-cash-counting__input {
13
+ flex: 1;
14
+ min-width: 0;
15
+ }
16
+
17
+ .pisell-private-cash-counting__button {
18
+ flex-shrink: 0;
19
+ }
20
+ }
21
+ }
22
+
23
+ .pisell-lowcode-input-number-wrapper{
24
+ width: auto;
25
+ }
26
+
27
+ &__input {
28
+ input {
29
+ width: 100%;
30
+ min-width: none;
31
+ max-width: none;
32
+ }
33
+ }
34
+
35
+ &__button {
36
+ width: max-content;
37
+ }
38
+
39
+ &__modal {
40
+ display: flex;
41
+ flex-direction: column;
42
+ height: min(720px, calc(90vh - 72px));
43
+ min-height: 520px;
44
+ overflow: hidden;
45
+ }
46
+
47
+ &__modal-intro {
48
+ flex-shrink: 0;
49
+ padding: 16px 24px 12px;
50
+ border-bottom: 1px solid #eaecf0;
51
+ }
52
+
53
+ &__subtitle {
54
+ color: #667085;
55
+ font-size: 14px;
56
+ line-height: 20px;
57
+ }
58
+
59
+ &__currency {
60
+ display: inline-flex;
61
+ align-items: center;
62
+ min-height: 28px;
63
+ margin-top: 12px;
64
+ padding: 4px 10px;
65
+ border-radius: 999px;
66
+ background: #f2f4f7;
67
+ color: #344054;
68
+ font-size: 13px;
69
+ font-weight: 600;
70
+ }
71
+
72
+ &__scroll {
73
+ flex: 1;
74
+ min-height: 0;
75
+ overflow-y: auto;
76
+ padding: 20px 24px 24px;
77
+ }
78
+
79
+ &__empty {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ min-height: 220px;
84
+ color: #98a2b3;
85
+ font-size: 14px;
86
+ }
87
+
88
+ &__section+&__section {
89
+ margin-top: 24px;
90
+ padding-top: 24px;
91
+ border-top: 1px solid #f2f4f7;
92
+ }
93
+
94
+ &__section-header {
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: space-between;
98
+ gap: 16px;
99
+ margin-bottom: 12px;
100
+ }
101
+
102
+ &__section-title {
103
+ display: flex;
104
+ align-items: center;
105
+ gap: 8px;
106
+ color: #667085;
107
+ font-size: 14px;
108
+ font-weight: 700;
109
+ letter-spacing: 0.04em;
110
+ text-transform: uppercase;
111
+ }
112
+
113
+ &__dot {
114
+ width: 8px;
115
+ height: 8px;
116
+ border-radius: 50%;
117
+ background: #635bff;
118
+
119
+ &--coin {
120
+ background: #f59e0b;
121
+ }
122
+ }
123
+
124
+ &__section-subtotal {
125
+ display: flex;
126
+ align-items: center;
127
+ gap: 10px;
128
+ color: #667085;
129
+ font-size: 14px;
130
+
131
+ strong {
132
+ color: #101828;
133
+ font-size: 15px;
134
+ }
135
+ }
136
+
137
+ &__denomination-list {
138
+ display: flex;
139
+ flex-direction: column;
140
+ gap: 12px;
141
+ }
142
+
143
+ &__denomination-row {
144
+ display: grid;
145
+ grid-template-columns: 92px minmax(150px, 220px) minmax(92px, 1fr);
146
+ align-items: center;
147
+ gap: 16px;
148
+ }
149
+
150
+ &__denomination-label {
151
+ display: inline-flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ min-width: 78px;
155
+ height: 32px;
156
+ padding: 0 12px;
157
+ border-radius: 6px;
158
+ background: #dbeafe;
159
+ color: #175cd3;
160
+ font-size: 14px;
161
+ font-weight: 700;
162
+
163
+ &--coin {
164
+ background: #fef3c7;
165
+ color: #92400e;
166
+ }
167
+ }
168
+
169
+ &__stepper {
170
+ &.numeric-stepper {
171
+ gap: 8px;
172
+ grid-template-columns: auto auto auto;
173
+ justify-content: flex-start;
174
+ width: auto;
175
+ }
176
+
177
+ .numeric-stepper-button {
178
+ width: 32px;
179
+ height: 32px;
180
+ border-radius: 6px;
181
+ }
182
+
183
+ .numeric-stepper-display {
184
+ width: 60px;
185
+ height: 32px;
186
+ max-width: 70px;
187
+ }
188
+ }
189
+
190
+ &__row-amount {
191
+ justify-self: end;
192
+ color: #98a2b3;
193
+ font-size: 15px;
194
+ font-weight: 700;
195
+ }
196
+
197
+ &__footer {
198
+ flex-shrink: 0;
199
+ padding: 20px 24px 24px;
200
+ border-top: 1px solid #eaecf0;
201
+ background: #ffffff;
202
+ box-shadow: 0 -8px 20px rgba(16, 24, 40, 0.04);
203
+ }
204
+
205
+ &__summary {
206
+ padding-bottom: 16px;
207
+ border-bottom: 1px dashed #d0d5dd;
208
+ }
209
+
210
+ &__summary-row,
211
+ &__total-row {
212
+ display: flex;
213
+ align-items: center;
214
+ justify-content: space-between;
215
+ gap: 16px;
216
+ }
217
+
218
+ &__summary-row {
219
+ color: #667085;
220
+ font-size: 15px;
221
+
222
+ +.pisell-private-cash-counting__summary-row {
223
+ margin-top: 10px;
224
+ }
225
+
226
+ strong {
227
+ color: #101828;
228
+ font-size: 16px;
229
+ }
230
+ }
231
+
232
+ &__total-row {
233
+ margin-top: 16px;
234
+ color: #101828;
235
+ font-size: 18px;
236
+ font-weight: 700;
237
+
238
+ strong {
239
+ color: #5b4be8;
240
+ font-size: 34px;
241
+ line-height: 40px;
242
+ }
243
+ }
244
+
245
+ &__actions {
246
+ display: grid;
247
+ grid-template-columns: 1fr 1fr 1fr;
248
+ gap: 12px;
249
+ margin-top: 18px;
250
+
251
+ .pisell-lowcode-btn {
252
+ margin: 0;
253
+ }
254
+ }
255
+ }
256
+
257
+ .pisell-lowcode-modal-root {
258
+ .pisell-private-cash-counting__modal-wrap {
259
+ .pisell-lowcode-modal-body {
260
+ overflow: hidden;
261
+ }
262
+ }
263
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { CashCountingConfirmPayload, CurrencyDenominationConfig } from '../../types';
3
+ import './index.less';
4
+ export interface PisellCashCountingModalRef {
5
+ open: (config: {
6
+ initialQuantities: Record<string, number>;
7
+ }) => void;
8
+ close: () => void;
9
+ }
10
+ interface PisellCashCountingModalProps {
11
+ currencyCode: string;
12
+ currencyDenominations: CurrencyDenominationConfig[];
13
+ decimalPlaces: number;
14
+ symbol: string;
15
+ modalWidth?: number | string;
16
+ onCancel: () => void;
17
+ onConfirm: (payload: CashCountingConfirmPayload) => void;
18
+ }
19
+ declare const CashCountingModal: React.ForwardRefExoticComponent<PisellCashCountingModalProps & React.RefAttributes<PisellCashCountingModalRef>>;
20
+ export default CashCountingModal;
@@ -0,0 +1,250 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useState } from 'react';
14
+ import { PisellModal, Iconfont, Tag, Button } from '@pisell/materials';
15
+ import NumericStepper from "../../../../pro/NumericStepper";
16
+ import { locales } from '@pisell/utils';
17
+ import { ExclamationCircleOutlined } from "@ant-design/icons";
18
+ import { getDenominationId, normalizeAmount } from "../../utils";
19
+ import useEngineContext from "../../../../hooks/useEngineContext";
20
+ import { useResponsive } from "../../../../hooks/useResponsive";
21
+ import "./index.less";
22
+ var PREFIX = 'pisell-private-cash-counting-modal';
23
+ var formatAmount = function formatAmount(value, symbol, precision) {
24
+ var formatter = new Intl.NumberFormat(undefined, {
25
+ minimumFractionDigits: precision,
26
+ maximumFractionDigits: precision
27
+ });
28
+ return "".concat(symbol).concat(formatter.format(value));
29
+ };
30
+ var CashCountingModal = /*#__PURE__*/forwardRef(function (props, ref) {
31
+ var _context$appHelper;
32
+ var currencyCode = props.currencyCode,
33
+ currencyDenominations = props.currencyDenominations,
34
+ decimalPlaces = props.decimalPlaces,
35
+ symbol = props.symbol,
36
+ modalWidth = props.modalWidth,
37
+ onCancel = props.onCancel,
38
+ onConfirm = props.onConfirm;
39
+ var context = useEngineContext();
40
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
41
+ isTerminal = _ref.isTerminal;
42
+ var _useState = useState(false),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ open = _useState2[0],
45
+ setOpen = _useState2[1];
46
+ var _useState3 = useState({}),
47
+ _useState4 = _slicedToArray(_useState3, 2),
48
+ draftQuantities = _useState4[0],
49
+ setDraftQuantities = _useState4[1];
50
+ var isIpad = useResponsive(1200);
51
+ var isMobile = useResponsive(450);
52
+
53
+ // 暴露 ref 方法
54
+ useImperativeHandle(ref, function () {
55
+ return {
56
+ open: function open(_ref2) {
57
+ var initialQuantities = _ref2.initialQuantities;
58
+ setDraftQuantities(initialQuantities);
59
+ setOpen(true);
60
+ },
61
+ close: function close() {
62
+ return setOpen(false);
63
+ }
64
+ };
65
+ });
66
+
67
+ // 计算
68
+ var groupedDenominations = useMemo(function () {
69
+ return currencyDenominations.reduce(function (acc, item) {
70
+ acc[item.denomination_type].push(item);
71
+ return acc;
72
+ }, {
73
+ bill: [],
74
+ coin: []
75
+ });
76
+ }, [currencyDenominations]);
77
+ var calculatedDetails = useMemo(function () {
78
+ return currencyDenominations.map(function (d) {
79
+ var _draftQuantities$getD;
80
+ var qty = (_draftQuantities$getD = draftQuantities[getDenominationId(d)]) !== null && _draftQuantities$getD !== void 0 ? _draftQuantities$getD : 0;
81
+ return {
82
+ denomination: d,
83
+ quantity: qty,
84
+ amount: normalizeAmount(d.denomination_value * qty, decimalPlaces)
85
+ };
86
+ });
87
+ }, [currencyDenominations, draftQuantities, decimalPlaces, getDenominationId, normalizeAmount]);
88
+ var billSubtotal = useMemo(function () {
89
+ return calculatedDetails.filter(function (i) {
90
+ return i.denomination.denomination_type === 'bill';
91
+ }).reduce(function (s, i) {
92
+ return s + i.amount;
93
+ }, 0);
94
+ }, [calculatedDetails]);
95
+ var coinSubtotal = useMemo(function () {
96
+ return calculatedDetails.filter(function (i) {
97
+ return i.denomination.denomination_type === 'coin';
98
+ }).reduce(function (s, i) {
99
+ return s + i.amount;
100
+ }, 0);
101
+ }, [calculatedDetails]);
102
+ var totalAmount = useMemo(function () {
103
+ return billSubtotal + coinSubtotal;
104
+ }, [billSubtotal, coinSubtotal]);
105
+
106
+ // 操作
107
+ var handleClose = function handleClose() {
108
+ setOpen(false);
109
+ if (typeof onCancel === 'function') {
110
+ onCancel();
111
+ }
112
+ };
113
+ var handleClear = function handleClear() {
114
+ var reset = {};
115
+ currencyDenominations.forEach(function (d) {
116
+ return reset[getDenominationId(d)] = 0;
117
+ });
118
+ setDraftQuantities(reset);
119
+ };
120
+ var handleConfirm = function handleConfirm() {
121
+ var payload = {
122
+ amount: totalAmount,
123
+ currencyCode: currencyCode,
124
+ decimalPlaces: decimalPlaces,
125
+ billSubtotal: billSubtotal,
126
+ coinSubtotal: coinSubtotal,
127
+ details: calculatedDetails,
128
+ quantities: draftQuantities
129
+ };
130
+ if (typeof onConfirm === 'function') {
131
+ onConfirm(payload);
132
+ }
133
+ setOpen(false);
134
+ };
135
+ var renderSection = function renderSection(type, title, subtotal) {
136
+ var items = groupedDenominations[type];
137
+ if (!items.length) return null;
138
+ return /*#__PURE__*/React.createElement("div", {
139
+ className: "".concat(PREFIX, "__section")
140
+ }, /*#__PURE__*/React.createElement("div", {
141
+ className: "".concat(PREFIX, "__section-header")
142
+ }, /*#__PURE__*/React.createElement("div", {
143
+ className: "".concat(PREFIX, "__section-title")
144
+ }, /*#__PURE__*/React.createElement("span", {
145
+ className: "".concat(PREFIX, "__dot ").concat(PREFIX, "__dot--").concat(type)
146
+ }), /*#__PURE__*/React.createElement("span", null, title)), /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(PREFIX, "__section-subtotal")
148
+ }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell-cash-counting.subtotal')), /*#__PURE__*/React.createElement("strong", null, formatAmount(subtotal, symbol, decimalPlaces)))), /*#__PURE__*/React.createElement("div", {
149
+ className: "".concat(PREFIX, "__denomination-list")
150
+ }, items.map(function (item) {
151
+ var _draftQuantities$id;
152
+ var id = getDenominationId(item);
153
+ var qty = (_draftQuantities$id = draftQuantities[id]) !== null && _draftQuantities$id !== void 0 ? _draftQuantities$id : 0;
154
+ var amt = normalizeAmount(item.denomination_value * qty, decimalPlaces);
155
+ return /*#__PURE__*/React.createElement("div", {
156
+ className: "".concat(PREFIX, "__denomination-row"),
157
+ key: id
158
+ }, /*#__PURE__*/React.createElement("div", {
159
+ className: "".concat(PREFIX, "__denomination-left")
160
+ }, /*#__PURE__*/React.createElement("div", {
161
+ className: "".concat(PREFIX, "__denomination-label ").concat(PREFIX, "__denomination-label--").concat(type)
162
+ }, item.denomination_label), /*#__PURE__*/React.createElement("div", {
163
+ className: "".concat(PREFIX, "__stepper-wrap")
164
+ }, /*#__PURE__*/React.createElement(NumericStepper, {
165
+ className: "".concat(PREFIX, "__stepper"),
166
+ min: 0,
167
+ max: 9999,
168
+ value: qty,
169
+ plusOnlyAtZero: false,
170
+ shape: "square",
171
+ onChange: function onChange(val) {
172
+ return setDraftQuantities(function (prev) {
173
+ return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, val));
174
+ });
175
+ }
176
+ }))), /*#__PURE__*/React.createElement("div", {
177
+ className: "".concat(PREFIX, "__row-amount")
178
+ }, formatAmount(amt, symbol, decimalPlaces)));
179
+ })));
180
+ };
181
+ var renderHeader = useCallback(function () {
182
+ return /*#__PURE__*/React.createElement("div", {
183
+ className: "".concat(PREFIX, "__modal-header")
184
+ }, /*#__PURE__*/React.createElement(Iconfont, {
185
+ type: "pisell2-cash",
186
+ className: "".concat(PREFIX, "__modal-header-icon")
187
+ }), /*#__PURE__*/React.createElement("div", {
188
+ className: "".concat(PREFIX, "__modal-header-title")
189
+ }, locales.getText('pisell-cash-counting.countCash')), /*#__PURE__*/React.createElement(Tag, {
190
+ color: "blue",
191
+ style: {
192
+ border: 'none'
193
+ }
194
+ }, currencyCode));
195
+ }, [currencyCode]);
196
+ var renderFooter = useCallback(function () {
197
+ return /*#__PURE__*/React.createElement("div", {
198
+ className: "".concat(PREFIX, "__footer")
199
+ }, /*#__PURE__*/React.createElement("div", {
200
+ className: "".concat(PREFIX, "__summary")
201
+ }, /*#__PURE__*/React.createElement("div", {
202
+ className: "".concat(PREFIX, "__summary-row")
203
+ }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell-cash-counting.billsSubtotal')), /*#__PURE__*/React.createElement("strong", null, formatAmount(billSubtotal, symbol, decimalPlaces))), /*#__PURE__*/React.createElement("div", {
204
+ className: "".concat(PREFIX, "__summary-row")
205
+ }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell-cash-counting.coinsSubtotal')), /*#__PURE__*/React.createElement("strong", null, formatAmount(coinSubtotal, symbol, decimalPlaces))), /*#__PURE__*/React.createElement("div", {
206
+ className: "".concat(PREFIX, "__total-row")
207
+ }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell-cash-counting.total')), /*#__PURE__*/React.createElement("strong", null, formatAmount(totalAmount, symbol, decimalPlaces)))), /*#__PURE__*/React.createElement("div", {
208
+ className: "".concat(PREFIX, "__actions")
209
+ }, /*#__PURE__*/React.createElement(Button, {
210
+ type: "text",
211
+ size: "large",
212
+ onClick: handleClear
213
+ }, locales.getText('pisell-cash-counting.clearAll')), /*#__PURE__*/React.createElement(Button, {
214
+ size: "large",
215
+ onClick: handleClose
216
+ }, locales.getText('pisell-cash-counting.cancel')), /*#__PURE__*/React.createElement(Button, {
217
+ type: "primary",
218
+ size: "large",
219
+ disabled: !currencyDenominations.length,
220
+ onClick: handleConfirm
221
+ }, locales.getText('pisell-cash-counting.confirm'))));
222
+ }, [coinSubtotal, billSubtotal, totalAmount, currencyDenominations, handleClear, handleClose, handleConfirm]);
223
+ return /*#__PURE__*/React.createElement(PisellModal, {
224
+ destroyOnClose: true,
225
+ maskClosable: false,
226
+ footer: renderFooter(),
227
+ open: open,
228
+ title: renderHeader(),
229
+ className: "".concat(PREFIX, "__modal-wrap"),
230
+ bodyStyle: {
231
+ padding: 0
232
+ },
233
+ width: modalWidth ? modalWidth : isTerminal !== null && isTerminal !== void 0 && isTerminal() ? '80%' : '880px',
234
+ onCancel: handleClose
235
+ }, /*#__PURE__*/React.createElement("div", {
236
+ className: "".concat(PREFIX, "__modal")
237
+ }, /*#__PURE__*/React.createElement("div", {
238
+ className: "".concat(PREFIX, "__modal-intro")
239
+ }, /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
240
+ style: {
241
+ fontSize: 18,
242
+ color: '#F2A63A'
243
+ }
244
+ }), locales.getText('pisell-cash-counting.subtitle')), /*#__PURE__*/React.createElement("div", {
245
+ className: "".concat(PREFIX, "__scroll ").concat(isIpad || isMobile ? "".concat(PREFIX, "__scroll-column") : '', " ").concat(isMobile ? "".concat(PREFIX, "__scroll-mobile") : '')
246
+ }, currencyDenominations.length === 0 ? /*#__PURE__*/React.createElement("div", {
247
+ className: "".concat(PREFIX, "__empty")
248
+ }, locales.getText('pisell-cash-counting.empty')) : /*#__PURE__*/React.createElement(React.Fragment, null, renderSection('bill', locales.getText('pisell-cash-counting.bills'), billSubtotal), renderSection('coin', locales.getText('pisell-cash-counting.coins'), coinSubtotal)))));
249
+ });
250
+ export default CashCountingModal;