@pisell/private-materials 3.0.193 → 3.0.194
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 +150 -142
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/eftpos/form/index.js +12 -6
- package/es/components/eftpos/group/index.d.ts +1 -2
- package/es/components/eftpos/group/index.js +1 -2
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftpos/receipt/index.d.ts +24 -0
- package/es/components/eftpos/receipt/index.js +96 -0
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/index.js +40 -17
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/eftpos/form/index.js +12 -6
- package/lib/components/eftpos/group/index.d.ts +1 -2
- package/lib/components/eftpos/group/index.js +0 -1
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftpos/receipt/index.d.ts +24 -0
- package/lib/components/eftpos/receipt/index.js +88 -0
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +26 -5
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +4 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftpos/receipt/index.tsx
|
|
30
|
+
var receipt_exports = {};
|
|
31
|
+
__export(receipt_exports, {
|
|
32
|
+
default: () => receipt_default,
|
|
33
|
+
getCommDefaultVal: () => getCommDefaultVal,
|
|
34
|
+
getCommName: () => getCommName
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(receipt_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_antd = require("antd");
|
|
39
|
+
var import_group = require("../group");
|
|
40
|
+
var getCommName = (commConfig, name) => {
|
|
41
|
+
commConfig.receipts.__sourceName = commConfig.receipts.name;
|
|
42
|
+
commConfig.receiptList.__sourceName = commConfig.receiptList.name;
|
|
43
|
+
commConfig.receipts.name = name.length > 0 ? [...name, commConfig.receipts.name] : commConfig.receipts.name;
|
|
44
|
+
commConfig.receiptList.name = name.length > 0 ? [...name, commConfig.receiptList.name] : commConfig.receiptList.name;
|
|
45
|
+
return commConfig;
|
|
46
|
+
};
|
|
47
|
+
var getCommDefaultVal = (commConfig) => {
|
|
48
|
+
const receipts = commConfig.receipts.input.defaultValue;
|
|
49
|
+
const receiptList = commConfig.receiptList.input.defaultValue;
|
|
50
|
+
console.log("receipts = ", receipts);
|
|
51
|
+
return {
|
|
52
|
+
[commConfig.receipts.__sourceName]: typeof receipts === "undefined" ? true : receipts,
|
|
53
|
+
[commConfig.receiptList.__sourceName]: typeof receiptList === "undefined" ? ["merchant", "customer"] : receiptList
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
var receipt_default = (props) => {
|
|
57
|
+
const { receipts, receiptList } = props;
|
|
58
|
+
const [receiptsInput, receiptsOther] = (0, import_react.useMemo)(() => {
|
|
59
|
+
const { input, ...other } = receipts;
|
|
60
|
+
return [input, other];
|
|
61
|
+
}, [receipts]);
|
|
62
|
+
const [receiptListInput, receiptListOther] = (0, import_react.useMemo)(() => {
|
|
63
|
+
const { input, ...other } = receiptList;
|
|
64
|
+
return [input, other];
|
|
65
|
+
}, [receipts]);
|
|
66
|
+
const [type, setType] = (0, import_react.useState)(receiptsInput.defaultValue);
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { style: { marginBottom: "12px" }, ...receiptsOther }, /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
import_group.RadioGroup,
|
|
69
|
+
{
|
|
70
|
+
...receiptsInput,
|
|
71
|
+
onChange: (event) => {
|
|
72
|
+
setType(event.target.value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
)), /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_antd.Form.Item,
|
|
77
|
+
{
|
|
78
|
+
...receiptListOther,
|
|
79
|
+
style: type ? { marginLeft: "24px", display: "none" } : { marginLeft: "24px" }
|
|
80
|
+
},
|
|
81
|
+
/* @__PURE__ */ import_react.default.createElement(import_group.CheckboxGroup, { ...receiptListInput })
|
|
82
|
+
));
|
|
83
|
+
};
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
getCommDefaultVal,
|
|
87
|
+
getCommName
|
|
88
|
+
});
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
|
|
301
301
|
action?: "amount" | "deviceList" | "pay" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -64,6 +64,20 @@ var tyro_default = ({
|
|
|
64
64
|
const requestIdRef = (0, import_react.useRef)((custom == null ? void 0 : custom.requestId) || "");
|
|
65
65
|
const unloadRef = (0, import_react.useRef)(false);
|
|
66
66
|
const clearRef = (0, import_react.useRef)();
|
|
67
|
+
const isPrint = (key) => {
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
|
+
if ((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const receiptList = (_d = (_c = deviceRef.current) == null ? void 0 : _c.setting) == null ? void 0 : _d.receiptList;
|
|
73
|
+
if (!Array.isArray(receiptList)) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
if (Array.isArray(receiptList) && receiptList.some((item) => item === key)) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
};
|
|
67
81
|
(0, import_react.useEffect)(() => {
|
|
68
82
|
listRef.current = (custom == null ? void 0 : custom.list) || [];
|
|
69
83
|
}, [custom == null ? void 0 : custom.list]);
|
|
@@ -114,7 +128,7 @@ var tyro_default = ({
|
|
|
114
128
|
);
|
|
115
129
|
requestParams.current = {
|
|
116
130
|
amount: new import_decimal.Decimal(amountRef.current || 0).mul(100).toFixed(0, import_decimal.Decimal.ROUND_HALF_UP),
|
|
117
|
-
// 打印小票 true
|
|
131
|
+
// 打印小票 true 打印到Pisell系统上 false 打印到pos机上
|
|
118
132
|
integratedReceipt: !((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts),
|
|
119
133
|
integrationKey,
|
|
120
134
|
transactionId: numRef.current,
|
|
@@ -244,8 +258,14 @@ var tyro_default = ({
|
|
|
244
258
|
console.log("商家小票 客户端是否打印小票 = ", signatureRequired);
|
|
245
259
|
console.log("商家小票 小票内容 = \n", merchantReceipt);
|
|
246
260
|
const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
|
|
247
|
-
onChange("print", receipt);
|
|
248
261
|
merchantReceiptRef.current = { signatureRequired, merchantReceipt };
|
|
262
|
+
if (signatureRequired) {
|
|
263
|
+
onChange("print", receipt);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (isPrint("merchant")) {
|
|
267
|
+
onChange("print", receipt);
|
|
268
|
+
}
|
|
249
269
|
};
|
|
250
270
|
const statusMessageCallbackImpl = (message) => {
|
|
251
271
|
var _a;
|
|
@@ -381,7 +401,6 @@ var tyro_default = ({
|
|
|
381
401
|
})
|
|
382
402
|
);
|
|
383
403
|
clearRef.current = setTimeout(() => {
|
|
384
|
-
var _a2;
|
|
385
404
|
const params = (0, import_helper.getPayParams)(
|
|
386
405
|
{
|
|
387
406
|
mode: modeRef.current,
|
|
@@ -398,14 +417,16 @@ var tyro_default = ({
|
|
|
398
417
|
);
|
|
399
418
|
onChange("success", {
|
|
400
419
|
...params,
|
|
401
|
-
receipt: (
|
|
420
|
+
receipt: isPrint("customer") ? receipt : []
|
|
402
421
|
});
|
|
403
422
|
}, 1e3);
|
|
404
423
|
return;
|
|
405
424
|
} else {
|
|
406
425
|
const current = ((_b = deviceRef.current) == null ? void 0 : _b.setting.receipts) ? [] : receipt;
|
|
407
426
|
if (current.length > 0) {
|
|
408
|
-
|
|
427
|
+
if (isPrint("customer")) {
|
|
428
|
+
onChange("print", receipt);
|
|
429
|
+
}
|
|
409
430
|
}
|
|
410
431
|
}
|
|
411
432
|
if (response.result === "UNKNOWN") {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.194",
|
|
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/materials": "3.0.55",
|
|
63
|
-
"@pisell/icon": "0.0.11",
|
|
64
62
|
"@pisell/utils": "1.0.42",
|
|
65
|
-
"@pisell/date-picker": "1.0.100"
|
|
63
|
+
"@pisell/date-picker": "1.0.100",
|
|
64
|
+
"@pisell/icon": "0.0.11",
|
|
65
|
+
"@pisell/materials": "3.0.55"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|