@pisell/private-materials 6.3.87 → 6.3.88
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/hooks.d.ts +7 -0
- package/es/components/eftpos/hooks.js +20 -0
- package/es/components/eftpos/index.js +85 -4
- package/es/components/eftpos/locales.d.ts +21 -0
- package/es/components/eftpos/locales.js +88 -7
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/hooks.d.ts +7 -0
- package/lib/components/eftpos/hooks.js +19 -0
- package/lib/components/eftpos/index.js +54 -3
- package/lib/components/eftpos/locales.d.ts +21 -0
- package/lib/components/eftpos/locales.js +85 -4
- package/package.json +4 -4
|
@@ -46,7 +46,11 @@ var import_hooks = require("./hooks");
|
|
|
46
46
|
var import_apiKey = __toESM(require("./icon/apiKey"));
|
|
47
47
|
var import_device2 = __toESM(require("./icon/device"));
|
|
48
48
|
var import_locales2 = require("../../utils/locales");
|
|
49
|
+
var import_hooks2 = require("./PairModal/hooks");
|
|
50
|
+
var import_PairModal = __toESM(require("./PairModal/index"));
|
|
49
51
|
var import_const = require("./const");
|
|
52
|
+
var import_materials = require("@pisell/materials");
|
|
53
|
+
var import_mx51SCI = __toESM(require("./assets/mx51SCI.svg"));
|
|
50
54
|
var import_index = require("./index.less");
|
|
51
55
|
import_utils.locales.init(import_locales.default, (0, import_locales2.getLocale)());
|
|
52
56
|
var PosTabs = (0, import_react.forwardRef)(
|
|
@@ -161,6 +165,8 @@ var eftpos_default = (props) => {
|
|
|
161
165
|
const [systemConfigStatus, setSystemConfigStatus] = (0, import_react.useState)(true);
|
|
162
166
|
const posTabRef = (0, import_react.useRef)(null);
|
|
163
167
|
const [posLoading, setPosLoading] = (0, import_react.useState)(false);
|
|
168
|
+
const pairModalHook = (0, import_hooks2.usePairModal)();
|
|
169
|
+
const pairRequest = (0, import_hooks.usePairRequest)();
|
|
164
170
|
const onDelDevice = (id) => {
|
|
165
171
|
return onDel(id);
|
|
166
172
|
};
|
|
@@ -311,6 +317,40 @@ var eftpos_default = (props) => {
|
|
|
311
317
|
(0, import_react.useEffect)(() => {
|
|
312
318
|
setPage("list");
|
|
313
319
|
}, [type]);
|
|
320
|
+
const onSavePair = async (device) => {
|
|
321
|
+
const eftposList = [import_const.Eftpos.MX51];
|
|
322
|
+
if (eftposList.includes(type)) {
|
|
323
|
+
try {
|
|
324
|
+
setLoading(true);
|
|
325
|
+
const response = await pairRequest.run({
|
|
326
|
+
...(device == null ? void 0 : device.connection) || {},
|
|
327
|
+
type
|
|
328
|
+
});
|
|
329
|
+
if ((response == null ? void 0 : response.code) == 200) {
|
|
330
|
+
pairModalHook.open({
|
|
331
|
+
data: {
|
|
332
|
+
type,
|
|
333
|
+
device,
|
|
334
|
+
pairResponse: response == null ? void 0 : response.data
|
|
335
|
+
},
|
|
336
|
+
onCancel: () => {
|
|
337
|
+
pairModalHook.close();
|
|
338
|
+
},
|
|
339
|
+
onConfirm: () => {
|
|
340
|
+
pairModalHook.close();
|
|
341
|
+
onSave(device);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
} catch (error) {
|
|
346
|
+
console.error("onSavePair error =>", error);
|
|
347
|
+
} finally {
|
|
348
|
+
setLoading(false);
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
onSave(device);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
314
354
|
if (type === import_const.Eftpos.Windcave) {
|
|
315
355
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
316
356
|
PosTabs,
|
|
@@ -425,7 +465,18 @@ var eftpos_default = (props) => {
|
|
|
425
465
|
{
|
|
426
466
|
open: page === "edit",
|
|
427
467
|
onClose: onBack,
|
|
428
|
-
title: type === import_const.Eftpos.MX51 ?
|
|
468
|
+
title: type === import_const.Eftpos.MX51 ? /* @__PURE__ */ import_react.default.createElement(
|
|
469
|
+
"span",
|
|
470
|
+
{
|
|
471
|
+
style: {
|
|
472
|
+
display: "inline-flex",
|
|
473
|
+
alignItems: "center",
|
|
474
|
+
gap: "4px"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.Image, { src: import_mx51SCI.default, preview: false, width: 24 }),
|
|
478
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, "Simple Cloud Payments")
|
|
479
|
+
) : import_utils.locales.getText("page.eftpos.text.device.add")(status, name),
|
|
429
480
|
titleNoWrap: true,
|
|
430
481
|
zIndex: zIndex || 9999,
|
|
431
482
|
destroyOnClose: true,
|
|
@@ -442,7 +493,7 @@ var eftpos_default = (props) => {
|
|
|
442
493
|
import_device.default,
|
|
443
494
|
{
|
|
444
495
|
formItemList: deviceItemList,
|
|
445
|
-
onSave,
|
|
496
|
+
onSave: onSavePair,
|
|
446
497
|
key: `device${type}`,
|
|
447
498
|
type,
|
|
448
499
|
status
|
|
@@ -471,5 +522,5 @@ var eftpos_default = (props) => {
|
|
|
471
522
|
device: deviceItem
|
|
472
523
|
}
|
|
473
524
|
)
|
|
474
|
-
), contextHolder);
|
|
525
|
+
), contextHolder, pairModalHook.visible && /* @__PURE__ */ import_react.default.createElement(import_PairModal.default, { ...pairModalHook.modalProps }));
|
|
475
526
|
};
|
|
@@ -31,6 +31,13 @@ declare const _default: {
|
|
|
31
31
|
'page.eftpos.text.setting': string;
|
|
32
32
|
'page.eftpos.text.setting.tip': string;
|
|
33
33
|
'page.eftpos.text.setting.btn': string;
|
|
34
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
codeTitle: string;
|
|
38
|
+
cancenButtonText: string;
|
|
39
|
+
okButtonText: string;
|
|
40
|
+
} | undefined;
|
|
34
41
|
};
|
|
35
42
|
'zh-CN': {
|
|
36
43
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -64,6 +71,13 @@ declare const _default: {
|
|
|
64
71
|
'page.eftpos.text.setting': string;
|
|
65
72
|
'page.eftpos.text.setting.tip': string;
|
|
66
73
|
'page.eftpos.text.setting.btn': string;
|
|
74
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
75
|
+
title: string;
|
|
76
|
+
description: string;
|
|
77
|
+
codeTitle: string;
|
|
78
|
+
cancenButtonText: string;
|
|
79
|
+
okButtonText: string;
|
|
80
|
+
} | undefined;
|
|
67
81
|
};
|
|
68
82
|
'zh-HK': {
|
|
69
83
|
'page.eftpos.text.manufacturer': string;
|
|
@@ -97,6 +111,13 @@ declare const _default: {
|
|
|
97
111
|
'page.eftpos.text.setting': string;
|
|
98
112
|
'page.eftpos.text.setting.tip': string;
|
|
99
113
|
'page.eftpos.text.setting.btn': string;
|
|
114
|
+
'page.eftpos.text.pair.modal.content.text-info': (status: string) => {
|
|
115
|
+
title: string;
|
|
116
|
+
description: string;
|
|
117
|
+
codeTitle: string;
|
|
118
|
+
cancenButtonText: string;
|
|
119
|
+
okButtonText: string;
|
|
120
|
+
} | undefined;
|
|
100
121
|
};
|
|
101
122
|
};
|
|
102
123
|
export default _default;
|
|
@@ -23,7 +23,7 @@ __export(locales_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(locales_exports);
|
|
25
25
|
var locales_default = {
|
|
26
|
-
|
|
26
|
+
en: {
|
|
27
27
|
"page.eftpos.text.manufacturer": "Manufacturer",
|
|
28
28
|
"page.eftpos.text.description": "Description",
|
|
29
29
|
"page.eftpos.text.status": "status",
|
|
@@ -60,7 +60,34 @@ var locales_default = {
|
|
|
60
60
|
"page.eftpos.text.log": "Log",
|
|
61
61
|
"page.eftpos.text.setting": "Setting",
|
|
62
62
|
"page.eftpos.text.setting.tip": "You have not configured the necessary parameters, which may affect the normal use of your POS! ",
|
|
63
|
-
"page.eftpos.text.setting.btn": "Go to configure"
|
|
63
|
+
"page.eftpos.text.setting.btn": "Go to configure",
|
|
64
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
65
|
+
if (status === "pairing") {
|
|
66
|
+
return {
|
|
67
|
+
title: "Pairing",
|
|
68
|
+
description: "Confirm the code on the EFTPOS terminal to continue.",
|
|
69
|
+
codeTitle: "Code",
|
|
70
|
+
cancenButtonText: "Cancel",
|
|
71
|
+
okButtonText: "Check status"
|
|
72
|
+
};
|
|
73
|
+
} else if (status === "success") {
|
|
74
|
+
return {
|
|
75
|
+
title: "Pairing is active",
|
|
76
|
+
description: "You are ready to go!",
|
|
77
|
+
codeTitle: "",
|
|
78
|
+
cancenButtonText: "Unpair",
|
|
79
|
+
okButtonText: "Confirm"
|
|
80
|
+
};
|
|
81
|
+
} else if (status === "failed") {
|
|
82
|
+
return {
|
|
83
|
+
title: "Pairing not active",
|
|
84
|
+
description: "Check the terminal, confirm the pairing code, then try again.",
|
|
85
|
+
codeTitle: "Code",
|
|
86
|
+
cancenButtonText: "Cancel",
|
|
87
|
+
okButtonText: "Check status"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
64
91
|
},
|
|
65
92
|
"zh-CN": {
|
|
66
93
|
"page.eftpos.text.manufacturer": "厂商",
|
|
@@ -99,7 +126,34 @@ var locales_default = {
|
|
|
99
126
|
"page.eftpos.text.log": "日志",
|
|
100
127
|
"page.eftpos.text.setting": "设置",
|
|
101
128
|
"page.eftpos.text.setting.tip": "您尚未配置必要参数,这可能会影响您Pos的正常使用!",
|
|
102
|
-
"page.eftpos.text.setting.btn": "前往配置"
|
|
129
|
+
"page.eftpos.text.setting.btn": "前往配置",
|
|
130
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
131
|
+
if (status === "pairing") {
|
|
132
|
+
return {
|
|
133
|
+
title: "正在配对",
|
|
134
|
+
description: "请在刷卡机上确认配对码以继续。",
|
|
135
|
+
codeTitle: "配对码",
|
|
136
|
+
cancenButtonText: "取消",
|
|
137
|
+
okButtonText: "检查状态"
|
|
138
|
+
};
|
|
139
|
+
} else if (status === "success") {
|
|
140
|
+
return {
|
|
141
|
+
title: "配对成功",
|
|
142
|
+
description: "设备已成功连接,可开始使用。",
|
|
143
|
+
codeTitle: "",
|
|
144
|
+
cancenButtonText: "解除配对",
|
|
145
|
+
okButtonText: "确认"
|
|
146
|
+
};
|
|
147
|
+
} else if (status === "failed") {
|
|
148
|
+
return {
|
|
149
|
+
title: "配对未生效",
|
|
150
|
+
description: "请检查刷卡机并确认配对码后重试。",
|
|
151
|
+
codeTitle: "配对码",
|
|
152
|
+
cancenButtonText: "取消",
|
|
153
|
+
okButtonText: "检查状态"
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
103
157
|
},
|
|
104
158
|
"zh-HK": {
|
|
105
159
|
"page.eftpos.text.manufacturer": "廠商",
|
|
@@ -138,6 +192,33 @@ var locales_default = {
|
|
|
138
192
|
"page.eftpos.text.log": "日誌",
|
|
139
193
|
"page.eftpos.text.setting": "设置",
|
|
140
194
|
"page.eftpos.text.setting.tip": "您尚未配置必要參數,這可能會影響您Pos的正常使用!",
|
|
141
|
-
"page.eftpos.text.setting.btn": "前往配置"
|
|
195
|
+
"page.eftpos.text.setting.btn": "前往配置",
|
|
196
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
197
|
+
if (status === "pairing") {
|
|
198
|
+
return {
|
|
199
|
+
title: "正在配對",
|
|
200
|
+
description: "請在刷卡機上確認配對碼以繼續。",
|
|
201
|
+
codeTitle: "配對碼",
|
|
202
|
+
cancenButtonText: "取消",
|
|
203
|
+
okButtonText: "檢查狀態"
|
|
204
|
+
};
|
|
205
|
+
} else if (status === "success") {
|
|
206
|
+
return {
|
|
207
|
+
title: "配對成功",
|
|
208
|
+
description: "設備已成功連接,可開始使用。",
|
|
209
|
+
codeTitle: "",
|
|
210
|
+
cancenButtonText: "解除配對",
|
|
211
|
+
okButtonText: "確認"
|
|
212
|
+
};
|
|
213
|
+
} else if (status === "failed") {
|
|
214
|
+
return {
|
|
215
|
+
title: "配對未生效",
|
|
216
|
+
description: "請檢查刷卡機並確認配對碼後重試。",
|
|
217
|
+
codeTitle: "配對碼",
|
|
218
|
+
cancenButtonText: "取消",
|
|
219
|
+
okButtonText: "檢查狀態"
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
142
223
|
}
|
|
143
224
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.88",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"react-infinite-scroll-component": "^6.1.0",
|
|
77
77
|
"react-resizable": "^3.0.5",
|
|
78
78
|
"styled-components": "^6.0.0-rc.3",
|
|
79
|
-
"@pisell/icon": "0.0.11",
|
|
80
79
|
"@pisell/materials": "6.3.23",
|
|
81
|
-
"@pisell/
|
|
82
|
-
"@pisell/
|
|
80
|
+
"@pisell/date-picker": "3.0.8",
|
|
81
|
+
"@pisell/icon": "0.0.11",
|
|
82
|
+
"@pisell/utils": "3.0.5"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "^18.0.0",
|