@pisell/private-materials 3.0.198 → 3.0.199
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/addons/model.d.ts +1 -1
- package/es/components/booking/components/customSelect/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +2 -6
- package/es/components/booking/components/footer/amount.js +22 -45
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +32 -218
- package/es/components/booking/info/addServiceVariant/index.js +1 -8
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
- package/es/components/booking/info/clientVariant/vertical/index.js +4 -33
- package/es/components/booking/info/main.js +8 -20
- package/es/components/booking/info/model.js +0 -3
- package/es/components/booking/info/pet/index.js +5 -54
- package/es/components/booking/info/service/addService/index.js +20 -127
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -11
- package/es/components/booking/info/service/addService/utils.js +24 -49
- package/es/components/booking/info/service/editService/index.js +41 -232
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/utils.d.ts +0 -9
- package/es/components/booking/info/utils.js +0 -13
- package/es/components/booking/locales.d.ts +0 -60
- package/es/components/booking/locales.js +3 -75
- package/es/components/booking/model.d.ts +1 -4
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +22 -126
- 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/helper.d.ts +1 -0
- package/es/components/eftposPay/helper.js +14 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/tyro/index.js +51 -20
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/lib/components/booking/addons/model.d.ts +1 -1
- package/lib/components/booking/components/customSelect/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +2 -6
- package/lib/components/booking/components/footer/amount.js +8 -26
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +31 -144
- package/lib/components/booking/info/addServiceVariant/index.js +0 -5
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
- package/lib/components/booking/info/clientVariant/vertical/index.js +10 -36
- package/lib/components/booking/info/main.js +4 -11
- package/lib/components/booking/info/model.js +0 -3
- package/lib/components/booking/info/pet/index.js +25 -61
- package/lib/components/booking/info/service/addService/index.js +28 -95
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -11
- package/lib/components/booking/info/service/addService/utils.js +10 -31
- package/lib/components/booking/info/service/editService/index.js +122 -271
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/utils.d.ts +0 -9
- package/lib/components/booking/info/utils.js +0 -6
- package/lib/components/booking/locales.d.ts +0 -60
- package/lib/components/booking/locales.js +3 -63
- package/lib/components/booking/model.d.ts +1 -4
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +15 -79
- 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/helper.d.ts +1 -0
- package/lib/components/eftposPay/helper.js +21 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +36 -7
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +4 -4
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/info/dateRange/index.d.ts +0 -5
- package/es/components/booking/info/dateRange/index.js +0 -98
- package/es/components/booking/info/dateRange/index.less +0 -21
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/es/components/booking/info/pet/ChangePetModal/index.js +0 -119
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -158
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
- package/es/components/booking/info/service2/index.d.ts +0 -3
- package/es/components/booking/info/service2/index.js +0 -58
- package/es/components/booking/info/service2/status.d.ts +0 -31
- package/es/components/booking/info/service2/status.js +0 -78
- package/es/components/booking/info/service2/utils.d.ts +0 -145
- package/es/components/booking/info/service2/utils.js +0 -436
- package/es/components/booking/materiels/holder/index.d.ts +0 -7
- package/es/components/booking/materiels/holder/index.js +0 -51
- package/es/components/shoppingCart/Provider.d.ts +0 -3
- package/es/components/shoppingCart/Provider.js +0 -86
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +0 -96
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/index.js +0 -72
- package/es/components/shoppingCart/components/Cart/index.less +0 -68
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Empty/index.js +0 -14
- package/es/components/shoppingCart/components/Empty/index.less +0 -19
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Render/index.js +0 -68
- package/es/components/shoppingCart/components/Render/index.less +0 -2
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useAddService.js +0 -23
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useClearCart.js +0 -54
- package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useContext.js +0 -5
- package/es/components/shoppingCart/index.d.ts +0 -4
- package/es/components/shoppingCart/index.js +0 -24
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/locales.js +0 -38
- package/es/components/shoppingCart/mock.d.ts +0 -40
- package/es/components/shoppingCart/mock.js +0 -40
- package/es/components/shoppingCart/status.d.ts +0 -2
- package/es/components/shoppingCart/status.js +0 -22
- package/es/components/shoppingCart/type.d.ts +0 -39
- package/es/components/shoppingCart/type.js +0 -1
- package/es/components/shoppingCart/utils.d.ts +0 -63
- package/es/components/shoppingCart/utils.js +0 -119
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -5
- package/lib/components/booking/info/dateRange/index.js +0 -111
- package/lib/components/booking/info/dateRange/index.less +0 -21
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -111
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -113
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
- package/lib/components/booking/info/service2/index.d.ts +0 -3
- package/lib/components/booking/info/service2/index.js +0 -75
- package/lib/components/booking/info/service2/status.d.ts +0 -31
- package/lib/components/booking/info/service2/status.js +0 -81
- package/lib/components/booking/info/service2/utils.d.ts +0 -145
- package/lib/components/booking/info/service2/utils.js +0 -320
- package/lib/components/booking/materiels/holder/index.d.ts +0 -7
- package/lib/components/booking/materiels/holder/index.js +0 -65
- package/lib/components/shoppingCart/Provider.d.ts +0 -3
- package/lib/components/shoppingCart/Provider.js +0 -110
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/Product.js +0 -89
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/index.js +0 -77
- package/lib/components/shoppingCart/components/Cart/index.less +0 -68
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Empty/index.js +0 -43
- package/lib/components/shoppingCart/components/Empty/index.less +0 -19
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Render/index.js +0 -79
- package/lib/components/shoppingCart/components/Render/index.less +0 -2
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -116
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useClearCart.js +0 -71
- package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useContext.js +0 -31
- package/lib/components/shoppingCart/index.d.ts +0 -4
- package/lib/components/shoppingCart/index.js +0 -60
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/locales.js +0 -56
- package/lib/components/shoppingCart/mock.d.ts +0 -40
- package/lib/components/shoppingCart/mock.js +0 -76
- package/lib/components/shoppingCart/status.d.ts +0 -2
- package/lib/components/shoppingCart/status.js +0 -60
- package/lib/components/shoppingCart/type.d.ts +0 -39
- package/lib/components/shoppingCart/type.js +0 -17
- package/lib/components/shoppingCart/utils.d.ts +0 -63
- package/lib/components/shoppingCart/utils.js +0 -92
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -9,6 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import { Input, InputNumber, Checkbox, Radio, Cascader, DatePicker, Select, Slider, Switch, TimePicker, Transfer, TreeSelect, Upload, Form } from 'antd';
|
|
10
10
|
import { CheckboxGroup, RadioGroup } from "../group";
|
|
11
11
|
import Surcharge, { getCommName, getCommDefaultVal } from "../surcharge";
|
|
12
|
+
import Receipt, { getCommName as getCommNameReceipt, getCommDefaultVal as getCommDefaultValReceipt } from "../receipt";
|
|
12
13
|
import DeviceList from "../deviceList";
|
|
13
14
|
|
|
14
15
|
// 通用表单配置
|
|
@@ -32,7 +33,8 @@ var Mapping = {
|
|
|
32
33
|
};
|
|
33
34
|
var CustomMapping = {
|
|
34
35
|
Surcharge: Surcharge,
|
|
35
|
-
DeviceList: DeviceList
|
|
36
|
+
DeviceList: DeviceList,
|
|
37
|
+
Receipt: Receipt
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -53,13 +55,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
|
|
|
53
55
|
return /*#__PURE__*/React.createElement(CustomFormItem, {
|
|
54
56
|
formItemList: item.children,
|
|
55
57
|
onChange: onChange,
|
|
56
|
-
key: item.name ? item.name
|
|
58
|
+
key: item.name ? "".concat(item.name).concat(level) : "".concat(Component).concat(index).concat(level),
|
|
57
59
|
level: level + 1
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
if (_typeof(Component) === 'object') {
|
|
61
63
|
return /*#__PURE__*/React.createElement(Component, _extends({}, item, {
|
|
62
|
-
key: item.name
|
|
64
|
+
key: "".concat(item.name).concat(level)
|
|
63
65
|
}));
|
|
64
66
|
}
|
|
65
67
|
if (Mapping[Component]) {
|
|
@@ -67,7 +69,7 @@ var CustomFormItem = function CustomFormItem(_ref) {
|
|
|
67
69
|
var input = item.input,
|
|
68
70
|
formItemProps = _objectWithoutProperties(item, _excluded2);
|
|
69
71
|
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, formItemProps, {
|
|
70
|
-
key: item.name
|
|
72
|
+
key: "".concat(item.name).concat(level)
|
|
71
73
|
}), /*#__PURE__*/React.createElement(Comm, input));
|
|
72
74
|
}
|
|
73
75
|
if (Mapping[Component]) {
|
|
@@ -75,13 +77,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
|
|
|
75
77
|
var _input = item.input,
|
|
76
78
|
_formItemProps = _objectWithoutProperties(item, _excluded3);
|
|
77
79
|
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, _formItemProps, {
|
|
78
|
-
key: item.name
|
|
80
|
+
key: "".concat(item.name).concat(level)
|
|
79
81
|
}), /*#__PURE__*/React.createElement(_Comm, _input));
|
|
80
82
|
}
|
|
81
83
|
if (CustomMapping[Component]) {
|
|
82
84
|
var _Comm2 = CustomMapping[Component];
|
|
83
85
|
return /*#__PURE__*/React.createElement(_Comm2, _extends({}, item, {
|
|
84
|
-
key: item.name
|
|
86
|
+
key: "".concat(item.name).concat(level)
|
|
85
87
|
}));
|
|
86
88
|
}
|
|
87
89
|
throw TypeError("pos\u7269\u6599\u5E93 \u8F93\u5165\u7EC4\u4EF6\u7C7B\u578B ".concat(Component, " \u65E0\u6CD5\u6620\u5C04,\u8BF7\u6B63\u786E\u4F20\u5165\u7EC4\u4EF6\u7C7B\u578B"));
|
|
@@ -92,5 +94,9 @@ export var helpMapping = {
|
|
|
92
94
|
Surcharge: {
|
|
93
95
|
getCommName: getCommName,
|
|
94
96
|
getCommDefaultVal: getCommDefaultVal
|
|
97
|
+
},
|
|
98
|
+
Receipt: {
|
|
99
|
+
getCommName: getCommNameReceipt,
|
|
100
|
+
getCommDefaultVal: getCommDefaultValReceipt
|
|
95
101
|
}
|
|
96
102
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RadioGroupProps } from 'antd';
|
|
3
3
|
export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
|
|
4
|
-
export declare const RadioGroup: ({ direction, options,
|
|
4
|
+
export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
|
|
5
5
|
direction?: "vertical" | undefined;
|
|
6
|
-
component: string;
|
|
7
6
|
}) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["direction", "options"],
|
|
2
2
|
_excluded2 = ["label", "value"],
|
|
3
|
-
_excluded3 = ["direction", "options"
|
|
3
|
+
_excluded3 = ["direction", "options"],
|
|
4
4
|
_excluded4 = ["label", "value"];
|
|
5
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
6
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
@@ -38,7 +38,6 @@ export var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
38
38
|
export var RadioGroup = function RadioGroup(_ref2) {
|
|
39
39
|
var direction = _ref2.direction,
|
|
40
40
|
options = _ref2.options,
|
|
41
|
-
component = _ref2.component,
|
|
42
41
|
props = _objectWithoutProperties(_ref2, _excluded3);
|
|
43
42
|
if (direction === 'vertical') {
|
|
44
43
|
return /*#__PURE__*/React.createElement(Radio.Group, props, /*#__PURE__*/React.createElement(Space, {
|
|
@@ -24,8 +24,8 @@ import Drawer from "../booking/components/drawer";
|
|
|
24
24
|
import Log from "./log";
|
|
25
25
|
import localeTexts from "./locales";
|
|
26
26
|
import { usePairTerminalo } from "./hooks";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
27
|
+
import DeviceIcon from "./icon/apiKey";
|
|
28
|
+
import ApiKeyIcon from "./icon/device";
|
|
29
29
|
import { Eftpos, getCommByFields, DeviceEnum, getDefaultValue } from "./const";
|
|
30
30
|
import "./index.less";
|
|
31
31
|
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @title: 自定义组件设置
|
|
4
|
+
* @description: 自定义组件设置
|
|
5
|
+
* @param {any} commConfig 当前组件配置
|
|
6
|
+
* @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: hongbing.wang
|
|
9
|
+
* @Date: 2024-08-20 11:10
|
|
10
|
+
*/
|
|
11
|
+
export declare const getCommName: (commConfig: any, name: string[]) => any;
|
|
12
|
+
/**
|
|
13
|
+
* @title: 自定义组件结果设置
|
|
14
|
+
* @description: 自定义组件结果设置
|
|
15
|
+
* @param {any} commConfig 当前组件配置
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: hongbing.wang
|
|
18
|
+
* @Date: 2024-08-20 11:11
|
|
19
|
+
*/
|
|
20
|
+
export declare const getCommDefaultVal: (commConfig: any) => {
|
|
21
|
+
[x: number]: any;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: (props: any) => React.JSX.Element;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["input"],
|
|
3
|
+
_excluded2 = ["input"];
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
+
import React, { useMemo, useState } from 'react';
|
|
21
|
+
import { Form } from 'antd';
|
|
22
|
+
import { CheckboxGroup, RadioGroup } from "../group";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title: 自定义组件设置
|
|
26
|
+
* @description: 自定义组件设置
|
|
27
|
+
* @param {any} commConfig 当前组件配置
|
|
28
|
+
* @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
|
|
29
|
+
* @return {*}
|
|
30
|
+
* @Author: hongbing.wang
|
|
31
|
+
* @Date: 2024-08-20 11:10
|
|
32
|
+
*/
|
|
33
|
+
export var getCommName = function getCommName(commConfig, name) {
|
|
34
|
+
commConfig.receipts.__sourceName = commConfig.receipts.name;
|
|
35
|
+
commConfig.receiptList.__sourceName = commConfig.receiptList.name;
|
|
36
|
+
commConfig.receipts.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receipts.name]) : commConfig.receipts.name;
|
|
37
|
+
commConfig.receiptList.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receiptList.name]) : commConfig.receiptList.name;
|
|
38
|
+
return commConfig;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @title: 自定义组件结果设置
|
|
43
|
+
* @description: 自定义组件结果设置
|
|
44
|
+
* @param {any} commConfig 当前组件配置
|
|
45
|
+
* @return {*}
|
|
46
|
+
* @Author: hongbing.wang
|
|
47
|
+
* @Date: 2024-08-20 11:11
|
|
48
|
+
*/
|
|
49
|
+
export var getCommDefaultVal = function getCommDefaultVal(commConfig) {
|
|
50
|
+
var _ref;
|
|
51
|
+
var receipts = commConfig.receipts.input.defaultValue;
|
|
52
|
+
var receiptList = commConfig.receiptList.input.defaultValue;
|
|
53
|
+
console.log('receipts = ', receipts);
|
|
54
|
+
return _ref = {}, _defineProperty(_ref, commConfig.receipts.__sourceName, typeof receipts === 'undefined' ? true : receipts), _defineProperty(_ref, commConfig.receiptList.__sourceName, typeof receiptList === 'undefined' ? ['merchant', 'customer'] : receiptList), _ref;
|
|
55
|
+
};
|
|
56
|
+
export default (function (props) {
|
|
57
|
+
var receipts = props.receipts,
|
|
58
|
+
receiptList = props.receiptList;
|
|
59
|
+
// const {input:receiptsInput,...receiptsOther} = receipts
|
|
60
|
+
var _useMemo = useMemo(function () {
|
|
61
|
+
var input = receipts.input,
|
|
62
|
+
other = _objectWithoutProperties(receipts, _excluded);
|
|
63
|
+
return [input, other];
|
|
64
|
+
}, [receipts]),
|
|
65
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
66
|
+
receiptsInput = _useMemo2[0],
|
|
67
|
+
receiptsOther = _useMemo2[1];
|
|
68
|
+
var _useMemo3 = useMemo(function () {
|
|
69
|
+
var input = receiptList.input,
|
|
70
|
+
other = _objectWithoutProperties(receiptList, _excluded2);
|
|
71
|
+
return [input, other];
|
|
72
|
+
}, [receipts]),
|
|
73
|
+
_useMemo4 = _slicedToArray(_useMemo3, 2),
|
|
74
|
+
receiptListInput = _useMemo4[0],
|
|
75
|
+
receiptListOther = _useMemo4[1];
|
|
76
|
+
var _useState = useState(receiptsInput.defaultValue),
|
|
77
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
78
|
+
type = _useState2[0],
|
|
79
|
+
setType = _useState2[1];
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
81
|
+
style: {
|
|
82
|
+
marginBottom: '12px'
|
|
83
|
+
}
|
|
84
|
+
}, receiptsOther), /*#__PURE__*/React.createElement(RadioGroup, _extends({}, receiptsInput, {
|
|
85
|
+
onChange: function onChange(event) {
|
|
86
|
+
setType(event.target.value);
|
|
87
|
+
}
|
|
88
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, _extends({}, receiptListOther, {
|
|
89
|
+
style: type ? {
|
|
90
|
+
marginLeft: '24px',
|
|
91
|
+
display: 'none'
|
|
92
|
+
} : {
|
|
93
|
+
marginLeft: '24px'
|
|
94
|
+
}
|
|
95
|
+
}), /*#__PURE__*/React.createElement(CheckboxGroup, receiptListInput)));
|
|
96
|
+
});
|
|
@@ -216,4 +216,18 @@ export function getPayAmonunt(_ref, formatAmount) {
|
|
|
216
216
|
surRateMoney: "".concat(surRateMoney),
|
|
217
217
|
totalUnit: formatAmount(total)
|
|
218
218
|
};
|
|
219
|
+
}
|
|
220
|
+
export function getBrowserVersion() {
|
|
221
|
+
var Sys = {};
|
|
222
|
+
var ua = navigator.userAgent.toLowerCase();
|
|
223
|
+
var s;
|
|
224
|
+
(s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] : (s = ua.match(/msie ([\d\.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/edge\/([\d\.]+)/)) ? Sys.edge = s[1] : (s = ua.match(/firefox\/([\d\.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/(?:opera|opr).([\d\.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/chrome\/([\d\.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/version\/([\d\.]+).*safari/)) ? Sys.safari = s[1] : 0;
|
|
225
|
+
// 根据关系进行判断
|
|
226
|
+
if (Sys.ie) return 'IE: ' + Sys.ie;
|
|
227
|
+
if (Sys.edge) return 'EDGE: ' + Sys.edge;
|
|
228
|
+
if (Sys.firefox) return 'Firefox: ' + Sys.firefox;
|
|
229
|
+
if (Sys.chrome) return 'Chrome: ' + Sys.chrome;
|
|
230
|
+
if (Sys.opera) return 'Opera: ' + Sys.opera;
|
|
231
|
+
if (Sys.safari) return 'Safari: ' + Sys.safari;
|
|
232
|
+
return 'Unkonwn';
|
|
219
233
|
}
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"windcave" | "tyro" | "payo" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -21,7 +21,7 @@ import { Button } from 'antd';
|
|
|
21
21
|
import { useDispatch, useContextData, updateState, updateCustom, updateComponent } from "../store";
|
|
22
22
|
import { ModeEnum, ClientEnum } from "../const";
|
|
23
23
|
import { Decimal } from 'decimal.js';
|
|
24
|
-
import { getUuid, getPayParams } from "../helper";
|
|
24
|
+
import { getUuid, getPayParams, getBrowserVersion } from "../helper";
|
|
25
25
|
import Step from "../component/step/step";
|
|
26
26
|
import { useStoreRef } from "../hooks";
|
|
27
27
|
var Minute = 1000 * 60;
|
|
@@ -68,6 +68,22 @@ export default (function (_ref) {
|
|
|
68
68
|
var requestIdRef = useRef((custom === null || custom === void 0 ? void 0 : custom.requestId) || '');
|
|
69
69
|
var unloadRef = useRef(false);
|
|
70
70
|
var clearRef = useRef();
|
|
71
|
+
var isPrint = function isPrint(key) {
|
|
72
|
+
var _deviceRef$current, _deviceRef$current$se, _deviceRef$current2, _deviceRef$current2$s;
|
|
73
|
+
if ((_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current$se = _deviceRef$current.setting) !== null && _deviceRef$current$se !== void 0 && _deviceRef$current$se.receipts) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
var receiptList = (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : (_deviceRef$current2$s = _deviceRef$current2.setting) === null || _deviceRef$current2$s === void 0 ? void 0 : _deviceRef$current2$s.receiptList;
|
|
77
|
+
if (!Array.isArray(receiptList)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(receiptList) && receiptList.some(function (item) {
|
|
81
|
+
return item === key;
|
|
82
|
+
})) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
};
|
|
71
87
|
useEffect(function () {
|
|
72
88
|
listRef.current = (custom === null || custom === void 0 ? void 0 : custom.list) || [];
|
|
73
89
|
}, [custom === null || custom === void 0 ? void 0 : custom.list]);
|
|
@@ -117,7 +133,7 @@ export default (function (_ref) {
|
|
|
117
133
|
* @Date: 2024-08-19 11:32
|
|
118
134
|
*/
|
|
119
135
|
var refundOrder = function refundOrder() {
|
|
120
|
-
var _deviceRef$
|
|
136
|
+
var _deviceRef$current3, _deviceRef$current3$s, _deviceRef$current4;
|
|
121
137
|
var iClient = iClientRef.current;
|
|
122
138
|
if (!iClient) {
|
|
123
139
|
return;
|
|
@@ -135,12 +151,16 @@ export default (function (_ref) {
|
|
|
135
151
|
}));
|
|
136
152
|
requestParams.current = {
|
|
137
153
|
amount: new Decimal(amountRef.current || 0).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
|
|
138
|
-
// 打印小票 true
|
|
139
|
-
integratedReceipt: !((_deviceRef$
|
|
154
|
+
// 打印小票 true 打印到Pisell系统上 false 打印到pos机上
|
|
155
|
+
integratedReceipt: !((_deviceRef$current3 = deviceRef.current) !== null && _deviceRef$current3 !== void 0 && (_deviceRef$current3$s = _deviceRef$current3.setting) !== null && _deviceRef$current3$s !== void 0 && _deviceRef$current3$s.receipts),
|
|
140
156
|
integrationKey: integrationKey,
|
|
141
157
|
transactionId: numRef.current,
|
|
142
158
|
mid: mid,
|
|
143
|
-
tid: tid
|
|
159
|
+
tid: tid,
|
|
160
|
+
device: JSON.stringify(deviceRef.current),
|
|
161
|
+
isPrintMerchant: isPrint('merchant'),
|
|
162
|
+
isPrintCustomer: isPrint('customer'),
|
|
163
|
+
browserVersion: getBrowserVersion()
|
|
144
164
|
};
|
|
145
165
|
dispatch(updateCustom({
|
|
146
166
|
requestParams: requestParams.current
|
|
@@ -151,7 +171,7 @@ export default (function (_ref) {
|
|
|
151
171
|
api.addTransaction({
|
|
152
172
|
order_id: orderIdRef.current,
|
|
153
173
|
number: numRef.current,
|
|
154
|
-
card_reader_id: (_deviceRef$
|
|
174
|
+
card_reader_id: (_deviceRef$current4 = deviceRef.current) === null || _deviceRef$current4 === void 0 ? void 0 : _deviceRef$current4.id,
|
|
155
175
|
card_reader_type: eftpos,
|
|
156
176
|
amount: requestParams.current.amount,
|
|
157
177
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -183,7 +203,7 @@ export default (function (_ref) {
|
|
|
183
203
|
* @Date: 2024-08-19 11:33
|
|
184
204
|
*/
|
|
185
205
|
var payOrder = function payOrder() {
|
|
186
|
-
var _deviceRef$
|
|
206
|
+
var _deviceRef$current5, _deviceRef$current5$s, _payRef$current, _deviceRef$current6, _deviceRef$current6$s, _deviceRef$current7, _deviceRef$current7$s, _deviceRef$current8;
|
|
187
207
|
var iClient = iClientRef.current;
|
|
188
208
|
if (!iClient) {
|
|
189
209
|
return;
|
|
@@ -199,18 +219,22 @@ export default (function (_ref) {
|
|
|
199
219
|
dispatch(updateState({
|
|
200
220
|
number: numRef.current
|
|
201
221
|
}));
|
|
202
|
-
console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$
|
|
222
|
+
console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : (_deviceRef$current5$s = _deviceRef$current5.setting) === null || _deviceRef$current5$s === void 0 ? void 0 : _deviceRef$current5$s.useOriginSurcharge);
|
|
203
223
|
// (deviceRef.current?.setting as { receipts?: boolean })
|
|
204
224
|
requestParams.current = {
|
|
205
225
|
amount: new Decimal((_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
|
|
206
226
|
// 手续费 true tyro 手续费, false 系统手续费
|
|
207
|
-
enableSurcharge: ((_deviceRef$
|
|
227
|
+
enableSurcharge: ((_deviceRef$current6 = deviceRef.current) === null || _deviceRef$current6 === void 0 ? void 0 : (_deviceRef$current6$s = _deviceRef$current6.setting) === null || _deviceRef$current6$s === void 0 ? void 0 : _deviceRef$current6$s.useOriginSurcharge) || false,
|
|
208
228
|
// 打印小票 true 打印到系统上 false 打印到pos机上
|
|
209
|
-
integratedReceipt: !((_deviceRef$
|
|
229
|
+
integratedReceipt: !((_deviceRef$current7 = deviceRef.current) !== null && _deviceRef$current7 !== void 0 && (_deviceRef$current7$s = _deviceRef$current7.setting) !== null && _deviceRef$current7$s !== void 0 && _deviceRef$current7$s.receipts),
|
|
210
230
|
integrationKey: integrationKey,
|
|
211
231
|
transactionId: numRef.current,
|
|
212
232
|
mid: mid,
|
|
213
|
-
tid: tid
|
|
233
|
+
tid: tid,
|
|
234
|
+
device: JSON.stringify(deviceRef.current),
|
|
235
|
+
isPrintMerchant: isPrint('merchant'),
|
|
236
|
+
isPrintCustomer: isPrint('customer'),
|
|
237
|
+
browserVersion: getBrowserVersion()
|
|
214
238
|
};
|
|
215
239
|
dispatch(updateCustom({
|
|
216
240
|
requestParams: requestParams.current
|
|
@@ -221,7 +245,7 @@ export default (function (_ref) {
|
|
|
221
245
|
api.addTransaction({
|
|
222
246
|
order_id: orderIdRef.current,
|
|
223
247
|
number: numRef.current,
|
|
224
|
-
card_reader_id: (_deviceRef$
|
|
248
|
+
card_reader_id: (_deviceRef$current8 = deviceRef.current) === null || _deviceRef$current8 === void 0 ? void 0 : _deviceRef$current8.id,
|
|
225
249
|
card_reader_type: eftpos,
|
|
226
250
|
amount: requestParams.current.amount,
|
|
227
251
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -284,11 +308,17 @@ export default (function (_ref) {
|
|
|
284
308
|
var receipt = [merchantReceipt].filter(function (item) {
|
|
285
309
|
return typeof item === 'string';
|
|
286
310
|
}).filter(Boolean);
|
|
287
|
-
onChange('print', receipt);
|
|
288
311
|
merchantReceiptRef.current = {
|
|
289
312
|
signatureRequired: signatureRequired,
|
|
290
313
|
merchantReceipt: merchantReceipt
|
|
291
314
|
};
|
|
315
|
+
if (signatureRequired) {
|
|
316
|
+
onChange('print', receipt);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (isPrint('merchant')) {
|
|
320
|
+
onChange('print', receipt);
|
|
321
|
+
}
|
|
292
322
|
};
|
|
293
323
|
|
|
294
324
|
/**
|
|
@@ -373,7 +403,7 @@ export default (function (_ref) {
|
|
|
373
403
|
* @Date: 2024-08-19 11:35
|
|
374
404
|
*/
|
|
375
405
|
var transactionCompleteCallbackImpl = function transactionCompleteCallbackImpl(response) {
|
|
376
|
-
var _deviceRef$
|
|
406
|
+
var _deviceRef$current9;
|
|
377
407
|
setStatus(-1);
|
|
378
408
|
setManually(false);
|
|
379
409
|
console.log('Response = ' + JSON.stringify(response), ', Request = ', JSON.stringify(requestParams.current));
|
|
@@ -385,7 +415,7 @@ export default (function (_ref) {
|
|
|
385
415
|
api.editTransaction(requestIdRef.current, {
|
|
386
416
|
order_id: orderIdRef.current,
|
|
387
417
|
number: numRef.current,
|
|
388
|
-
card_reader_id: (_deviceRef$
|
|
418
|
+
card_reader_id: (_deviceRef$current9 = deviceRef.current) === null || _deviceRef$current9 === void 0 ? void 0 : _deviceRef$current9.id,
|
|
389
419
|
card_reader_type: eftpos,
|
|
390
420
|
amount: requestParams.current.amount,
|
|
391
421
|
action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
|
|
@@ -413,7 +443,6 @@ export default (function (_ref) {
|
|
|
413
443
|
card_reader_surcharge: response.surchargeAmount || 0
|
|
414
444
|
}));
|
|
415
445
|
clearRef.current = setTimeout(function () {
|
|
416
|
-
var _deviceRef$current8;
|
|
417
446
|
var params = getPayParams({
|
|
418
447
|
mode: modeRef.current,
|
|
419
448
|
amount: amountRef.current,
|
|
@@ -426,15 +455,17 @@ export default (function (_ref) {
|
|
|
426
455
|
}
|
|
427
456
|
}, 'success');
|
|
428
457
|
onChange('success', _objectSpread(_objectSpread({}, params), {}, {
|
|
429
|
-
receipt: (
|
|
458
|
+
receipt: isPrint('customer') ? receipt : []
|
|
430
459
|
}));
|
|
431
460
|
}, 1000);
|
|
432
461
|
return;
|
|
433
462
|
} else {
|
|
434
|
-
var _deviceRef$
|
|
435
|
-
var current = (_deviceRef$
|
|
463
|
+
var _deviceRef$current10;
|
|
464
|
+
var current = (_deviceRef$current10 = deviceRef.current) !== null && _deviceRef$current10 !== void 0 && _deviceRef$current10.setting.receipts ? [] : receipt;
|
|
436
465
|
if (current.length > 0) {
|
|
437
|
-
|
|
466
|
+
if (isPrint('customer')) {
|
|
467
|
+
onChange('print', receipt);
|
|
468
|
+
}
|
|
438
469
|
}
|
|
439
470
|
}
|
|
440
471
|
if (response.result === 'UNKNOWN') {
|
package/es/index.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export { default as Eftpos } from './components/eftpos';
|
|
|
22
22
|
export { default as EftposPay } from './components/eftposPay';
|
|
23
23
|
export { default as BookingDashboard } from './components/booking/dashboard';
|
|
24
24
|
export { default as PisellSelectCustomerModal } from './components/pisellSelectCustomerModal';
|
|
25
|
-
export { default as ShoppingCart } from './components/shoppingCart';
|
package/es/index.js
CHANGED
|
@@ -25,5 +25,4 @@ export { default as ToCPay } from "./components/pay/toC";
|
|
|
25
25
|
export { default as Eftpos } from "./components/eftpos";
|
|
26
26
|
export { default as EftposPay } from "./components/eftposPay";
|
|
27
27
|
export { default as BookingDashboard } from "./components/booking/dashboard";
|
|
28
|
-
export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
|
|
29
|
-
export { default as ShoppingCart } from "./components/shoppingCart";
|
|
28
|
+
export { default as PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
4
|
state: FormState;
|
|
5
5
|
} & {
|
|
6
6
|
dispatch: (params: {
|
|
@@ -32,7 +32,6 @@ interface CustomSelectProps {
|
|
|
32
32
|
autoFocus?: boolean;
|
|
33
33
|
showDropDown?: boolean;
|
|
34
34
|
handleOpenModal?: () => void;
|
|
35
|
-
handleDayChange?: (value: any) => void;
|
|
36
35
|
}
|
|
37
36
|
declare const _default: React.ForwardRefExoticComponent<CustomSelectProps & React.RefAttributes<unknown>>;
|
|
38
37
|
export default _default;
|
|
@@ -75,8 +75,7 @@ var CustomSelect = (props, ref) => {
|
|
|
75
75
|
closeCallback,
|
|
76
76
|
autoFocus,
|
|
77
77
|
showDropDown = true,
|
|
78
|
-
handleOpenModal: propsHandleOpenModal
|
|
79
|
-
handleDayChange
|
|
78
|
+
handleOpenModal: propsHandleOpenModal
|
|
80
79
|
} = props;
|
|
81
80
|
const searchRef = (0, import_react.useRef)();
|
|
82
81
|
const [_value, set_value] = (0, import_react.useState)([]);
|
|
@@ -112,7 +111,7 @@ var CustomSelect = (props, ref) => {
|
|
|
112
111
|
}
|
|
113
112
|
closeCallback == null ? void 0 : closeCallback();
|
|
114
113
|
};
|
|
115
|
-
const handleOpenModal = (
|
|
114
|
+
const handleOpenModal = () => {
|
|
116
115
|
if (disabled) {
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
@@ -146,9 +145,6 @@ var CustomSelect = (props, ref) => {
|
|
|
146
145
|
handleViewItem == null ? void 0 : handleViewItem(item);
|
|
147
146
|
};
|
|
148
147
|
const handleRemoveItem = (item) => {
|
|
149
|
-
if (handleDayChange) {
|
|
150
|
-
handleDayChange(item);
|
|
151
|
-
}
|
|
152
148
|
let _arr = (0, import_utils.changeArray)(_value, item, rowKey);
|
|
153
149
|
_onValueChange(_arr);
|
|
154
150
|
set_value(_arr);
|
|
@@ -25,7 +25,6 @@ __export(amount_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(amount_exports);
|
|
26
26
|
var import_utils = require("../../utils");
|
|
27
27
|
var import_utils2 = require("@pisell/utils");
|
|
28
|
-
var import_utils3 = require("../../info/service2/utils");
|
|
29
28
|
var getRelationDetailsTotal = (relation_details) => {
|
|
30
29
|
let total = 0;
|
|
31
30
|
for (let item of relation_details) {
|
|
@@ -39,44 +38,27 @@ var getProductAmount = (state, isEdit) => {
|
|
|
39
38
|
var _a, _b;
|
|
40
39
|
let price = 0;
|
|
41
40
|
let duration = 0;
|
|
42
|
-
const isDay = (0, import_utils3.isDayBooking)(state);
|
|
43
41
|
if (isEdit) {
|
|
44
42
|
if ((state == null ? void 0 : state.service) || (state == null ? void 0 : state.addons)) {
|
|
45
43
|
for (let item of state == null ? void 0 : state.service.value) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
duration += _duration;
|
|
50
|
-
} else {
|
|
51
|
-
price += Number(item._extend.total);
|
|
52
|
-
price += getRelationDetailsTotal(item._extend.relation_details || []);
|
|
53
|
-
duration += import_utils.flexibleObj.getValue(item._extend.duration);
|
|
54
|
-
}
|
|
44
|
+
price += Number(item._extend.total);
|
|
45
|
+
price += getRelationDetailsTotal(item._extend.relation_details || []);
|
|
46
|
+
duration += import_utils.flexibleObj.getValue(item._extend.duration);
|
|
55
47
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
price += Number(item._extend.total) * item._extend.quantity;
|
|
59
|
-
}
|
|
48
|
+
for (let item of state.addons.value) {
|
|
49
|
+
price += Number(item._extend.total) * item._extend.quantity;
|
|
60
50
|
}
|
|
61
51
|
}
|
|
62
52
|
} else {
|
|
63
53
|
price = Number((_a = state.bookingDetail) == null ? void 0 : _a.product_expect_amount);
|
|
64
|
-
|
|
65
|
-
duration = services.reduce((pre, cur) => {
|
|
54
|
+
duration = (((_b = state == null ? void 0 : state.service) == null ? void 0 : _b.value) || []).reduce((pre, cur) => {
|
|
66
55
|
var _a2;
|
|
67
|
-
|
|
68
|
-
if (isDay) {
|
|
69
|
-
const _duration = (0, import_utils3.isAppointment)(cur, state) ? cur._extend.duration : 0;
|
|
70
|
-
current = _duration || 0;
|
|
71
|
-
} else {
|
|
72
|
-
current = import_utils.flexibleObj.getValue(((_a2 = cur._extend) == null ? void 0 : _a2.duration) || 0);
|
|
73
|
-
}
|
|
74
|
-
return pre + current;
|
|
56
|
+
return pre + import_utils.flexibleObj.getValue(((_a2 = cur._extend) == null ? void 0 : _a2.duration) || 0);
|
|
75
57
|
}, 0);
|
|
76
58
|
}
|
|
77
59
|
return {
|
|
78
60
|
price: Number(price),
|
|
79
|
-
duration: (0, import_utils.getDiscountTime)(duration
|
|
61
|
+
duration: (0, import_utils.getDiscountTime)(duration)
|
|
80
62
|
};
|
|
81
63
|
};
|
|
82
64
|
var getProductItemTax = (item, bookingDetail) => {
|