@pisell/private-materials 3.0.95 → 3.0.97

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 (267) 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 +16 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +15 -8
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/model.d.ts +1 -2
  13. package/es/components/booking/forms/forms.d.ts +1 -1
  14. package/es/components/booking/forms/index.d.ts +1 -1
  15. package/es/components/booking/forms/model.d.ts +1 -2
  16. package/es/components/booking/index.d.ts +1 -1
  17. package/es/components/booking/info/index.d.ts +1 -1
  18. package/es/components/booking/info/model.d.ts +1 -2
  19. package/es/components/booking/model.d.ts +1 -2
  20. package/es/components/booking/notes/index.d.ts +1 -1
  21. package/es/components/booking/notes/model.d.ts +1 -2
  22. package/es/components/booking/payments/index.d.ts +1 -1
  23. package/es/components/booking/payments/model.d.ts +1 -2
  24. package/es/components/eftpos/const.d.ts +38 -0
  25. package/es/components/eftpos/const.js +79 -0
  26. package/es/components/eftpos/device.d.ts +8 -0
  27. package/es/components/eftpos/device.js +30 -0
  28. package/es/components/eftpos/form/index.d.ts +16 -0
  29. package/es/components/eftpos/form/index.js +113 -0
  30. package/es/components/eftpos/index.d.ts +37 -0
  31. package/es/components/eftpos/index.js +274 -0
  32. package/es/components/eftpos/index.less +153 -0
  33. package/es/components/eftpos/locales.d.ts +75 -0
  34. package/es/components/eftpos/locales.js +98 -0
  35. package/es/components/eftpos/pos.d.ts +9 -0
  36. package/es/components/eftpos/pos.js +33 -0
  37. package/es/components/eftpos/surcharge/index.css +17 -0
  38. package/es/components/eftpos/surcharge/index.d.ts +8 -0
  39. package/es/components/eftpos/surcharge/index.js +111 -0
  40. package/es/components/eftpos/table.d.ts +17 -0
  41. package/es/components/eftpos/table.js +236 -0
  42. package/es/components/eftposPay/amount.d.ts +14 -0
  43. package/es/components/eftposPay/amount.js +253 -0
  44. package/es/components/eftposPay/component/alert/index.d.ts +6 -0
  45. package/es/components/eftposPay/component/alert/index.js +11 -0
  46. package/es/components/eftposPay/component/alert/index.less +29 -0
  47. package/es/components/eftposPay/component/alert/warn.d.ts +3 -0
  48. package/es/components/eftposPay/component/alert/warn.js +45 -0
  49. package/es/components/eftposPay/component/fail/failCustom.d.ts +4 -0
  50. package/es/components/eftposPay/component/fail/failCustom.js +95 -0
  51. package/es/components/eftposPay/component/fail/index.d.ts +4 -0
  52. package/es/components/eftposPay/component/fail/index.js +105 -0
  53. package/es/components/eftposPay/component/fail/network.d.ts +4 -0
  54. package/es/components/eftposPay/component/fail/network.js +48 -0
  55. package/es/components/eftposPay/component/fail/unknow.d.ts +4 -0
  56. package/es/components/eftposPay/component/fail/unknow.js +43 -0
  57. package/es/components/eftposPay/component/header/index.d.ts +9 -0
  58. package/es/components/eftposPay/component/header/index.js +66 -0
  59. package/es/components/eftposPay/component/header/index.less +44 -0
  60. package/es/components/eftposPay/component/header/titlebar.d.ts +13 -0
  61. package/es/components/eftposPay/component/header/titlebar.js +39 -0
  62. package/es/components/eftposPay/component/header/titlebar.less +17 -0
  63. package/es/components/eftposPay/component/manual/index.d.ts +5 -0
  64. package/es/components/eftposPay/component/manual/index.js +91 -0
  65. package/es/components/eftposPay/component/manual/index.less +96 -0
  66. package/es/components/eftposPay/component/signature/index.d.ts +4 -0
  67. package/es/components/eftposPay/component/signature/index.js +63 -0
  68. package/es/components/eftposPay/component/step/index.d.ts +12 -0
  69. package/es/components/eftposPay/component/step/index.js +31 -0
  70. package/es/components/eftposPay/component/step/step.d.ts +9 -0
  71. package/es/components/eftposPay/component/step/step.js +23 -0
  72. package/es/components/eftposPay/const.d.ts +131 -0
  73. package/es/components/eftposPay/const.js +48 -0
  74. package/es/components/eftposPay/device.d.ts +14 -0
  75. package/es/components/eftposPay/device.js +124 -0
  76. package/es/components/eftposPay/device.less +61 -0
  77. package/es/components/eftposPay/eftpos/config.d.ts +11 -0
  78. package/es/components/eftposPay/eftpos/config.js +178 -0
  79. package/es/components/eftposPay/eftpos/const.d.ts +10 -0
  80. package/es/components/eftposPay/eftpos/const.js +139 -0
  81. package/es/components/eftposPay/eftpos/index.d.ts +7 -0
  82. package/es/components/eftposPay/eftpos/index.js +35 -0
  83. package/es/components/eftposPay/helper.d.ts +3 -0
  84. package/es/components/eftposPay/helper.js +35 -0
  85. package/es/components/eftposPay/hooks.d.ts +4 -0
  86. package/es/components/eftposPay/hooks.js +153 -0
  87. package/es/components/eftposPay/index.d.ts +7 -0
  88. package/es/components/eftposPay/index.js +188 -0
  89. package/es/components/eftposPay/index.less +273 -0
  90. package/es/components/eftposPay/locales.d.ts +264 -0
  91. package/es/components/eftposPay/locales.js +384 -0
  92. package/es/components/eftposPay/manufacturer.d.ts +6 -0
  93. package/es/components/eftposPay/manufacturer.js +32 -0
  94. package/es/components/eftposPay/pay.d.ts +10 -0
  95. package/es/components/eftposPay/pay.js +108 -0
  96. package/es/components/eftposPay/payo/config.d.ts +11 -0
  97. package/es/components/eftposPay/payo/config.js +357 -0
  98. package/es/components/eftposPay/payo/const.d.ts +6 -0
  99. package/es/components/eftposPay/payo/const.js +93 -0
  100. package/es/components/eftposPay/payo/hooks.d.ts +5 -0
  101. package/es/components/eftposPay/payo/hooks.js +84 -0
  102. package/es/components/eftposPay/payo/index.d.ts +7 -0
  103. package/es/components/eftposPay/payo/index.js +35 -0
  104. package/es/components/eftposPay/store/index.d.ts +239 -0
  105. package/es/components/eftposPay/store/index.js +304 -0
  106. package/es/components/eftposPay/store/useThunkReducer.d.ts +9 -0
  107. package/es/components/eftposPay/store/useThunkReducer.js +31 -0
  108. package/es/components/eftposPay/windcave/action.d.ts +8 -0
  109. package/es/components/eftposPay/windcave/action.js +104 -0
  110. package/es/components/eftposPay/windcave/const.d.ts +104 -0
  111. package/es/components/eftposPay/windcave/const.js +253 -0
  112. package/es/components/eftposPay/windcave/helper.d.ts +9 -0
  113. package/es/components/eftposPay/windcave/helper.js +314 -0
  114. package/es/components/eftposPay/windcave/hook.d.ts +14 -0
  115. package/es/components/eftposPay/windcave/hook.js +144 -0
  116. package/es/components/eftposPay/windcave/index.d.ts +8 -0
  117. package/es/components/eftposPay/windcave/index.js +49 -0
  118. package/es/components/eftposPay/windcave/pos.d.ts +8 -0
  119. package/es/components/eftposPay/windcave/pos.js +180 -0
  120. package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
  121. package/es/components/eftposPay/windcave/pwd.js +124 -0
  122. package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
  123. package/es/components/eftposPay/windcave/receipet.js +67 -0
  124. package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
  125. package/es/components/eftposPay/windcave/receiptAction.js +326 -0
  126. package/es/components/eftposPay/windcave/timer.d.ts +17 -0
  127. package/es/components/eftposPay/windcave/timer.js +181 -0
  128. package/es/components/eftposPay/windcave/wait.d.ts +12 -0
  129. package/es/components/eftposPay/windcave/wait.js +139 -0
  130. package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
  131. package/es/components/eftposPay/windcave/windcave.js +283 -0
  132. package/es/components/schedules/index.d.ts +1 -1
  133. package/es/components/schedules/model.d.ts +1 -2
  134. package/es/hooks/usePrefix.d.ts +1 -0
  135. package/es/hooks/usePrefix.js +10 -0
  136. package/es/index.d.ts +2 -0
  137. package/es/index.js +3 -1
  138. package/lib/components/booking/addons/index.d.ts +1 -1
  139. package/lib/components/booking/addons/model.d.ts +1 -2
  140. package/lib/components/booking/forms/forms.d.ts +1 -1
  141. package/lib/components/booking/forms/index.d.ts +1 -1
  142. package/lib/components/booking/forms/model.d.ts +1 -2
  143. package/lib/components/booking/index.d.ts +1 -1
  144. package/lib/components/booking/info/index.d.ts +1 -1
  145. package/lib/components/booking/info/model.d.ts +1 -2
  146. package/lib/components/booking/model.d.ts +1 -2
  147. package/lib/components/booking/notes/index.d.ts +1 -1
  148. package/lib/components/booking/notes/model.d.ts +1 -2
  149. package/lib/components/booking/payments/index.d.ts +1 -1
  150. package/lib/components/booking/payments/model.d.ts +1 -2
  151. package/lib/components/eftpos/const.d.ts +38 -0
  152. package/lib/components/eftpos/const.js +108 -0
  153. package/lib/components/eftpos/device.d.ts +8 -0
  154. package/lib/components/eftpos/device.js +55 -0
  155. package/lib/components/eftpos/form/index.d.ts +16 -0
  156. package/lib/components/eftpos/form/index.js +124 -0
  157. package/lib/components/eftpos/index.d.ts +37 -0
  158. package/lib/components/eftpos/index.js +279 -0
  159. package/lib/components/eftpos/index.less +153 -0
  160. package/lib/components/eftpos/locales.d.ts +75 -0
  161. package/lib/components/eftpos/locales.js +116 -0
  162. package/lib/components/eftpos/pos.d.ts +9 -0
  163. package/lib/components/eftpos/pos.js +55 -0
  164. package/lib/components/eftpos/surcharge/index.css +17 -0
  165. package/lib/components/eftpos/surcharge/index.d.ts +8 -0
  166. package/lib/components/eftpos/surcharge/index.js +125 -0
  167. package/lib/components/eftpos/table.d.ts +17 -0
  168. package/lib/components/eftpos/table.js +235 -0
  169. package/lib/components/eftposPay/amount.d.ts +14 -0
  170. package/lib/components/eftposPay/amount.js +239 -0
  171. package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
  172. package/lib/components/eftposPay/component/alert/index.js +38 -0
  173. package/lib/components/eftposPay/component/alert/index.less +29 -0
  174. package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
  175. package/lib/components/eftposPay/component/alert/warn.js +80 -0
  176. package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
  177. package/lib/components/eftposPay/component/fail/failCustom.js +117 -0
  178. package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
  179. package/lib/components/eftposPay/component/fail/index.js +121 -0
  180. package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
  181. package/lib/components/eftposPay/component/fail/network.js +65 -0
  182. package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
  183. package/lib/components/eftposPay/component/fail/unknow.js +72 -0
  184. package/lib/components/eftposPay/component/header/index.d.ts +9 -0
  185. package/lib/components/eftposPay/component/header/index.js +92 -0
  186. package/lib/components/eftposPay/component/header/index.less +44 -0
  187. package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
  188. package/lib/components/eftposPay/component/header/titlebar.js +55 -0
  189. package/lib/components/eftposPay/component/header/titlebar.less +17 -0
  190. package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
  191. package/lib/components/eftposPay/component/manual/index.js +101 -0
  192. package/lib/components/eftposPay/component/manual/index.less +96 -0
  193. package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
  194. package/lib/components/eftposPay/component/signature/index.js +80 -0
  195. package/lib/components/eftposPay/component/step/index.d.ts +12 -0
  196. package/lib/components/eftposPay/component/step/index.js +71 -0
  197. package/lib/components/eftposPay/component/step/step.d.ts +9 -0
  198. package/lib/components/eftposPay/component/step/step.js +59 -0
  199. package/lib/components/eftposPay/const.d.ts +131 -0
  200. package/lib/components/eftposPay/const.js +86 -0
  201. package/lib/components/eftposPay/device.d.ts +14 -0
  202. package/lib/components/eftposPay/device.js +127 -0
  203. package/lib/components/eftposPay/device.less +61 -0
  204. package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
  205. package/lib/components/eftposPay/eftpos/config.js +199 -0
  206. package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
  207. package/lib/components/eftposPay/eftpos/const.js +165 -0
  208. package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
  209. package/lib/components/eftposPay/eftpos/index.js +66 -0
  210. package/lib/components/eftposPay/helper.d.ts +3 -0
  211. package/lib/components/eftposPay/helper.js +62 -0
  212. package/lib/components/eftposPay/hooks.d.ts +4 -0
  213. package/lib/components/eftposPay/hooks.js +237 -0
  214. package/lib/components/eftposPay/index.d.ts +7 -0
  215. package/lib/components/eftposPay/index.js +189 -0
  216. package/lib/components/eftposPay/index.less +273 -0
  217. package/lib/components/eftposPay/locales.d.ts +264 -0
  218. package/lib/components/eftposPay/locales.js +304 -0
  219. package/lib/components/eftposPay/manufacturer.d.ts +6 -0
  220. package/lib/components/eftposPay/manufacturer.js +77 -0
  221. package/lib/components/eftposPay/pay.d.ts +10 -0
  222. package/lib/components/eftposPay/pay.js +120 -0
  223. package/lib/components/eftposPay/payo/config.d.ts +11 -0
  224. package/lib/components/eftposPay/payo/config.js +377 -0
  225. package/lib/components/eftposPay/payo/const.d.ts +6 -0
  226. package/lib/components/eftposPay/payo/const.js +112 -0
  227. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  228. package/lib/components/eftposPay/payo/hooks.js +80 -0
  229. package/lib/components/eftposPay/payo/index.d.ts +7 -0
  230. package/lib/components/eftposPay/payo/index.js +63 -0
  231. package/lib/components/eftposPay/store/index.d.ts +239 -0
  232. package/lib/components/eftposPay/store/index.js +371 -0
  233. package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
  234. package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
  235. package/lib/components/eftposPay/windcave/action.d.ts +8 -0
  236. package/lib/components/eftposPay/windcave/action.js +143 -0
  237. package/lib/components/eftposPay/windcave/const.d.ts +104 -0
  238. package/lib/components/eftposPay/windcave/const.js +300 -0
  239. package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
  240. package/lib/components/eftposPay/windcave/helper.js +378 -0
  241. package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
  242. package/lib/components/eftposPay/windcave/hook.js +139 -0
  243. package/lib/components/eftposPay/windcave/index.d.ts +8 -0
  244. package/lib/components/eftposPay/windcave/index.js +78 -0
  245. package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
  246. package/lib/components/eftposPay/windcave/pos.js +197 -0
  247. package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
  248. package/lib/components/eftposPay/windcave/pwd.js +143 -0
  249. package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
  250. package/lib/components/eftposPay/windcave/receipet.js +93 -0
  251. package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
  252. package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
  253. package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
  254. package/lib/components/eftposPay/windcave/timer.js +126 -0
  255. package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
  256. package/lib/components/eftposPay/windcave/wait.js +163 -0
  257. package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
  258. package/lib/components/eftposPay/windcave/windcave.js +283 -0
  259. package/lib/components/schedules/index.d.ts +1 -1
  260. package/lib/components/schedules/model.d.ts +1 -2
  261. package/lib/hooks/usePrefix.d.ts +1 -0
  262. package/lib/hooks/usePrefix.js +44 -0
  263. package/lib/index.d.ts +2 -0
  264. package/lib/index.js +6 -0
  265. package/lowcode/eftpos/meta.ts +187 -0
  266. package/lowcode/eftpos-pay/meta.ts +122 -0
  267. package/package.json +4 -3
