@pisell/private-materials 3.0.136 → 3.0.137

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 (231) 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/addons/model.d.ts +1 -2
  12. package/es/components/booking/forms/model.d.ts +1 -2
  13. package/es/components/booking/notes/index.d.ts +1 -1
  14. package/es/components/booking/notes/model.d.ts +1 -2
  15. package/es/components/booking/payments/model.d.ts +1 -2
  16. package/es/components/eftpos/const.d.ts +26 -0
  17. package/es/components/eftpos/const.js +40 -8
  18. package/es/components/eftpos/device.d.ts +3 -2
  19. package/es/components/eftpos/device.js +6 -5
  20. package/es/components/eftpos/form/index.d.ts +5 -0
  21. package/es/components/eftpos/form/index.js +8 -0
  22. package/es/components/eftpos/hooks.d.ts +34 -0
  23. package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
  24. package/es/components/eftpos/icon/apiKey.d.ts +5 -0
  25. package/es/components/eftpos/icon/apiKey.js +17 -0
  26. package/es/components/eftpos/icon/device.d.ts +5 -0
  27. package/es/components/eftpos/icon/device.js +19 -0
  28. package/es/components/eftpos/index.d.ts +10 -0
  29. package/es/components/eftpos/index.js +329 -46
  30. package/es/components/eftpos/index.less +38 -1
  31. package/es/components/eftpos/locales.d.ts +12 -0
  32. package/es/components/eftpos/locales.js +15 -3
  33. package/es/components/eftpos/log.d.ts +8 -0
  34. package/es/components/eftpos/log.js +85 -0
  35. package/es/components/eftpos/pos.d.ts +1 -1
  36. package/es/components/eftpos/pos.js +8 -5
  37. package/es/components/eftpos/surcharge/index.d.ts +25 -2
  38. package/es/components/eftpos/surcharge/index.js +100 -16
  39. package/es/components/eftpos/table.d.ts +4 -0
  40. package/es/components/eftpos/table.js +102 -10
  41. package/es/components/eftposPay/amount.d.ts +7 -1
  42. package/es/components/eftposPay/amount.js +65 -38
  43. package/es/components/eftposPay/component/fail/failCustom.js +65 -20
  44. package/es/components/eftposPay/component/fail/index.js +60 -30
  45. package/es/components/eftposPay/component/fail/network.d.ts +5 -0
  46. package/es/components/eftposPay/component/fail/network.js +13 -0
  47. package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
  48. package/es/components/eftposPay/component/fail/unknow.js +18 -3
  49. package/es/components/eftposPay/component/header/index.d.ts +2 -1
  50. package/es/components/eftposPay/component/header/index.js +4 -1
  51. package/es/components/eftposPay/component/header/index.less +1 -10
  52. package/es/components/eftposPay/component/manual/index.d.ts +6 -1
  53. package/es/components/eftposPay/component/manual/index.js +174 -23
  54. package/es/components/eftposPay/component/manual/index.less +42 -14
  55. package/es/components/eftposPay/component/signature/index.d.ts +5 -0
  56. package/es/components/eftposPay/component/signature/index.js +20 -2
  57. package/es/components/eftposPay/component/step/index.d.ts +7 -7
  58. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  59. package/es/components/eftposPay/const.d.ts +19 -4
  60. package/es/components/eftposPay/const.js +4 -2
  61. package/es/components/eftposPay/device.d.ts +7 -0
  62. package/es/components/eftposPay/device.js +22 -0
  63. package/es/components/eftposPay/helper.d.ts +54 -0
  64. package/es/components/eftposPay/helper.js +93 -1
  65. package/es/components/eftposPay/hooks.d.ts +30 -1
  66. package/es/components/eftposPay/hooks.js +181 -26
  67. package/es/components/eftposPay/index.d.ts +2 -4
  68. package/es/components/eftposPay/index.js +119 -31
  69. package/es/components/eftposPay/index.less +27 -19
  70. package/es/components/eftposPay/locales.d.ts +45 -0
  71. package/es/components/eftposPay/locales.js +348 -3
  72. package/es/components/eftposPay/manufacturer.d.ts +2 -2
  73. package/es/components/eftposPay/manufacturer.js +9 -10
  74. package/es/components/eftposPay/pay.d.ts +10 -1
  75. package/es/components/eftposPay/pay.js +112 -34
  76. package/es/components/eftposPay/payo/config.js +137 -270
  77. package/es/components/eftposPay/payo/const.d.ts +22 -2
  78. package/es/components/eftposPay/payo/const.js +83 -33
  79. package/es/components/eftposPay/payo/hooks.d.ts +5 -0
  80. package/es/components/eftposPay/payo/hooks.js +19 -2
  81. package/es/components/eftposPay/store/index.d.ts +154 -53
  82. package/es/components/eftposPay/store/index.js +112 -60
  83. package/es/components/eftposPay/tyro/const.d.ts +17 -0
  84. package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
  85. package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
  86. package/es/components/eftposPay/tyro/hooks.js +40 -0
  87. package/es/components/eftposPay/tyro/index.d.ts +9 -0
  88. package/es/components/eftposPay/tyro/index.js +575 -0
  89. package/es/components/eftposPay/windcave/const.d.ts +24 -9
  90. package/es/components/eftposPay/windcave/const.js +90 -81
  91. package/es/components/eftposPay/windcave/helper.d.ts +16 -2
  92. package/es/components/eftposPay/windcave/helper.js +175 -42
  93. package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  94. package/es/components/eftposPay/windcave/receiptAction.js +91 -43
  95. package/es/components/eftposPay/windcave/timer.d.ts +13 -1
  96. package/es/components/eftposPay/windcave/timer.js +18 -1
  97. package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
  98. package/es/components/eftposPay/windcave/windcave.js +155 -139
  99. package/es/components/schedules/index.d.ts +1 -1
  100. package/es/components/schedules/model.d.ts +1 -2
  101. package/es/utils/load.d.ts +11 -0
  102. package/es/utils/load.js +85 -0
  103. package/lib/components/booking/addons/model.d.ts +1 -2
  104. package/lib/components/booking/forms/model.d.ts +1 -2
  105. package/lib/components/booking/notes/index.d.ts +1 -1
  106. package/lib/components/booking/notes/model.d.ts +1 -2
  107. package/lib/components/booking/payments/model.d.ts +1 -2
  108. package/lib/components/eftpos/const.d.ts +26 -0
  109. package/lib/components/eftpos/const.js +13 -1
  110. package/lib/components/eftpos/device.d.ts +3 -2
  111. package/lib/components/eftpos/device.js +2 -2
  112. package/lib/components/eftpos/form/index.d.ts +5 -0
  113. package/lib/components/eftpos/hooks.d.ts +34 -0
  114. package/lib/components/eftpos/hooks.js +106 -0
  115. package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
  116. package/lib/components/eftpos/icon/apiKey.js +57 -0
  117. package/lib/components/eftpos/icon/device.d.ts +5 -0
  118. package/lib/components/eftpos/icon/device.js +57 -0
  119. package/lib/components/eftpos/index.d.ts +10 -0
  120. package/lib/components/eftpos/index.js +262 -97
  121. package/lib/components/eftpos/index.less +38 -1
  122. package/lib/components/eftpos/locales.d.ts +12 -0
  123. package/lib/components/eftpos/locales.js +15 -3
  124. package/lib/components/eftpos/log.d.ts +8 -0
  125. package/lib/components/eftpos/log.js +87 -0
  126. package/lib/components/eftpos/pos.d.ts +1 -1
  127. package/lib/components/eftpos/pos.js +5 -4
  128. package/lib/components/eftpos/surcharge/index.d.ts +25 -2
  129. package/lib/components/eftpos/surcharge/index.js +36 -6
  130. package/lib/components/eftpos/table.d.ts +4 -0
  131. package/lib/components/eftpos/table.js +40 -8
  132. package/lib/components/eftposPay/amount.d.ts +7 -1
  133. package/lib/components/eftposPay/amount.js +10 -33
  134. package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
  135. package/lib/components/eftposPay/component/fail/index.js +39 -18
  136. package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
  137. package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
  138. package/lib/components/eftposPay/component/fail/unknow.js +3 -3
  139. package/lib/components/eftposPay/component/header/index.d.ts +2 -1
  140. package/lib/components/eftposPay/component/header/index.js +2 -1
  141. package/lib/components/eftposPay/component/header/index.less +1 -10
  142. package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
  143. package/lib/components/eftposPay/component/manual/index.js +122 -31
  144. package/lib/components/eftposPay/component/manual/index.less +42 -14
  145. package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
  146. package/lib/components/eftposPay/component/signature/index.js +2 -2
  147. package/lib/components/eftposPay/component/step/index.d.ts +7 -7
  148. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  149. package/lib/components/eftposPay/const.d.ts +19 -4
  150. package/lib/components/eftposPay/const.js +3 -1
  151. package/lib/components/eftposPay/device.d.ts +7 -0
  152. package/lib/components/eftposPay/helper.d.ts +54 -0
  153. package/lib/components/eftposPay/helper.js +64 -0
  154. package/lib/components/eftposPay/hooks.d.ts +30 -1
  155. package/lib/components/eftposPay/hooks.js +182 -44
  156. package/lib/components/eftposPay/index.d.ts +2 -4
  157. package/lib/components/eftposPay/index.js +74 -27
  158. package/lib/components/eftposPay/index.less +27 -19
  159. package/lib/components/eftposPay/locales.d.ts +45 -0
  160. package/lib/components/eftposPay/locales.js +352 -3
  161. package/lib/components/eftposPay/manufacturer.d.ts +2 -2
  162. package/lib/components/eftposPay/manufacturer.js +13 -13
  163. package/lib/components/eftposPay/pay.d.ts +10 -1
  164. package/lib/components/eftposPay/pay.js +86 -25
  165. package/lib/components/eftposPay/payo/config.js +121 -268
  166. package/lib/components/eftposPay/payo/const.d.ts +22 -2
  167. package/lib/components/eftposPay/payo/const.js +55 -36
  168. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  169. package/lib/components/eftposPay/payo/hooks.js +1 -1
  170. package/lib/components/eftposPay/store/index.d.ts +154 -53
  171. package/lib/components/eftposPay/store/index.js +7 -66
  172. package/lib/components/eftposPay/tyro/const.d.ts +17 -0
  173. package/lib/components/eftposPay/tyro/const.js +114 -0
  174. package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
  175. package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
  176. package/lib/components/eftposPay/tyro/index.d.ts +9 -0
  177. package/lib/components/eftposPay/tyro/index.js +558 -0
  178. package/lib/components/eftposPay/windcave/const.d.ts +24 -9
  179. package/lib/components/eftposPay/windcave/const.js +53 -104
  180. package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
  181. package/lib/components/eftposPay/windcave/helper.js +163 -48
  182. package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  183. package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
  184. package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
  185. package/lib/components/eftposPay/windcave/timer.js +5 -0
  186. package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
  187. package/lib/components/eftposPay/windcave/windcave.js +130 -130
  188. package/lib/components/schedules/index.d.ts +1 -1
  189. package/lib/components/schedules/model.d.ts +1 -2
  190. package/lib/utils/load.d.ts +11 -0
  191. package/lib/utils/load.js +100 -0
  192. package/lowcode/eftpos/meta.ts +202 -160
  193. package/lowcode/eftpos-pay/meta.ts +45 -12
  194. package/package.json +4 -4
  195. package/es/components/eftposPay/eftpos/config.d.ts +0 -11
  196. package/es/components/eftposPay/eftpos/config.js +0 -178
  197. package/es/components/eftposPay/eftpos/const.d.ts +0 -10
  198. package/es/components/eftposPay/eftpos/index.d.ts +0 -7
  199. package/es/components/eftposPay/eftpos/index.js +0 -35
  200. package/es/components/eftposPay/windcave/action.d.ts +0 -8
  201. package/es/components/eftposPay/windcave/action.js +0 -104
  202. package/es/components/eftposPay/windcave/hook.d.ts +0 -14
  203. package/es/components/eftposPay/windcave/index.d.ts +0 -8
  204. package/es/components/eftposPay/windcave/index.js +0 -49
  205. package/es/components/eftposPay/windcave/pos.d.ts +0 -8
  206. package/es/components/eftposPay/windcave/pos.js +0 -180
  207. package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
  208. package/es/components/eftposPay/windcave/pwd.js +0 -124
  209. package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
  210. package/es/components/eftposPay/windcave/receipet.js +0 -67
  211. package/es/components/eftposPay/windcave/wait.d.ts +0 -12
  212. package/es/components/eftposPay/windcave/wait.js +0 -139
  213. package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
  214. package/lib/components/eftposPay/eftpos/config.js +0 -199
  215. package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
  216. package/lib/components/eftposPay/eftpos/const.js +0 -165
  217. package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
  218. package/lib/components/eftposPay/windcave/action.d.ts +0 -8
  219. package/lib/components/eftposPay/windcave/action.js +0 -143
  220. package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
  221. package/lib/components/eftposPay/windcave/hook.js +0 -139
  222. package/lib/components/eftposPay/windcave/index.d.ts +0 -8
  223. package/lib/components/eftposPay/windcave/index.js +0 -78
  224. package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
  225. package/lib/components/eftposPay/windcave/pos.js +0 -197
  226. package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
  227. package/lib/components/eftposPay/windcave/pwd.js +0 -143
  228. package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
  229. package/lib/components/eftposPay/windcave/receipet.js +0 -93
  230. package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
  231. package/lib/components/eftposPay/windcave/wait.js +0 -163
