@pisell/private-materials 3.0.136 → 3.0.138

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 (219) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/forms/single/index.js +3 -0
  12. package/es/components/eftpos/const.d.ts +26 -0
  13. package/es/components/eftpos/const.js +40 -8
  14. package/es/components/eftpos/device.d.ts +3 -2
  15. package/es/components/eftpos/device.js +6 -5
  16. package/es/components/eftpos/form/index.d.ts +5 -0
  17. package/es/components/eftpos/form/index.js +8 -0
  18. package/es/components/eftpos/hooks.d.ts +34 -0
  19. package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
  20. package/es/components/eftpos/icon/apiKey.d.ts +5 -0
  21. package/es/components/eftpos/icon/apiKey.js +17 -0
  22. package/es/components/eftpos/icon/device.d.ts +5 -0
  23. package/es/components/eftpos/icon/device.js +19 -0
  24. package/es/components/eftpos/index.d.ts +10 -0
  25. package/es/components/eftpos/index.js +329 -46
  26. package/es/components/eftpos/index.less +38 -1
  27. package/es/components/eftpos/locales.d.ts +12 -0
  28. package/es/components/eftpos/locales.js +15 -3
  29. package/es/components/eftpos/log.d.ts +8 -0
  30. package/es/components/eftpos/log.js +85 -0
  31. package/es/components/eftpos/pos.d.ts +1 -1
  32. package/es/components/eftpos/pos.js +8 -5
  33. package/es/components/eftpos/surcharge/index.d.ts +25 -2
  34. package/es/components/eftpos/surcharge/index.js +100 -16
  35. package/es/components/eftpos/table.d.ts +4 -0
  36. package/es/components/eftpos/table.js +102 -10
  37. package/es/components/eftposPay/amount.d.ts +7 -1
  38. package/es/components/eftposPay/amount.js +65 -38
  39. package/es/components/eftposPay/component/fail/failCustom.js +65 -20
  40. package/es/components/eftposPay/component/fail/index.js +60 -30
  41. package/es/components/eftposPay/component/fail/network.d.ts +5 -0
  42. package/es/components/eftposPay/component/fail/network.js +13 -0
  43. package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
  44. package/es/components/eftposPay/component/fail/unknow.js +18 -3
  45. package/es/components/eftposPay/component/header/index.d.ts +2 -1
  46. package/es/components/eftposPay/component/header/index.js +4 -1
  47. package/es/components/eftposPay/component/header/index.less +1 -10
  48. package/es/components/eftposPay/component/manual/index.d.ts +6 -1
  49. package/es/components/eftposPay/component/manual/index.js +174 -23
  50. package/es/components/eftposPay/component/manual/index.less +42 -14
  51. package/es/components/eftposPay/component/signature/index.d.ts +5 -0
  52. package/es/components/eftposPay/component/signature/index.js +20 -2
  53. package/es/components/eftposPay/component/step/index.d.ts +7 -7
  54. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  55. package/es/components/eftposPay/const.d.ts +19 -4
  56. package/es/components/eftposPay/const.js +4 -2
  57. package/es/components/eftposPay/device.d.ts +7 -0
  58. package/es/components/eftposPay/device.js +22 -0
  59. package/es/components/eftposPay/helper.d.ts +54 -0
  60. package/es/components/eftposPay/helper.js +93 -1
  61. package/es/components/eftposPay/hooks.d.ts +30 -1
  62. package/es/components/eftposPay/hooks.js +181 -26
  63. package/es/components/eftposPay/index.d.ts +2 -4
  64. package/es/components/eftposPay/index.js +119 -31
  65. package/es/components/eftposPay/index.less +27 -19
  66. package/es/components/eftposPay/locales.d.ts +45 -0
  67. package/es/components/eftposPay/locales.js +348 -3
  68. package/es/components/eftposPay/manufacturer.d.ts +2 -2
  69. package/es/components/eftposPay/manufacturer.js +9 -10
  70. package/es/components/eftposPay/pay.d.ts +10 -1
  71. package/es/components/eftposPay/pay.js +112 -34
  72. package/es/components/eftposPay/payo/config.js +137 -270
  73. package/es/components/eftposPay/payo/const.d.ts +22 -2
  74. package/es/components/eftposPay/payo/const.js +83 -33
  75. package/es/components/eftposPay/payo/hooks.d.ts +5 -0
  76. package/es/components/eftposPay/payo/hooks.js +19 -2
  77. package/es/components/eftposPay/store/index.d.ts +154 -53
  78. package/es/components/eftposPay/store/index.js +112 -60
  79. package/es/components/eftposPay/tyro/const.d.ts +17 -0
  80. package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
  81. package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
  82. package/es/components/eftposPay/tyro/hooks.js +40 -0
  83. package/es/components/eftposPay/tyro/index.d.ts +9 -0
  84. package/es/components/eftposPay/tyro/index.js +575 -0
  85. package/es/components/eftposPay/windcave/const.d.ts +24 -9
  86. package/es/components/eftposPay/windcave/const.js +90 -81
  87. package/es/components/eftposPay/windcave/helper.d.ts +16 -2
  88. package/es/components/eftposPay/windcave/helper.js +175 -42
  89. package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  90. package/es/components/eftposPay/windcave/receiptAction.js +91 -43
  91. package/es/components/eftposPay/windcave/timer.d.ts +13 -1
  92. package/es/components/eftposPay/windcave/timer.js +18 -1
  93. package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
  94. package/es/components/eftposPay/windcave/windcave.js +155 -139
  95. package/es/utils/load.d.ts +11 -0
  96. package/es/utils/load.js +85 -0
  97. package/lib/components/booking/forms/single/index.js +1 -0
  98. package/lib/components/eftpos/const.d.ts +26 -0
  99. package/lib/components/eftpos/const.js +13 -1
  100. package/lib/components/eftpos/device.d.ts +3 -2
  101. package/lib/components/eftpos/device.js +2 -2
  102. package/lib/components/eftpos/form/index.d.ts +5 -0
  103. package/lib/components/eftpos/hooks.d.ts +34 -0
  104. package/lib/components/eftpos/hooks.js +106 -0
  105. package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
  106. package/lib/components/eftpos/icon/apiKey.js +57 -0
  107. package/lib/components/eftpos/icon/device.d.ts +5 -0
  108. package/lib/components/eftpos/icon/device.js +57 -0
  109. package/lib/components/eftpos/index.d.ts +10 -0
  110. package/lib/components/eftpos/index.js +262 -97
  111. package/lib/components/eftpos/index.less +38 -1
  112. package/lib/components/eftpos/locales.d.ts +12 -0
  113. package/lib/components/eftpos/locales.js +15 -3
  114. package/lib/components/eftpos/log.d.ts +8 -0
  115. package/lib/components/eftpos/log.js +87 -0
  116. package/lib/components/eftpos/pos.d.ts +1 -1
  117. package/lib/components/eftpos/pos.js +5 -4
  118. package/lib/components/eftpos/surcharge/index.d.ts +25 -2
  119. package/lib/components/eftpos/surcharge/index.js +36 -6
  120. package/lib/components/eftpos/table.d.ts +4 -0
  121. package/lib/components/eftpos/table.js +40 -8
  122. package/lib/components/eftposPay/amount.d.ts +7 -1
  123. package/lib/components/eftposPay/amount.js +10 -33
  124. package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
  125. package/lib/components/eftposPay/component/fail/index.js +39 -18
  126. package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
  127. package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
  128. package/lib/components/eftposPay/component/fail/unknow.js +3 -3
  129. package/lib/components/eftposPay/component/header/index.d.ts +2 -1
  130. package/lib/components/eftposPay/component/header/index.js +2 -1
  131. package/lib/components/eftposPay/component/header/index.less +1 -10
  132. package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
  133. package/lib/components/eftposPay/component/manual/index.js +122 -31
  134. package/lib/components/eftposPay/component/manual/index.less +42 -14
  135. package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
  136. package/lib/components/eftposPay/component/signature/index.js +2 -2
  137. package/lib/components/eftposPay/component/step/index.d.ts +7 -7
  138. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  139. package/lib/components/eftposPay/const.d.ts +19 -4
  140. package/lib/components/eftposPay/const.js +3 -1
  141. package/lib/components/eftposPay/device.d.ts +7 -0
  142. package/lib/components/eftposPay/helper.d.ts +54 -0
  143. package/lib/components/eftposPay/helper.js +64 -0
  144. package/lib/components/eftposPay/hooks.d.ts +30 -1
  145. package/lib/components/eftposPay/hooks.js +182 -44
  146. package/lib/components/eftposPay/index.d.ts +2 -4
  147. package/lib/components/eftposPay/index.js +74 -27
  148. package/lib/components/eftposPay/index.less +27 -19
  149. package/lib/components/eftposPay/locales.d.ts +45 -0
  150. package/lib/components/eftposPay/locales.js +352 -3
  151. package/lib/components/eftposPay/manufacturer.d.ts +2 -2
  152. package/lib/components/eftposPay/manufacturer.js +13 -13
  153. package/lib/components/eftposPay/pay.d.ts +10 -1
  154. package/lib/components/eftposPay/pay.js +86 -25
  155. package/lib/components/eftposPay/payo/config.js +121 -268
  156. package/lib/components/eftposPay/payo/const.d.ts +22 -2
  157. package/lib/components/eftposPay/payo/const.js +55 -36
  158. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  159. package/lib/components/eftposPay/payo/hooks.js +1 -1
  160. package/lib/components/eftposPay/store/index.d.ts +154 -53
  161. package/lib/components/eftposPay/store/index.js +7 -66
  162. package/lib/components/eftposPay/tyro/const.d.ts +17 -0
  163. package/lib/components/eftposPay/tyro/const.js +114 -0
  164. package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
  165. package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
  166. package/lib/components/eftposPay/tyro/index.d.ts +9 -0
  167. package/lib/components/eftposPay/tyro/index.js +558 -0
  168. package/lib/components/eftposPay/windcave/const.d.ts +24 -9
  169. package/lib/components/eftposPay/windcave/const.js +53 -104
  170. package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
  171. package/lib/components/eftposPay/windcave/helper.js +163 -48
  172. package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  173. package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
  174. package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
  175. package/lib/components/eftposPay/windcave/timer.js +5 -0
  176. package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
  177. package/lib/components/eftposPay/windcave/windcave.js +130 -130
  178. package/lib/utils/load.d.ts +11 -0
  179. package/lib/utils/load.js +100 -0
  180. package/lowcode/eftpos/meta.ts +202 -160
  181. package/lowcode/eftpos-pay/meta.ts +45 -12
  182. package/package.json +4 -4
  183. package/es/components/eftposPay/eftpos/config.d.ts +0 -11
  184. package/es/components/eftposPay/eftpos/config.js +0 -178
  185. package/es/components/eftposPay/eftpos/const.d.ts +0 -10
  186. package/es/components/eftposPay/eftpos/index.d.ts +0 -7
  187. package/es/components/eftposPay/eftpos/index.js +0 -35
  188. package/es/components/eftposPay/windcave/action.d.ts +0 -8
  189. package/es/components/eftposPay/windcave/action.js +0 -104
  190. package/es/components/eftposPay/windcave/hook.d.ts +0 -14
  191. package/es/components/eftposPay/windcave/index.d.ts +0 -8
  192. package/es/components/eftposPay/windcave/index.js +0 -49
  193. package/es/components/eftposPay/windcave/pos.d.ts +0 -8
  194. package/es/components/eftposPay/windcave/pos.js +0 -180
  195. package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
  196. package/es/components/eftposPay/windcave/pwd.js +0 -124
  197. package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
  198. package/es/components/eftposPay/windcave/receipet.js +0 -67
  199. package/es/components/eftposPay/windcave/wait.d.ts +0 -12
  200. package/es/components/eftposPay/windcave/wait.js +0 -139
  201. package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
  202. package/lib/components/eftposPay/eftpos/config.js +0 -199
  203. package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
  204. package/lib/components/eftposPay/eftpos/const.js +0 -165
  205. package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
  206. package/lib/components/eftposPay/windcave/action.d.ts +0 -8
  207. package/lib/components/eftposPay/windcave/action.js +0 -143
  208. package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
  209. package/lib/components/eftposPay/windcave/hook.js +0 -139
  210. package/lib/components/eftposPay/windcave/index.d.ts +0 -8
  211. package/lib/components/eftposPay/windcave/index.js +0 -78
  212. package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
  213. package/lib/components/eftposPay/windcave/pos.js +0 -197
  214. package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
  215. package/lib/components/eftposPay/windcave/pwd.js +0 -143
  216. package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
  217. package/lib/components/eftposPay/windcave/receipet.js +0 -93
  218. package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
  219. package/lib/components/eftposPay/windcave/wait.js +0 -163
