@pisell/private-materials 3.3.51 → 3.3.55
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/index.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Resource/index.js +5 -44
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +177 -218
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/locales.d.ts +0 -3
- package/es/components/appointmentBooking/locales.js +0 -9
- package/es/components/booking/components/TabProduct/productItem/index.js +2 -14
- package/es/components/booking/components/drawer/index.js +2 -4
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +17 -25
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/client/index.js +1 -2
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info/pet/index.js +0 -3
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +27 -27
- package/es/components/booking/info2/index.js +3 -3
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +2 -5
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/editService/index.js +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +4 -23
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +6 -18
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.js +10 -28
- package/es/components/productSelect/components/productGroup/index.js +7 -20
- package/es/components/productSelect/components/productGroup/index.less +1 -14
- package/es/components/productSelect/index.less +2 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +10 -16
- package/es/components/ticketBooking/components/addServiceVariant/index.less +0 -10
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -3
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -2
- package/es/components/ticketBooking/locales.d.ts +0 -3
- package/es/components/ticketBooking/locales.js +3 -12
- package/es/components/ticketBooking/utils/index.d.ts +1 -5
- package/es/components/ticketBooking/utils/index.js +3 -35
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Resource/index.js +5 -44
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +3 -12
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/locales.d.ts +0 -3
- package/lib/components/appointmentBooking/locales.js +0 -3
- package/lib/components/booking/components/TabProduct/productItem/index.js +1 -8
- package/lib/components/booking/components/drawer/index.js +2 -2
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +27 -31
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/client/index.js +1 -2
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info/pet/index.js +0 -3
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/index.js +4 -7
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +2 -4
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/editService/index.js +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +8 -18
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +1 -8
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.js +6 -19
- package/lib/components/productSelect/components/productGroup/index.js +4 -24
- package/lib/components/productSelect/components/productGroup/index.less +1 -14
- package/lib/components/productSelect/index.less +2 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +14 -25
- package/lib/components/ticketBooking/components/addServiceVariant/index.less +0 -10
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -3
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -2
- package/lib/components/ticketBooking/locales.d.ts +0 -3
- package/lib/components/ticketBooking/locales.js +3 -6
- package/lib/components/ticketBooking/utils/index.d.ts +1 -5
- package/lib/components/ticketBooking/utils/index.js +3 -35
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/package.json +4 -4
- package/es/components/appointmentBooking/assets/resource.svg +0 -1
- package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
- package/es/components/productSelect/components/TabProduct/tabs/index.js +0 -243
- package/es/components/productSelect/components/TabProduct/tabs/index.less +0 -126
- package/es/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/es/components/productSelect/components/pisellPriceText/index.js +0 -43
- package/lib/components/appointmentBooking/assets/resource.svg +0 -1
- package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
- package/lib/components/productSelect/components/TabProduct/tabs/index.js +0 -202
- package/lib/components/productSelect/components/TabProduct/tabs/index.less +0 -126
- package/lib/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/lib/components/productSelect/components/pisellPriceText/index.js +0 -72
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(addService_exports);
|
|
|
35
35
|
var import_utils = require("@pisell/utils");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_materials = require("@pisell/materials");
|
|
38
39
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
39
40
|
var import_utils2 = require("../../../booking/utils");
|
|
40
41
|
var import_utils3 = require("../../../booking/info2/service/addService/utils");
|
|
@@ -48,14 +49,13 @@ var import_index = require("./index.less");
|
|
|
48
49
|
var import_utils6 = require("../../utils");
|
|
49
50
|
var import_notAvailable = __toESM(require("../notAvailable"));
|
|
50
51
|
var AddSerivce = (props) => {
|
|
51
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
52
53
|
const { onEdit, state, dispatch, renderMode = "current" } = props;
|
|
53
|
-
const [loading, setLoading] = (0, import_react.useState)(
|
|
54
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
54
55
|
const context = (0, import_useEngineContext.default)();
|
|
55
56
|
const notAvailableRef = (0, import_react.useRef)(null);
|
|
56
57
|
const isLoadedServiceRef = (0, import_react.useRef)(false);
|
|
57
58
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
58
|
-
const Toast = (_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.Toast;
|
|
59
59
|
const { createBookingData, createBooking } = (0, import_serviceManager.useService)({
|
|
60
60
|
renderMode,
|
|
61
61
|
onEdit,
|
|
@@ -63,18 +63,18 @@ var AddSerivce = (props) => {
|
|
|
63
63
|
dispatch
|
|
64
64
|
});
|
|
65
65
|
const isBooking4 = (0, import_utils5.isBooking4Shop)(
|
|
66
|
-
(
|
|
66
|
+
(_e = (_d = (_c = (_b = (_a = context.appHelper.utils.store) == null ? void 0 : _a.getState) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.global) == null ? void 0 : _d.globalConfig) == null ? void 0 : _e.id,
|
|
67
67
|
state == null ? void 0 : state.renderType
|
|
68
68
|
);
|
|
69
69
|
const [currentProduct, setCurrentProduct] = (0, import_react.useState)(null);
|
|
70
70
|
const menuList = (0, import_react.useMemo)(() => {
|
|
71
71
|
var _a2, _b2, _c2;
|
|
72
72
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
|
|
73
|
-
}, [(
|
|
73
|
+
}, [(_f = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _f.config]);
|
|
74
74
|
const customerId = (0, import_react.useMemo)(() => {
|
|
75
75
|
var _a2, _b2;
|
|
76
76
|
return ((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) || void 0;
|
|
77
|
-
}, [(
|
|
77
|
+
}, [(_h = (_g = state.client) == null ? void 0 : _g.value) == null ? void 0 : _h.id]);
|
|
78
78
|
const setDefaultService = async (list) => {
|
|
79
79
|
if (state.renderType !== "eventBooking") {
|
|
80
80
|
return;
|
|
@@ -229,7 +229,7 @@ var AddSerivce = (props) => {
|
|
|
229
229
|
setCurrentProduct(null);
|
|
230
230
|
},
|
|
231
231
|
callback: async (e, extension_type, detail) => {
|
|
232
|
-
var _a2
|
|
232
|
+
var _a2;
|
|
233
233
|
setCurrentProduct(null);
|
|
234
234
|
if (lock) {
|
|
235
235
|
return;
|
|
@@ -273,27 +273,16 @@ var AddSerivce = (props) => {
|
|
|
273
273
|
if (renderMode === "current") {
|
|
274
274
|
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
275
275
|
}
|
|
276
|
-
cacheItem = (0, import_utils3.getProductExtend)({
|
|
277
|
-
cacheItem,
|
|
278
|
-
state,
|
|
279
|
-
isDisabledTime: true
|
|
280
|
-
});
|
|
276
|
+
cacheItem = (0, import_utils3.getProductExtend)({ cacheItem, state });
|
|
281
277
|
if (state.renderType === "eventBooking") {
|
|
282
278
|
cacheItem.autoClose = false;
|
|
283
279
|
}
|
|
284
280
|
if (cacheItem.autoClose) {
|
|
285
281
|
cacheItem.autoClose = false;
|
|
286
|
-
let
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
);
|
|
290
|
-
(_b2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _b2.call(
|
|
291
|
-
Toast,
|
|
292
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, cacheItem.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(
|
|
293
|
-
quantity || 1
|
|
294
|
-
)))
|
|
295
|
-
);
|
|
296
|
-
(0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
|
|
282
|
+
let _list = (0, import_utils6.addService)(state.service.value, cacheItem);
|
|
283
|
+
(0, import_materials.PisellToast)({
|
|
284
|
+
content: import_utils.locales.getText("pisell2.ticket-booking.add-to-cart")
|
|
285
|
+
});
|
|
297
286
|
dispatch({
|
|
298
287
|
type: "setService",
|
|
299
288
|
payload: {
|
|
@@ -330,7 +319,7 @@ var AddSerivce = (props) => {
|
|
|
330
319
|
}
|
|
331
320
|
}
|
|
332
321
|
return _list;
|
|
333
|
-
}, [(
|
|
322
|
+
}, [(_i = state.service) == null ? void 0 : _i.services, state == null ? void 0 : state.activeCartId]);
|
|
334
323
|
const currentDate = (0, import_react.useMemo)(() => {
|
|
335
324
|
return state.date.value.format("YYYY-MM-DD");
|
|
336
325
|
}, [state.date.value]);
|
|
@@ -373,7 +362,7 @@ var AddSerivce = (props) => {
|
|
|
373
362
|
}
|
|
374
363
|
return null;
|
|
375
364
|
}, [
|
|
376
|
-
(
|
|
365
|
+
(_k = (_j = state.service) == null ? void 0 : _j.cacheItem) == null ? void 0 : _k.autoClose,
|
|
377
366
|
state.service.addModal,
|
|
378
367
|
import_utils.locales,
|
|
379
368
|
renderList,
|
|
@@ -277,7 +277,6 @@ var TicketBooking = () => {
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
_modalState.service.value = [];
|
|
281
280
|
_modalState.service.cacheItem = null;
|
|
282
281
|
_modalState.service.addTimeModal = false;
|
|
283
282
|
_modalState.service.changeService = false;
|
|
@@ -762,8 +761,7 @@ var TicketBooking = () => {
|
|
|
762
761
|
locale: engineProps.locale,
|
|
763
762
|
refreshData: _refreshData,
|
|
764
763
|
setActiveTab: _setActiveTab,
|
|
765
|
-
clearAllValue: _clearAllValue
|
|
766
|
-
drawerMask: true
|
|
764
|
+
clearAllValue: _clearAllValue
|
|
767
765
|
},
|
|
768
766
|
setGlobalState: _setModalState,
|
|
769
767
|
setState,
|
|
@@ -36,7 +36,6 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_miniRedux = require("./miniRedux");
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_dayjs = __toESM(require("dayjs"));
|
|
39
|
-
var import_lodash = require("lodash");
|
|
40
39
|
var import_ticketBooking = __toESM(require("./components/ticketBooking/index"));
|
|
41
40
|
var import_utils2 = require("../../utils");
|
|
42
41
|
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
@@ -187,7 +186,7 @@ var ticketBooking_default = (props) => {
|
|
|
187
186
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
188
187
|
}, []);
|
|
189
188
|
(0, import_react.useMemo)(() => {
|
|
190
|
-
const store = (0, import_miniRedux.createStore)({ ...
|
|
189
|
+
const store = (0, import_miniRedux.createStore)({ ...initialState, bookingConfigParams, productExtensionType });
|
|
191
190
|
storeRef.current = store;
|
|
192
191
|
}, []);
|
|
193
192
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-wrapper" }, /* @__PURE__ */ import_react.default.createElement(import_menuBar.default, null), /* @__PURE__ */ import_react.default.createElement(import_miniRedux.Provider, { store: storeRef.current }, /* @__PURE__ */ import_react.default.createElement(import_ticketBooking.default, null)));
|
|
@@ -47,7 +47,6 @@ declare const _default: {
|
|
|
47
47
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
48
48
|
"pisell2.ticket-booking.not-available-title": string;
|
|
49
49
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
50
|
-
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
51
50
|
};
|
|
52
51
|
"zh-CN": {
|
|
53
52
|
"pisell2.ticket-booking.info": string;
|
|
@@ -97,7 +96,6 @@ declare const _default: {
|
|
|
97
96
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
98
97
|
"pisell2.ticket-booking.not-available-title": string;
|
|
99
98
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
100
|
-
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
101
99
|
};
|
|
102
100
|
"zh-HK": {
|
|
103
101
|
"pisell2.ticket-booking.info": string;
|
|
@@ -147,7 +145,6 @@ declare const _default: {
|
|
|
147
145
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
148
146
|
"pisell2.ticket-booking.not-available-title": string;
|
|
149
147
|
"pisell2.ticket-booking.not-available-ok": string;
|
|
150
|
-
"pisell2.ticket-booking.in-cart": (number: number) => string;
|
|
151
148
|
};
|
|
152
149
|
};
|
|
153
150
|
export default _default;
|
|
@@ -70,8 +70,7 @@ var locales_default = {
|
|
|
70
70
|
"pisell2.ticket-booking.create-new": "Create new",
|
|
71
71
|
"pisell2.ticket-booking.add-to-cart": "Added to Cart",
|
|
72
72
|
"pisell2.ticket-booking.not-available-title": "Sorry, Not available at current time.",
|
|
73
|
-
"pisell2.ticket-booking.not-available-ok": "OK"
|
|
74
|
-
"pisell2.ticket-booking.in-cart": (number) => `${number} in cart`
|
|
73
|
+
"pisell2.ticket-booking.not-available-ok": "OK"
|
|
75
74
|
},
|
|
76
75
|
"zh-CN": {
|
|
77
76
|
"pisell2.ticket-booking.info": "信息",
|
|
@@ -120,8 +119,7 @@ var locales_default = {
|
|
|
120
119
|
"pisell2.ticket-booking.create-new": "新建",
|
|
121
120
|
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
122
121
|
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售时间。",
|
|
123
|
-
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
124
|
-
"pisell2.ticket-booking.in-cart": (number) => `已有${number}件`
|
|
122
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
125
123
|
},
|
|
126
124
|
"zh-HK": {
|
|
127
125
|
"pisell2.ticket-booking.info": "資訊",
|
|
@@ -170,7 +168,6 @@ var locales_default = {
|
|
|
170
168
|
"pisell2.ticket-booking.create-new": "新建",
|
|
171
169
|
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
172
170
|
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售時間。",
|
|
173
|
-
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
174
|
-
"pisell2.ticket-booking.in-cart": (number) => `已有${number}件`
|
|
171
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
175
172
|
}
|
|
176
173
|
};
|
|
@@ -12,8 +12,4 @@ export declare const restoreProductOtherData: (data: any) => {
|
|
|
12
12
|
product_variant_id: number;
|
|
13
13
|
quantity: number;
|
|
14
14
|
} | undefined;
|
|
15
|
-
export declare const addService: (list: any[], addItem: any) =>
|
|
16
|
-
list: any[];
|
|
17
|
-
quantity: any;
|
|
18
|
-
};
|
|
19
|
-
export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
|
|
15
|
+
export declare const addService: (list: any[], addItem: any) => any[];
|
|
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
addService: () => addService,
|
|
33
|
-
addServiceScroll: () => addServiceScroll,
|
|
34
33
|
formatBookingList: () => formatBookingList,
|
|
35
34
|
formatDateToStr: () => formatDateToStr,
|
|
36
35
|
getDefaultStartParam: () => getDefaultStartParam,
|
|
@@ -129,27 +128,19 @@ var isSameProduct = (a, b) => {
|
|
|
129
128
|
};
|
|
130
129
|
var addService = (list, addItem) => {
|
|
131
130
|
let value = list;
|
|
132
|
-
let count;
|
|
133
131
|
if (!(0, import_utils.isNormalProductByDurationSchedule)(addItem)) {
|
|
134
132
|
value.push(addItem);
|
|
135
|
-
count = addItem._extend.quantity;
|
|
136
133
|
} else {
|
|
137
134
|
let isNotSame = true;
|
|
138
135
|
value = list.map((item) => {
|
|
139
|
-
var _a, _b
|
|
136
|
+
var _a, _b;
|
|
140
137
|
if (isSameProduct(item, addItem)) {
|
|
141
138
|
isNotSame = false;
|
|
142
|
-
const quantity = (((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.quantity) || 1) + (((_b = addItem == null ? void 0 : addItem._extend) == null ? void 0 : _b.quantity) || 1);
|
|
143
|
-
count = quantity;
|
|
144
139
|
return {
|
|
145
140
|
...item,
|
|
146
141
|
_extend: {
|
|
147
142
|
...item._extend,
|
|
148
|
-
quantity
|
|
149
|
-
other: {
|
|
150
|
-
...((_c = item._extend) == null ? void 0 : _c.other) || {},
|
|
151
|
-
quantity
|
|
152
|
-
}
|
|
143
|
+
quantity: (((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.quantity) || 1) + (((_b = addItem == null ? void 0 : addItem._extend) == null ? void 0 : _b.quantity) || 1)
|
|
153
144
|
}
|
|
154
145
|
};
|
|
155
146
|
}
|
|
@@ -157,36 +148,13 @@ var addService = (list, addItem) => {
|
|
|
157
148
|
});
|
|
158
149
|
if (isNotSame) {
|
|
159
150
|
value.push(addItem);
|
|
160
|
-
count = addItem._extend.quantity;
|
|
161
151
|
}
|
|
162
152
|
}
|
|
163
|
-
return
|
|
164
|
-
};
|
|
165
|
-
var addServiceScroll = (rowKey, cacheItem) => {
|
|
166
|
-
const list = document.querySelectorAll(`#rowKey-${rowKey}`);
|
|
167
|
-
setTimeout(() => {
|
|
168
|
-
if (list.length && (0, import_utils.isNormalProductByDurationSchedule)(cacheItem)) {
|
|
169
|
-
list[list.length - 1].scrollIntoView({
|
|
170
|
-
behavior: "smooth",
|
|
171
|
-
block: "center"
|
|
172
|
-
});
|
|
173
|
-
} else {
|
|
174
|
-
setTimeout(() => {
|
|
175
|
-
const bookingWrap = document.querySelectorAll(`.booking-info-warp`);
|
|
176
|
-
if (bookingWrap.length) {
|
|
177
|
-
bookingWrap[0].scrollTo({
|
|
178
|
-
top: 99999,
|
|
179
|
-
behavior: "smooth"
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}, 100);
|
|
183
|
-
}
|
|
184
|
-
});
|
|
153
|
+
return value;
|
|
185
154
|
};
|
|
186
155
|
// Annotate the CommonJS export names for ESM import in node:
|
|
187
156
|
0 && (module.exports = {
|
|
188
157
|
addService,
|
|
189
|
-
addServiceScroll,
|
|
190
158
|
formatBookingList,
|
|
191
159
|
formatDateToStr,
|
|
192
160
|
getDefaultStartParam,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.55",
|
|
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/
|
|
65
|
-
"@pisell/
|
|
63
|
+
"@pisell/materials": "3.3.18",
|
|
64
|
+
"@pisell/date-picker": "3.0.2",
|
|
65
|
+
"@pisell/icon": "0.0.11"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1275.59 1275.59"><defs><style>.cls-1{fill:#a6a6a6;}</style></defs><g id="DxmwFQ.tif"><path class="cls-1" d="M636.87,977.58c-114.72,1.47-224.68-20.79-329.21-68-15.86-7.16-27.21-5.9-41.28,3.48C213.52,948.26,160,982.43,106.5,1016.73c-9.48,6.08-19.25,13.77-31.41,4.9-13-9.52-8.84-21.72-5.11-33.57,17.49-55.52,34-111.4,53.34-166.26,7.84-22.23,4.17-36.79-11.17-54.36C36.65,680.94,2.43,581,23.2,466.21c18-99.46,74-176.57,151-238.71C273.46,147.32,388.47,104,514.45,86.05c118.93-16.93,236.23-12.26,351.34,21.89,145.61,43.18,271,116.11,348.42,253.1,49,86.79,56.45,179,26.18,273.75-4.88,15.27-7.87,40.71-32.33,33.2-26.2-8-10.69-29.31-5.9-44.58,43.67-139.14-3.45-251.65-104.6-345.78C991.83,179.25,861.31,135,720.56,120c-146.14-15.54-287.38,5.21-419.35,72.83C199.54,244.92,115.73,315.67,75.28,426.91c-38.67,106.33-15.56,203,49.22,292.24,4.14,5.7,8,12.14,13.45,16.28,38,28.73,40.16,63.43,21.87,104.72C148.1,866.6,141.39,895.27,132.55,923c-2.35,7.39-7.94,16.28-1.15,22.29,7.8,6.92,14.27-2.48,20.45-6.38,37.3-23.55,74.68-47,111.42-71.41,15-10,28.85-10.45,44.66-2.72,148,72.35,303.66,87.56,464.76,62.18,2.62-.41,5.25-.7,7.86-1.16,14.24-2.49,28.51-1.69,31.3,15.32s-10.53,22.14-24.72,24.41c-41,6.55-82.07,12.48-123.76,12.07C654.53,977.5,645.7,977.58,636.87,977.58Z"/><path class="cls-1" d="M1033.47,1198.82c-10.6,0-21.19.18-31.78,0-39.56-.77-60.71-20.83-61.28-60.26-.27-19.06-1.81-36.46-15.66-51.38-4.39-4.72-7.17-13-7-19.55,1-39.88-20.87-70.15-41.08-101.14C821.4,881.7,821.09,797.61,876,725.15c62.22-82.07,179.6-102.34,265.78-45.9,89.35,58.51,116.38,169.16,63.78,262.88-12.06,21.5-25.44,42.29-38.6,63.17a108.78,108.78,0,0,0-16.33,49.79c-1.41,17.07-4.09,33.17-17.53,45.64-8.07,7.48-6.06,17.91-6.27,27.49-1.12,53.27-18.56,70.41-72.19,70.82-7.07,0-14.13,0-21.19,0Zm158.82-356.91c-3.34-65.92-35.67-113.78-95.24-140.62-60.42-27.23-118.46-17.53-167.61,26.49-47.76,42.77-66.7,96.58-47.38,160.23,7.78,25.6,22.78,47.57,37,69.91,18,28.32,36.23,56.7,37.17,92,.29,10.66,3.07,20.93,16,19.1,12.71-1.79,9.38-13,7.91-21.35q-9.6-54.74-19.93-109.33c-2-10.22-1.75-19.22,6.61-26.62,9.23-8.17,18.11-4.49,26.63,1,7.15,4.58,14.3,7.73,21.9,1.9,12.06-9.25,23.72-10.48,36-.34,6.3,5.21,12.84,3,19.81.11,29.47-12.11,39.23-5,34.33,26.56-5.53,35.71-13,71.11-19.52,106.68-1.56,8.62-4.23,19,7.81,21.78,11.43,2.62,16.2-6.24,16.73-15.66,2.4-42.66,25.38-76.24,47.2-110.54C1177.31,912.39,1194.61,880.63,1192.29,841.91Zm-159.57,316.58v-.28c12.32,0,24.71.84,36.94-.2,17-1.43,17.21-14.74,17.48-27.46.27-12.54-4.83-20.42-18.34-20.45q-34.33-.07-68.69.21c-13.61.13-21.4,6-20.94,20.9.43,13.63,4,25.14,19.26,27C1009.7,1159.59,1021.28,1158.49,1032.72,1158.49Zm1.72-202.58c-14,3-28.37,5.21-25.36,24,4,25.21,8.92,50.28,14,75.31,1.19,5.91,4.1,12.5,11.94,11.66,6.39-.68,7.5-7,8.54-12,4.85-23.27,8.23-46.91,14.29-69.85C1063.81,962.48,1048.2,960.53,1034.44,955.91Z"/><path class="cls-1" d="M639.31,407.39q-177.43-.06-354.85-.09c-8.8,0-17.7,0-26.37-1.3-9.74-1.42-16.3-7.62-16.29-17.81,0-9.93,5.86-16.66,15.75-18.41a122.26,122.26,0,0,1,21.06-1.36q356.16-.14,712.33-.08c8.81,0,17.7,0,26.42,1.09,10.46,1.33,19,6.48,19,18.27,0,13.21-9.32,18.08-21.07,18.91-8.79.63-17.63.79-26.45.79Q814.09,407.48,639.31,407.39Z"/><path class="cls-1" d="M639.72,508.17q178.74,0,357.48.06c8.77,0,17.76.22,26.24,2.13s13.39,8.66,13.14,17.6c-.21,7.72-4.61,13.91-12,15.69a113,113,0,0,1-26,3.06q-360.13.25-720.27.1a106,106,0,0,1-21-1.71c-9.79-2-15.52-8.75-15.41-18.73.12-10.32,6.62-16.18,16.63-17.19,8.75-.89,17.61-.95,26.43-1Q462.3,508.15,639.72,508.17Z"/><path class="cls-1" d="M448.43,687.14q-82,0-164,0c-7.05,0-14.1-.2-21.14-.51-12.23-.54-20.81-6.52-21-19.05-.27-14,8.57-20,22.32-20q183.78.17,367.57.13c13.67,0,26.26,4.07,25.34,20-1,16.95-15.35,19.67-29.28,19.71-59.93.18-119.87.08-179.81.08Z"/></g></svg>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export interface Com<T> extends React.FC<T> {
|
|
4
|
-
}
|
|
5
|
-
export declare type RowKey = string | number;
|
|
6
|
-
export interface Option {
|
|
7
|
-
id: number | string;
|
|
8
|
-
name: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export interface TabsProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'> {
|
|
11
|
-
renderTab: (item: any) => React.ReactNode;
|
|
12
|
-
rowKey: RowKey;
|
|
13
|
-
name: RowKey;
|
|
14
|
-
onChange: (key: RowKey, _item: any) => void;
|
|
15
|
-
tab: RowKey;
|
|
16
|
-
className: string;
|
|
17
|
-
tabsRef: any;
|
|
18
|
-
options: Option[];
|
|
19
|
-
}
|
|
20
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<Partial<TabsProps>, "ref"> & React.RefAttributes<unknown>>;
|
|
21
|
-
export default _default;
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
8
|
-
import classNames from 'classnames';
|
|
9
|
-
import { useDebounceFn } from 'ahooks';
|
|
10
|
-
import ChevronLeft from '@pisell/icon/es/ChevronLeft';
|
|
11
|
-
import ChevronRight from '@pisell/icon/es/ChevronRight';
|
|
12
|
-
import "./index.less";
|
|
13
|
-
|
|
14
|
-
// tabs 子组件定义
|
|
15
|
-
|
|
16
|
-
// 定义主键类型
|
|
17
|
-
|
|
18
|
-
// Tabs 可传递的参数
|
|
19
|
-
|
|
20
|
-
var Tabs = function Tabs(_ref, ref) {
|
|
21
|
-
var renderTab = _ref.renderTab,
|
|
22
|
-
rowKey = _ref.rowKey,
|
|
23
|
-
_ref$name = _ref.name,
|
|
24
|
-
name = _ref$name === void 0 ? 'tabs-' : _ref$name,
|
|
25
|
-
onChange = _ref.onChange,
|
|
26
|
-
tab = _ref.tab,
|
|
27
|
-
className = _ref.className,
|
|
28
|
-
options = _ref.options;
|
|
29
|
-
var _useState = useState(false),
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
isShowButton = _useState2[0],
|
|
32
|
-
setIsShowButton = _useState2[1];
|
|
33
|
-
useImperativeHandle(ref, function () {
|
|
34
|
-
return {
|
|
35
|
-
scroll: function scroll(tab) {
|
|
36
|
-
if (tab) {
|
|
37
|
-
var dom = document.querySelector("#".concat(name).concat(tab));
|
|
38
|
-
if (dom) {
|
|
39
|
-
setTabScroll(dom === null || dom === void 0 ? void 0 : dom.offsetLeft);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* @Title: 改变tab事件
|
|
47
|
-
* @Describe:
|
|
48
|
-
* @Author: Wzw
|
|
49
|
-
* @param {RowKey} _key
|
|
50
|
-
*/
|
|
51
|
-
var _onChange = function _onChange(_key, _item, e) {
|
|
52
|
-
// setScroll(_tab, _key);
|
|
53
|
-
// 如果传入了tab 并且有onChange, 则调用onChange, 否则设置组件内部tab
|
|
54
|
-
if (onChange) {
|
|
55
|
-
onChange(_key, _item);
|
|
56
|
-
}
|
|
57
|
-
setTabScroll(e.target.offsetLeft);
|
|
58
|
-
};
|
|
59
|
-
useEffect(function () {
|
|
60
|
-
if (options !== null && options !== void 0 && options.length) {
|
|
61
|
-
calculateWidth();
|
|
62
|
-
}
|
|
63
|
-
}, [options]);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @title: 判断是否展示箭头
|
|
67
|
-
* @description:
|
|
68
|
-
* @return {*}
|
|
69
|
-
* @Author: chensheng.gu
|
|
70
|
-
* @Date: 2023-08-01 15:59
|
|
71
|
-
*/
|
|
72
|
-
var calculateWidth = function calculateWidth() {
|
|
73
|
-
var tabsWrapper = document.querySelector('#pisell-tabs');
|
|
74
|
-
var tabsContent = document.querySelector('#pisell-tabs-content');
|
|
75
|
-
if ((tabsContent === null || tabsContent === void 0 ? void 0 : tabsContent.offsetWidth) + 60 > (tabsWrapper === null || tabsWrapper === void 0 ? void 0 : tabsWrapper.offsetWidth)) {
|
|
76
|
-
setIsShowButton(true);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @title: 选项
|
|
82
|
-
* @description:
|
|
83
|
-
* @param {*} useMemo
|
|
84
|
-
* @return {*}
|
|
85
|
-
* @Author: zhiwei.Wang
|
|
86
|
-
* @Date: 2023-06-03 10:44
|
|
87
|
-
*/
|
|
88
|
-
var _options = useMemo(function () {
|
|
89
|
-
return options || [];
|
|
90
|
-
}, [options]);
|
|
91
|
-
|
|
92
|
-
// 左侧按钮宽度
|
|
93
|
-
var _useState3 = useState(40),
|
|
94
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
95
|
-
leftWidth = _useState4[0],
|
|
96
|
-
setLeftWidth = _useState4[1];
|
|
97
|
-
var _useState5 = useState(false),
|
|
98
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
99
|
-
leftActive = _useState6[0],
|
|
100
|
-
setLeftActive = _useState6[1];
|
|
101
|
-
//右侧按钮宽度
|
|
102
|
-
var _useState7 = useState(40),
|
|
103
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
104
|
-
rightWidth = _useState8[0],
|
|
105
|
-
setRightWidth = _useState8[1];
|
|
106
|
-
var _useState9 = useState(true),
|
|
107
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
108
|
-
rightActive = _useState10[0],
|
|
109
|
-
setRightActive = _useState10[1];
|
|
110
|
-
|
|
111
|
-
// 防抖
|
|
112
|
-
var debounceChange = useDebounceFn(function (_ref2) {
|
|
113
|
-
var current = _ref2.current,
|
|
114
|
-
total = _ref2.total;
|
|
115
|
-
if (current === 0) {
|
|
116
|
-
// setLeftWidth(0);
|
|
117
|
-
setLeftActive(false);
|
|
118
|
-
} else {
|
|
119
|
-
// setLeftWidth(40);
|
|
120
|
-
setLeftActive(true);
|
|
121
|
-
}
|
|
122
|
-
if (current + 10 >= total) {
|
|
123
|
-
// setRightWidth(0);
|
|
124
|
-
setRightActive(false);
|
|
125
|
-
} else {
|
|
126
|
-
// setRightWidth(40);
|
|
127
|
-
setRightActive(true);
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
wait: 200
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// 滚动时触发
|
|
134
|
-
var onScroll = function onScroll(e) {
|
|
135
|
-
var total = e.target.scrollWidth - e.target.clientWidth;
|
|
136
|
-
var current = e.target.scrollLeft;
|
|
137
|
-
debounceChange.run({
|
|
138
|
-
current: current,
|
|
139
|
-
total: total
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// 设置滚动位置
|
|
144
|
-
var setTabScroll = function setTabScroll(val) {
|
|
145
|
-
var dom = document.querySelector('#pisell-tabs-content');
|
|
146
|
-
console.log('domdom', dom);
|
|
147
|
-
if (!dom) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
dom.scrollLeft = val;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @title: 手动触发滚动位置
|
|
155
|
-
* @description:
|
|
156
|
-
* @param {*} type
|
|
157
|
-
* @return {*}
|
|
158
|
-
* @Author: zhiwei.Wang
|
|
159
|
-
* @Date: 2023-06-03 10:45
|
|
160
|
-
*/
|
|
161
|
-
var onPageChange = function onPageChange(type) {
|
|
162
|
-
var dom = document.querySelector('#pisell-tabs-content');
|
|
163
|
-
if (!dom) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (type === 'left') {
|
|
167
|
-
setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) - dom.clientWidth / 2);
|
|
168
|
-
} else {
|
|
169
|
-
setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) + dom.clientWidth / 2);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
// 左侧按钮
|
|
174
|
-
var leftBtn = useMemo(function () {
|
|
175
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
176
|
-
className: "booking-pisell-tabs-btn-left",
|
|
177
|
-
style: {
|
|
178
|
-
width: leftWidth,
|
|
179
|
-
// marginLeft: !leftWidth ? '20px' : 0,
|
|
180
|
-
opacity: leftActive ? 1 : 0.3
|
|
181
|
-
},
|
|
182
|
-
onClick: function onClick() {
|
|
183
|
-
onPageChange('left');
|
|
184
|
-
}
|
|
185
|
-
}, /*#__PURE__*/React.createElement(ChevronRight, {
|
|
186
|
-
className: "booking-pisell-tabs-btn-icon"
|
|
187
|
-
}));
|
|
188
|
-
}, [leftWidth, leftActive]);
|
|
189
|
-
|
|
190
|
-
// 右侧按钮
|
|
191
|
-
var rightBtn = useMemo(function () {
|
|
192
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
-
className: "booking-pisell-tabs-btn-right",
|
|
194
|
-
style: {
|
|
195
|
-
width: rightWidth,
|
|
196
|
-
// marginRight: !rightWidth ? '20px' : 0,
|
|
197
|
-
opacity: rightActive ? 1 : 0.3
|
|
198
|
-
},
|
|
199
|
-
onClick: function onClick() {
|
|
200
|
-
onPageChange('right');
|
|
201
|
-
}
|
|
202
|
-
}, /*#__PURE__*/React.createElement(ChevronLeft, {
|
|
203
|
-
type: "icona-iconArrowsLine",
|
|
204
|
-
className: "booking-pisell-tabs-btn-icon"
|
|
205
|
-
}));
|
|
206
|
-
}, [rightWidth, rightActive]);
|
|
207
|
-
|
|
208
|
-
// 中间内容
|
|
209
|
-
var content = useMemo(function () {
|
|
210
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
-
className: "booking-pisell-tabs-content",
|
|
212
|
-
id: "pisell-tabs-content",
|
|
213
|
-
onScroll: onScroll,
|
|
214
|
-
style: {
|
|
215
|
-
width: 'unset'
|
|
216
|
-
}
|
|
217
|
-
}, !isShowButton ? /*#__PURE__*/React.createElement("div", {
|
|
218
|
-
style: {
|
|
219
|
-
width: 10
|
|
220
|
-
}
|
|
221
|
-
}) : null, _options.map(function (d, i) {
|
|
222
|
-
var _key = rowKey ? d[rowKey] : i;
|
|
223
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
224
|
-
className: classNames('booking-pisell-tabs-tab', {
|
|
225
|
-
'booking-pisell-tabs-tab-active': tab === _key
|
|
226
|
-
}),
|
|
227
|
-
key: _key,
|
|
228
|
-
id: name + '' + _key,
|
|
229
|
-
onClick: function onClick(e) {
|
|
230
|
-
_onChange(_key, d, e);
|
|
231
|
-
}
|
|
232
|
-
}, renderTab ? renderTab(d) : /*#__PURE__*/React.createElement("div", {
|
|
233
|
-
className: "booking-pisell-tabs-tab-content"
|
|
234
|
-
}, d.name));
|
|
235
|
-
}));
|
|
236
|
-
}, [_options, rowKey, name, tab, isShowButton]);
|
|
237
|
-
console.log('isShow', isShowButton);
|
|
238
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
239
|
-
className: classNames('booking-pisell-tabs', className),
|
|
240
|
-
id: "pisell-tabs"
|
|
241
|
-
}, isShowButton && leftBtn, content, isShowButton && rightBtn);
|
|
242
|
-
};
|
|
243
|
-
export default /*#__PURE__*/forwardRef(Tabs);
|