@@ -1,124 +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 _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; }
4
- 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; }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- 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."); }
7
- 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); }
8
- 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; }
9
- 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; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- /* eslint-disable no-unused-vars */
12
- /* eslint-disable @typescript-eslint/no-unused-vars */
13
- import { locales } from '@pisell/utils';
14
- import React, { useEffect, useRef } from 'react';
15
- import Step from "../component/step";
16
- import { StatusEnum } from "../const";
17
- import { useFail } from "../hooks";
18
- import { useContextData, useDispatch, updateComponent, updateState, updateCurrentStemItem } from "../store";
19
- import { useValidate, useSuccess } from "./hook";
20
- var Pwd = function Pwd(_ref) {
21
- var api = _ref.api,
22
- hasBackup = _ref.hasBackup;
23
- var dispatch = useDispatch();
24
- var _useValidate = useValidate(1000 * 60),
25
- _useValidate2 = _slicedToArray(_useValidate, 1),
26
- check = _useValidate2[0];
27
- var _useContextData = useContextData(),
28
- custom = _useContextData.custom,
29
- steps = _useContextData.steps,
30
- status = _useContextData.status,
31
- mode = _useContextData.mode;
32
- console.log(steps);
33
- var statusRef = useRef(status);
34
- var ref = useRef(custom === null || custom === void 0 ? void 0 : custom.number);
35
- var backupRef = useRef(hasBackup);
36
- var initRef = useRef(false);
37
- var fail = useFail(1, true);
38
- var success = useSuccess(1);
39
- var failRef = useRef(fail);
40
- var successRef = useRef(success);
41
- var unloadRef = useRef(false);
42
- useEffect(function () {
43
- failRef.current = fail;
44
- }, [fail]);
45
- useEffect(function () {
46
- successRef.current = success;
47
- }, [success]);
48
- useEffect(function () {
49
- statusRef.current = status;
50
- }, [status]);
51
- var _steps$ = steps[1],
52
- key = _steps$.key,
53
- props = _objectWithoutProperties(_steps$, _excluded);
54
- var stepStatusRef = useRef(props.status);
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
- backupRef.current = hasBackup;
66
- }, [hasBackup]);
67
- useEffect(function () {
68
- if (initRef.current) {
69
- return;
70
- }
71
- initRef.current = true;
72
- if (statusRef.current !== StatusEnum.Loading) {
73
- return;
74
- }
75
- if (stepStatusRef.current !== StatusEnum.Loading) {
76
- return;
77
- }
78
- if (ref.current) {
79
- console.log(' pwd 开始查询 ', ref.current, statusRef.current);
80
- check({
81
- check: api.check,
82
- number: ref.current,
83
- txn_status_id: '7',
84
- __start__: '5',
85
- checkCondition: function checkCondition(r) {
86
- return Number(r.txn_status_id) < 7;
87
- }
88
- }).then(function (res) {
89
- if (unloadRef.current) {
90
- return;
91
- }
92
- successRef.current(res, backupRef.current);
93
- }, function (res) {
94
- if (unloadRef.current) {
95
- return;
96
- }
97
- if (backupRef.current) {
98
- return;
99
- }
100
- if (res && _typeof(res) === 'object' && typeof res.txn_status_id !== 'undefined' && typeof res.status_id !== 'undefined') {
101
- dispatch(updateCurrentStemItem({
102
- status: 'fail'
103
- }));
104
- dispatch(updateState({
105
- manual: {
106
- title: locales.getText('page.eftpos-pay.text.timedout.title'),
107
- text: locales.getText('page.eftpos-pay.text.timedout.text')(mode)
108
- }
109
- }));
110
- dispatch(updateComponent('Manual'));
111
- return;
112
- }
113
- failRef.current(res, backupRef.current);
114
- });
115
- }
116
- }, [api.check, check, dispatch]);
117
- useEffect(function () {
118
- return function () {
119
- unloadRef.current = true;
120
- };
121
- }, []);
122
- return /*#__PURE__*/React.createElement(Step, props);
123
- };
124
- export default Pwd;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- declare const Receipet: ({ hasBackup }: {
3
- hasBackup: boolean;
4
- }) => React.JSX.Element;
5
- export declare const ReceipetAgain: () => React.JSX.Element;
6
- export default Receipet;
@@ -1,67 +0,0 @@
1
- var _excluded = ["key"],
2
- _excluded2 = ["key"];
3
- 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; }
4
- 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; }
5
- /* eslint-disable no-unused-vars */
6
- /* eslint-disable @typescript-eslint/no-unused-vars */
7
- import React, { useEffect, useRef } from 'react';
8
- import Step from "../component/step";
9
- import { StatusEnum } from "../const";
10
- import { useContextData, useDispatch, updateNextStep, updateSteps, updateStatus } from "../store";
11
- var Receipet = function Receipet(_ref) {
12
- var hasBackup = _ref.hasBackup;
13
- var dispatch = useDispatch();
14
- var _useContextData = useContextData(),
15
- steps = _useContextData.steps,
16
- status = _useContextData.status;
17
- var _steps$ = steps[2],
18
- key = _steps$.key,
19
- props = _objectWithoutProperties(_steps$, _excluded);
20
- var statusRef = useRef(status);
21
- var stepStatusRef = useRef(props.status);
22
- var backupRef = useRef(hasBackup);
23
- var initRef = useRef(false);
24
- var clearRef = useRef();
25
- useEffect(function () {
26
- backupRef.current = hasBackup;
27
- }, [hasBackup]);
28
- useEffect(function () {
29
- stepStatusRef.current = props.status;
30
- }, [props.status]);
31
- useEffect(function () {
32
- if (initRef.current) {
33
- return;
34
- }
35
- initRef.current = true;
36
- if (statusRef.current !== StatusEnum.Loading) {
37
- return;
38
- }
39
- if (stepStatusRef.current !== StatusEnum.Loading) {
40
- return;
41
- }
42
- clearRef.current = setTimeout(function () {
43
- if (!backupRef.current) {
44
- dispatch(updateNextStep());
45
- dispatch(updateSteps(steps));
46
- dispatch(updateStatus(StatusEnum.Warn));
47
- }
48
- }, 1000);
49
- }, [dispatch, steps]);
50
- useEffect(function () {
51
- return function () {
52
- if (clearRef.current) {
53
- clearTimeout(clearRef.current);
54
- }
55
- };
56
- }, []);
57
- return /*#__PURE__*/React.createElement(Step, props);
58
- };
59
- export var ReceipetAgain = function ReceipetAgain() {
60
- var _useContextData2 = useContextData(),
61
- steps = _useContextData2.steps;
62
- var _steps$2 = steps[3],
63
- key = _steps$2.key,
64
- props = _objectWithoutProperties(_steps$2, _excluded2);
65
- return /*#__PURE__*/React.createElement(Step, props);
66
- };
67
- export default Receipet;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { StatusEnum } from '../const';
3
- declare const Wait: ({ api, onChange, hasBackup, }: {
4
- api: {
5
- [key: string]: (...agrn: unknown[]) => Promise<unknown>;
6
- };
7
- onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}`, params?: {
8
- [keys: string]: unknown;
9
- } | undefined) => void;
10
- hasBackup: boolean;
11
- }) => React.JSX.Element;
12
- export default Wait;
@@ -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;