@@ -1,139 +0,0 @@
1
- var _excluded = ["key"];
2
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
- 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."); }
5
- 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); }
6
- 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; }
7
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
8
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- /* eslint-disable no-unused-vars */
12
- /* eslint-disable @typescript-eslint/no-unused-vars */
13
- /* eslint-disable consistent-return */
14
- import { locales } from '@pisell/utils';
15
- import React, { useEffect, useRef } from 'react';
16
- import Step from "../component/step";
17
- import { StatusEnum } from "../const";
18
- import { useFail } from "../hooks";
19
- import { useContextData, useDispatch, updateComponent, updateState, updateCurrentStemItem } from "../store";
20
- import { useValidate, useSuccess } from "./hook";
21
- var Wait = function Wait(_ref) {
22
- var api = _ref.api,
23
- onChange = _ref.onChange,
24
- hasBackup = _ref.hasBackup;
25
- var dispatch = useDispatch();
26
- var _useContextData = useContextData(),
27
- steps = _useContextData.steps,
28
- status = _useContextData.status,
29
- custom = _useContextData.custom,
30
- mode = _useContextData.mode;
31
- var _steps$ = steps[4],
32
- key = _steps$.key,
33
- props = _objectWithoutProperties(_steps$, _excluded);
34
- var _useValidate = useValidate(1000 * 60),
35
- _useValidate2 = _slicedToArray(_useValidate, 1),
36
- check = _useValidate2[0];
37
- var fail = useFail(4, true);
38
- var success = useSuccess(4);
39
- var failRef = useRef(fail);
40
- var successRef = useRef(success);
41
- var ref = useRef(custom === null || custom === void 0 ? void 0 : custom.number);
42
- var statusRef = useRef(status);
43
- var backupRef = useRef(hasBackup);
44
- var customRef = useRef(custom);
45
- var stepStatusRef = useRef(props.status);
46
- var clearRef = useRef();
47
- var initRef = useRef(false);
48
- var unloadRef = useRef(false);
49
- useEffect(function () {
50
- customRef.current = custom;
51
- }, [custom]);
52
- useEffect(function () {
53
- backupRef.current = hasBackup;
54
- }, [hasBackup]);
55
- useEffect(function () {
56
- stepStatusRef.current = props.status;
57
- }, [props.status]);
58
- useEffect(function () {
59
- ref.current = custom === null || custom === void 0 ? void 0 : custom.number;
60
- }, [custom === null || custom === void 0 ? void 0 : custom.number]);
61
- useEffect(function () {
62
- statusRef.current = status;
63
- }, [status]);
64
- useEffect(function () {
65
- failRef.current = fail;
66
- }, [fail]);
67
- useEffect(function () {
68
- successRef.current = success;
69
- }, [success]);
70
- useEffect(function () {
71
- if (initRef.current) {
72
- return;
73
- }
74
- initRef.current = true;
75
- if (statusRef.current === StatusEnum.Success && stepStatusRef.current === StatusEnum.Success) {
76
- clearRef.current = setTimeout(function () {
77
- var _customRef$current;
78
- onChange('success', (_customRef$current = customRef.current) === null || _customRef$current === void 0 ? void 0 : _customRef$current.pay);
79
- }, 1000);
80
- return;
81
- }
82
- if (statusRef.current !== StatusEnum.Loading) {
83
- return;
84
- }
85
- if (stepStatusRef.current !== StatusEnum.Loading) {
86
- return;
87
- }
88
- console.log('wait 开始查询 ', ref.current);
89
- check({
90
- check: api.check,
91
- number: ref.current,
92
- txn_status_id: '8',
93
- __start__: '7',
94
- checkCondition: function checkCondition(r) {
95
- return "".concat(r.txn_status_id) !== '8' || "".concat(r.status_id) !== '6';
96
- }
97
- }).then(function (res) {
98
- if (unloadRef.current) {
99
- return;
100
- }
101
- successRef.current(res, backupRef.current);
102
- clearRef.current = setTimeout(function () {
103
- var _customRef$current2;
104
- onChange('success', (_customRef$current2 = customRef.current) === null || _customRef$current2 === void 0 ? void 0 : _customRef$current2.pay);
105
- }, 1000);
106
- }, function (res) {
107
- if (unloadRef.current) {
108
- return;
109
- }
110
- if (backupRef.current) {
111
- return;
112
- }
113
- if (res && _typeof(res) === 'object' && typeof res.txn_status_id !== 'undefined' && typeof res.status_id !== 'undefined') {
114
- dispatch(updateCurrentStemItem({
115
- status: 'fail'
116
- }));
117
- dispatch(updateState({
118
- manual: {
119
- title: locales.getText('page.eftpos-pay.text.timedout.title'),
120
- text: locales.getText('page.eftpos-pay.text.timedout.text')(mode)
121
- }
122
- }));
123
- dispatch(updateComponent('Manual'));
124
- return;
125
- }
126
- failRef.current(res);
127
- });
128
- }, [api.check, check, dispatch, onChange]);
129
- useEffect(function () {
130
- return function () {
131
- unloadRef.current = true;
132
- if (clearRef.current) {
133
- clearTimeout(clearRef.current);
134
- }
135
- };
136
- }, []);
137
- return /*#__PURE__*/React.createElement(Step, props);
138
- };
139
- export default Wait;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- export declare const POS: () => React.JSX.Element;
3
- export declare const Surcharge: () => React.JSX.Element;
4
- export declare const Card: () => React.JSX.Element;
5
- export declare const Pwd: () => React.JSX.Element;
6
- export declare const Receipet: () => React.JSX.Element;
7
- export declare const ReceipetAgain: () => React.JSX.Element;
8
- export declare const Wait: () => React.JSX.Element;
9
- export declare const Action: ({ index }: {
10
- index: number;
11
- }) => React.JSX.Element;
@@ -1,199 +0,0 @@
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/components/eftposPay/eftpos/config.tsx
30
- var config_exports = {};
31
- __export(config_exports, {
32
- Action: () => Action,
33
- Card: () => Card,
34
- POS: () => POS,
35
- Pwd: () => Pwd,
36
- Receipet: () => Receipet,
37
- ReceipetAgain: () => ReceipetAgain,
38
- Surcharge: () => Surcharge,
39
- Wait: () => Wait
40
- });
41
- module.exports = __toCommonJS(config_exports);
42
- var import_utils = require("@pisell/utils");
43
- var import_antd = require("antd");
44
- var import_react = __toESM(require("react"));
45
- var import_step = __toESM(require("../component/step"));
46
- var import_store = require("../store");
47
- var POS = () => {
48
- const dispatch = (0, import_store.useDispatch)();
49
- const { steps } = (0, import_store.useContextData)();
50
- const { key, ...props } = steps[0];
51
- (0, import_react.useEffect)(() => {
52
- setTimeout(() => {
53
- dispatch((0, import_store.updateStep)({ step: 1 }));
54
- }, 2e3);
55
- }, []);
56
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
57
- };
58
- var Surcharge = () => {
59
- const dispatch = (0, import_store.useDispatch)();
60
- const { steps } = (0, import_store.useContextData)();
61
- const { key, ...props } = steps[1];
62
- (0, import_react.useEffect)(() => {
63
- setTimeout(() => {
64
- dispatch((0, import_store.updateStep)({ step: 2 }));
65
- }, 4e3);
66
- }, []);
67
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
68
- };
69
- var Card = () => {
70
- const dispatch = (0, import_store.useDispatch)();
71
- const { steps } = (0, import_store.useContextData)();
72
- const { key, ...props } = steps[2];
73
- (0, import_react.useEffect)(() => {
74
- setTimeout(() => {
75
- dispatch((0, import_store.updateStep)({ step: 3 }));
76
- }, 200);
77
- }, []);
78
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
79
- };
80
- var Pwd = () => {
81
- const dispatch = (0, import_store.useDispatch)();
82
- const { steps } = (0, import_store.useContextData)();
83
- const { key, ...props } = steps[3];
84
- (0, import_react.useEffect)(() => {
85
- setTimeout(() => {
86
- dispatch((0, import_store.updateStep)({ step: 4 }));
87
- }, 200);
88
- }, []);
89
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
90
- };
91
- var Receipet = () => {
92
- const dispatch = (0, import_store.useDispatch)();
93
- const { steps } = (0, import_store.useContextData)();
94
- const { key, ...props } = steps[4];
95
- (0, import_react.useEffect)(() => {
96
- setTimeout(() => {
97
- dispatch((0, import_store.updateStep)({ step: 5 }));
98
- dispatch((0, import_store.updateStatus)("warn"));
99
- dispatch(
100
- (0, import_store.updateWarn)(import_utils.locales.getText("page.eftpos-pay.text.receipt.again.text"))
101
- );
102
- }, 200);
103
- }, []);
104
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
105
- };
106
- var ReceipetAgain = () => {
107
- const { steps } = (0, import_store.useContextData)();
108
- const { key, ...props } = steps[5];
109
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
110
- };
111
- var Wait = () => {
112
- const dispatch = (0, import_store.useDispatch)();
113
- const { steps, mode } = (0, import_store.useContextData)();
114
- const { key, ...props } = steps[6];
115
- (0, import_react.useEffect)(() => {
116
- setTimeout(() => {
117
- dispatch((0, import_store.updateNextStep)());
118
- }, 200);
119
- }, []);
120
- return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
121
- };
122
- var Action = ({ index }) => {
123
- const dispatch = (0, import_store.useDispatch)();
124
- const data = (0, import_store.useContextData)();
125
- const onCancel = () => {
126
- dispatch((0, import_store.updateComponent)("Fail"));
127
- data.steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.cancel");
128
- dispatch((0, import_store.updateSteps)(data.steps));
129
- };
130
- const onAccept = () => {
131
- console.log("index 内 = ", index);
132
- dispatch((0, import_store.updateNextStep)());
133
- };
134
- const onDecline = () => {
135
- dispatch((0, import_store.updateComponent)("Signature"));
136
- };
137
- const onManually = () => {
138
- dispatch(
139
- (0, import_store.updateState)({
140
- manual: {
141
- title: import_utils.locales.getText("page.eftpos-pay.text.request.title")(data.mode),
142
- text: import_utils.locales.getText("page.eftpos-pay.text.request.text")(data.mode)
143
- }
144
- })
145
- );
146
- dispatch((0, import_store.updateComponent)("Manual"));
147
- };
148
- if (index < 5) {
149
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
150
- import_antd.Button,
151
- {
152
- block: true,
153
- className: "pisell-lowcode__eft-pay-step-item-btn",
154
- onClick: onCancel
155
- },
156
- import_utils.locales.getText("page.eftpos-pay.text.cancel")
157
- ));
158
- }
159
- if (index === 5) {
160
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
161
- import_antd.Button,
162
- {
163
- block: true,
164
- className: "pisell-lowcode__eft-pay-step-item-btn",
165
- onClick: onDecline
166
- },
167
- import_utils.locales.getText("page.eftpos-pay.text.decline")
168
- ), /* @__PURE__ */ import_react.default.createElement(
169
- import_antd.Button,
170
- {
171
- block: true,
172
- type: "primary",
173
- className: "pisell-lowcode__eft-pay-step-item-btn",
174
- onClick: onAccept
175
- },
176
- import_utils.locales.getText("page.eftpos-pay.text.accept")
177
- ));
178
- }
179
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
180
- import_antd.Button,
181
- {
182
- block: true,
183
- className: "pisell-lowcode__eft-pay-step-item-btn",
184
- onClick: onManually
185
- },
186
- import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
187
- ));
188
- };
189
- // Annotate the CommonJS export names for ESM import in node:
190
- 0 && (module.exports = {
191
- Action,
192
- Card,
193
- POS,
194
- Pwd,
195
- Receipet,
196
- ReceipetAgain,
197
- Surcharge,
198
- Wait
199
- });
@@ -1,10 +0,0 @@
1
- import { Amount } from '../const';
2
- import { State } from '../store';
3
- export declare const getStep: ({ amount, symbol, mode, }?: {
4
- amount?: string | undefined;
5
- symbol: string;
6
- mode?: string | undefined;
7
- }) => State['steps'];
8
- declare const getInitState: (params: any) => State;
9
- export default getInitState;
10
- export declare function getAmonunt(store: State): Amount;
@@ -1,165 +0,0 @@
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/eftposPay/eftpos/const.ts
20
- var const_exports = {};
21
- __export(const_exports, {
22
- default: () => const_default,
23
- getAmonunt: () => getAmonunt,
24
- getStep: () => getStep
25
- });
26
- module.exports = __toCommonJS(const_exports);
27
- var import_utils = require("@pisell/utils");
28
- var import_const = require("../const");
29
- var getStep = ({
30
- amount,
31
- symbol,
32
- mode
33
- } = {
34
- amount: "0",
35
- symbol: "",
36
- mode: import_const.ModeEnum.Pay
37
- }) => [
38
- {
39
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
40
- key: Date.now(),
41
- text: import_utils.locales.getText("page.eftpos-pay.text.wait")(symbol + amount, mode),
42
- // 'Asked EFTPOS to accept payment for Purchase $100...',
43
- warn: "",
44
- tip: "processing...",
45
- status: "loading"
46
- },
47
- {
48
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
49
- key: Date.now(),
50
- text: import_utils.locales.getText("page.eftpos-pay.text.surcharge"),
51
- warn: "",
52
- tip: "processing...",
53
- status: "loading"
54
- },
55
- {
56
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
57
- key: Date.now(),
58
- text: import_utils.locales.getText("page.eftpos-pay.text.account"),
59
- warn: "",
60
- tip: "processing...",
61
- status: "loading"
62
- },
63
- {
64
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
65
- key: Date.now(),
66
- text: import_utils.locales.getText("page.eftpos-pay.text.pin"),
67
- warn: "",
68
- tip: "processing...",
69
- status: "loading"
70
- },
71
- {
72
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
73
- key: Date.now(),
74
- text: import_utils.locales.getText("page.eftpos-pay.text.receipt"),
75
- warn: "",
76
- tip: "processing...",
77
- status: "loading"
78
- },
79
- {
80
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
81
- key: Date.now(),
82
- text: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.title"),
83
- warn: import_utils.locales.getText("page.eftpos-pay.text.receipt.again.text"),
84
- tip: "",
85
- status: "warn"
86
- },
87
- {
88
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
89
- key: Date.now(),
90
- text: "Waiting for the appvoval...",
91
- success: "Approade",
92
- warn: "",
93
- tip: "processing...",
94
- status: "loading"
95
- }
96
- ];
97
- var getInitState = (params) => ({
98
- mode: (params == null ? void 0 : params.mode) || import_const.ModeEnum.Pay,
99
- eftpos: import_const.EftposEnum.Eftpos,
100
- key: Date.now(),
101
- warn: "",
102
- step: 0,
103
- type: import_const.PayRouteEnum.Step,
104
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")((params == null ? void 0 : params.mode) || import_const.ModeEnum.Pay),
105
- component: "",
106
- status: import_const.StatusEnum.Loading,
107
- steps: getStep(params),
108
- custom: params,
109
- render: true,
110
- ...params.device ? { device: params.device } : {}
111
- });
112
- var const_default = getInitState;
113
- function getAmonunt(store) {
114
- const { device, custom } = store;
115
- if (!device || !custom) {
116
- throw Error("device or custom is not defined");
117
- }
118
- const name = custom.name;
119
- const symbol = custom.symbol;
120
- const money = custom.amount;
121
- const pay = custom.pay;
122
- const setting = device.setting;
123
- if (pay) {
124
- return {
125
- name,
126
- symbol,
127
- // format,
128
- money,
129
- amount: Number(pay.amount),
130
- surRate: Number(pay.surRate),
131
- surMoney: Number(pay.surMoney),
132
- surcharge: (setting == null ? void 0 : setting.surcharge) || false
133
- };
134
- }
135
- if (!setting) {
136
- return {
137
- name,
138
- symbol,
139
- // format,
140
- money,
141
- amount: money,
142
- surRate: 0,
143
- surMoney: 0,
144
- surcharge: false
145
- };
146
- }
147
- const surRate = setting.constant_rate || 0;
148
- const surMoney = setting.constant_money || 0;
149
- const surcharge = setting.surcharge;
150
- return {
151
- name,
152
- symbol,
153
- // format,
154
- money,
155
- amount: money,
156
- surRate: surcharge ? surRate : 0,
157
- surMoney: surcharge ? surMoney : 0,
158
- surcharge
159
- };
160
- }
161
- // Annotate the CommonJS export names for ESM import in node:
162
- 0 && (module.exports = {
163
- getAmonunt,
164
- getStep
165
- });
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- declare const _default: ({ api, onChange, children, }: {
3
- api: any;
4
- onChange: any;
5
- children: React.ReactNode;
6
- }) => React.JSX.Element;
7
- export default _default;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- declare const _default: ({ index, api, }: {
3
- index: number;
4
- api: {
5
- [key: string]: (...agrn: unknown[]) => Promise<unknown>;
6
- };
7
- }) => React.JSX.Element;
8
- export default _default;
@@ -1,143 +0,0 @@
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/components/eftposPay/windcave/action.tsx
30
- var action_exports = {};
31
- __export(action_exports, {
32
- default: () => action_default
33
- });
34
- module.exports = __toCommonJS(action_exports);
35
- var import_utils = require("@pisell/utils");
36
- var import_antd = require("antd");
37
- var import_react = __toESM(require("react"));
38
- var import_store = require("../store");
39
- var action_default = ({
40
- index,
41
- api
42
- }) => {
43
- const [disabled, setDisabled] = (0, import_react.useState)(false);
44
- const dispatch = (0, import_store.useDispatch)();
45
- const data = (0, import_store.useContextData)();
46
- const { custom } = (0, import_store.useContextData)();
47
- const onCancel = () => {
48
- setDisabled(true);
49
- api.update({
50
- type: "CANCEL",
51
- number: custom == null ? void 0 : custom.number
52
- }).then(() => {
53
- dispatch((0, import_store.updateComponent)("Fail"));
54
- data.steps[index].status = "fail";
55
- data.steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.cancel");
56
- dispatch((0, import_store.updateSteps)(data.steps));
57
- setDisabled(false);
58
- }).catch((res) => {
59
- console.log(res);
60
- setDisabled(false);
61
- });
62
- };
63
- const onAccept = () => {
64
- setDisabled(true);
65
- api.update({
66
- type: "YES",
67
- number: custom == null ? void 0 : custom.number
68
- }).then(() => {
69
- setDisabled(false);
70
- dispatch((0, import_store.updateNextStep)());
71
- }).catch((res) => {
72
- setDisabled(false);
73
- console.log(res);
74
- });
75
- };
76
- const onDecline = () => {
77
- dispatch((0, import_store.updateComponent)("Signature", true));
78
- };
79
- const onManually = () => {
80
- dispatch(
81
- (0, import_store.updateState)({
82
- manual: {
83
- title: import_utils.locales.getText("page.eftpos-pay.text.request.title")(data.mode),
84
- text: import_utils.locales.getText("page.eftpos-pay.text.request.text")(data.mode)
85
- }
86
- })
87
- );
88
- dispatch((0, import_store.updateComponent)("Manual", true));
89
- };
90
- if (index === 0) {
91
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
92
- import_antd.Button,
93
- {
94
- block: true,
95
- className: "pisell-lowcode__eft-pay-step-item-btn",
96
- onClick: onCancel,
97
- disabled
98
- },
99
- import_utils.locales.getText("page.eftpos-pay.text.cancel")
100
- ));
101
- }
102
- if (index > 0 && index < 3) {
103
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
104
- import_antd.Button,
105
- {
106
- block: true,
107
- className: "pisell-lowcode__eft-pay-step-item-btn",
108
- disabled: true
109
- },
110
- import_utils.locales.getText("page.eftpos-pay.text.leave")
111
- ));
112
- }
113
- if (index === 3) {
114
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
115
- import_antd.Button,
116
- {
117
- block: true,
118
- className: "pisell-lowcode__eft-pay-step-item-btn",
119
- onClick: onDecline
120
- },
121
- import_utils.locales.getText("page.eftpos-pay.text.decline")
122
- ), /* @__PURE__ */ import_react.default.createElement(
123
- import_antd.Button,
124
- {
125
- block: true,
126
- type: "primary",
127
- className: "pisell-lowcode__eft-pay-step-item-btn",
128
- onClick: onAccept,
129
- disabled
130
- },
131
- import_utils.locales.getText("page.eftpos-pay.text.accept")
132
- ));
133
- }
134
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ import_react.default.createElement(
135
- import_antd.Button,
136
- {
137
- block: true,
138
- className: "pisell-lowcode__eft-pay-step-item-btn",
139
- onClick: onManually
140
- },
141
- import_utils.locales.getText("page.eftpos-pay.text.manual.marking")
142
- ));
143
- };