@pisell/private-materials 3.0.96 → 3.0.98

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 (269) 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 +33 -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 +169 -0
  33. package/es/components/eftpos/locales.d.ts +87 -0
  34. package/es/components/eftpos/locales.js +110 -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 +285 -0
  42. package/es/components/eftposPay/amount.d.ts +14 -0
  43. package/es/components/eftposPay/amount.js +252 -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 +99 -0
  51. package/es/components/eftposPay/component/fail/index.d.ts +4 -0
  52. package/es/components/eftposPay/component/fail/index.js +109 -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 +97 -0
  65. package/es/components/eftposPay/component/manual/index.less +109 -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 +132 -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 +187 -0
  89. package/es/components/eftposPay/index.less +263 -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 +11 -0
  95. package/es/components/eftposPay/pay.js +110 -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/var.less +9 -0
  109. package/es/components/eftposPay/windcave/action.d.ts +8 -0
  110. package/es/components/eftposPay/windcave/action.js +104 -0
  111. package/es/components/eftposPay/windcave/const.d.ts +104 -0
  112. package/es/components/eftposPay/windcave/const.js +253 -0
  113. package/es/components/eftposPay/windcave/helper.d.ts +9 -0
  114. package/es/components/eftposPay/windcave/helper.js +314 -0
  115. package/es/components/eftposPay/windcave/hook.d.ts +14 -0
  116. package/es/components/eftposPay/windcave/hook.js +144 -0
  117. package/es/components/eftposPay/windcave/index.d.ts +8 -0
  118. package/es/components/eftposPay/windcave/index.js +49 -0
  119. package/es/components/eftposPay/windcave/pos.d.ts +8 -0
  120. package/es/components/eftposPay/windcave/pos.js +180 -0
  121. package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
  122. package/es/components/eftposPay/windcave/pwd.js +124 -0
  123. package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
  124. package/es/components/eftposPay/windcave/receipet.js +67 -0
  125. package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
  126. package/es/components/eftposPay/windcave/receiptAction.js +326 -0
  127. package/es/components/eftposPay/windcave/timer.d.ts +17 -0
  128. package/es/components/eftposPay/windcave/timer.js +181 -0
  129. package/es/components/eftposPay/windcave/wait.d.ts +12 -0
  130. package/es/components/eftposPay/windcave/wait.js +139 -0
  131. package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
  132. package/es/components/eftposPay/windcave/windcave.js +283 -0
  133. package/es/components/schedules/index.d.ts +1 -1
  134. package/es/components/schedules/model.d.ts +1 -2
  135. package/es/hooks/usePrefix.d.ts +1 -0
  136. package/es/hooks/usePrefix.js +10 -0
  137. package/es/index.d.ts +2 -0
  138. package/es/index.js +3 -1
  139. package/lib/components/booking/addons/index.d.ts +1 -1
  140. package/lib/components/booking/addons/model.d.ts +1 -2
  141. package/lib/components/booking/forms/forms.d.ts +1 -1
  142. package/lib/components/booking/forms/index.d.ts +1 -1
  143. package/lib/components/booking/forms/model.d.ts +1 -2
  144. package/lib/components/booking/index.d.ts +1 -1
  145. package/lib/components/booking/info/index.d.ts +1 -1
  146. package/lib/components/booking/info/model.d.ts +1 -2
  147. package/lib/components/booking/model.d.ts +1 -2
  148. package/lib/components/booking/notes/index.d.ts +1 -1
  149. package/lib/components/booking/notes/model.d.ts +1 -2
  150. package/lib/components/booking/payments/index.d.ts +1 -1
  151. package/lib/components/booking/payments/model.d.ts +1 -2
  152. package/lib/components/eftpos/const.d.ts +38 -0
  153. package/lib/components/eftpos/const.js +108 -0
  154. package/lib/components/eftpos/device.d.ts +8 -0
  155. package/lib/components/eftpos/device.js +55 -0
  156. package/lib/components/eftpos/form/index.d.ts +16 -0
  157. package/lib/components/eftpos/form/index.js +124 -0
  158. package/lib/components/eftpos/index.d.ts +37 -0
  159. package/lib/components/eftpos/index.js +279 -0
  160. package/lib/components/eftpos/index.less +169 -0
  161. package/lib/components/eftpos/locales.d.ts +87 -0
  162. package/lib/components/eftpos/locales.js +128 -0
  163. package/lib/components/eftpos/pos.d.ts +9 -0
  164. package/lib/components/eftpos/pos.js +55 -0
  165. package/lib/components/eftpos/surcharge/index.css +17 -0
  166. package/lib/components/eftpos/surcharge/index.d.ts +8 -0
  167. package/lib/components/eftpos/surcharge/index.js +125 -0
  168. package/lib/components/eftpos/table.d.ts +17 -0
  169. package/lib/components/eftpos/table.js +260 -0
  170. package/lib/components/eftposPay/amount.d.ts +14 -0
  171. package/lib/components/eftposPay/amount.js +238 -0
  172. package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
  173. package/lib/components/eftposPay/component/alert/index.js +38 -0
  174. package/lib/components/eftposPay/component/alert/index.less +29 -0
  175. package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
  176. package/lib/components/eftposPay/component/alert/warn.js +80 -0
  177. package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
  178. package/lib/components/eftposPay/component/fail/failCustom.js +120 -0
  179. package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
  180. package/lib/components/eftposPay/component/fail/index.js +124 -0
  181. package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
  182. package/lib/components/eftposPay/component/fail/network.js +65 -0
  183. package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
  184. package/lib/components/eftposPay/component/fail/unknow.js +72 -0
  185. package/lib/components/eftposPay/component/header/index.d.ts +9 -0
  186. package/lib/components/eftposPay/component/header/index.js +92 -0
  187. package/lib/components/eftposPay/component/header/index.less +44 -0
  188. package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
  189. package/lib/components/eftposPay/component/header/titlebar.js +55 -0
  190. package/lib/components/eftposPay/component/header/titlebar.less +17 -0
  191. package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
  192. package/lib/components/eftposPay/component/manual/index.js +113 -0
  193. package/lib/components/eftposPay/component/manual/index.less +109 -0
  194. package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
  195. package/lib/components/eftposPay/component/signature/index.js +80 -0
  196. package/lib/components/eftposPay/component/step/index.d.ts +12 -0
  197. package/lib/components/eftposPay/component/step/index.js +71 -0
  198. package/lib/components/eftposPay/component/step/step.d.ts +9 -0
  199. package/lib/components/eftposPay/component/step/step.js +59 -0
  200. package/lib/components/eftposPay/const.d.ts +132 -0
  201. package/lib/components/eftposPay/const.js +86 -0
  202. package/lib/components/eftposPay/device.d.ts +14 -0
  203. package/lib/components/eftposPay/device.js +127 -0
  204. package/lib/components/eftposPay/device.less +61 -0
  205. package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
  206. package/lib/components/eftposPay/eftpos/config.js +199 -0
  207. package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
  208. package/lib/components/eftposPay/eftpos/const.js +165 -0
  209. package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
  210. package/lib/components/eftposPay/eftpos/index.js +66 -0
  211. package/lib/components/eftposPay/helper.d.ts +3 -0
  212. package/lib/components/eftposPay/helper.js +62 -0
  213. package/lib/components/eftposPay/hooks.d.ts +4 -0
  214. package/lib/components/eftposPay/hooks.js +237 -0
  215. package/lib/components/eftposPay/index.d.ts +7 -0
  216. package/lib/components/eftposPay/index.js +193 -0
  217. package/lib/components/eftposPay/index.less +263 -0
  218. package/lib/components/eftposPay/locales.d.ts +264 -0
  219. package/lib/components/eftposPay/locales.js +304 -0
  220. package/lib/components/eftposPay/manufacturer.d.ts +6 -0
  221. package/lib/components/eftposPay/manufacturer.js +77 -0
  222. package/lib/components/eftposPay/pay.d.ts +11 -0
  223. package/lib/components/eftposPay/pay.js +122 -0
  224. package/lib/components/eftposPay/payo/config.d.ts +11 -0
  225. package/lib/components/eftposPay/payo/config.js +377 -0
  226. package/lib/components/eftposPay/payo/const.d.ts +6 -0
  227. package/lib/components/eftposPay/payo/const.js +112 -0
  228. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  229. package/lib/components/eftposPay/payo/hooks.js +80 -0
  230. package/lib/components/eftposPay/payo/index.d.ts +7 -0
  231. package/lib/components/eftposPay/payo/index.js +63 -0
  232. package/lib/components/eftposPay/store/index.d.ts +239 -0
  233. package/lib/components/eftposPay/store/index.js +371 -0
  234. package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
  235. package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
  236. package/lib/components/eftposPay/var.less +9 -0
  237. package/lib/components/eftposPay/windcave/action.d.ts +8 -0
  238. package/lib/components/eftposPay/windcave/action.js +143 -0
  239. package/lib/components/eftposPay/windcave/const.d.ts +104 -0
  240. package/lib/components/eftposPay/windcave/const.js +300 -0
  241. package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
  242. package/lib/components/eftposPay/windcave/helper.js +378 -0
  243. package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
  244. package/lib/components/eftposPay/windcave/hook.js +139 -0
  245. package/lib/components/eftposPay/windcave/index.d.ts +8 -0
  246. package/lib/components/eftposPay/windcave/index.js +78 -0
  247. package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
  248. package/lib/components/eftposPay/windcave/pos.js +197 -0
  249. package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
  250. package/lib/components/eftposPay/windcave/pwd.js +143 -0
  251. package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
  252. package/lib/components/eftposPay/windcave/receipet.js +93 -0
  253. package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
  254. package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
  255. package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
  256. package/lib/components/eftposPay/windcave/timer.js +126 -0
  257. package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
  258. package/lib/components/eftposPay/windcave/wait.js +163 -0
  259. package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
  260. package/lib/components/eftposPay/windcave/windcave.js +283 -0
  261. package/lib/components/schedules/index.d.ts +1 -1
  262. package/lib/components/schedules/model.d.ts +1 -2
  263. package/lib/hooks/usePrefix.d.ts +1 -0
  264. package/lib/hooks/usePrefix.js +44 -0
  265. package/lib/index.d.ts +2 -0
  266. package/lib/index.js +6 -0
  267. package/lowcode/eftpos/meta.ts +187 -0
  268. package/lowcode/eftpos-pay/meta.ts +122 -0
  269. package/package.json +4 -3
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { PayProps, PosProps } from './const';
3
+ import './device.less';
4
+ declare const _default: ({ api, onChange, onClose, className, isIpad, net, }: {
5
+ api: PayProps['api'];
6
+ className?: string | undefined;
7
+ onChange?: ((status: "page" | "success" | "fail", params?: string | {
8
+ [keys: string]: unknown;
9
+ } | undefined) => void) | undefined;
10
+ onClose: () => void;
11
+ isIpad: boolean;
12
+ net: boolean;
13
+ }) => React.JSX.Element;
14
+ export default _default;
@@ -0,0 +1,127 @@
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/device.tsx
30
+ var device_exports = {};
31
+ __export(device_exports, {
32
+ default: () => device_default
33
+ });
34
+ module.exports = __toCommonJS(device_exports);
35
+ var import_utils = require("@pisell/utils");
36
+ var import_ahooks = require("ahooks");
37
+ var import_antd = require("antd");
38
+ var import_react = __toESM(require("react"));
39
+ var import_titlebar = __toESM(require("./component/header/titlebar"));
40
+ var import_const = require("./const");
41
+ var import_store = require("./store");
42
+ var import_device = require("./device.less");
43
+ var device_default = ({
44
+ api,
45
+ onChange,
46
+ onClose,
47
+ className = "",
48
+ isIpad,
49
+ net
50
+ }) => {
51
+ const { device, mode, eftpos } = (0, import_store.useContextData)();
52
+ const [loading, setLoading] = (0, import_react.useState)(false);
53
+ const [dataStaus, setDataStaus] = (0, import_react.useState)(true);
54
+ const [list, setList] = (0, import_react.useState)([]);
55
+ const dispatch = (0, import_store.useDispatch)();
56
+ const onClick = (event) => {
57
+ if (!net) {
58
+ import_antd.message.open({
59
+ key: "net-warning",
60
+ type: "warning",
61
+ content: import_utils.locales.getText("page.eftpos-pay.text.not.connected")
62
+ });
63
+ return;
64
+ }
65
+ const [index] = [Number(event.currentTarget.dataset.index)];
66
+ dispatch((0, import_store.updateDevice)({ device: list[index] }));
67
+ if (typeof onChange === "function") {
68
+ onChange("page", mode === import_const.ModeEnum.Pay ? "amount" : "pay");
69
+ }
70
+ };
71
+ (0, import_ahooks.useMount)(() => {
72
+ setLoading(true);
73
+ api.getDeviceList({ type: eftpos, status: "paired" }).then(
74
+ (res) => {
75
+ setLoading(false);
76
+ if (res && Array.isArray(res.list) && res.list.length > 0) {
77
+ setDataStaus(true);
78
+ setList(res.list);
79
+ if (res.list.length === 1) {
80
+ dispatch((0, import_store.updateDevice)({ device: res.list[0] }));
81
+ if (typeof api.selectDevice === "function") {
82
+ api.selectDevice(res.list[0]);
83
+ }
84
+ if (typeof onChange === "function") {
85
+ onChange("page", mode === import_const.ModeEnum.Pay ? "amount" : "pay");
86
+ }
87
+ }
88
+ return;
89
+ }
90
+ setDataStaus(false);
91
+ },
92
+ () => {
93
+ setDataStaus(false);
94
+ setLoading(false);
95
+ }
96
+ );
97
+ });
98
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-lowcode__eft-pay-device-box ${className}` }, isIpad ? null : /* @__PURE__ */ import_react.default.createElement(import_titlebar.default, { type: "left-title-close", onClose }, dataStaus ? import_utils.locales.getText("page.eftpos-pay.text.device") : ""), dataStaus ? /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: loading }, /* @__PURE__ */ import_react.default.createElement(
99
+ "div",
100
+ {
101
+ className: "pisell-lowcode__eft-pay-device-list",
102
+ style: isIpad ? { marginTop: "20px" } : {}
103
+ },
104
+ list.map(({ id, name }, index) => /* @__PURE__ */ import_react.default.createElement(
105
+ "div",
106
+ {
107
+ key: id,
108
+ className: `pisell-lowcode__eft-pay-device ${id === (device == null ? void 0 : device.id) ? "active" : ""}`,
109
+ "data-index": index,
110
+ onClick,
111
+ role: "button",
112
+ tabIndex: index
113
+ },
114
+ name
115
+ ))
116
+ )) : /* @__PURE__ */ import_react.default.createElement(
117
+ "div",
118
+ {
119
+ className: "pisell-lowcode__eft-pay-device-error",
120
+ style: isIpad ? { marginTop: "20px" } : {}
121
+ },
122
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-tit" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.title")),
123
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-txt" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.add")),
124
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-txt" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.web")),
125
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-device-error-txt" }, import_utils.locales.getText("page.eftpos-pay.text.device.no.terminal"))
126
+ ));
127
+ };
@@ -0,0 +1,61 @@
1
+ .pisell-lowcode__eft-pay-device-box {
2
+ max-height: var(--pisel-lc-pos-device-max-height, unset);
3
+ width: var(--pisel-lc-pos-device-width, 600px);
4
+ max-width: 100%;
5
+ padding: var(--pisel-lc-pos-device-padding, 0 24px 24px);
6
+ }
7
+ .pisell-lowcode__eft-pay-device-list,
8
+ .pisell-lowcode__eft-pay-device-error {
9
+ display: flex;
10
+ flex-direction: column;
11
+
12
+ overflow: auto;
13
+ min-height: 200px;
14
+ margin: 0 0 20px;
15
+ }
16
+
17
+ .pisell-lowcode__eft-pay-device-list {
18
+ gap: 10px;
19
+ }
20
+ .pisell-lowcode__eft-pay-device {
21
+ height: 52px;
22
+ display: flex;
23
+ align-items: center;
24
+ padding: 0 16px;
25
+ border-radius: 12px;
26
+ border: 1px solid var(--Gray-200, #eaecf0);
27
+ background: #fff;
28
+
29
+ color: var(--Gray-900, #101828);
30
+ /* Text sm/Medium */
31
+ font-size: 14px;
32
+ font-style: normal;
33
+ font-weight: 500;
34
+ cursor: pointer;
35
+ flex-shrink: 0;
36
+ }
37
+ .pisell-lowcode__eft-pay-device.active,
38
+ .pisell-lowcode__eft-pay-device:hover {
39
+ background: var(--Gray-50, #f9fafb);
40
+ }
41
+
42
+ .pisell-lowcode__eft-pay-device-error {
43
+ gap: 20px;
44
+ }
45
+ .pisell-lowcode__eft-pay-device-error-tit {
46
+ color: var(--Gray-900, #101828);
47
+
48
+ font-size: 18px;
49
+ font-style: normal;
50
+ font-weight: 600;
51
+ line-height: 28px; /* 155.556% */
52
+ }
53
+
54
+ .pisell-lowcode__eft-pay-device-error-txt {
55
+ color: var(--Gray-900, #101828);
56
+
57
+ font-size: 14px;
58
+ font-style: normal;
59
+ font-weight: 400;
60
+ line-height: 20px; /* 142.857% */
61
+ }
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,199 @@
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
+ });
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,165 @@
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
+ });
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,66 @@
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/index.tsx
30
+ var eftpos_exports = {};
31
+ __export(eftpos_exports, {
32
+ default: () => eftpos_default
33
+ });
34
+ module.exports = __toCommonJS(eftpos_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_const = require("../const");
37
+ var import_store = require("../store");
38
+ var import_config = require("./config");
39
+ var eftpos_default = ({
40
+ api,
41
+ onChange,
42
+ children
43
+ }) => {
44
+ const { step, steps, ...data } = (0, import_store.useContextData)();
45
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, steps.map((item, idx) => {
46
+ let Comm;
47
+ if (idx === 0)
48
+ Comm = import_config.POS;
49
+ if (idx === 1)
50
+ Comm = import_config.Surcharge;
51
+ if (idx === 2)
52
+ Comm = import_config.Card;
53
+ if (idx === 3)
54
+ Comm = import_config.Pwd;
55
+ if (idx === 4)
56
+ Comm = import_config.Receipet;
57
+ if (idx === 5)
58
+ Comm = import_config.ReceipetAgain;
59
+ if (idx === 6)
60
+ Comm = import_config.Wait;
61
+ if (!Comm) {
62
+ throw new Error("no comm");
63
+ }
64
+ return /* @__PURE__ */ import_react.default.createElement(Comm, { key: `${data.key}-${item.key}-${idx}` });
65
+ }), children, data.status !== import_const.StatusEnum.Success ? /* @__PURE__ */ import_react.default.createElement(import_config.Action, { index: step }) : null);
66
+ };
@@ -0,0 +1,3 @@
1
+ export declare function getUuid(): string;
2
+ export declare const sleep: (time: number) => Promise<unknown>;
3
+ export declare function cloneDeep(source: any, hash?: WeakMap<object, any>): any;