@pisell/private-materials 3.0.138 → 3.0.140

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 (57) 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.js +9 -9
  8. package/build/lowcode/view.js +7 -7
  9. package/es/components/booking/addons/model.d.ts +1 -2
  10. package/es/components/booking/forms/model.d.ts +1 -2
  11. package/es/components/booking/info/header/index.js +2 -2
  12. package/es/components/booking/notes/index.d.ts +1 -1
  13. package/es/components/booking/notes/model.d.ts +1 -2
  14. package/es/components/booking/payments/model.d.ts +1 -2
  15. package/es/components/eftpos/deviceList/index.d.ts +3 -0
  16. package/es/components/eftpos/deviceList/index.js +52 -0
  17. package/es/components/eftpos/form/index.js +21 -74
  18. package/es/components/eftpos/group/index.d.ts +7 -0
  19. package/es/components/eftpos/group/index.js +65 -0
  20. package/es/components/eftposPay/component/manual/index.js +15 -15
  21. package/es/components/eftposPay/helper.d.ts +9 -0
  22. package/es/components/eftposPay/helper.js +69 -1
  23. package/es/components/eftposPay/hooks.d.ts +1 -1
  24. package/es/components/eftposPay/manufacturer.d.ts +1 -1
  25. package/es/components/eftposPay/manufacturer.js +17 -15
  26. package/es/components/eftposPay/payo/const.js +6 -3
  27. package/es/components/eftposPay/payo/hooks.js +31 -2
  28. package/es/components/eftposPay/store/index.d.ts +1 -1
  29. package/es/components/eftposPay/tyro/const.js +3 -1
  30. package/es/components/eftposPay/windcave/const.js +2 -1
  31. package/es/components/schedules/index.d.ts +1 -1
  32. package/es/components/schedules/model.d.ts +1 -2
  33. package/lib/components/booking/addons/model.d.ts +1 -2
  34. package/lib/components/booking/forms/model.d.ts +1 -2
  35. package/lib/components/booking/info/header/index.js +1 -1
  36. package/lib/components/booking/notes/index.d.ts +1 -1
  37. package/lib/components/booking/notes/model.d.ts +1 -2
  38. package/lib/components/booking/payments/model.d.ts +1 -2
  39. package/lib/components/eftpos/deviceList/index.d.ts +3 -0
  40. package/lib/components/eftpos/deviceList/index.js +70 -0
  41. package/lib/components/eftpos/form/index.js +6 -33
  42. package/lib/components/eftpos/group/index.d.ts +7 -0
  43. package/lib/components/eftpos/group/index.js +75 -0
  44. package/lib/components/eftposPay/component/manual/index.js +4 -15
  45. package/lib/components/eftposPay/helper.d.ts +9 -0
  46. package/lib/components/eftposPay/helper.js +49 -0
  47. package/lib/components/eftposPay/hooks.d.ts +1 -1
  48. package/lib/components/eftposPay/manufacturer.d.ts +1 -1
  49. package/lib/components/eftposPay/manufacturer.js +2 -13
  50. package/lib/components/eftposPay/payo/const.js +3 -3
  51. package/lib/components/eftposPay/payo/hooks.js +17 -0
  52. package/lib/components/eftposPay/store/index.d.ts +1 -1
  53. package/lib/components/eftposPay/tyro/const.js +1 -1
  54. package/lib/components/eftposPay/windcave/const.js +1 -1
  55. package/lib/components/schedules/index.d.ts +1 -1
  56. package/lib/components/schedules/model.d.ts +1 -2
  57. package/package.json +3 -3
@@ -28,6 +28,7 @@ var import_helper = require("../helper");
28
28
  var useValidate = (timeout) => {
29
29
  const controllerRef = (0, import_react.useRef)();
30
30
  const ref = (0, import_react.useRef)(true);
31
+ const isTimeoutCloseRef = (0, import_react.useRef)(false);
31
32
  const TimeoutRef = (0, import_react.useRef)();
32
33
  const checkApi = (0, import_react.useCallback)(
33
34
  async (check, number, time) => {
@@ -49,6 +50,20 @@ var useValidate = (timeout) => {
49
50
  await (0, import_helper.sleep)(time - diff);
50
51
  }
51
52
  }
53
+ if (isTimeoutCloseRef.current) {
54
+ if (!res) {
55
+ return {
56
+ code: import_const.PayStatus.Timeout
57
+ };
58
+ }
59
+ const { code } = res;
60
+ if (`${code}` === `200`) {
61
+ return {
62
+ ...res,
63
+ code: import_const.PayStatus.Timeout
64
+ };
65
+ }
66
+ }
52
67
  return res;
53
68
  },
54
69
  []
@@ -59,8 +74,10 @@ var useValidate = (timeout) => {
59
74
  (_a = controllerRef.current) == null ? void 0 : _a.abort();
60
75
  }, []);
61
76
  const run = (...params) => {
77
+ isTimeoutCloseRef.current = false;
62
78
  TimeoutRef.current && clearTimeout(TimeoutRef.current);
63
79
  TimeoutRef.current = setTimeout(() => {
80
+ isTimeoutCloseRef.current = true;
64
81
  close();
65
82
  }, timeout);
66
83
  return checkApi(...params);
@@ -283,7 +283,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
283
283
  amount?: string | number | undefined;
284
284
  mode?: "refund" | "pay" | "query" | undefined;
285
285
  order_id?: string | number | undefined;
286
- eftpos?: "windcave" | "tyro" | "payo" | "stripe" | undefined;
286
+ eftpos?: "tyro" | "windcave" | "payo" | "stripe" | undefined;
287
287
  action?: "amount" | "deviceList" | "pay" | undefined;
288
288
  key?: number | undefined;
289
289
  step?: number | undefined;
@@ -93,10 +93,10 @@ function getAmonunt(store) {
93
93
  useOriginSurcharge: false
94
94
  };
95
95
  }
96
+ const useOriginSurcharge = setting.useOriginSurcharge || false;
96
97
  const surRate = setting.constant_rate || 0;
97
98
  const surMoney = setting.constant_money || 0;
98
99
  const surcharge = setting.surcharge;
99
- const useOriginSurcharge = setting.useOriginSurcharge || false;
100
100
  return {
101
101
  name,
102
102
  symbol,
@@ -98,10 +98,10 @@ function getAmonunt(store) {
98
98
  useOriginSurcharge: false
99
99
  };
100
100
  }
101
+ const useOriginSurcharge = setting.useOriginSurcharge || false;
101
102
  const surRate = setting.constant_rate || 0;
102
103
  const surMoney = setting.constant_money || 0;
103
104
  const surcharge = setting.surcharge;
104
- const useOriginSurcharge = setting.useOriginSurcharge || false;
105
105
  return {
106
106
  name,
107
107
  symbol,
@@ -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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.138",
3
+ "version": "3.0.140",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/date-picker": "1.0.100",
63
62
  "@pisell/utils": "1.0.42",
64
63
  "@pisell/icon": "0.0.11",
65
- "@pisell/materials": "3.0.47"
64
+ "@pisell/materials": "3.0.47",
65
+ "@pisell/date-picker": "1.0.100"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",