@pisell/private-materials 3.0.203 → 3.0.205
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 +27 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +33 -18
- 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 -46
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +35 -266
- package/es/components/booking/forms/model.d.ts +1 -1
- 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 +9 -124
- package/es/components/booking/info/main.js +15 -28
- 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 +96 -187
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -12
- package/es/components/booking/info/service/addService/utils.js +26 -103
- package/es/components/booking/info/service/editService/index.js +132 -435
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/service/serve.d.ts +0 -10
- package/es/components/booking/info/service/serve.js +0 -28
- package/es/components/booking/info/utils.d.ts +0 -20
- package/es/components/booking/info/utils.js +0 -37
- package/es/components/booking/locales.d.ts +0 -66
- package/es/components/booking/locales.js +3 -81
- package/es/components/booking/model.d.ts +1 -5
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +26 -143
- 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/hooks.d.ts +4 -4
- 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/app.d.ts +11 -0
- package/es/components/eftposPay/app.js +173 -0
- package/es/components/eftposPay/component/fail/failCustom.js +1 -0
- package/es/components/eftposPay/component/fail/index.js +1 -0
- package/es/components/eftposPay/component/manual/index.js +4 -1
- package/es/components/eftposPay/component/step/index.d.ts +6 -6
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +27 -1
- package/es/components/eftposPay/const.js +22 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/device.js +2 -2
- package/es/components/eftposPay/helper.d.ts +6 -0
- package/es/components/eftposPay/helper.js +24 -4
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +22 -16
- package/es/components/eftposPay/index.d.ts +1 -1
- package/es/components/eftposPay/index.js +130 -179
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +15 -0
- package/es/components/eftposPay/payo/config.js +20 -8
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +10 -0
- package/es/components/eftposPay/tip.js +177 -0
- package/es/components/eftposPay/tip.less +9 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/es/components/eftposPay/tyro/index.js +55 -22
- package/es/components/eftposPay/windcave/helper.d.ts +1 -1
- package/es/components/eftposPay/windcave/windcave.js +17 -6
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- 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 -27
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +35 -161
- package/lib/components/booking/forms/model.d.ts +1 -1
- 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 +11 -87
- package/lib/components/booking/info/main.js +9 -17
- 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 +84 -115
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
- package/lib/components/booking/info/service/addService/utils.js +10 -58
- package/lib/components/booking/info/service/editService/index.js +182 -425
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/service/serve.d.ts +0 -10
- package/lib/components/booking/info/service/serve.js +2 -7
- package/lib/components/booking/info/utils.d.ts +0 -20
- package/lib/components/booking/info/utils.js +0 -41
- package/lib/components/booking/locales.d.ts +0 -66
- package/lib/components/booking/locales.js +3 -69
- package/lib/components/booking/model.d.ts +1 -5
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +18 -89
- 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/hooks.d.ts +4 -4
- 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/app.d.ts +11 -0
- package/lib/components/eftposPay/app.js +166 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
- package/lib/components/eftposPay/component/fail/index.js +1 -1
- package/lib/components/eftposPay/component/manual/index.js +19 -5
- package/lib/components/eftposPay/component/step/index.d.ts +6 -6
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +27 -1
- package/lib/components/eftposPay/const.js +18 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/device.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +6 -0
- package/lib/components/eftposPay/helper.js +29 -4
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +8 -2
- package/lib/components/eftposPay/index.d.ts +1 -1
- package/lib/components/eftposPay/index.js +106 -144
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +15 -0
- package/lib/components/eftposPay/payo/config.js +33 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +10 -0
- package/lib/components/eftposPay/tip.js +159 -0
- package/lib/components/eftposPay/tip.less +9 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/lib/components/eftposPay/tyro/index.js +40 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
- package/lib/components/eftposPay/windcave/windcave.js +29 -6
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +5 -5
- 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/Provider.d.ts +0 -0
- package/es/components/booking/info/Provider.js +0 -54
- 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 -134
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
- package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
- package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
- package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceManager/index.js +0 -277
- package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/es/components/booking/info/service/serviceManager/utils.js +0 -0
- package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/es/components/booking/info/service2/Group/utils.js +0 -146
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -152
- 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 -6
- package/es/components/booking/info/service2/index.js +0 -57
- 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 -237
- package/es/components/booking/info/service2/utils.js +0 -1064
- 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 -68
- 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 -69
- 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 -132
- 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 -59
- 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 -116
- 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/Provider.d.ts +0 -0
- package/lib/components/booking/info/Provider.js +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 -121
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
- package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
- package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceManager/index.js +0 -207
- package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
- package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/lib/components/booking/info/service2/Group/utils.js +0 -142
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -115
- 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 -6
- 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 -237
- package/lib/components/booking/info/service2/utils.js +0 -678
- 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 -73
- 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 -75
- 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 -124
- 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 -66
- 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 -86
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -1,65 +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/booking/materiels/holder/index.tsx
|
|
30
|
-
var holder_exports = {};
|
|
31
|
-
__export(holder_exports, {
|
|
32
|
-
default: () => holder_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(holder_exports);
|
|
35
|
-
var import_antd = require("antd");
|
|
36
|
-
var import_model = require("../../info/model");
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
|
-
var import_useSelectPet = __toESM(require("../../info/service2/hooks/useSelectPet"));
|
|
39
|
-
var Holder = (props) => {
|
|
40
|
-
var _a;
|
|
41
|
-
const { selectProps, ...resetProps } = props;
|
|
42
|
-
const { state } = (0, import_react.useContext)(import_model.Context);
|
|
43
|
-
const { holderLists } = (0, import_useSelectPet.default)(state);
|
|
44
|
-
const holders = (0, import_react.useMemo)(() => {
|
|
45
|
-
const lists = holderLists == null ? void 0 : holderLists.filter((d) => (d == null ? void 0 : d.id) > 0);
|
|
46
|
-
if (!(lists == null ? void 0 : lists.length))
|
|
47
|
-
return [];
|
|
48
|
-
return lists.map((d) => {
|
|
49
|
-
return {
|
|
50
|
-
value: d == null ? void 0 : d.id,
|
|
51
|
-
label: d == null ? void 0 : d.main_field
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
}, [(_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.value]);
|
|
55
|
-
const renderOptions = (0, import_react.useCallback)(
|
|
56
|
-
(array, value = "value", label = "label") => {
|
|
57
|
-
return array.map((d) => {
|
|
58
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d[value], key: d[value], disabled: d.disabled }, d[label]);
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
[]
|
|
62
|
-
);
|
|
63
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, renderOptions(holders));
|
|
64
|
-
};
|
|
65
|
-
var holder_default = Holder;
|
|
@@ -1,110 +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/shoppingCart/Provider.tsx
|
|
30
|
-
var Provider_exports = {};
|
|
31
|
-
__export(Provider_exports, {
|
|
32
|
-
CartContext: () => CartContext,
|
|
33
|
-
CartProvider: () => CartProvider
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(Provider_exports);
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_status = require("./status");
|
|
38
|
-
var import_utils = require("./utils");
|
|
39
|
-
var CartContext = (0, import_react.createContext)({});
|
|
40
|
-
var CartProvider = ({
|
|
41
|
-
children,
|
|
42
|
-
props,
|
|
43
|
-
onCard,
|
|
44
|
-
onChange,
|
|
45
|
-
onAddProduct,
|
|
46
|
-
onActiveKey
|
|
47
|
-
}) => {
|
|
48
|
-
const defaultState = { ...import_status.defaultData, ...props };
|
|
49
|
-
const [state, setState] = (0, import_react.useState)(defaultState);
|
|
50
|
-
const updateState = (newState) => {
|
|
51
|
-
console.log(newState, "wh_new");
|
|
52
|
-
setState((prevState) => {
|
|
53
|
-
return {
|
|
54
|
-
...prevState,
|
|
55
|
-
...newState
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
(0, import_react.useEffect)(() => {
|
|
60
|
-
const _isOpenGroup = props == null ? void 0 : props.hasOwnProperty("isOpenGroup");
|
|
61
|
-
let newState = {};
|
|
62
|
-
if (props == null ? void 0 : props.platform) {
|
|
63
|
-
newState["platform"] = props == null ? void 0 : props.platform;
|
|
64
|
-
}
|
|
65
|
-
if (_isOpenGroup) {
|
|
66
|
-
newState["isOpenGroup"] = props == null ? void 0 : props.isOpenGroup;
|
|
67
|
-
}
|
|
68
|
-
if (props == null ? void 0 : props.emptyText) {
|
|
69
|
-
newState["emptyText"] = props == null ? void 0 : props.emptyText;
|
|
70
|
-
}
|
|
71
|
-
if (props == null ? void 0 : props.productParams) {
|
|
72
|
-
newState = {
|
|
73
|
-
...newState,
|
|
74
|
-
...props == null ? void 0 : props.productParams
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
if (props == null ? void 0 : props.collapseParams) {
|
|
78
|
-
newState["collapseParams"] = props == null ? void 0 : props.collapseParams;
|
|
79
|
-
}
|
|
80
|
-
const params = { ...defaultState, ...newState };
|
|
81
|
-
const result = { ...params, ...(0, import_utils.formatState)(params) };
|
|
82
|
-
console.log(result, params, "result");
|
|
83
|
-
setState(result);
|
|
84
|
-
}, [
|
|
85
|
-
props == null ? void 0 : props.platform,
|
|
86
|
-
props == null ? void 0 : props.isOpenGroup,
|
|
87
|
-
props == null ? void 0 : props.emptyText,
|
|
88
|
-
props == null ? void 0 : props.productParams,
|
|
89
|
-
props == null ? void 0 : props.collapseParams
|
|
90
|
-
]);
|
|
91
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
92
|
-
CartContext.Provider,
|
|
93
|
-
{
|
|
94
|
-
value: {
|
|
95
|
-
state,
|
|
96
|
-
updateState,
|
|
97
|
-
onCard,
|
|
98
|
-
onChange,
|
|
99
|
-
onAddProduct,
|
|
100
|
-
onActiveKey
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
children
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
107
|
-
0 && (module.exports = {
|
|
108
|
-
CartContext,
|
|
109
|
-
CartProvider
|
|
110
|
-
});
|
|
@@ -1,73 +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/shoppingCart/components/Cart/Product.tsx
|
|
30
|
-
var Product_exports = {};
|
|
31
|
-
__export(Product_exports, {
|
|
32
|
-
default: () => Product_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Product_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_materials = require("@pisell/materials");
|
|
37
|
-
var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
|
|
38
|
-
var import_useContext = require("../../hooks/useContext");
|
|
39
|
-
var import_useAddService = __toESM(require("../../hooks/useAddService"));
|
|
40
|
-
var Product = (props) => {
|
|
41
|
-
const { id, lists } = props;
|
|
42
|
-
const { state, onAction, onChange } = (0, import_useContext.useContext)();
|
|
43
|
-
const { disabledEdit, isShowPackageNote, isShowNote, hideAddBtn } = state;
|
|
44
|
-
const clearCart = (0, import_useClearCart.default)(id);
|
|
45
|
-
const handleChange = (item, type, other) => {
|
|
46
|
-
if (disabledEdit)
|
|
47
|
-
return;
|
|
48
|
-
onChange(item, type, other);
|
|
49
|
-
};
|
|
50
|
-
const productParams = (0, import_react.useMemo)(() => {
|
|
51
|
-
return {
|
|
52
|
-
isShowNote,
|
|
53
|
-
isShowPackageNote,
|
|
54
|
-
disabledEdit
|
|
55
|
-
};
|
|
56
|
-
}, [isShowNote, isShowPackageNote, disabledEdit]);
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-content" }, clearCart, lists == null ? void 0 : lists.map((item) => {
|
|
58
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
-
import_materials.ProductCard,
|
|
60
|
-
{
|
|
61
|
-
key: item._id,
|
|
62
|
-
dataSource: item,
|
|
63
|
-
onAction: (e) => onAction == null ? void 0 : onAction(e),
|
|
64
|
-
onDelete: (e) => handleChange(e, "delete"),
|
|
65
|
-
onNote: (e) => handleChange(e, "note", { note: e.note }),
|
|
66
|
-
onLike: (e) => handleChange(e, "like", { like_status: e.like_status }),
|
|
67
|
-
onCard: (e) => handleChange == null ? void 0 : handleChange(e, "view"),
|
|
68
|
-
...productParams
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}), !hideAddBtn ? (0, import_useAddService.default)(id, "more") : null);
|
|
72
|
-
};
|
|
73
|
-
var Product_default = Product;
|
|
@@ -1,77 +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/shoppingCart/components/Cart/index.tsx
|
|
30
|
-
var Cart_exports = {};
|
|
31
|
-
__export(Cart_exports, {
|
|
32
|
-
default: () => Cart_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Cart_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_classnames = __toESM(require("classnames"));
|
|
37
|
-
var import_materials = require("@pisell/materials");
|
|
38
|
-
var import_utils = require("@pisell/utils");
|
|
39
|
-
var import_Empty = __toESM(require("../Empty"));
|
|
40
|
-
var import_locales = __toESM(require("../../locales"));
|
|
41
|
-
var import_useContext = require("../../hooks/useContext");
|
|
42
|
-
var import_Product = __toESM(require("./Product"));
|
|
43
|
-
var import_index = require("./index.less");
|
|
44
|
-
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
45
|
-
var Cart = () => {
|
|
46
|
-
const { state, updateState, onActiveKey } = (0, import_useContext.useContext)();
|
|
47
|
-
const { platform, carts, isProductList, collapseParams } = state;
|
|
48
|
-
const cartsMap = (0, import_react.useMemo)(() => {
|
|
49
|
-
return carts == null ? void 0 : carts.map((item) => {
|
|
50
|
-
var _a, _b;
|
|
51
|
-
return {
|
|
52
|
-
...item,
|
|
53
|
-
label: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-label" }, `${item == null ? void 0 : item.label} ${import_utils.locales.getText(
|
|
54
|
-
"pisell2.text.shopping-cart.item"
|
|
55
|
-
)((_a = item == null ? void 0 : item.products) == null ? void 0 : _a.length)}`),
|
|
56
|
-
children: ((_b = item == null ? void 0 : item.products) == null ? void 0 : _b.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(import_Product.default, { id: item == null ? void 0 : item.key, lists: item == null ? void 0 : item.products }) : /* @__PURE__ */ import_react.default.createElement(import_Empty.default, { id: item == null ? void 0 : item.key }),
|
|
57
|
-
showArrow: platform === "shop"
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
}, [carts, platform]);
|
|
61
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__shopping-cart") }, isProductList ? /* @__PURE__ */ import_react.default.createElement(import_Product.default, { id: void 0, lists: state == null ? void 0 : state.products }) : /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
-
import_materials.Collapse,
|
|
63
|
-
{
|
|
64
|
-
items: cartsMap,
|
|
65
|
-
showHeader: true,
|
|
66
|
-
panelBackground: "#ffffff",
|
|
67
|
-
collapsible: platform !== "shop" ? "disabled" : "-",
|
|
68
|
-
accordion: platform === "shop",
|
|
69
|
-
onChange: (key) => {
|
|
70
|
-
updateState({ activeKey: key });
|
|
71
|
-
onActiveKey(key);
|
|
72
|
-
},
|
|
73
|
-
...collapseParams
|
|
74
|
-
}
|
|
75
|
-
));
|
|
76
|
-
};
|
|
77
|
-
var Cart_default = Cart;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
.pisell-lowcode__shopping-cart {
|
|
2
|
-
.pisell-lowcode-collapse-content-box {
|
|
3
|
-
padding: 0 0 16px !important;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.pisell-lowcode-collapse-item {
|
|
7
|
-
.pisell-lowcode-collapse-header {
|
|
8
|
-
padding: 20px 0 !important;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&:first-child {
|
|
12
|
-
.pisell-lowcode-collapse-header {
|
|
13
|
-
padding: 0 0 20px !important;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.pisell-lowcode__shopping-cart-content {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
gap: 16px;
|
|
22
|
-
|
|
23
|
-
.pisell-lowcode-product-card {
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.pisell-lowcode__shopping-cart-label {
|
|
29
|
-
color: var(--Base-Black, #000);
|
|
30
|
-
font-size: 16px;
|
|
31
|
-
font-style: normal;
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
line-height: 24px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.pisell-lowcode__shopping-cart-clear-btn {
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
color: var(--Blue-700, #175cd3);
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
line-height: 24px; /* 150% */
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
.anticon {
|
|
44
|
-
font-size: 18px;
|
|
45
|
-
margin-right: 6px;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.pisell-lowcode__shopping-cart-clear-btn-empty {
|
|
50
|
-
margin-top: 12px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.pisell-lowcode__shopping-cart-add-service {
|
|
54
|
-
color: var(--Blue-700, #175cd3);
|
|
55
|
-
font-size: 16px;
|
|
56
|
-
font-style: normal;
|
|
57
|
-
font-weight: 400;
|
|
58
|
-
line-height: 24px;
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
gap: 8px;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.pisell-lowcode__shopping-cart-add-service-products {
|
|
66
|
-
align-items: start;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,43 +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/shoppingCart/components/Empty/index.tsx
|
|
30
|
-
var Empty_exports = {};
|
|
31
|
-
__export(Empty_exports, {
|
|
32
|
-
default: () => Empty_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Empty_exports);
|
|
35
|
-
var import_useContext = require("../../hooks/useContext");
|
|
36
|
-
var import_useAddService = __toESM(require("../../hooks/useAddService"));
|
|
37
|
-
var import_index = require("./index.less");
|
|
38
|
-
var Empty = (props) => {
|
|
39
|
-
const { state } = (0, import_useContext.useContext)();
|
|
40
|
-
const { emptyText, holders, hideAddBtn } = state;
|
|
41
|
-
return /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__shopping-cart-empty" }, emptyText, !hideAddBtn ? (0, import_useAddService.default)(props == null ? void 0 : props.id) : null);
|
|
42
|
-
};
|
|
43
|
-
var Empty_default = Empty;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.pisell-lowcode__shopping-cart-empty {
|
|
2
|
-
color: var(--Gray-500, #667085);
|
|
3
|
-
font-size: 16px;
|
|
4
|
-
font-style: normal;
|
|
5
|
-
font-weight: 400;
|
|
6
|
-
line-height: 24px;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
// height: 380px;
|
|
12
|
-
height: 40px;
|
|
13
|
-
margin: 16px 20px 20px;
|
|
14
|
-
gap: 10px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.pisell-lowcode__shopping-cart-empty-multiple {
|
|
18
|
-
height: 40px;
|
|
19
|
-
}
|
|
@@ -1,75 +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/shoppingCart/components/Render/index.tsx
|
|
30
|
-
var Render_exports = {};
|
|
31
|
-
__export(Render_exports, {
|
|
32
|
-
default: () => Render_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Render_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_classnames = __toESM(require("classnames"));
|
|
37
|
-
var import_useContext = require("../../hooks/useContext");
|
|
38
|
-
var import_Empty = __toESM(require("../Empty"));
|
|
39
|
-
var import_utils = require("../../utils");
|
|
40
|
-
var import_SelectHolderModal = __toESM(require("../SelectHolderModal"));
|
|
41
|
-
var import_Cart = __toESM(require("../Cart"));
|
|
42
|
-
var import_index = require("./index.less");
|
|
43
|
-
var Content = () => {
|
|
44
|
-
const { state, onChange } = (0, import_useContext.useContext)();
|
|
45
|
-
const selectPetRef = (0, import_react.useRef)();
|
|
46
|
-
const [pet, setPet] = (0, import_react.useState)([]);
|
|
47
|
-
const { isEmpty, className, holders, products, isEdit } = state;
|
|
48
|
-
(0, import_react.useEffect)(() => {
|
|
49
|
-
var _a, _b, _c, _d;
|
|
50
|
-
let _holders = holders == null ? void 0 : holders.filter((item) => (item == null ? void 0 : item.key) > 0);
|
|
51
|
-
console.log(isEdit, products, _holders, pet, "wh_holder");
|
|
52
|
-
if ((_holders == null ? void 0 : _holders.length) && !(pet == null ? void 0 : pet.length) && (products == null ? void 0 : products.length) && !isEdit) {
|
|
53
|
-
if (_holders.length === 1) {
|
|
54
|
-
onChange(products, "update_holders", (_a = _holders[0]) == null ? void 0 : _a.key);
|
|
55
|
-
return;
|
|
56
|
-
const _products = (0, import_utils.formatService)(products, (_b = _holders[0]) == null ? void 0 : _b.key);
|
|
57
|
-
onChange(_products);
|
|
58
|
-
} else {
|
|
59
|
-
(_d = (_c = selectPetRef.current) == null ? void 0 : _c.open) == null ? void 0 : _d.call(_c, {
|
|
60
|
-
products,
|
|
61
|
-
holders
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
setPet(_holders);
|
|
66
|
-
}, [holders]);
|
|
67
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
className: (0, import_classnames.default)("pisell-lowcode__shopping-cart-wrap", className)
|
|
71
|
-
},
|
|
72
|
-
isEmpty ? /* @__PURE__ */ import_react.default.createElement(import_Empty.default, null) : /* @__PURE__ */ import_react.default.createElement(import_Cart.default, null)
|
|
73
|
-
), /* @__PURE__ */ import_react.default.createElement(import_SelectHolderModal.default, { ref: selectPetRef, onChange }));
|
|
74
|
-
};
|
|
75
|
-
var Render_default = Content;
|