@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
@@ -13,5 +13,5 @@ export interface InfoProps {
13
13
  setGlobalState: any;
14
14
  }
15
15
  export declare const formatProducts: (values: any) => any;
16
- declare const Addons: (props: any) => any;
16
+ declare const Addons: (props: any) => JSX.Element;
17
17
  export default Addons;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -21,5 +21,5 @@ export interface InfoProps {
21
21
  * @Author: zhiwei.Wang
22
22
  * @Date: 2024-01-30 17:10
23
23
  */
24
- declare const Forms: (props: any) => any;
24
+ declare const Forms: (props: any) => JSX.Element;
25
25
  export default Forms;
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Forms: (props: any) => any;
8
+ declare const Forms: (props: any) => JSX.Element;
9
9
  export default Forms;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,2 +1,2 @@
1
- declare const Booking: (props: any) => any;
1
+ declare const Booking: (props: any) => JSX.Element;
2
2
  export default Booking;
@@ -8,5 +8,5 @@ export interface InfoProps {
8
8
  slot: any;
9
9
  setState: any;
10
10
  }
11
- declare const Info: (props: any) => any;
11
+ declare const Info: (props: any) => JSX.Element;
12
12
  export default Info;
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
2
  export declare const walkInData: {
4
3
  id: number;
5
4
  nickname: string;
6
5
  };
7
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
6
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
8
7
  state: FormState;
9
8
  } & {
10
9
  dispatch: (params: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -96,7 +95,7 @@ export declare const walkInData: {
96
95
  id: number;
97
96
  nickname: string;
98
97
  };
99
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
98
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
100
99
  state: FormState;
101
100
  } & {
102
101
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: (props: any) => JSX.Element;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Payments: (props: any) => any;
8
+ declare const Payments: (props: any) => JSX.Element;
9
9
  export default Payments;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -0,0 +1,38 @@
1
+ export declare enum Eftpos {
2
+ Payo = "payo",
3
+ Tyro = "tyro",
4
+ Windcave = "windcave",
5
+ Stripe = "stripe"
6
+ }
7
+ export declare enum DeviceEnum {
8
+ Add = "add",
9
+ Edit = "edit",
10
+ Repair = "repair"
11
+ }
12
+ export declare type DeviceStatus = `${DeviceEnum}`;
13
+ export interface DeviceProp {
14
+ id?: string | number;
15
+ name: string;
16
+ type: Eftpos.Tyro;
17
+ status: "unpaired" | "paired";
18
+ setting: {
19
+ [key: string]: unknown;
20
+ } | null;
21
+ connection: {
22
+ [key: string]: unknown;
23
+ } | null;
24
+ [key: string]: unknown;
25
+ }
26
+ export declare const getDefaultValue: (list: any) => any;
27
+ export declare function getCommByFields({ field, value, name, getComm, }: {
28
+ field: (string | {
29
+ name: string;
30
+ children: string[];
31
+ })[];
32
+ value?: any;
33
+ name?: string[];
34
+ getComm: (params: {
35
+ field: string;
36
+ value?: unknown;
37
+ }, record?: any) => any;
38
+ }): any;
@@ -0,0 +1,79 @@
1
+ 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); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ 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); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ import { helpMapping } from "./form";
14
+ export var Eftpos;
15
+ (function (Eftpos) {
16
+ Eftpos["Payo"] = "payo";
17
+ Eftpos["Tyro"] = "tyro";
18
+ Eftpos["Windcave"] = "windcave";
19
+ Eftpos["Stripe"] = "stripe";
20
+ })(Eftpos || (Eftpos = {}));
21
+ export var DeviceEnum;
22
+ (function (DeviceEnum) {
23
+ DeviceEnum["Add"] = "add";
24
+ DeviceEnum["Edit"] = "edit";
25
+ DeviceEnum["Repair"] = "repair";
26
+ })(DeviceEnum || (DeviceEnum = {}));
27
+ export var getDefaultValue = function getDefaultValue(list) {
28
+ return list.reduce(function (target, item) {
29
+ if (Array.isArray(item.children) && item.children.length) {
30
+ return _objectSpread(_objectSpread({}, target), {}, _defineProperty({}, item.__sourceName, getDefaultValue(item.children)));
31
+ }
32
+ if (!item.Component) {
33
+ return target;
34
+ }
35
+ var ComponentName = item.Component;
36
+ if (helpMapping[ComponentName]) {
37
+ return _objectSpread(_objectSpread({}, target), helpMapping[ComponentName].getCommDefaultVal(item));
38
+ }
39
+ return _objectSpread(_objectSpread({}, target), {}, _defineProperty({}, item.__sourceName, item.input.defaultValue));
40
+ }, {});
41
+ };
42
+ export function getCommByFields(_ref) {
43
+ var field = _ref.field,
44
+ value = _ref.value,
45
+ _ref$name = _ref.name,
46
+ name = _ref$name === void 0 ? [] : _ref$name,
47
+ getComm = _ref.getComm;
48
+ return field.map(function (item) {
49
+ if (typeof item === "string") {
50
+ var commConfig = getComm(value ? {
51
+ field: item,
52
+ value: value[item]
53
+ } : {
54
+ field: item
55
+ }, value);
56
+ if (!commConfig) {
57
+ return undefined;
58
+ }
59
+ var ComponentName = commConfig.Component;
60
+ var helpFn = helpMapping[ComponentName];
61
+ if (helpFn) {
62
+ return helpFn.getCommName(commConfig, name);
63
+ }
64
+ commConfig.__sourceName = commConfig.name;
65
+ commConfig.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.name]) : commConfig.name;
66
+ return commConfig;
67
+ }
68
+ return {
69
+ name: name.length > 0 ? [].concat(_toConsumableArray(name), [item.name]) : item.name,
70
+ __sourceName: item.name,
71
+ children: getCommByFields({
72
+ field: item.children,
73
+ value: value,
74
+ name: [].concat(_toConsumableArray(name || []), [item.name]),
75
+ getComm: getComm
76
+ })
77
+ };
78
+ }).filter(Boolean);
79
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { DeviceProp } from "./const";
3
+ interface DeviceProps {
4
+ formItemList: any[];
5
+ onSave: (device: DeviceProp) => void;
6
+ }
7
+ declare const Device: (props: DeviceProps) => React.JSX.Element;
8
+ export default Device;
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { Form, Button } from "antd";
3
+ import { locales } from "@pisell/utils";
4
+ import { getDefaultValue } from "./const";
5
+ import FormItem from "./form";
6
+ var Device = function Device(props) {
7
+ var onSave = props.onSave,
8
+ formItemList = props.formItemList;
9
+ var initialValues = getDefaultValue(formItemList);
10
+ return /*#__PURE__*/React.createElement(Form, {
11
+ layout: "vertical",
12
+ onFinish: onSave,
13
+ initialValues: initialValues,
14
+ className: "pisell-lowcode__pos-device"
15
+ }, /*#__PURE__*/React.createElement("div", {
16
+ style: {
17
+ flex: 1,
18
+ overflow: 'auto',
19
+ padding: '0 0 60px 0'
20
+ }
21
+ }, /*#__PURE__*/React.createElement(FormItem, {
22
+ formItemList: formItemList
23
+ })), /*#__PURE__*/React.createElement(Form.Item, {
24
+ className: "pisell-lowcode__pos-device-btn"
25
+ }, /*#__PURE__*/React.createElement(Button, {
26
+ htmlType: "submit",
27
+ block: true,
28
+ style: {
29
+ height: '48px'
30
+ }
31
+ }, locales.getText("page.eftpos.text.save"))));
32
+ };
33
+ export default Device;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ declare const CustomFormItem: ({ formItemList, level, onChange, }: {
3
+ formItemList: any[];
4
+ level?: number | undefined;
5
+ onChange?: ((...agrn: unknown[]) => unknown) | undefined;
6
+ }) => React.JSX.Element;
7
+ export default CustomFormItem;
8
+ declare type helpMappingType = {
9
+ [key: string]: {
10
+ getCommName<T = any>(commConfig: T, name: string[]): T;
11
+ getCommDefaultVal: (commConfig: any) => {
12
+ [key: string]: string;
13
+ };
14
+ };
15
+ };
16
+ export declare const helpMapping: helpMappingType;
@@ -0,0 +1,113 @@
1
+ var _excluded = ["direction", "options"],
2
+ _excluded2 = ["label", "value"],
3
+ _excluded3 = ["__sourceName", "Component"],
4
+ _excluded4 = ["input"],
5
+ _excluded5 = ["input"];
6
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
7
+ 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); }
8
+ 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; }
9
+ 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; }
10
+ import React from "react";
11
+ import { Input, InputNumber, Checkbox, Radio, Cascader, DatePicker, Select, Slider, Switch, TimePicker, Transfer, TreeSelect, Upload, Form, Space } from "antd";
12
+ import Surcharge, { getCommName, getCommDefaultVal } from "../surcharge";
13
+ var Mapping = {
14
+ Input: Input,
15
+ InputNumber: InputNumber,
16
+ Checkbox: Checkbox,
17
+ "Checkbox.Group": Checkbox.Group,
18
+ Radio: Radio,
19
+ "Radio.Group": function RadioGroup(_ref) {
20
+ var direction = _ref.direction,
21
+ options = _ref.options,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ if (direction === 'vertical') {
24
+ return /*#__PURE__*/React.createElement(Radio.Group, props, /*#__PURE__*/React.createElement(Space, {
25
+ direction: "vertical"
26
+ }, options === null || options === void 0 ? void 0 : options.map(function (item) {
27
+ if (_typeof(item) === "object") {
28
+ var label = item.label,
29
+ value = item.value,
30
+ other = _objectWithoutProperties(item, _excluded2);
31
+ return /*#__PURE__*/React.createElement(Radio, _extends({}, other, {
32
+ value: value,
33
+ key: "".concat(item.value)
34
+ }), label);
35
+ }
36
+ return /*#__PURE__*/React.createElement(Radio, {
37
+ value: item,
38
+ key: "".concat(item)
39
+ }, item);
40
+ })));
41
+ }
42
+ return /*#__PURE__*/React.createElement(Radio.Group, _extends({}, props, {
43
+ options: options
44
+ }));
45
+ },
46
+ "Radio.Button": Radio.Button,
47
+ Cascader: Cascader,
48
+ DatePicker: DatePicker,
49
+ Select: Select,
50
+ Slider: Slider,
51
+ Switch: Switch,
52
+ TimePicker: TimePicker,
53
+ Transfer: Transfer,
54
+ TreeSelect: TreeSelect,
55
+ Upload: Upload
56
+ };
57
+ var CustomMapping = {
58
+ Surcharge: Surcharge
59
+ };
60
+ var CustomFormItem = function CustomFormItem(_ref2) {
61
+ var formItemList = _ref2.formItemList,
62
+ _ref2$level = _ref2.level,
63
+ level = _ref2$level === void 0 ? 0 : _ref2$level,
64
+ onChange = _ref2.onChange;
65
+ return /*#__PURE__*/React.createElement(React.Fragment, null, formItemList.map(function (_ref3, index) {
66
+ var __sourceName = _ref3.__sourceName,
67
+ Component = _ref3.Component,
68
+ item = _objectWithoutProperties(_ref3, _excluded3);
69
+ if (Array.isArray(item.children)) {
70
+ return /*#__PURE__*/React.createElement(CustomFormItem, {
71
+ formItemList: item.children,
72
+ onChange: onChange,
73
+ key: item.name ? item.name + level : Component + index + level,
74
+ level: level + 1
75
+ });
76
+ }
77
+ if (_typeof(Component) === "object") {
78
+ return /*#__PURE__*/React.createElement(Component, _extends({}, item, {
79
+ key: item.name + level
80
+ }));
81
+ }
82
+ if (Mapping[Component]) {
83
+ var Comm = Mapping[Component];
84
+ var input = item.input,
85
+ formItemProps = _objectWithoutProperties(item, _excluded4);
86
+ return /*#__PURE__*/React.createElement(Form.Item, _extends({}, formItemProps, {
87
+ key: item.name + level
88
+ }), /*#__PURE__*/React.createElement(Comm, input));
89
+ }
90
+ if (Mapping[Component]) {
91
+ var _Comm = Mapping[Component];
92
+ var _input = item.input,
93
+ _formItemProps = _objectWithoutProperties(item, _excluded5);
94
+ return /*#__PURE__*/React.createElement(Form.Item, _extends({}, _formItemProps, {
95
+ key: item.name + level
96
+ }), /*#__PURE__*/React.createElement(_Comm, _input));
97
+ }
98
+ if (CustomMapping[Component]) {
99
+ var _Comm2 = CustomMapping[Component];
100
+ return /*#__PURE__*/React.createElement(_Comm2, _extends({}, item, {
101
+ key: item.name + level
102
+ }));
103
+ }
104
+ throw TypeError("pos\u7269\u6599\u5E93 \u8F93\u5165\u7EC4\u4EF6\u7C7B\u578B ".concat(Component, " \u65E0\u6CD5\u6620\u5C04,\u8BF7\u6B63\u786E\u4F20\u5165\u7EC4\u4EF6\u7C7B\u578B"));
105
+ }));
106
+ };
107
+ export default CustomFormItem;
108
+ export var helpMapping = {
109
+ Surcharge: {
110
+ getCommName: getCommName,
111
+ getCommDefaultVal: getCommDefaultVal
112
+ }
113
+ };
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import { Eftpos, DeviceStatus } from "./const";
3
+ import "./index.less";
4
+ interface PosProps {
5
+ /** 厂商类型 */
6
+ type: Eftpos;
7
+ /** 厂商名称 */
8
+ name: string;
9
+ /** 编辑页面zIndex */
10
+ zIndex?: number;
11
+ /** table 列表宽度 */
12
+ tableSize: number[];
13
+ /** 获取字段匹配数据项 */
14
+ getComm: (params: {
15
+ field: string;
16
+ value?: unknown;
17
+ }, record?: any) => any;
18
+ /** 设备厂商默认数据 */
19
+ getField: (type: Eftpos, status?: DeviceStatus) => any;
20
+ /** 编辑设备数据 */
21
+ onEdit: (device: any, type: DeviceStatus) => Promise<any>;
22
+ /** 编辑厂商数据 */
23
+ onEditKey: () => {};
24
+ /** 设备列表数据 */
25
+ getList: (params: {
26
+ type: Eftpos;
27
+ num: number;
28
+ skip: number;
29
+ }) => any;
30
+ /** 删除列表数据 */
31
+ onDel: (id: string | number) => Promise<any>;
32
+ /** 获取pos刷卡机配置字段 */
33
+ getPosComm: (...agrn: unknown[]) => any;
34
+ savePos: (...agrn: unknown[]) => any;
35
+ }
36
+ declare const _default: (props: PosProps) => React.JSX.Element;
37
+ export default _default;