@pisell/private-materials 3.0.187 → 3.0.188

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 (73) 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 +3 -3
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/eftposPay/amount.d.ts +4 -3
  12. package/es/components/eftposPay/amount.js +5 -4
  13. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  14. package/es/components/eftposPay/component/fail/failCustom.js +14 -6
  15. package/es/components/eftposPay/component/fail/index.d.ts +1 -1
  16. package/es/components/eftposPay/component/fail/index.js +14 -5
  17. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -1
  18. package/es/components/eftposPay/component/fail/unknow.js +17 -7
  19. package/es/components/eftposPay/const.d.ts +8 -2
  20. package/es/components/eftposPay/const.js +5 -0
  21. package/es/components/eftposPay/device.d.ts +4 -3
  22. package/es/components/eftposPay/device.js +5 -4
  23. package/es/components/eftposPay/hooks.d.ts +4 -3
  24. package/es/components/eftposPay/hooks.js +31 -6
  25. package/es/components/eftposPay/index.js +57 -23
  26. package/es/components/eftposPay/index.less +1 -0
  27. package/es/components/eftposPay/locales.d.ts +6 -0
  28. package/es/components/eftposPay/locales.js +6 -0
  29. package/es/components/eftposPay/pay.d.ts +3 -2
  30. package/es/components/eftposPay/pay.js +8 -7
  31. package/es/components/eftposPay/payo/config.d.ts +3 -1
  32. package/es/components/eftposPay/payo/config.js +11 -9
  33. package/es/components/eftposPay/payo/const.js +4 -2
  34. package/es/components/eftposPay/payo/index.js +3 -1
  35. package/es/components/eftposPay/store/index.d.ts +17 -2
  36. package/es/components/eftposPay/store/index.js +20 -0
  37. package/es/components/eftposPay/tyro/const.js +4 -2
  38. package/es/components/eftposPay/tyro/index.js +70 -20
  39. package/es/components/eftposPay/windcave/const.js +4 -2
  40. package/es/components/eftposPay/windcave/helper.js +19 -28
  41. package/es/components/eftposPay/windcave/windcave.js +2 -1
  42. package/lib/components/eftposPay/amount.d.ts +4 -3
  43. package/lib/components/eftposPay/amount.js +4 -3
  44. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -1
  45. package/lib/components/eftposPay/component/fail/failCustom.js +16 -4
  46. package/lib/components/eftposPay/component/fail/index.d.ts +1 -1
  47. package/lib/components/eftposPay/component/fail/index.js +17 -4
  48. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -1
  49. package/lib/components/eftposPay/component/fail/unknow.js +15 -3
  50. package/lib/components/eftposPay/const.d.ts +8 -2
  51. package/lib/components/eftposPay/const.js +7 -0
  52. package/lib/components/eftposPay/device.d.ts +4 -3
  53. package/lib/components/eftposPay/device.js +5 -4
  54. package/lib/components/eftposPay/hooks.d.ts +4 -3
  55. package/lib/components/eftposPay/hooks.js +30 -8
  56. package/lib/components/eftposPay/index.js +46 -18
  57. package/lib/components/eftposPay/index.less +1 -0
  58. package/lib/components/eftposPay/locales.d.ts +6 -0
  59. package/lib/components/eftposPay/locales.js +6 -0
  60. package/lib/components/eftposPay/pay.d.ts +3 -2
  61. package/lib/components/eftposPay/pay.js +7 -6
  62. package/lib/components/eftposPay/payo/config.d.ts +3 -1
  63. package/lib/components/eftposPay/payo/config.js +8 -8
  64. package/lib/components/eftposPay/payo/const.js +2 -0
  65. package/lib/components/eftposPay/payo/index.js +1 -1
  66. package/lib/components/eftposPay/store/index.d.ts +17 -2
  67. package/lib/components/eftposPay/store/index.js +14 -0
  68. package/lib/components/eftposPay/tyro/const.js +2 -0
  69. package/lib/components/eftposPay/tyro/index.js +63 -6
  70. package/lib/components/eftposPay/windcave/const.js +2 -0
  71. package/lib/components/eftposPay/windcave/helper.js +23 -28
  72. package/lib/components/eftposPay/windcave/windcave.js +2 -1
  73. package/package.json +1 -1
