@pisell/private-materials 3.0.139 → 3.0.141
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/info/header/index.js +73 -9
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/eftpos/deviceList/index.d.ts +3 -0
- package/es/components/eftpos/deviceList/index.js +52 -0
- package/es/components/eftpos/form/index.js +21 -74
- package/es/components/eftpos/group/index.d.ts +7 -0
- package/es/components/eftpos/group/index.js +65 -0
- package/es/components/eftposPay/component/manual/index.js +15 -15
- package/es/components/eftposPay/helper.d.ts +9 -0
- package/es/components/eftposPay/helper.js +69 -1
- package/es/components/eftposPay/manufacturer.d.ts +1 -1
- package/es/components/eftposPay/manufacturer.js +17 -15
- package/es/components/eftposPay/payo/const.js +6 -3
- package/es/components/eftposPay/payo/hooks.js +31 -2
- package/es/components/eftposPay/tyro/const.js +3 -1
- package/es/components/eftposPay/windcave/const.js +2 -1
- package/lib/components/booking/info/header/index.js +52 -7
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/eftpos/deviceList/index.d.ts +3 -0
- package/lib/components/eftpos/deviceList/index.js +70 -0
- package/lib/components/eftpos/form/index.js +6 -33
- package/lib/components/eftpos/group/index.d.ts +7 -0
- package/lib/components/eftpos/group/index.js +75 -0
- package/lib/components/eftposPay/component/manual/index.js +4 -15
- package/lib/components/eftposPay/helper.d.ts +9 -0
- package/lib/components/eftposPay/helper.js +49 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -1
- package/lib/components/eftposPay/manufacturer.js +2 -13
- package/lib/components/eftposPay/payo/const.js +3 -3
- package/lib/components/eftposPay/payo/hooks.js +17 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/package.json +2 -2
|
@@ -32,7 +32,7 @@ __export(manufacturer_exports, {
|
|
|
32
32
|
Payo: () => import_payo.default,
|
|
33
33
|
Tyro: () => import_tyro.default,
|
|
34
34
|
Windcave: () => import_windcave.default,
|
|
35
|
-
getAmonunt: () => getAmonunt,
|
|
35
|
+
getAmonunt: () => import_helper.getAmonunt,
|
|
36
36
|
getInitState: () => getInitState
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(manufacturer_exports);
|
|
@@ -40,6 +40,7 @@ var import_const = require("./const");
|
|
|
40
40
|
var import_const2 = __toESM(require("./payo/const"));
|
|
41
41
|
var import_const3 = __toESM(require("./tyro/const"));
|
|
42
42
|
var import_const4 = __toESM(require("./windcave/const"));
|
|
43
|
+
var import_helper = require("./helper");
|
|
43
44
|
var import_payo = __toESM(require("./payo"));
|
|
44
45
|
var import_windcave = __toESM(require("./windcave/windcave"));
|
|
45
46
|
var import_tyro = __toESM(require("./tyro"));
|
|
@@ -55,18 +56,6 @@ var getInitState = (type, params) => {
|
|
|
55
56
|
throw new Error("未知的厂商类型");
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
var getAmonunt = (store) => {
|
|
59
|
-
if (store.eftpos === import_const.EftposEnum.Payo) {
|
|
60
|
-
return (0, import_const2.getAmonunt)(store);
|
|
61
|
-
}
|
|
62
|
-
if (store.eftpos === import_const.EftposEnum.Windcave) {
|
|
63
|
-
return (0, import_const4.getAmonunt)(store);
|
|
64
|
-
}
|
|
65
|
-
if (store.eftpos === import_const.EftposEnum.Tyro) {
|
|
66
|
-
return (0, import_const3.getAmonunt)(store);
|
|
67
|
-
}
|
|
68
|
-
throw new Error("未知的厂商类型");
|
|
69
|
-
};
|
|
70
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
71
60
|
0 && (module.exports = {
|
|
72
61
|
Payo,
|
|
@@ -109,10 +109,10 @@ function getAmonunt(store) {
|
|
|
109
109
|
useOriginSurcharge: false
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
const surRate = setting.useOriginSurcharge ? 0 : setting.constant_rate || 0;
|
|
113
|
-
const surMoney = setting.useOriginSurcharge ? 0 : setting.constant_money || 0;
|
|
114
|
-
const surcharge = setting.surcharge;
|
|
115
112
|
const useOriginSurcharge = setting.useOriginSurcharge || false;
|
|
113
|
+
const surRate = setting.constant_rate || 0;
|
|
114
|
+
const surMoney = setting.constant_money || 0;
|
|
115
|
+
const surcharge = setting.surcharge;
|
|
116
116
|
return {
|
|
117
117
|
name,
|
|
118
118
|
symbol,
|
|
@@ -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);
|
|
@@ -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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.141",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
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/utils": "1.0.42",
|
|
62
63
|
"@pisell/materials": "3.0.47",
|
|
63
64
|
"@pisell/icon": "0.0.11",
|
|
64
|
-
"@pisell/utils": "1.0.42",
|
|
65
65
|
"@pisell/date-picker": "1.0.100"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|