@pisell/private-materials 3.0.199 → 3.0.201
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 +1 -0
- package/es/components/booking/components/customSelect/index.js +6 -2
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/components/footer/amount.js +45 -22
- package/es/components/booking/components/footer/index.js +84 -40
- package/es/components/booking/components/footer/utils.js +243 -32
- package/es/components/booking/info/addServiceVariant/index.js +8 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
- package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
- package/es/components/booking/info/dateRange/index.d.ts +5 -0
- package/es/components/booking/info/dateRange/index.js +98 -0
- package/es/components/booking/info/dateRange/index.less +21 -0
- package/es/components/booking/info/main.js +20 -8
- package/es/components/booking/info/model.js +3 -0
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/es/components/booking/info/pet/ChangePetModal/index.js +119 -0
- package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/es/components/booking/info/pet/index.js +54 -5
- package/es/components/booking/info/service/addService/index.js +142 -22
- package/es/components/booking/info/service/addService/index.less +13 -3
- package/es/components/booking/info/service/addService/utils.d.ts +11 -2
- package/es/components/booking/info/service/addService/utils.js +49 -24
- package/es/components/booking/info/service/editService/index.js +255 -44
- package/es/components/booking/info/service/editService/index.less +18 -13
- package/es/components/booking/info/service2/Lists.d.ts +3 -0
- package/es/components/booking/info/service2/Lists.js +158 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
- package/es/components/booking/info/service2/index.d.ts +3 -0
- package/es/components/booking/info/service2/index.js +58 -0
- package/es/components/booking/info/service2/status.d.ts +31 -0
- package/es/components/booking/info/service2/status.js +78 -0
- package/es/components/booking/info/service2/utils.d.ts +145 -0
- package/es/components/booking/info/service2/utils.js +438 -0
- package/es/components/booking/info/utils.d.ts +9 -0
- package/es/components/booking/info/utils.js +13 -0
- package/es/components/booking/locales.d.ts +60 -0
- package/es/components/booking/locales.js +75 -3
- package/es/components/booking/materiels/holder/index.d.ts +7 -0
- package/es/components/booking/materiels/holder/index.js +51 -0
- package/es/components/booking/model.d.ts +4 -1
- package/es/components/booking/model.js +4 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/utils.d.ts +12 -3
- package/es/components/booking/utils.js +139 -23
- package/es/components/eftpos/form/index.js +6 -12
- package/es/components/eftpos/group/index.d.ts +2 -1
- package/es/components/eftpos/group/index.js +2 -1
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftposPay/helper.d.ts +0 -1
- package/es/components/eftposPay/helper.js +0 -14
- package/es/components/eftposPay/tyro/index.js +20 -51
- package/es/components/shoppingCart/Provider.d.ts +3 -0
- package/es/components/shoppingCart/Provider.js +86 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/Product.js +96 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/index.js +72 -0
- package/es/components/shoppingCart/components/Cart/index.less +68 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Empty/index.js +14 -0
- package/es/components/shoppingCart/components/Empty/index.less +19 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Render/index.js +68 -0
- package/es/components/shoppingCart/components/Render/index.less +2 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useAddService.js +23 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
- package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useContext.js +5 -0
- package/es/components/shoppingCart/index.d.ts +4 -0
- package/es/components/shoppingCart/index.js +24 -0
- package/es/components/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/locales.js +38 -0
- package/es/components/shoppingCart/mock.d.ts +40 -0
- package/es/components/shoppingCart/mock.js +40 -0
- package/es/components/shoppingCart/status.d.ts +2 -0
- package/es/components/shoppingCart/status.js +22 -0
- package/es/components/shoppingCart/type.d.ts +39 -0
- package/es/components/shoppingCart/type.js +1 -0
- package/es/components/shoppingCart/utils.d.ts +63 -0
- package/es/components/shoppingCart/utils.js +119 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +1 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +6 -2
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/components/footer/amount.js +26 -8
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.js +157 -31
- package/lib/components/booking/info/addServiceVariant/index.js +5 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
- package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
- package/lib/components/booking/info/dateRange/index.d.ts +5 -0
- package/lib/components/booking/info/dateRange/index.js +111 -0
- package/lib/components/booking/info/dateRange/index.less +21 -0
- package/lib/components/booking/info/main.js +11 -4
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.js +111 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/lib/components/booking/info/pet/index.js +61 -25
- package/lib/components/booking/info/service/addService/index.js +107 -34
- package/lib/components/booking/info/service/addService/index.less +13 -3
- package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
- package/lib/components/booking/info/service/addService/utils.js +31 -10
- package/lib/components/booking/info/service/editService/index.js +293 -125
- package/lib/components/booking/info/service/editService/index.less +18 -13
- package/lib/components/booking/info/service2/Lists.d.ts +3 -0
- package/lib/components/booking/info/service2/Lists.js +113 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
- package/lib/components/booking/info/service2/index.d.ts +3 -0
- package/lib/components/booking/info/service2/index.js +75 -0
- package/lib/components/booking/info/service2/status.d.ts +31 -0
- package/lib/components/booking/info/service2/status.js +81 -0
- package/lib/components/booking/info/service2/utils.d.ts +145 -0
- package/lib/components/booking/info/service2/utils.js +322 -0
- package/lib/components/booking/info/utils.d.ts +9 -0
- package/lib/components/booking/info/utils.js +6 -0
- package/lib/components/booking/locales.d.ts +60 -0
- package/lib/components/booking/locales.js +63 -3
- package/lib/components/booking/materiels/holder/index.d.ts +7 -0
- package/lib/components/booking/materiels/holder/index.js +65 -0
- package/lib/components/booking/model.d.ts +4 -1
- package/lib/components/booking/model.js +4 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +12 -3
- package/lib/components/booking/utils.js +87 -15
- package/lib/components/eftpos/form/index.js +6 -12
- package/lib/components/eftpos/group/index.d.ts +2 -1
- package/lib/components/eftpos/group/index.js +1 -0
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +0 -1
- package/lib/components/eftposPay/helper.js +0 -21
- package/lib/components/eftposPay/tyro/index.js +7 -36
- package/lib/components/shoppingCart/Provider.d.ts +3 -0
- package/lib/components/shoppingCart/Provider.js +110 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/index.js +77 -0
- package/lib/components/shoppingCart/components/Cart/index.less +68 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Empty/index.js +43 -0
- package/lib/components/shoppingCart/components/Empty/index.less +19 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Render/index.js +79 -0
- package/lib/components/shoppingCart/components/Render/index.less +2 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
- package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useContext.js +31 -0
- package/lib/components/shoppingCart/index.d.ts +4 -0
- package/lib/components/shoppingCart/index.js +60 -0
- package/lib/components/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/locales.js +56 -0
- package/lib/components/shoppingCart/mock.d.ts +40 -0
- package/lib/components/shoppingCart/mock.js +76 -0
- package/lib/components/shoppingCart/status.d.ts +2 -0
- package/lib/components/shoppingCart/status.js +60 -0
- package/lib/components/shoppingCart/type.d.ts +39 -0
- package/lib/components/shoppingCart/type.js +17 -0
- package/lib/components/shoppingCart/utils.d.ts +63 -0
- package/lib/components/shoppingCart/utils.js +92 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/shopping-cart/meta.ts +98 -0
- package/package.json +4 -4
- package/es/components/eftpos/receipt/index.d.ts +0 -24
- package/es/components/eftpos/receipt/index.js +0 -96
- package/lib/components/eftpos/receipt/index.d.ts +0 -24
- package/lib/components/eftpos/receipt/index.js +0 -88
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/shoppingCart/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
formatCartList: () => formatCartList,
|
|
23
|
+
formatService: () => formatService,
|
|
24
|
+
formatState: () => formatState,
|
|
25
|
+
isEmptyStatus: () => isEmptyStatus,
|
|
26
|
+
isProductList: () => isProductList,
|
|
27
|
+
updateProduct: () => updateProduct
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(utils_exports);
|
|
30
|
+
var formatCartList = (state) => {
|
|
31
|
+
const { products, holders } = state;
|
|
32
|
+
return holders == null ? void 0 : holders.map((holder) => {
|
|
33
|
+
return {
|
|
34
|
+
...holder,
|
|
35
|
+
products: products == null ? void 0 : products.filter(
|
|
36
|
+
(product) => {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = product == null ? void 0 : product._extend) == null ? void 0 : _a.holder_id) === (holder == null ? void 0 : holder.key);
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var isEmptyStatus = (state) => {
|
|
45
|
+
const { products, holders, isOpenGroup } = state;
|
|
46
|
+
if (!isOpenGroup && !(products == null ? void 0 : products.length))
|
|
47
|
+
return true;
|
|
48
|
+
if (isOpenGroup && !(holders == null ? void 0 : holders.length))
|
|
49
|
+
return true;
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
var isProductList = (state) => {
|
|
53
|
+
const { holders, isOpenGroup } = state;
|
|
54
|
+
if (isOpenGroup && (holders == null ? void 0 : holders.length))
|
|
55
|
+
return false;
|
|
56
|
+
return true;
|
|
57
|
+
};
|
|
58
|
+
var formatState = (state) => {
|
|
59
|
+
const _default = { ...state };
|
|
60
|
+
const _carts = formatCartList(_default);
|
|
61
|
+
return {
|
|
62
|
+
isEmpty: isEmptyStatus(_default),
|
|
63
|
+
isProductList: isProductList(_default),
|
|
64
|
+
carts: _carts
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
var updateProduct = (state, newProducts) => {
|
|
68
|
+
return {
|
|
69
|
+
products: newProducts,
|
|
70
|
+
carts: formatCartList({ ...state, products: newProducts })
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
var formatService = (service, id) => {
|
|
74
|
+
return service.map((item) => {
|
|
75
|
+
return {
|
|
76
|
+
...item,
|
|
77
|
+
_extend: {
|
|
78
|
+
...item._extend || {},
|
|
79
|
+
holder_id: id
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
formatCartList,
|
|
87
|
+
formatService,
|
|
88
|
+
formatState,
|
|
89
|
+
isEmptyStatus,
|
|
90
|
+
isProductList,
|
|
91
|
+
updateProduct
|
|
92
|
+
});
|
package/lib/index.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ 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/lib/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
ProductExtension: () => import_productExtension.default,
|
|
49
49
|
RuleSetting: () => import_ruleSetting.default,
|
|
50
50
|
Schedules: () => import_schedules.default,
|
|
51
|
+
ShoppingCart: () => import_shoppingCart.default,
|
|
51
52
|
TaxSelect: () => import_taxSelect.default,
|
|
52
53
|
ToCPay: () => import_toC.default,
|
|
53
54
|
VerticalAddService: () => import_addServiceVariant.default,
|
|
@@ -80,6 +81,7 @@ var import_eftpos = __toESM(require("./components/eftpos"));
|
|
|
80
81
|
var import_eftposPay = __toESM(require("./components/eftposPay"));
|
|
81
82
|
var import_dashboard = __toESM(require("./components/booking/dashboard"));
|
|
82
83
|
var import_pisellSelectCustomerModal = __toESM(require("./components/pisellSelectCustomerModal"));
|
|
84
|
+
var import_shoppingCart = __toESM(require("./components/shoppingCart"));
|
|
83
85
|
import_dayjs.default.extend(import_weekday.default);
|
|
84
86
|
import_dayjs.default.extend(import_localeData.default);
|
|
85
87
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -103,6 +105,7 @@ import_dayjs.default.extend(import_localeData.default);
|
|
|
103
105
|
ProductExtension,
|
|
104
106
|
RuleSetting,
|
|
105
107
|
Schedules,
|
|
108
|
+
ShoppingCart,
|
|
106
109
|
TaxSelect,
|
|
107
110
|
ToCPay,
|
|
108
111
|
VerticalAddService,
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';
|
|
2
|
+
|
|
3
|
+
const ShoppingCartMeta: ComponentMetadata = {
|
|
4
|
+
componentName: 'ShoppingCart',
|
|
5
|
+
title: 'ShoppingCart',
|
|
6
|
+
docUrl: '',
|
|
7
|
+
screenshot: '',
|
|
8
|
+
devMode: 'proCode',
|
|
9
|
+
npm: {
|
|
10
|
+
package: '@pisell/private-materials',
|
|
11
|
+
version: '1.0.4',
|
|
12
|
+
exportName: 'ShoppingCart',
|
|
13
|
+
main: 'src/index.ts',
|
|
14
|
+
destructuring: true,
|
|
15
|
+
subName: '',
|
|
16
|
+
},
|
|
17
|
+
configure: {
|
|
18
|
+
props: [
|
|
19
|
+
{
|
|
20
|
+
title: {
|
|
21
|
+
label: {
|
|
22
|
+
type: 'i18n',
|
|
23
|
+
'en-US': '卡片样式',
|
|
24
|
+
'zh-CN': '卡片样式',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
name: 'platform',
|
|
28
|
+
propType: {
|
|
29
|
+
type: "oneOf",
|
|
30
|
+
value: ["shop", "h5"],
|
|
31
|
+
},
|
|
32
|
+
setter: [
|
|
33
|
+
{
|
|
34
|
+
componentName: "RadioGroupSetter",
|
|
35
|
+
props: {
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
title: "管理端",
|
|
39
|
+
value: "shop",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "用户端",
|
|
43
|
+
value: "h5",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
"VariableSetter",
|
|
49
|
+
],
|
|
50
|
+
defaultValue: "shop",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: {
|
|
54
|
+
label: {
|
|
55
|
+
type: 'i18n',
|
|
56
|
+
'en-US': '空数据提示',
|
|
57
|
+
'zh-CN': '空数据提示',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
name: 'emptyText',
|
|
61
|
+
setter: "StringSetter",
|
|
62
|
+
defaultValue: "No services selected",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: {
|
|
66
|
+
label: {
|
|
67
|
+
type: 'i18n',
|
|
68
|
+
'en-US': '是否开启分组',
|
|
69
|
+
'zh-CN': '是否开启分组',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
name: 'isOpenGroup',
|
|
73
|
+
setter: "BoolSetter",
|
|
74
|
+
defaultValue: true,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
supports: {
|
|
78
|
+
style: true,
|
|
79
|
+
events: [],
|
|
80
|
+
},
|
|
81
|
+
component: {},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
const snippets: Snippet[] = [
|
|
85
|
+
{
|
|
86
|
+
title: 'ShoppingCart',
|
|
87
|
+
screenshot: '',
|
|
88
|
+
schema: {
|
|
89
|
+
componentName: 'ShoppingCart',
|
|
90
|
+
props: {},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
export default {
|
|
96
|
+
...ShoppingCartMeta,
|
|
97
|
+
snippets,
|
|
98
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.201",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/
|
|
64
|
-
"@pisell/date-picker": "
|
|
65
|
-
"@pisell/
|
|
63
|
+
"@pisell/icon": "0.0.11",
|
|
64
|
+
"@pisell/date-picker": "3.0.1",
|
|
65
|
+
"@pisell/materials": "3.0.61"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,88 +0,0 @@
|
|
|
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
|
-
});
|