@pisell/private-materials 6.1.1 → 6.1.3
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/businessModel/SalesModel/Sales/index.js +37 -4
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +7 -0
- package/es/components/Sales/Resource/serve.js +10 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +47 -18
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/editBookingModal/index.d.ts +5 -0
- package/es/components/booking/editBookingModal/index.js +386 -0
- package/es/components/booking/editBookingModal/index.less +8 -0
- package/es/components/booking/editBookingModal/locales.d.ts +21 -0
- package/es/components/booking/editBookingModal/locales.js +20 -0
- package/es/components/booking/editBookingModal/mock.d.ts +807 -0
- package/es/components/booking/editBookingModal/mock.js +2993 -0
- package/es/components/booking/editBookingModal/serve.d.ts +51 -0
- package/es/components/booking/editBookingModal/serve.js +288 -0
- package/es/components/booking/editBookingModal/type.d.ts +12 -0
- package/es/components/booking/editBookingModal/type.js +1 -0
- package/es/components/booking/editBookingModal/utils.d.ts +12 -0
- package/es/components/booking/editBookingModal/utils.js +157 -0
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +24 -10
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/Lists.js +38 -26
- package/es/components/booking/info/service/editService/index.js +3 -0
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.js +2 -0
- package/es/components/booking/info/service/serviceManager/index.js +3 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.js +1 -0
- package/es/components/booking/info/service2/utils.js +26 -25
- package/es/components/booking/info2/service/addService/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/es/components/booking/info2/service/addService/utils.js +54 -17
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +27 -8
- package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/es/components/booking/info2/service/editService/index.js +261 -167
- package/es/components/booking/info2/service/index.js +19 -15
- package/es/components/booking/info2/service/serviceList/index.js +2 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.js +30 -3
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +19 -3
- package/es/components/eventBooking/index.js +21 -7
- package/es/components/eventBooking/locales.js +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toB/components/Content/index.js +35 -52
- package/es/components/pay/toB/store/hooks.js +13 -4
- package/es/components/pay/toB/store/provider.js +1 -0
- package/es/components/pay/toB/types/storeTypes.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +48 -41
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/stepController/components/Content/index.d.ts +7 -0
- package/es/components/stepController/components/Content/index.js +9 -0
- package/es/components/stepController/components/Content/index.less +8 -0
- package/es/components/stepController/components/Footer/index.d.ts +8 -0
- package/es/components/stepController/components/Footer/index.js +15 -0
- package/es/components/stepController/components/Footer/index.less +39 -0
- package/es/components/stepController/components/Header/index.d.ts +20 -0
- package/es/components/stepController/components/Header/index.js +97 -0
- package/es/components/stepController/components/Header/index.less +21 -0
- package/es/components/stepController/index.d.ts +5 -0
- package/es/components/stepController/index.js +64 -0
- package/es/components/stepController/index.less +11 -0
- package/es/components/stepController/locales.d.ts +27 -0
- package/es/components/stepController/locales.js +32 -0
- package/es/components/stepController/types.d.ts +23 -0
- package/es/components/stepController/types.js +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +137 -137
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/businessModel/SalesModel/Sales/index.js +22 -8
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +7 -0
- package/lib/components/Sales/Resource/serve.js +9 -2
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +27 -7
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/editBookingModal/index.d.ts +5 -0
- package/lib/components/booking/editBookingModal/index.js +363 -0
- package/lib/components/booking/editBookingModal/index.less +8 -0
- package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
- package/lib/components/booking/editBookingModal/locales.js +44 -0
- package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
- package/lib/components/booking/editBookingModal/mock.js +3314 -0
- package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
- package/lib/components/booking/editBookingModal/serve.js +178 -0
- package/lib/components/booking/editBookingModal/type.d.ts +12 -0
- package/lib/components/booking/editBookingModal/type.js +17 -0
- package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
- package/lib/components/booking/editBookingModal/utils.js +158 -0
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/client/index.js +7 -6
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +16 -10
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/Lists.js +37 -23
- package/lib/components/booking/info/service/editService/index.js +3 -0
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.js +2 -0
- package/lib/components/booking/info/service/serviceManager/index.js +2 -0
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.js +1 -0
- package/lib/components/booking/info/service2/utils.js +22 -21
- package/lib/components/booking/info2/service/addService/index.js +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/lib/components/booking/info2/service/addService/utils.js +36 -7
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +56 -10
- package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/lib/components/booking/info2/service/editService/index.js +164 -79
- package/lib/components/booking/info2/service/index.js +13 -9
- package/lib/components/booking/info2/service/serviceList/index.js +2 -0
- package/lib/components/booking/info2/utilsByBooking.js +6 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.js +22 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +9 -3
- package/lib/components/eventBooking/index.js +11 -7
- package/lib/components/eventBooking/locales.js +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toB/components/Content/index.js +5 -5
- package/lib/components/pay/toB/store/hooks.js +8 -1
- package/lib/components/pay/toB/store/provider.js +1 -0
- package/lib/components/pay/toB/types/storeTypes.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +31 -21
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/stepController/components/Content/index.d.ts +7 -0
- package/lib/components/stepController/components/Content/index.js +40 -0
- package/lib/components/stepController/components/Content/index.less +8 -0
- package/lib/components/stepController/components/Footer/index.d.ts +8 -0
- package/lib/components/stepController/components/Footer/index.js +49 -0
- package/lib/components/stepController/components/Footer/index.less +39 -0
- package/lib/components/stepController/components/Header/index.d.ts +20 -0
- package/lib/components/stepController/components/Header/index.js +104 -0
- package/lib/components/stepController/components/Header/index.less +21 -0
- package/lib/components/stepController/index.d.ts +5 -0
- package/lib/components/stepController/index.js +89 -0
- package/lib/components/stepController/index.less +11 -0
- package/lib/components/stepController/locales.d.ts +27 -0
- package/lib/components/stepController/locales.js +50 -0
- package/lib/components/stepController/types.d.ts +23 -0
- package/lib/components/stepController/types.js +17 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +143 -138
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/edit-booking-modal/meta.ts +53 -0
- package/lowcode/step-controller/meta.ts +88 -0
- package/package.json +2 -2
@@ -48,10 +48,12 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
48
48
|
const { handleAddHolder } = (0, import_useAddHolder.default)(state, dispatch);
|
49
49
|
const handleChange = (0, import_ahooks.useMemoizedFn)(
|
50
50
|
(currentItem, type, other) => {
|
51
|
+
console.time("handleChange");
|
52
|
+
console.log(window.pp1 = performance.now(), "打开商品");
|
51
53
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
52
54
|
return;
|
53
55
|
}
|
54
|
-
let
|
56
|
+
let products2 = (0, import_utils.updateServices)(state, currentItem, type, other, {
|
55
57
|
handleAddHolder
|
56
58
|
});
|
57
59
|
if (type === "view" || type === "edit_product") {
|
@@ -63,12 +65,14 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
63
65
|
state
|
64
66
|
});
|
65
67
|
}
|
68
|
+
openBookingEditModal();
|
66
69
|
onChange({ editModal: true, cacheItem });
|
67
|
-
return onEdit == null ? void 0 : onEdit(
|
70
|
+
return onEdit == null ? void 0 : onEdit(cacheItem, type);
|
68
71
|
}
|
72
|
+
closeBookingEditModal();
|
69
73
|
const params = {
|
70
74
|
editModal: false,
|
71
|
-
value:
|
75
|
+
value: products2,
|
72
76
|
edit: true,
|
73
77
|
cacheItem: null
|
74
78
|
};
|
@@ -95,26 +99,36 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
|
|
95
99
|
isShowChangeHolder,
|
96
100
|
state.isBookingCreatePage
|
97
101
|
]);
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
102
|
+
const products = (0, import_react.useMemo)(() => {
|
103
|
+
var _a2;
|
104
|
+
console.time("products");
|
105
|
+
const p = (0, import_utils.formatProducts)(
|
106
|
+
((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) || [],
|
107
|
+
state,
|
108
|
+
false,
|
109
|
+
true,
|
110
|
+
isParallelResource
|
111
|
+
);
|
112
|
+
console.timeEnd("products");
|
113
|
+
return p;
|
114
|
+
}, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value]);
|
115
|
+
return (0, import_react.useMemo)(() => {
|
116
|
+
console.log("render List");
|
117
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
|
118
|
+
import_shoppingCart.default,
|
119
|
+
{
|
120
|
+
isParallelResource,
|
121
|
+
onAction,
|
122
|
+
onChange: handleChange,
|
123
|
+
isOpenGroup: false,
|
124
|
+
isHideClearCart: true,
|
125
|
+
onAddProduct: () => onChange({ addModal: true }),
|
126
|
+
productParams: {
|
127
|
+
...productParams,
|
128
|
+
products
|
129
|
+
}
|
116
130
|
}
|
117
|
-
|
118
|
-
)
|
131
|
+
));
|
132
|
+
}, [products, state, productParams]);
|
119
133
|
};
|
120
134
|
var Lists_default = Lists;
|
@@ -190,6 +190,7 @@ var Info = (_, ref) => {
|
|
190
190
|
} else {
|
191
191
|
_list = _list.filter((d) => d._id !== _id);
|
192
192
|
}
|
193
|
+
closeBookingEditModal();
|
193
194
|
dispatch({
|
194
195
|
type: "setService",
|
195
196
|
payload: {
|
@@ -504,6 +505,7 @@ var Info = (_, ref) => {
|
|
504
505
|
if (state.channelDisabledEdit) {
|
505
506
|
return;
|
506
507
|
}
|
508
|
+
openBookingEditModal();
|
507
509
|
dispatch({
|
508
510
|
type: "setService",
|
509
511
|
payload: {
|
@@ -632,6 +634,7 @@ var Info = (_, ref) => {
|
|
632
634
|
open: state.service.editModal && !((_a2 = state.service.cacheItem) == null ? void 0 : _a2.autoClose),
|
633
635
|
title: isDayBookingMode ? import_utils.locales.getText("pisell2.text.edit-select-service") : import_utils.locales.getText("pisell2.text.edit-service"),
|
634
636
|
onClose: () => {
|
637
|
+
closeBookingEditModal();
|
635
638
|
dispatch({
|
636
639
|
type: "setService",
|
637
640
|
payload: {
|
@@ -52,6 +52,7 @@ var ServiceList = ({ onEdit }) => {
|
|
52
52
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
53
53
|
return;
|
54
54
|
}
|
55
|
+
openBookingEditModal();
|
55
56
|
dispatch({
|
56
57
|
type: "setService",
|
57
58
|
payload: {
|
@@ -67,6 +68,7 @@ var ServiceList = ({ onEdit }) => {
|
|
67
68
|
}
|
68
69
|
let _list = [...state.service.value];
|
69
70
|
_list = _list.filter((d) => d._id !== item._id);
|
71
|
+
closeBookingEditModal();
|
70
72
|
dispatch({
|
71
73
|
type: "setService",
|
72
74
|
payload: {
|
@@ -178,6 +178,7 @@ var useService = ({
|
|
178
178
|
}
|
179
179
|
}
|
180
180
|
(0, import_utils2.deleteCacheParams)();
|
181
|
+
closeBookingEditModal();
|
181
182
|
dispatch({
|
182
183
|
type: "setService",
|
183
184
|
payload: {
|
@@ -191,6 +192,7 @@ var useService = ({
|
|
191
192
|
});
|
192
193
|
};
|
193
194
|
const goEditPanel = ({ booking }) => {
|
195
|
+
openBookingEditModal();
|
194
196
|
dispatch({
|
195
197
|
type: "setService",
|
196
198
|
payload: {
|
@@ -63,6 +63,7 @@ var Lists = ({ onEdit, onChange }) => {
|
|
63
63
|
let products = (0, import_utils.updateServices)(state, currentItem, type, other);
|
64
64
|
if (type === "view") {
|
65
65
|
let product = currentItem._origin;
|
66
|
+
openBookingEditModal();
|
66
67
|
onChange({ editModal: true, cacheItem: { ...product, new: 0 } });
|
67
68
|
return onEdit == null ? void 0 : onEdit({ ...product, new: 0 });
|
68
69
|
}
|
@@ -377,12 +377,13 @@ var formatBundle = (bundle) => {
|
|
377
377
|
var formatOptions = (options) => {
|
378
378
|
if (!(options == null ? void 0 : options.length)) return [];
|
379
379
|
return options.map((item) => {
|
380
|
+
const price = Number((item == null ? void 0 : item.price) || (item == null ? void 0 : item.add_price));
|
380
381
|
return {
|
381
382
|
id: item == null ? void 0 : item.id,
|
382
383
|
name: item == null ? void 0 : item.name,
|
383
384
|
num: item == null ? void 0 : item.num,
|
384
|
-
price
|
385
|
-
total:
|
385
|
+
price,
|
386
|
+
total: price,
|
386
387
|
origin_total: item == null ? void 0 : item.original_price
|
387
388
|
};
|
388
389
|
});
|
@@ -422,7 +423,7 @@ var getErrorMessageInfo2 = (errorList) => {
|
|
422
423
|
};
|
423
424
|
var getAllErrorList = (item) => {
|
424
425
|
const { resourceMaps } = item._data || {};
|
425
|
-
const { resource } = item._extend || {};
|
426
|
+
const { resource = {} } = item._extend || {};
|
426
427
|
const errorList = [];
|
427
428
|
Object.entries(resource).forEach(([key, value]) => {
|
428
429
|
value.forEach((val) => {
|
@@ -437,7 +438,7 @@ var getAllErrorList = (item) => {
|
|
437
438
|
var mapListItems = (items) => items.map((item) => ({
|
438
439
|
id: item.id || item.form_record_id,
|
439
440
|
label: item.labelText,
|
440
|
-
isError: !item.usable
|
441
|
+
isError: !item.usable || item.unbound
|
441
442
|
}));
|
442
443
|
var getIsSubjectRequire = (state) => {
|
443
444
|
var _a, _b, _c, _d, _e, _f, _g;
|
@@ -578,25 +579,25 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
|
|
578
579
|
_origin: item
|
579
580
|
};
|
580
581
|
};
|
581
|
-
lists.forEach((item) => {
|
582
|
-
var _a;
|
583
|
-
if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
|
584
|
-
normalList.push(formItem(item));
|
585
|
-
} else {
|
586
|
-
groupList.push(item);
|
587
|
-
}
|
588
|
-
});
|
589
|
-
let groups = groupList.reduce((prev, item) => {
|
590
|
-
var _a;
|
591
|
-
const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
|
592
|
-
if (!prev[groupId]) {
|
593
|
-
prev[groupId] = [];
|
594
|
-
}
|
595
|
-
prev[groupId].push(item);
|
596
|
-
return prev;
|
597
|
-
}, {});
|
598
582
|
console.log(normalList, "normalList");
|
599
583
|
if (isRenderGroup) {
|
584
|
+
lists.forEach((item) => {
|
585
|
+
var _a;
|
586
|
+
if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
|
587
|
+
normalList.push(formItem(item));
|
588
|
+
} else {
|
589
|
+
groupList.push(item);
|
590
|
+
}
|
591
|
+
});
|
592
|
+
let groups = groupList.reduce((prev, item) => {
|
593
|
+
var _a;
|
594
|
+
const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
|
595
|
+
if (!prev[groupId]) {
|
596
|
+
prev[groupId] = [];
|
597
|
+
}
|
598
|
+
prev[groupId].push(item);
|
599
|
+
return prev;
|
600
|
+
}, {});
|
600
601
|
return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
|
601
602
|
} else {
|
602
603
|
return lists == null ? void 0 : lists.map((item) => formItem(item));
|
@@ -69,6 +69,16 @@ export declare const setDefaultResource: ({ cacheItem, resources }: any) => any;
|
|
69
69
|
* @Date: 2024-09-19 20:26
|
70
70
|
*/
|
71
71
|
export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any;
|
72
|
+
/**
|
73
|
+
* @title: 将商品内关联的资源id还原成数据
|
74
|
+
* @description:
|
75
|
+
* @param {any} resourcesOriginMap
|
76
|
+
* @param {any} cacheItem
|
77
|
+
* @return {*}
|
78
|
+
* @Author: zhiwei.Wang
|
79
|
+
* @Date: 2024-09-19 20:23
|
80
|
+
*/
|
81
|
+
export declare const getResourceByIds: (resourcesOriginMap: any, cacheItem: any, extraParams?: any) => any[];
|
72
82
|
/**
|
73
83
|
* @title: 预生成服务的 extend
|
74
84
|
* @description:
|
@@ -33,6 +33,7 @@ __export(utils_exports, {
|
|
33
33
|
getDurationProps: () => getDurationProps,
|
34
34
|
getFlexibleOption: () => getFlexibleOption,
|
35
35
|
getProductExtend: () => getProductExtend,
|
36
|
+
getResourceByIds: () => getResourceByIds,
|
36
37
|
getTimeObj: () => getTimeObj,
|
37
38
|
getTimeSlices: () => getTimeSlices,
|
38
39
|
getUsableTime: () => getUsableTime,
|
@@ -141,7 +142,8 @@ var getTimeObj = ({
|
|
141
142
|
cacheItem,
|
142
143
|
useStartTime,
|
143
144
|
currentResource,
|
144
|
-
|
145
|
+
// 没有使用该参数
|
146
|
+
// state,
|
145
147
|
durationProps
|
146
148
|
});
|
147
149
|
let obj = (0, import_utils.sliceDayIntoFiveMinutes)(
|
@@ -177,8 +179,12 @@ var formatResources = ({ cacheItem, resourcesOrigin, id }) => {
|
|
177
179
|
let _item = (0, import_lodash.cloneDeep)(item);
|
178
180
|
_item.renderList = _item.renderList.map((d) => {
|
179
181
|
let res = (0, import_utilsByBooking.formatResource)(d, _cacheItem, (newData) => {
|
180
|
-
|
182
|
+
let unbound = !item.optional_resource.includes(newData.id) && !item.default_resource.includes(newData.id) && newData.id !== 0;
|
183
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "resource-option" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "like-wrap" }), /* @__PURE__ */ import_react.default.createElement("span", { className: "resource-option-label-text" }, newData.labelText), (!newData.usable || unbound) && /* @__PURE__ */ import_react.default.createElement(import_AlertTriangle.default, { className: "resource-option-alert-icon" }));
|
181
184
|
});
|
185
|
+
if (!item.optional_resource.includes(d.id) && !item.default_resource.includes(d.id) && d.id !== 0) {
|
186
|
+
res.unbound = true;
|
187
|
+
}
|
182
188
|
renderListMaps[res.id] = res;
|
183
189
|
return res;
|
184
190
|
}).sort((a, b) => b.usable ? 1 : -1);
|
@@ -237,7 +243,8 @@ var setDefaultResource = ({ cacheItem, resources }) => {
|
|
237
243
|
}
|
238
244
|
const defaultResource = defaultOriginalResource.map((d) => {
|
239
245
|
return {
|
240
|
-
...d,
|
246
|
+
// ...d,
|
247
|
+
children: d.children,
|
241
248
|
relation_type: d.relation_type,
|
242
249
|
form_id: item.form_id,
|
243
250
|
relation_id: d.id,
|
@@ -280,12 +287,17 @@ var setDefaultCapacitys = ({ capacitys, cacheItem }) => {
|
|
280
287
|
}
|
281
288
|
return [{ id: 0, value: 1, name: "" }];
|
282
289
|
};
|
283
|
-
var getResourceByIds = (resourcesOriginMap, cacheItem) => {
|
290
|
+
var getResourceByIds = (resourcesOriginMap, cacheItem, extraParams) => {
|
284
291
|
var _a;
|
285
292
|
let _resources = [...((_a = cacheItem == null ? void 0 : cacheItem.product_resource) == null ? void 0 : _a.resources) || []];
|
293
|
+
const { extraResources = [] } = extraParams || {};
|
286
294
|
_resources = _resources.filter((d) => d.status == 1);
|
287
295
|
for (let item of _resources) {
|
288
296
|
const form_id = item.id;
|
297
|
+
let extraResourceIds = extraResources.filter((_extraItem) => {
|
298
|
+
return _extraItem.form_id === form_id && !item.optional_resource.includes(_extraItem.id) && !item.default_resource.includes(_extraItem.id);
|
299
|
+
}).map((_extraItem) => _extraItem.id);
|
300
|
+
extraResourceIds = Array.from(new Set(extraResourceIds));
|
289
301
|
item.optional_resource = (item.optional_resource || []).filter(
|
290
302
|
(d) => item.default_resource.indexOf(d) == -1
|
291
303
|
);
|
@@ -294,8 +306,12 @@ var getResourceByIds = (resourcesOriginMap, cacheItem) => {
|
|
294
306
|
if (resourcesOriginMap[d].combined_resource && resourcesOriginMap[d].combined_resource.status === 1) {
|
295
307
|
resourcesOriginMap[d].combined_resource.resource_ids.forEach(
|
296
308
|
(id) => {
|
309
|
+
var _a2, _b;
|
297
310
|
if (resourcesOriginMap[id]) {
|
298
|
-
combiningResources.push(
|
311
|
+
combiningResources.push({
|
312
|
+
...resourcesOriginMap[id],
|
313
|
+
relation_id: ((_a2 = resourcesOriginMap[id]) == null ? void 0 : _a2.relation_id) || ((_b = resourcesOriginMap[id]) == null ? void 0 : _b.id)
|
314
|
+
});
|
299
315
|
}
|
300
316
|
}
|
301
317
|
);
|
@@ -308,7 +324,7 @@ var getResourceByIds = (resourcesOriginMap, cacheItem) => {
|
|
308
324
|
}
|
309
325
|
};
|
310
326
|
};
|
311
|
-
let optional_resource = item.optional_resource.map((d) => {
|
327
|
+
let optional_resource = [...item.optional_resource, ...extraResourceIds].map((d) => {
|
312
328
|
if (!resourcesOriginMap[d]) {
|
313
329
|
return null;
|
314
330
|
}
|
@@ -417,9 +433,21 @@ var getProductExtend = ({ cacheItem, state, isDisabledTime }) => {
|
|
417
433
|
_cacheItem._data.capacitys = cacheItem.capacity;
|
418
434
|
}
|
419
435
|
if (!_cacheItem._data.resourcesOrigin) {
|
436
|
+
const extraResources = [];
|
437
|
+
if (Array.isArray(_cacheItem._extend.event_resources)) {
|
438
|
+
_cacheItem._extend.event_resources.forEach((_item) => {
|
439
|
+
extraResources.push({
|
440
|
+
form_id: _item.form_id,
|
441
|
+
id: _item.relation_id
|
442
|
+
});
|
443
|
+
});
|
444
|
+
}
|
420
445
|
_cacheItem._data.resourcesOrigin = getResourceByIds(
|
421
446
|
resourcesOriginMap,
|
422
|
-
cacheItem
|
447
|
+
cacheItem,
|
448
|
+
{
|
449
|
+
extraResources
|
450
|
+
}
|
423
451
|
);
|
424
452
|
}
|
425
453
|
if (!_cacheItem._data.resources) {
|
@@ -458,6 +486,7 @@ var transServiceList = (list) => {
|
|
458
486
|
getDurationProps,
|
459
487
|
getFlexibleOption,
|
460
488
|
getProductExtend,
|
489
|
+
getResourceByIds,
|
461
490
|
getTimeObj,
|
462
491
|
getTimeSlices,
|
463
492
|
getUsableTime,
|
@@ -64,6 +64,7 @@ var AddTimeModal = () => {
|
|
64
64
|
const [number, setNumber] = (0, import_react.useState)(1);
|
65
65
|
const originServices = (0, import_react.useRef)([]);
|
66
66
|
const [renderList, setRenderList] = (0, import_react.useState)([]);
|
67
|
+
console.log(renderList, "renderListrenderList");
|
67
68
|
const context = (0, import_useEngineContext.default)();
|
68
69
|
const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
69
70
|
const statusMap = {
|
@@ -125,6 +126,7 @@ var AddTimeModal = () => {
|
|
125
126
|
}
|
126
127
|
return arr.filter(Boolean);
|
127
128
|
}, [(_f = (_e = (_d = state.service) == null ? void 0 : _d.cacheItem) == null ? void 0 : _e._extend) == null ? void 0 : _f.resource]);
|
129
|
+
console.log(currentResource, "currentResource");
|
128
130
|
const getTimeUsableStatus = (time) => {
|
129
131
|
var _a2, _b2;
|
130
132
|
if (!((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend) || !currentResource.length) {
|
@@ -201,6 +203,7 @@ var AddTimeModal = () => {
|
|
201
203
|
setLoading("list");
|
202
204
|
const newList = await _getAddTimeProducts();
|
203
205
|
let list = newList.map((d) => {
|
206
|
+
debugger;
|
204
207
|
let isUsable = (0, import_utils2.isUsableProduct)(d.add_time, state.service.cacheItem);
|
205
208
|
return {
|
206
209
|
...d,
|
@@ -43,7 +43,20 @@ var import_lodash = require("lodash");
|
|
43
43
|
var import_utils2 = require("../utils");
|
44
44
|
var import_ahooks = require("ahooks");
|
45
45
|
var import_icons = require("@ant-design/icons");
|
46
|
-
var Resources = ({
|
46
|
+
var Resources = ({
|
47
|
+
state,
|
48
|
+
cacheItem,
|
49
|
+
getCurrentCacheItem,
|
50
|
+
onChange,
|
51
|
+
value,
|
52
|
+
config = {
|
53
|
+
// 是否显示自动分配
|
54
|
+
autoAllocation: true,
|
55
|
+
// 是否显示资源错误图标
|
56
|
+
resourceErrorIcon: true,
|
57
|
+
disabled: false
|
58
|
+
}
|
59
|
+
}, ref) => {
|
47
60
|
var _a, _b;
|
48
61
|
const [showError, setShowError] = (0, import_react.useState)(false);
|
49
62
|
const update = (0, import_ahooks.useUpdate)();
|
@@ -134,7 +147,7 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
134
147
|
);
|
135
148
|
});
|
136
149
|
},
|
137
|
-
[]
|
150
|
+
[config == null ? void 0 : config.resourceErrorIcon]
|
138
151
|
);
|
139
152
|
const check = () => {
|
140
153
|
var _a2;
|
@@ -155,9 +168,11 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
155
168
|
const getIsAutoAllocation = (id) => {
|
156
169
|
return (0, import_utils2.getAutoAllocationStorage)(id);
|
157
170
|
};
|
171
|
+
console.log("resourcesss");
|
158
172
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.map((item) => {
|
159
173
|
var _a2;
|
160
174
|
const cur = _value[item.form_id];
|
175
|
+
console.log(cur, "curcur");
|
161
176
|
const errors = (cur || []).reduce((pre, d) => {
|
162
177
|
return pre.concat((d == null ? void 0 : d.errors) || []);
|
163
178
|
}, []);
|
@@ -166,6 +181,7 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
166
181
|
{
|
167
182
|
label: item.title,
|
168
183
|
required: true,
|
184
|
+
labelCol: config == null ? void 0 : config.labelCol,
|
169
185
|
extra: showError && item.select_type.min > (cur == null ? void 0 : cur.length) ? /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#ff4d4f" } }, import_utils.locales.getText(
|
170
186
|
"page.booking.text.resource.min-length-error"
|
171
187
|
)(item.select_type.min, item.title)) : void 0
|
@@ -173,9 +189,12 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
173
189
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "resource-col" }, item.select_type.type === "multiple" ? null : /* @__PURE__ */ import_react.default.createElement(
|
174
190
|
import_antd.Button,
|
175
191
|
{
|
176
|
-
className: "resource-col-like-wrap"
|
192
|
+
className: `resource-col-like-wrap ${(config == null ? void 0 : config.disabled) ? "resource-col-like-wrap-disabled" : ""}`,
|
177
193
|
onClick: () => {
|
178
194
|
var _a3;
|
195
|
+
if (config == null ? void 0 : config.disabled) {
|
196
|
+
return;
|
197
|
+
}
|
179
198
|
setLikeStatus(
|
180
199
|
((_a3 = cur == null ? void 0 : cur[0]) == null ? void 0 : _a3.like_status) === "like" ? "common" : "like",
|
181
200
|
item.form_id,
|
@@ -183,7 +202,13 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
183
202
|
);
|
184
203
|
}
|
185
204
|
},
|
186
|
-
/* @__PURE__ */ import_react.default.createElement(
|
205
|
+
/* @__PURE__ */ import_react.default.createElement(
|
206
|
+
import_like.default,
|
207
|
+
{
|
208
|
+
status: (_a2 = cur == null ? void 0 : cur[0]) == null ? void 0 : _a2.like_status,
|
209
|
+
className: `${(config == null ? void 0 : config.disabled) ? "like-icon-disabled" : ""}`
|
210
|
+
}
|
211
|
+
)
|
187
212
|
), /* @__PURE__ */ import_react.default.createElement(
|
188
213
|
import_MaxLengthSelect.default,
|
189
214
|
{
|
@@ -204,14 +229,35 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
204
229
|
showSearch: true,
|
205
230
|
filterOption: (str, option) => {
|
206
231
|
return ((option == null ? void 0 : option.labelText) || "").toLowerCase().includes((str || "").toLowerCase());
|
232
|
+
},
|
233
|
+
disabled: config == null ? void 0 : config.disabled
|
234
|
+
},
|
235
|
+
renderOptions(
|
236
|
+
item.renderList,
|
237
|
+
"id",
|
238
|
+
(config == null ? void 0 : config.resourceErrorIcon) ? "label" : "labelText",
|
239
|
+
"resource"
|
240
|
+
)
|
241
|
+
), (config == null ? void 0 : config.autoAllocation) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
242
|
+
import_antd.Checkbox,
|
243
|
+
{
|
244
|
+
checked: getIsAutoAllocation(item.form_id),
|
245
|
+
onChange: (e) => {
|
246
|
+
handleCheckAutoAllocation(
|
247
|
+
item.form_id,
|
248
|
+
e.target.checked
|
249
|
+
);
|
207
250
|
}
|
251
|
+
}
|
252
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
253
|
+
import_antd.Tooltip,
|
254
|
+
{
|
255
|
+
title: import_utils.locales.getText(
|
256
|
+
"page.booking.text.resource.check-auto-allocation-tip"
|
257
|
+
)
|
208
258
|
},
|
209
|
-
|
210
|
-
)
|
211
|
-
handleCheckAutoAllocation(item.form_id, e.target.checked);
|
212
|
-
} }), /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: import_utils.locales.getText(
|
213
|
-
"page.booking.text.resource.check-auto-allocation-tip"
|
214
|
-
) }, /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, null)))
|
259
|
+
/* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, null)
|
260
|
+
)) : null)
|
215
261
|
), state.renderType !== "eventBooking" && (errors || []).map((d) => {
|
216
262
|
return /* @__PURE__ */ import_react.default.createElement(
|
217
263
|
import_antd.Alert,
|
package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { SelectProps } from 'antd';
|
3
|
+
interface MaxLengthSelectProps<T> extends SelectProps<T> {
|
4
|
+
maxLength: number;
|
5
|
+
}
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<MaxLengthSelectProps<any>> & import("react").RefAttributes<unknown>>;
|
7
|
+
export default _default;
|
@@ -0,0 +1,53 @@
|
|
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/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.tsx
|
20
|
+
var MaxLengthSelect_exports = {};
|
21
|
+
__export(MaxLengthSelect_exports, {
|
22
|
+
default: () => MaxLengthSelect_default
|
23
|
+
});
|
24
|
+
module.exports = __toCommonJS(MaxLengthSelect_exports);
|
25
|
+
var import_react = require("react");
|
26
|
+
var import_antd = require("antd");
|
27
|
+
var MaxLengthSelect = (props, ref) => {
|
28
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
29
|
+
return {
|
30
|
+
onChange: handleChange
|
31
|
+
};
|
32
|
+
});
|
33
|
+
const handleChange = (e, _option) => {
|
34
|
+
if (props.onChange) {
|
35
|
+
if ((props.mode === "multiple" || props.mode === "tags") && props.maxLength) {
|
36
|
+
if (props.value && props.value.length >= props.maxLength && e.length > props.value.length) {
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
props.onChange(e, _option);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
return /* @__PURE__ */ React.createElement(
|
44
|
+
import_antd.Select,
|
45
|
+
{
|
46
|
+
...props,
|
47
|
+
onChange: handleChange,
|
48
|
+
popupMatchSelectWidth: false
|
49
|
+
},
|
50
|
+
props.children
|
51
|
+
);
|
52
|
+
};
|
53
|
+
var MaxLengthSelect_default = (0, import_react.forwardRef)(MaxLengthSelect);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.less';
|
3
|
+
interface IResourcesProps {
|
4
|
+
[key: string]: any;
|
5
|
+
/** 展示资源的变动情况 */
|
6
|
+
originCacheItem: any;
|
7
|
+
originValue: any;
|
8
|
+
}
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<IResourcesProps, "ref"> & React.RefAttributes<unknown>>;
|
10
|
+
export default _default;
|