@@ -39,6 +39,7 @@ var const_default = (params) => {
39
39
  pay,
40
40
  device,
41
41
  net,
42
+ client,
42
43
  ...other
43
44
  } = params || {
44
45
  mode: import_const.ModeEnum.Pay
@@ -59,6 +60,7 @@ var const_default = (params) => {
59
60
  status: import_const.StatusEnum.Loading,
60
61
  steps: [],
61
62
  render: true,
63
+ client: client !== "undefined" ? client : import_const.ClientEnum.Merchant,
62
64
  custom: other ? { ...other, list: [], step: 1 /* Free */ } : { list: [], step: 1 /* Free */ },
63
65
  ...typeof net !== "undefined" ? { net } : {},
64
66
  ...typeof number !== "undefined" ? { number } : {},
@@ -44,7 +44,7 @@ var Max4004 = 1;
44
44
  var useFail = () => {
45
45
  const dispatch = (0, import_store.useDispatch)();
46
46
  const { custom } = (0, import_store.useContextData)();
47
- const { modeRef } = (0, import_hooks.useStoreRef)();
47
+ const { modeRef, clientRef } = (0, import_hooks.useStoreRef)();
48
48
  const ref = (0, import_react.useRef)((custom == null ? void 0 : custom.retry) || 0);
49
49
  (0, import_react.useEffect)(() => {
50
50
  ref.current = (custom == null ? void 0 : custom.retry) || 0;
@@ -135,6 +135,23 @@ var useFail = () => {
135
135
  }
136
136
  if (code === import_const.PayStatus.Timeout) {
137
137
  if (isMark) {
138
+ if (clientRef.current === import_const.ClientEnum.User) {
139
+ dispatch(
140
+ (0, import_store.updateCustom)({
141
+ failCustom: {
142
+ isPosNetworkError: true,
143
+ status: "warn",
144
+ fail: null,
145
+ title: import_utils.locales.getText("page.eftpos-pay.text.timedout.title"),
146
+ warn: import_utils.locales.getText(
147
+ "page.eftpos-pay.text.transaction.eftpos.fail.other"
148
+ )
149
+ }
150
+ })
151
+ );
152
+ dispatch((0, import_store.updateComponent)("FailCustom"));
153
+ return;
154
+ }
138
155
  dispatch(
139
156
  (0, import_store.updateState)({
140
157
  manual: {
@@ -211,7 +228,7 @@ var useFail = () => {
211
228
  status: "warn",
212
229
  fail: null,
213
230
  title: import_utils.locales.getText("page.eftpos-pay.text.interrupted"),
214
- warn: `${import_utils.locales.getText(
231
+ warn: clientRef.current === import_const.ClientEnum.Merchant ? `${import_utils.locales.getText(
215
232
  "page.eftpos-pay.text.transaction.eftpos.fail.title"
216
233
  )}
217
234
  ${import_utils.locales.getText(
@@ -225,31 +242,9 @@ ${import_utils.locales.getText(
225
242
  )}
226
243
  ${import_utils.locales.getText(
227
244
  "page.eftpos-pay.text.transaction.eftpos.fail.if"
228
- )(modeRef.current)}
229
- `
230
- // warn: (
231
- // <>
232
- // {locales.getText(
233
- // 'page.eftpos-pay.text.transaction.eftpos.fail.title'
234
- // )}
235
- // <br />
236
- // {locales.getText(
237
- // 'page.eftpos-pay.text.transaction.eftpos.fail.power'
238
- // )}
239
- // . <br />
240
- // {locales.getText(
241
- // 'page.eftpos-pay.text.transaction.eftpos.fail.device'
242
- // )}
243
- // <br />
244
- // {locales.getText(
245
- // 'page.eftpos-pay.text.transaction.eftpos.fail.network'
246
- // )}
247
- // <br />
248
- // {locales.getText(
249
- // 'page.eftpos-pay.text.transaction.eftpos.fail.if'
250
- // )(modeRef.current)}
251
- // </>
252
- // ),
245
+ )(modeRef.current)}` : import_utils.locales.getText(
246
+ "page.eftpos-pay.text.transaction.eftpos.fail.other"
247
+ )
253
248
  }
254
249
  })
255
250
  );
@@ -331,7 +326,7 @@ var useValidate = (check, num, onChange) => {
331
326
  const failRef = (0, import_react.useRef)(fail);
332
327
  const ref = (0, import_react.useRef)();
333
328
  const { custom } = (0, import_store.useContextData)();
334
- const { netRef, payRef, numRef, modeRef } = (0, import_hooks.useStoreRef)();
329
+ const { netRef, payRef, numRef, modeRef, clientRef } = (0, import_hooks.useStoreRef)();
335
330
  const stepRef = (0, import_react.useRef)(custom == null ? void 0 : custom.step);
336
331
  const listRef = (0, import_react.useRef)(custom == null ? void 0 : custom.list);
337
332
  (0, import_react.useEffect)(() => {
@@ -59,7 +59,8 @@ var windcave_default = ({
59
59
  netRef,
60
60
  symbolRef,
61
61
  amountRef,
62
- eftposRef
62
+ eftposRef,
63
+ clientRef
63
64
  } = (0, import_hooks.useStoreRef)();
64
65
  const dispatch = (0, import_store.useDispatch)();
65
66
  const fail = (0, import_helper2.useFail)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.187",
3
+ "version": "3.0.188",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",