@@ -0,0 +1,163 @@
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/wait.tsx
30
+ var wait_exports = {};
31
+ __export(wait_exports, {
32
+ default: () => wait_default
33
+ });
34
+ module.exports = __toCommonJS(wait_exports);
35
+ var import_utils = require("@pisell/utils");
36
+ var import_react = __toESM(require("react"));
37
+ var import_step = __toESM(require("../component/step"));
38
+ var import_const = require("../const");
39
+ var import_hooks = require("../hooks");
40
+ var import_store = require("../store");
41
+ var import_hook = require("./hook");
42
+ var Wait = ({
43
+ api,
44
+ onChange,
45
+ hasBackup
46
+ }) => {
47
+ const dispatch = (0, import_store.useDispatch)();
48
+ const { steps, status, custom, mode } = (0, import_store.useContextData)();
49
+ const { key, ...props } = steps[4];
50
+ const [check] = (0, import_hook.useValidate)(1e3 * 60);
51
+ const fail = (0, import_hooks.useFail)(4, true);
52
+ const success = (0, import_hook.useSuccess)(4);
53
+ const failRef = (0, import_react.useRef)(fail);
54
+ const successRef = (0, import_react.useRef)(success);
55
+ const ref = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
56
+ const statusRef = (0, import_react.useRef)(status);
57
+ const backupRef = (0, import_react.useRef)(hasBackup);
58
+ const customRef = (0, import_react.useRef)(custom);
59
+ const stepStatusRef = (0, import_react.useRef)(props.status);
60
+ const clearRef = (0, import_react.useRef)();
61
+ const initRef = (0, import_react.useRef)(false);
62
+ const unloadRef = (0, import_react.useRef)(false);
63
+ (0, import_react.useEffect)(() => {
64
+ customRef.current = custom;
65
+ }, [custom]);
66
+ (0, import_react.useEffect)(() => {
67
+ backupRef.current = hasBackup;
68
+ }, [hasBackup]);
69
+ (0, import_react.useEffect)(() => {
70
+ stepStatusRef.current = props.status;
71
+ }, [props.status]);
72
+ (0, import_react.useEffect)(() => {
73
+ ref.current = custom == null ? void 0 : custom.number;
74
+ }, [custom == null ? void 0 : custom.number]);
75
+ (0, import_react.useEffect)(() => {
76
+ statusRef.current = status;
77
+ }, [status]);
78
+ (0, import_react.useEffect)(() => {
79
+ failRef.current = fail;
80
+ }, [fail]);
81
+ (0, import_react.useEffect)(() => {
82
+ successRef.current = success;
83
+ }, [success]);
84
+ (0, import_react.useEffect)(() => {
85
+ if (initRef.current) {
86
+ return;
87
+ }
88
+ initRef.current = true;
89
+ if (statusRef.current === import_const.StatusEnum.Success && stepStatusRef.current === import_const.StatusEnum.Success) {
90
+ clearRef.current = setTimeout(() => {
91
+ var _a;
92
+ onChange(
93
+ "success",
94
+ (_a = customRef.current) == null ? void 0 : _a.pay
95
+ );
96
+ }, 1e3);
97
+ return;
98
+ }
99
+ if (statusRef.current !== import_const.StatusEnum.Loading) {
100
+ return;
101
+ }
102
+ if (stepStatusRef.current !== import_const.StatusEnum.Loading) {
103
+ return;
104
+ }
105
+ console.log("wait 开始查询 ", ref.current);
106
+ check({
107
+ check: api.check,
108
+ number: ref.current,
109
+ txn_status_id: "8",
110
+ __start__: "7",
111
+ checkCondition: (r) => `${r.txn_status_id}` !== "8" || `${r.status_id}` !== "6"
112
+ }).then(
113
+ (res) => {
114
+ if (unloadRef.current) {
115
+ return;
116
+ }
117
+ successRef.current(res, backupRef.current);
118
+ clearRef.current = setTimeout(() => {
119
+ var _a;
120
+ onChange(
121
+ "success",
122
+ (_a = customRef.current) == null ? void 0 : _a.pay
123
+ );
124
+ }, 1e3);
125
+ },
126
+ (res) => {
127
+ if (unloadRef.current) {
128
+ return;
129
+ }
130
+ if (backupRef.current) {
131
+ return;
132
+ }
133
+ if (res && typeof res === "object" && typeof res.txn_status_id !== "undefined" && typeof res.status_id !== "undefined") {
134
+ dispatch((0, import_store.updateCurrentStemItem)({ status: "fail" }));
135
+ dispatch(
136
+ (0, import_store.updateState)({
137
+ manual: {
138
+ title: import_utils.locales.getText("page.eftpos-pay.text.timedout.title"),
139
+ text: import_utils.locales.getText("page.eftpos-pay.text.timedout.text")(
140
+ mode
141
+ )
142
+ }
143
+ })
144
+ );
145
+ dispatch((0, import_store.updateComponent)("Manual"));
146
+ return;
147
+ }
148
+ failRef.current(res);
149
+ }
150
+ );
151
+ }, [api.check, check, dispatch, onChange]);
152
+ (0, import_react.useEffect)(
153
+ () => () => {
154
+ unloadRef.current = true;
155
+ if (clearRef.current) {
156
+ clearTimeout(clearRef.current);
157
+ }
158
+ },
159
+ []
160
+ );
161
+ return /* @__PURE__ */ import_react.default.createElement(import_step.default, { ...props });
162
+ };
163
+ var wait_default = Wait;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const _default: ({ api, onChange }: {
3
+ api: any;
4
+ onChange: any;
5
+ }) => React.JSX.Element;
6
+ export default _default;
@@ -0,0 +1,283 @@
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/windcave.tsx
30
+ var windcave_exports = {};
31
+ __export(windcave_exports, {
32
+ default: () => windcave_default
33
+ });
34
+ module.exports = __toCommonJS(windcave_exports);
35
+ var import_utils = require("@pisell/utils");
36
+ var import_react = __toESM(require("react"));
37
+ var import_decimal = require("decimal.js");
38
+ var import_step = __toESM(require("../component/step/step"));
39
+ var import_const = require("../const");
40
+ var import_helper = require("../helper");
41
+ var import_store = require("../store");
42
+ var import_const2 = require("./const");
43
+ var import_helper2 = require("./helper");
44
+ var import_receiptAction = __toESM(require("./receiptAction"));
45
+ var Minute = 1e3 * 60;
46
+ var windcave_default = ({ api, onChange }) => {
47
+ const { eftpos, custom, device, status, mode } = (0, import_store.useContextData)();
48
+ const dispatch = (0, import_store.useDispatch)();
49
+ const fail = (0, import_helper2.useFail)();
50
+ const failRef = (0, import_react.useRef)(fail);
51
+ const modeRef = (0, import_react.useRef)(mode);
52
+ const statusRef = (0, import_react.useRef)(status);
53
+ const unloadRef = (0, import_react.useRef)(false);
54
+ const customRef = (0, import_react.useRef)(custom);
55
+ const deviceRef = (0, import_react.useRef)(device);
56
+ const refundRef = (0, import_react.useRef)(
57
+ custom == null ? void 0 : custom.refund
58
+ );
59
+ const ref = (0, import_react.useRef)(custom == null ? void 0 : custom.number);
60
+ const stepRef = (0, import_react.useRef)(custom == null ? void 0 : custom.step);
61
+ const listRef = (0, import_react.useRef)(custom == null ? void 0 : custom.list);
62
+ const initRef = (0, import_react.useRef)(false);
63
+ const isPayRef = (0, import_react.useRef)(custom == null ? void 0 : custom.isPay);
64
+ const isReceiptPage = (0, import_react.useMemo)(
65
+ () => (custom == null ? void 0 : custom.step) === import_const2.StepStatusEnum.Receipt,
66
+ [custom == null ? void 0 : custom.step]
67
+ );
68
+ const receiptPage = (0, import_react.useMemo)(
69
+ () => (custom == null ? void 0 : custom.step) !== import_const2.StepStatusEnum.Receipt ? "" : (custom == null ? void 0 : custom.receiptPage) || "receipt",
70
+ [custom == null ? void 0 : custom.step, custom == null ? void 0 : custom.receiptPage]
71
+ );
72
+ const [disabled, setDisabled] = (0, import_react.useState)(false);
73
+ (0, import_react.useEffect)(() => {
74
+ statusRef.current = status;
75
+ }, [status]);
76
+ (0, import_react.useEffect)(() => {
77
+ modeRef.current = mode;
78
+ }, [mode]);
79
+ (0, import_react.useEffect)(() => {
80
+ isPayRef.current = custom == null ? void 0 : custom.isPay;
81
+ }, [custom == null ? void 0 : custom.isPay]);
82
+ (0, import_react.useEffect)(() => {
83
+ listRef.current = custom == null ? void 0 : custom.list;
84
+ }, [custom == null ? void 0 : custom.list]);
85
+ (0, import_react.useEffect)(() => {
86
+ stepRef.current = custom == null ? void 0 : custom.step;
87
+ }, [custom == null ? void 0 : custom.step]);
88
+ (0, import_react.useEffect)(() => {
89
+ refundRef.current = custom == null ? void 0 : custom.refund;
90
+ }, [custom == null ? void 0 : custom.refund]);
91
+ (0, import_react.useEffect)(() => {
92
+ customRef.current = custom;
93
+ }, [custom]);
94
+ (0, import_react.useEffect)(() => {
95
+ deviceRef.current = device;
96
+ }, [device]);
97
+ (0, import_react.useEffect)(() => {
98
+ ref.current = custom == null ? void 0 : custom.number;
99
+ }, [custom == null ? void 0 : custom.number]);
100
+ (0, import_react.useEffect)(() => {
101
+ failRef.current = fail;
102
+ }, [fail]);
103
+ const [run] = (0, import_helper2.useValidate)(api.check, Minute, (res) => {
104
+ dispatch(
105
+ (0, import_store.updateCustom)({
106
+ list: listRef.current.map((item) => ({
107
+ ...item,
108
+ status: "resolve"
109
+ }))
110
+ })
111
+ );
112
+ dispatch(
113
+ (0, import_store.updateState)({
114
+ status: "success",
115
+ title: import_utils.locales.getText("page.eftpos-pay.text.successful")(mode)
116
+ })
117
+ );
118
+ setTimeout(() => {
119
+ var _a;
120
+ if (modeRef.current === import_const.ModeEnum.Pay) {
121
+ const obj = ((_a = customRef.current) == null ? void 0 : _a.pay) || {};
122
+ const cardReaderSurcharge = (res == null ? void 0 : res.card_reader_surcharge) || 0;
123
+ const surCardDeci = new import_decimal.Decimal(Number(cardReaderSurcharge));
124
+ const surMoneyDeci = new import_decimal.Decimal(Number((obj == null ? void 0 : obj.surMoney) || 0));
125
+ const surRateMoneyDeci = new import_decimal.Decimal(Number(obj == null ? void 0 : obj.surRateMoney));
126
+ const surMoneyTotal = surMoneyDeci.add(surCardDeci);
127
+ const surchargeDeci = surMoneyTotal.add(surRateMoneyDeci);
128
+ onChange("success", {
129
+ ...obj,
130
+ cardReaderSurcharge,
131
+ surMoney: surMoneyTotal.toFixed(2, import_decimal.Decimal.ROUND_HALF_UP),
132
+ surcharge: surchargeDeci.toFixed(2, import_decimal.Decimal.ROUND_HALF_UP),
133
+ number: ref.current,
134
+ device: deviceRef.current
135
+ });
136
+ return;
137
+ }
138
+ if (modeRef.current === import_const.ModeEnum.Refund) {
139
+ const obj = refundRef.current || {};
140
+ onChange("success", {
141
+ ...obj,
142
+ number: ref.current,
143
+ device: deviceRef.current
144
+ });
145
+ return;
146
+ }
147
+ onChange("success", { number: ref.current });
148
+ }, 1e3);
149
+ });
150
+ const controllerRef = (0, import_react.useRef)();
151
+ (0, import_react.useEffect)(() => {
152
+ var _a, _b, _c;
153
+ if (initRef.current) {
154
+ return;
155
+ }
156
+ initRef.current = true;
157
+ const { pay, order_id } = customRef.current;
158
+ if (stepRef.current === import_const2.StepStatusEnum.Receipt) {
159
+ if (import_const.StatusEnum.Loading === statusRef.current) {
160
+ run();
161
+ } else {
162
+ run(-1);
163
+ }
164
+ return;
165
+ }
166
+ controllerRef.current = new AbortController();
167
+ if (!ref.current) {
168
+ console.log("modeRef.current = ", modeRef.current);
169
+ ref.current = (0, import_helper.getUuid)();
170
+ dispatch(
171
+ (0, import_store.updateCustom)({
172
+ number: ref.current
173
+ })
174
+ );
175
+ const resultPromise = modeRef.current === import_const.ModeEnum.Pay ? api.pay(
176
+ {
177
+ order_id,
178
+ amount: pay.total,
179
+ card_reader_type: eftpos,
180
+ card_reader_id: (_a = deviceRef.current) == null ? void 0 : _a.id,
181
+ number: ref.current
182
+ },
183
+ { signal: controllerRef.current.signal }
184
+ ) : api.refund(
185
+ {
186
+ order_id,
187
+ amount: (_b = refundRef.current) == null ? void 0 : _b.total,
188
+ card_reader_type: eftpos,
189
+ card_reader_id: (_c = deviceRef.current) == null ? void 0 : _c.id,
190
+ number: ref.current
191
+ },
192
+ { signal: controllerRef.current.signal }
193
+ );
194
+ resultPromise.then((res) => {
195
+ var _a2;
196
+ if (unloadRef.current) {
197
+ return;
198
+ }
199
+ if (!((_a2 = customRef.current) == null ? void 0 : _a2.net)) {
200
+ return;
201
+ }
202
+ if (res && (res.code === 200 || res.code === "200")) {
203
+ dispatch(
204
+ (0, import_store.updateCustom)({
205
+ isPay: true
206
+ })
207
+ );
208
+ run();
209
+ }
210
+ }).catch((res) => {
211
+ var _a2, _b2;
212
+ if (unloadRef.current) {
213
+ return;
214
+ }
215
+ if (!((_a2 = customRef.current) == null ? void 0 : _a2.net)) {
216
+ return;
217
+ }
218
+ (_b2 = failRef.current) == null ? void 0 : _b2.call(failRef, res, stepRef.current >= 3);
219
+ });
220
+ return;
221
+ }
222
+ run();
223
+ }, [api, run, eftpos, dispatch]);
224
+ const onCancel = () => {
225
+ setDisabled(true);
226
+ api.update({
227
+ type: "CANCEL",
228
+ number: custom == null ? void 0 : custom.number
229
+ });
230
+ };
231
+ (0, import_react.useEffect)(
232
+ () => () => {
233
+ var _a, _b;
234
+ unloadRef.current = true;
235
+ (_b = (_a = controllerRef.current) == null ? void 0 : _a.abort) == null ? void 0 : _b.call(_a);
236
+ },
237
+ []
238
+ );
239
+ const onChangeReceipt = (status2) => {
240
+ if (status2) {
241
+ run();
242
+ }
243
+ };
244
+ (0, import_react.useEffect)(() => {
245
+ var _a, _b, _c;
246
+ if (listRef.current.length === 0) {
247
+ let totalUnit = "";
248
+ if (modeRef.current === import_const.ModeEnum.Pay) {
249
+ totalUnit = (_b = (_a = customRef.current) == null ? void 0 : _a.pay) == null ? void 0 : _b.totalUnit;
250
+ } else if (modeRef.current === import_const.ModeEnum.Refund) {
251
+ totalUnit = ((_c = refundRef.current) == null ? void 0 : _c.totalUnit) || "";
252
+ }
253
+ const nextStep = (0, import_const2.getStepMapping)(import_const2.StepStatusEnum.Free, {
254
+ money: totalUnit,
255
+ mode
256
+ });
257
+ dispatch(
258
+ (0, import_store.updateCustom)({
259
+ list: [nextStep],
260
+ step: 2
261
+ })
262
+ );
263
+ }
264
+ }, [dispatch]);
265
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-body" }, receiptPage !== "again" ? (custom == null ? void 0 : custom.list).map((item) => /* @__PURE__ */ import_react.default.createElement(
266
+ import_step.default,
267
+ {
268
+ key: item.index,
269
+ pedding: item.pedding,
270
+ resolve: item.resolve,
271
+ reject: item.reject,
272
+ status: item.status,
273
+ className: item.type === import_const2.StemTypeEnum.Passive && item.status === "pedding" ? "pisell-lowcode__eft-pay-step-item-warn" : ""
274
+ }
275
+ )) : null, receiptPage === "again" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, import_utils.locales.getText("page.eftpos-pay.text.signature.text")(mode)) : null, status === import_const.StatusEnum.Loading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip" }, import_utils.locales.getText("page.eftpos-pay.text.processing")) : null, status === import_const.StatusEnum.Success ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip" }, import_utils.locales.getText("page.eftpos-pay.text.transaction.end")) : null), !isReceiptPage && status !== import_const.StatusEnum.Success ? /* @__PURE__ */ import_react.default.createElement(
276
+ import_receiptAction.default,
277
+ {
278
+ index: custom == null ? void 0 : custom.step,
279
+ onCancel,
280
+ disabled
281
+ }
282
+ ) : null, isReceiptPage ? /* @__PURE__ */ import_react.default.createElement(import_receiptAction.ReceiptAction, { api, onChange: onChangeReceipt }) : null);
283
+ };
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
@@ -0,0 +1 @@
1
+ export default function usePrefix(): string;
@@ -0,0 +1,44 @@
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/hooks/usePrefix.ts
30
+ var usePrefix_exports = {};
31
+ __export(usePrefix_exports, {
32
+ default: () => usePrefix
33
+ });
34
+ module.exports = __toCommonJS(usePrefix_exports);
35
+ var import_react = require("react");
36
+ var import_useEngineContext = __toESM(require("./useEngineContext"));
37
+ function usePrefix() {
38
+ var _a, _b;
39
+ const context = (0, import_useEngineContext.default)();
40
+ return (0, import_react.useMemo)(() => {
41
+ var _a2, _b2;
42
+ return ((_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b2.staticURL) || "https://static.pisellcdn.com";
43
+ }, [(_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.staticURL]);
44
+ }
package/lib/index.d.ts CHANGED
@@ -16,3 +16,5 @@ export { default as ProductExtension } from './components/productExtension';
16
16
  export { default as BookingDeposit } from './components/booking/deposit';
17
17
  export { default as RuleSetting } from './components/ruleSetting';
18
18
  export { default as TaxSelect } from './components/taxSelect';
19
+ export { default as Eftpos } from './components/eftpos';
20
+ export { default as EftposPay } from './components/eftposPay';
package/lib/index.js CHANGED
@@ -40,6 +40,8 @@ __export(src_exports, {
40
40
  BookingPayment: () => import_payments.default,
41
41
  BookingResources: () => import_resources.default,
42
42
  BookingStartTime: () => import_startTime.default,
43
+ Eftpos: () => import_eftpos.default,
44
+ EftposPay: () => import_eftposPay.default,
43
45
  Login: () => import_login.default,
44
46
  ProductExtension: () => import_productExtension.default,
45
47
  RuleSetting: () => import_ruleSetting.default,
@@ -68,6 +70,8 @@ var import_productExtension = __toESM(require("./components/productExtension"));
68
70
  var import_deposit = __toESM(require("./components/booking/deposit"));
69
71
  var import_ruleSetting = __toESM(require("./components/ruleSetting"));
70
72
  var import_taxSelect = __toESM(require("./components/taxSelect"));
73
+ var import_eftpos = __toESM(require("./components/eftpos"));
74
+ var import_eftposPay = __toESM(require("./components/eftposPay"));
71
75
  import_dayjs.default.extend(import_weekday.default);
72
76
  import_dayjs.default.extend(import_localeData.default);
73
77
  // Annotate the CommonJS export names for ESM import in node:
@@ -83,6 +87,8 @@ import_dayjs.default.extend(import_localeData.default);
83
87
  BookingPayment,
84
88
  BookingResources,
85
89
  BookingStartTime,
90
+ Eftpos,
91
+ EftposPay,
86
92
  Login,
87
93
  ProductExtension,
88
94
  RuleSetting,