@pisell/private-materials 6.3.78 → 6.3.79
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Cart/index.d.ts +1 -1
- package/es/components/Sales/Cart/index.js +18 -3
- package/es/components/Sales/Cart/utils.d.ts +68 -0
- package/es/components/Sales/Checkout/utils.d.ts +41 -0
- package/es/components/Sales/Checkout/utils.js +57 -1
- package/es/components/Sales/Summary/index.d.ts +2 -0
- package/es/components/Sales/Summary/index.js +7 -2
- package/es/components/Sales/Summary/utils.d.ts +58 -0
- package/es/components/Sales/Summary/utils.js +57 -10
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +62 -4
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +5 -1
- package/es/components/appointmentBooking/components/Deposit/index.js +9 -4
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/locales.d.ts +366 -0
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/components/tabPane/index.d.ts +4 -0
- package/es/components/booking/deposit/DepositItem/index.d.ts +25 -0
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- 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/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/utils.d.ts +1 -0
- 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/model.d.ts +10 -1
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -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.d.ts +1 -0
- package/es/components/booking/info/service2/utils.js +4 -4
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/editService/utils.d.ts +13 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/addNote/index.d.ts +3 -0
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/const.d.ts +184 -0
- package/es/components/eftposPay/device.d.ts +1 -2
- package/es/components/eftposPay/hooks.d.ts +35 -0
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/linkly/index.d.ts +0 -1
- package/es/components/eftposPay/locales.d.ts +330 -0
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +355 -0
- package/es/components/eftposPay/tyro/index.d.ts +9 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +4 -2
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +4 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +79 -6
- package/es/components/eventBooking/components/Provider/Cart/Item/index.less +7 -6
- package/es/components/eventBooking/components/Provider/Cart/index.js +2 -7
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.less +1 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- 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/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
- package/es/components/eventBooking/components/Voucher/index.js +1 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/pay/toC/PaymentList/utils.d.ts +36 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/index.d.ts +10 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +40 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/ruleSetting/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/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/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/type.d.ts +48 -0
- package/es/components/subTotal/index.d.ts +2 -0
- package/es/components/subTotal/index.js +42 -20
- package/es/components/subTotal/locales.d.ts +42 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/locales.d.ts +174 -0
- package/es/hooks/useEngineContext.d.ts +10 -0
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/es/plus/selectHolder/locales.d.ts +21 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/types.d.ts +429 -0
- package/es/plus/skuOptionsSelection/utils/transformSelectorValueToValue.d.ts +4 -0
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +4 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/pro/NumericStepper/index.d.ts +43 -0
- package/es/pro/Selector/Selector.d.ts +14 -0
- package/es/pro/Selector/components/Card/index.d.ts +57 -0
- package/es/pro/Selector/components/Indicator/index.d.ts +19 -0
- package/es/pro/Selector/components/LayoutContainer/index.d.ts +16 -0
- package/es/pro/Selector/demo.d.ts +0 -1
- package/es/pro/Selector/hooks/usePresetProps.d.ts +24 -0
- package/es/pro/Selector/types.d.ts +173 -0
- package/es/pro/pisellNumberSelector/example.d.ts +3 -0
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.d.ts +1 -1
- package/lib/components/Sales/Cart/index.js +20 -7
- package/lib/components/Sales/Cart/utils.d.ts +68 -0
- package/lib/components/Sales/Checkout/utils.d.ts +41 -0
- package/lib/components/Sales/Checkout/utils.js +64 -1
- package/lib/components/Sales/Summary/index.d.ts +2 -0
- package/lib/components/Sales/Summary/index.js +8 -2
- package/lib/components/Sales/Summary/utils.d.ts +58 -0
- package/lib/components/Sales/Summary/utils.js +38 -13
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +52 -4
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +5 -1
- package/lib/components/appointmentBooking/components/Deposit/index.js +7 -4
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/locales.d.ts +366 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/components/tabPane/index.d.ts +4 -0
- package/lib/components/booking/deposit/DepositItem/index.d.ts +25 -0
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- 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/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/utils.d.ts +1 -0
- 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/model.d.ts +10 -1
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -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.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.js +4 -4
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/editService/utils.d.ts +13 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/addNote/index.d.ts +3 -0
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/const.d.ts +184 -0
- package/lib/components/eftposPay/device.d.ts +1 -2
- package/lib/components/eftposPay/hooks.d.ts +35 -0
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/linkly/index.d.ts +0 -1
- package/lib/components/eftposPay/locales.d.ts +330 -0
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +355 -0
- package/lib/components/eftposPay/tyro/index.d.ts +9 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +4 -2
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +3 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +77 -5
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +7 -6
- package/lib/components/eventBooking/components/Provider/Cart/index.js +2 -2
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.less +1 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- 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/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
- package/lib/components/eventBooking/components/Voucher/index.js +1 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/pay/toC/PaymentList/utils.d.ts +36 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/index.d.ts +10 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +40 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/ruleSetting/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/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/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/type.d.ts +48 -0
- package/lib/components/subTotal/index.d.ts +2 -0
- package/lib/components/subTotal/index.js +34 -20
- package/lib/components/subTotal/locales.d.ts +42 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/locales.d.ts +174 -0
- package/lib/hooks/useEngineContext.d.ts +10 -0
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/plus/selectHolder/locales.d.ts +21 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/types.d.ts +429 -0
- package/lib/plus/skuOptionsSelection/utils/transformSelectorValueToValue.d.ts +4 -0
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +4 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/pro/NumericStepper/index.d.ts +43 -0
- package/lib/pro/Selector/Selector.d.ts +14 -0
- package/lib/pro/Selector/components/Card/index.d.ts +57 -0
- package/lib/pro/Selector/components/Indicator/index.d.ts +19 -0
- package/lib/pro/Selector/components/LayoutContainer/index.d.ts +16 -0
- package/lib/pro/Selector/demo.d.ts +0 -1
- package/lib/pro/Selector/hooks/usePresetProps.d.ts +24 -0
- package/lib/pro/Selector/types.d.ts +173 -0
- package/lib/pro/pisellNumberSelector/example.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ExprRule {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface RuleConfig {
|
|
6
|
+
autoValidate?: boolean;
|
|
7
|
+
required?: 0 | 1;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
mutex?: Array<Array<OptionKey>>;
|
|
11
|
+
customValidator?: (value: SelectionValue) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface GroupItem {
|
|
14
|
+
id?: number;
|
|
15
|
+
title?: string;
|
|
16
|
+
mode?: 'single' | 'multiple';
|
|
17
|
+
valueType?: 'primitive' | 'object';
|
|
18
|
+
preserve?: boolean;
|
|
19
|
+
fieldNames?: {
|
|
20
|
+
label?: string;
|
|
21
|
+
value?: string;
|
|
22
|
+
cover?: string;
|
|
23
|
+
};
|
|
24
|
+
ruleConfig?: RuleConfig;
|
|
25
|
+
dataSource?: OptionItem[];
|
|
26
|
+
}
|
|
27
|
+
export interface OptionItem {
|
|
28
|
+
id?: number;
|
|
29
|
+
title?: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
value?: OptionKey;
|
|
32
|
+
cover?: string;
|
|
33
|
+
groups?: GroupItem[];
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
ruleConfig?: {
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
};
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
export declare type OptionKey = number | string;
|
|
42
|
+
/** 原始值类型:单选时为id,多选时为id[] */
|
|
43
|
+
export declare type SelectionValuePrimitive<T = OptionKey> = T | T[];
|
|
44
|
+
/** 复杂对象值类型:包含id、数量等额外信息 */
|
|
45
|
+
export interface SelectionValueObject<T = OptionKey> {
|
|
46
|
+
value?: T;
|
|
47
|
+
quantity?: number;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
/** 单选值类型 */
|
|
51
|
+
export declare type SelectionValueSingle<T = OptionKey> = T | SelectionValueObject<T>;
|
|
52
|
+
/** 多选值类型 */
|
|
53
|
+
export declare type SelectionValueMultiple<T = OptionKey> = T[] | SelectionValueObject<T>[];
|
|
54
|
+
/** 选择器值类型 */
|
|
55
|
+
export declare type SelectionValue<T = OptionKey> = SelectionValueSingle<T> | SelectionValueMultiple<T>;
|
|
56
|
+
export declare type RenderItemProps = {
|
|
57
|
+
dataSource: OptionItem;
|
|
58
|
+
actions: any;
|
|
59
|
+
optionItemValue?: any;
|
|
60
|
+
indicator: React.ReactNode;
|
|
61
|
+
numberSelector: React.ReactNode;
|
|
62
|
+
values: any;
|
|
63
|
+
quantityInfo: {
|
|
64
|
+
maxReached: boolean;
|
|
65
|
+
remainingCount: number;
|
|
66
|
+
selectedCount: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare type ItemProps = {
|
|
70
|
+
layout?: 'vertical' | 'horizontal';
|
|
71
|
+
renderContent?: (props: {
|
|
72
|
+
dataSource: OptionItem;
|
|
73
|
+
}) => React.ReactNode;
|
|
74
|
+
styles?: {
|
|
75
|
+
[key: string]: React.CSSProperties;
|
|
76
|
+
};
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
};
|
|
79
|
+
export declare type LayoutType = 'antdGrid' | 'custom';
|
|
80
|
+
export declare type LayoutConfig = {
|
|
81
|
+
type?: LayoutType;
|
|
82
|
+
className?: string;
|
|
83
|
+
containerStyle?: React.CSSProperties;
|
|
84
|
+
columns?: number;
|
|
85
|
+
gutter?: number | object | Array<number>;
|
|
86
|
+
align?: 'top' | 'middle' | 'bottom' | 'stretch';
|
|
87
|
+
justify?: 'start' | 'end' | 'center' | 'space-between' | 'space-around';
|
|
88
|
+
wrap?: boolean;
|
|
89
|
+
colConfig?: {
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export interface PresetConfig {
|
|
94
|
+
variant?: '1' | '2' | '3' | '4' | '5';
|
|
95
|
+
}
|
|
96
|
+
export declare type ItemLayout = 'vertical' | 'horizontal';
|
|
97
|
+
export declare type SelectorVariant = 'default' | 'select' | 'card' | 'media';
|
|
98
|
+
export declare type HeaderProps = {
|
|
99
|
+
visible?: boolean;
|
|
100
|
+
style?: React.CSSProperties;
|
|
101
|
+
title?: {
|
|
102
|
+
visible?: boolean;
|
|
103
|
+
text?: React.ReactNode;
|
|
104
|
+
style?: React.CSSProperties;
|
|
105
|
+
};
|
|
106
|
+
icon?: {
|
|
107
|
+
visible?: boolean;
|
|
108
|
+
icon?: React.ReactNode;
|
|
109
|
+
style?: React.CSSProperties;
|
|
110
|
+
};
|
|
111
|
+
tip?: {
|
|
112
|
+
visible?: boolean;
|
|
113
|
+
text?: React.ReactNode;
|
|
114
|
+
style?: React.CSSProperties;
|
|
115
|
+
};
|
|
116
|
+
renderExtra?: (props: {
|
|
117
|
+
dataSource: OptionItem;
|
|
118
|
+
values: SelectionValue;
|
|
119
|
+
}) => React.ReactNode;
|
|
120
|
+
};
|
|
121
|
+
export interface SelectorProps<T = OptionKey> extends GroupItem {
|
|
122
|
+
className?: string;
|
|
123
|
+
value?: SelectionValue<T>;
|
|
124
|
+
defaultValue?: SelectionValue<T>;
|
|
125
|
+
onChange?: (value: SelectionValue<T>) => void;
|
|
126
|
+
onClear?: () => void;
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
variant?: SelectorVariant;
|
|
129
|
+
itemLayout?: ItemLayout;
|
|
130
|
+
preset?: PresetConfig;
|
|
131
|
+
layout?: LayoutConfig;
|
|
132
|
+
renderItem?: (props: RenderItemProps) => React.ReactNode;
|
|
133
|
+
itemProps?: ItemProps;
|
|
134
|
+
indicatorProps?: {
|
|
135
|
+
show?: boolean;
|
|
136
|
+
variant?: 'outlined' | 'filled';
|
|
137
|
+
render?: (props: {
|
|
138
|
+
option: OptionItem;
|
|
139
|
+
selected: boolean;
|
|
140
|
+
disabled: boolean;
|
|
141
|
+
actions: any;
|
|
142
|
+
}) => React.ReactNode;
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
};
|
|
145
|
+
showStepper?: true | false | 'auto';
|
|
146
|
+
stepperProps?: {
|
|
147
|
+
size?: 'small' | 'middle' | 'large';
|
|
148
|
+
shape?: 'round' | 'square';
|
|
149
|
+
};
|
|
150
|
+
style?: React.CSSProperties;
|
|
151
|
+
/**
|
|
152
|
+
* @deprecated
|
|
153
|
+
*/
|
|
154
|
+
titleProps?: HeaderProps;
|
|
155
|
+
headerProps?: HeaderProps;
|
|
156
|
+
}
|
|
157
|
+
export interface SelectorGroupProps {
|
|
158
|
+
allowedValuesPolicy?: 'relaxed' | 'strict';
|
|
159
|
+
className?: string;
|
|
160
|
+
customScrollParent?: HTMLElement | string;
|
|
161
|
+
dataSource: GroupItem[];
|
|
162
|
+
defaultValue?: Record<string, SelectionValue>;
|
|
163
|
+
linkageRules?: ExprRule[] | Record<string, any>;
|
|
164
|
+
onChange?: (values: Record<string, SelectionValue>) => void;
|
|
165
|
+
preserve?: boolean;
|
|
166
|
+
tabProps?: {
|
|
167
|
+
visible?: boolean;
|
|
168
|
+
};
|
|
169
|
+
style?: React.CSSProperties;
|
|
170
|
+
value?: Record<string, SelectionValue>;
|
|
171
|
+
scrollToFirstError?: boolean;
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
}
|
|
@@ -13,7 +13,7 @@ interface CartContextType {
|
|
|
13
13
|
createCartItemFromEvent: (eventItem: any) => CartItem;
|
|
14
14
|
createCartItemFromHolder: (holderItem: any) => CartItem;
|
|
15
15
|
addToCart: () => void;
|
|
16
|
-
updateCartItem: (cartItem: CartItem) => CartItem;
|
|
16
|
+
updateCartItem: (cartItem: CartItem, updateType?: 'deposit') => CartItem;
|
|
17
17
|
deleteCartItem: (cartItem: CartItem) => void;
|
|
18
18
|
clickCartItem: (cartItem: CartItem) => void;
|
|
19
19
|
updateCurrentCartItem: (cartItem: Partial<CartItem>) => void;
|
|
@@ -241,10 +241,7 @@ var CartProvider = ({ children }) => {
|
|
|
241
241
|
const endDateInfo = (_g = (_f = eventItem == null ? void 0 : eventItem.eventDetail) == null ? void 0 : _f.selectDate) == null ? void 0 : _g.endDateInfo;
|
|
242
242
|
const endTime = (_j = (_i = (_h = endDateInfo == null ? void 0 : endDateInfo.times) == null ? void 0 : _h.slice(-1)) == null ? void 0 : _i[0]) == null ? void 0 : _j.end_at;
|
|
243
243
|
const num = 1;
|
|
244
|
-
const { price, totalPrice, originTotal, is_charge_tax } = (0, import_utils3.handleProductInfo)(
|
|
245
|
-
eventDetail,
|
|
246
|
-
num
|
|
247
|
-
);
|
|
244
|
+
const { price, totalPrice, originTotal, is_charge_tax } = (0, import_utils3.handleProductInfo)(eventDetail, num);
|
|
248
245
|
const transformProduct = (_temp) => {
|
|
249
246
|
var _a2;
|
|
250
247
|
if (!((_a2 = _temp == null ? void 0 : _temp.variant) == null ? void 0 : _a2.length)) {
|
|
@@ -305,6 +302,7 @@ var CartProvider = ({ children }) => {
|
|
|
305
302
|
event_unique_identifier: _id
|
|
306
303
|
// 传递给接口用于商品可用性检测的比对
|
|
307
304
|
},
|
|
305
|
+
_eventDetail: eventDetail,
|
|
308
306
|
_productDetail: eventDetail.productDetail,
|
|
309
307
|
_productOrigin: transformProduct(
|
|
310
308
|
((_p = eventDetail == null ? void 0 : eventDetail.productDetail) == null ? void 0 : _p.origin) || bookingOptionData
|
|
@@ -337,9 +335,24 @@ var CartProvider = ({ children }) => {
|
|
|
337
335
|
});
|
|
338
336
|
}
|
|
339
337
|
};
|
|
340
|
-
const updateCartItem = (cartItem) => {
|
|
341
|
-
|
|
342
|
-
|
|
338
|
+
const updateCartItem = (cartItem, updateType) => {
|
|
339
|
+
var _a, _b, _c;
|
|
340
|
+
let newCartItems = (_c = (_b = (_a = getCurrentData()) == null ? void 0 : _a.cartData) == null ? void 0 : _b.cartItems) == null ? void 0 : _c.map(
|
|
341
|
+
(item) => {
|
|
342
|
+
if (item._id === cartItem._id) {
|
|
343
|
+
const _tempCartItem = { ...cartItem || {} };
|
|
344
|
+
if (updateType === "deposit") {
|
|
345
|
+
const eventDetail = _tempCartItem == null ? void 0 : _tempCartItem._eventDetail;
|
|
346
|
+
if (eventDetail) {
|
|
347
|
+
const num = (_tempCartItem == null ? void 0 : _tempCartItem.num) || 1;
|
|
348
|
+
const deposit = (0, import_utils3.handleProductDeposit)(_tempCartItem, eventDetail, num);
|
|
349
|
+
_tempCartItem.deposit = deposit;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return _tempCartItem;
|
|
353
|
+
}
|
|
354
|
+
return item;
|
|
355
|
+
}
|
|
343
356
|
);
|
|
344
357
|
setCartData({
|
|
345
358
|
cartItems: newCartItems
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
2
|
+
import { ICalculatePriceParams } from './types';
|
|
3
|
+
export declare const handleProductInfo: (eventDetail: any, num: number) => {
|
|
4
|
+
price: number;
|
|
5
|
+
totalPrice: number;
|
|
6
|
+
originTotal: any;
|
|
7
|
+
is_charge_tax: any;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 获取商品价格
|
|
11
|
+
*/
|
|
12
|
+
export declare const getPrice: (params: ICalculatePriceParams) => number;
|
|
13
|
+
/**
|
|
14
|
+
* 获取商品总价
|
|
15
|
+
* @description 当前总价计算基于商品数量为1
|
|
16
|
+
* @param item 商品
|
|
17
|
+
* @returns 商品总价
|
|
18
|
+
*/
|
|
19
|
+
export declare const getTotalPrice: (params: ICalculatePriceParams) => number;
|
|
20
|
+
/**
|
|
21
|
+
* 获取商品原始总价
|
|
22
|
+
* @description 当前总价计算基于商品数量为1
|
|
23
|
+
* @param item 商品
|
|
24
|
+
* @returns 商品原始总价
|
|
25
|
+
*/
|
|
26
|
+
export declare const getOriginTotalPrice: (params: ICalculatePriceParams) => number | undefined;
|
|
27
|
+
export declare const handleCartItemOrigin: (cartItem: any, eventDetail: any) => any;
|
|
28
|
+
export declare const formatBundleToOrigin: (bundle: any) => any;
|
|
29
|
+
export declare const formatOptionsToOrigin: (options: any) => any;
|
|
30
|
+
export declare const handleProductDeposit: (cartItem: any, eventDetail: any, num: number) => {
|
|
31
|
+
total: number;
|
|
32
|
+
protocols: any;
|
|
33
|
+
} | null;
|
|
34
|
+
/**
|
|
35
|
+
* 获取商品定金
|
|
36
|
+
* @description 定金基于商品售价来算,最终乘商品数量
|
|
37
|
+
* 1、如果套餐主商品有定金规则,则定金为:(套餐商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
|
|
38
|
+
* 2、如果套餐主商品没有定金规则,子商品有定金规则,则定金为:(套餐子商品售价 * 套餐子商品定金百分比 + 套餐子商品定金固定金额)* 商品数量,最终将所有子商品定金相加
|
|
39
|
+
* 3、普通商品/单规格商品/组合规则商品,定金规则:(商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
|
|
40
|
+
* @param params 参数
|
|
41
|
+
* @returns 商品定金
|
|
42
|
+
*/
|
|
43
|
+
export declare const getProductDeposit: (params: {
|
|
44
|
+
cartItem: any;
|
|
45
|
+
product: any;
|
|
46
|
+
bundle?: any;
|
|
47
|
+
options?: any;
|
|
48
|
+
num?: number;
|
|
49
|
+
}) => {
|
|
50
|
+
total: number;
|
|
51
|
+
protocols: any;
|
|
52
|
+
} | null;
|
|
53
|
+
/**
|
|
54
|
+
* 计算商品定金
|
|
55
|
+
* @param params 参数
|
|
56
|
+
* @returns 商品定金
|
|
57
|
+
*/
|
|
58
|
+
export declare const calculateProductDeposit: (params: {
|
|
59
|
+
depositData: {
|
|
60
|
+
deposit_fixed?: string;
|
|
61
|
+
deposit_percentage?: string;
|
|
62
|
+
};
|
|
63
|
+
total: string | number;
|
|
64
|
+
num: number;
|
|
65
|
+
}) => {
|
|
66
|
+
result: boolean;
|
|
67
|
+
depositTotal: Decimal;
|
|
68
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 套餐单规格信息
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {any} option
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: zhiwei.Wang
|
|
7
|
+
* @Date: 2024-02-19 09:26
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatProductOption: (option: any) => any;
|
|
10
|
+
/**
|
|
11
|
+
* @title: 套餐信息
|
|
12
|
+
* @description:
|
|
13
|
+
* @param {any} bundle
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @Author: zhiwei.Wang
|
|
16
|
+
* @Date: 2024-02-19 09:26
|
|
17
|
+
*/
|
|
18
|
+
export declare const formatProductBundle: (bundle: any) => any;
|
|
19
|
+
/**
|
|
20
|
+
* @title: 格式化下单接口数据
|
|
21
|
+
* @description:
|
|
22
|
+
* @param {any} state saledModel数据源
|
|
23
|
+
* @param {boolean} excludeDisabled 是否需要排除购物车中失效商品
|
|
24
|
+
* @Author: xiangfeng.xue
|
|
25
|
+
* @Date: 2025-01-21 17:57
|
|
26
|
+
*/
|
|
27
|
+
export declare const formatValues: (params: {
|
|
28
|
+
state: any;
|
|
29
|
+
platform: 'h5' | 'pc';
|
|
30
|
+
excludeDisabled?: boolean;
|
|
31
|
+
extra?: Record<string, any>;
|
|
32
|
+
otherValue?: Record<string, any>;
|
|
33
|
+
}) => any;
|
|
34
|
+
/**
|
|
35
|
+
* @title: 获取拉开表单弹窗参数
|
|
36
|
+
* @param state
|
|
37
|
+
*/
|
|
38
|
+
export declare const getFormParams: (state: any) => {
|
|
39
|
+
product_id: any;
|
|
40
|
+
appointment_type: string;
|
|
41
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
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
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/Sales/Checkout/utils.ts
|
|
@@ -25,6 +35,7 @@ __export(utils_exports, {
|
|
|
25
35
|
getFormParams: () => getFormParams
|
|
26
36
|
});
|
|
27
37
|
module.exports = __toCommonJS(utils_exports);
|
|
38
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
28
39
|
var formatProductOption = (option) => {
|
|
29
40
|
if (!option) {
|
|
30
41
|
return [];
|
|
@@ -57,10 +68,62 @@ var formatProductBundle = (bundle) => {
|
|
|
57
68
|
var formatBookings = (list) => {
|
|
58
69
|
let bookings = [];
|
|
59
70
|
bookings = list.map((item) => {
|
|
60
|
-
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
const newOriginData = { ...item._originData || {} };
|
|
73
|
+
const product = (newOriginData == null ? void 0 : newOriginData.product) || {};
|
|
74
|
+
const discount_list = product == null ? void 0 : product.discount_list;
|
|
75
|
+
const main_product_discount = discount_list == null ? void 0 : discount_list.filter(
|
|
76
|
+
(d) => {
|
|
77
|
+
var _a2;
|
|
78
|
+
return !((_a2 = d.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
if (main_product_discount == null ? void 0 : main_product_discount.length) {
|
|
82
|
+
product.metadata = {
|
|
83
|
+
product_discount_difference: handleProductDiscountDifference([
|
|
84
|
+
main_product_discount
|
|
85
|
+
])
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
console.log("main_product_discount", main_product_discount);
|
|
89
|
+
if ((_a = product == null ? void 0 : product.product_bundle) == null ? void 0 : _a.length) {
|
|
90
|
+
product.product_bundle = (_c = (_b = product == null ? void 0 : product.product_bundle) == null ? void 0 : _b.map) == null ? void 0 : _c.call(_b, (v) => {
|
|
91
|
+
var _a2, _b2, _c2, _d;
|
|
92
|
+
const bundle_item_discount = [];
|
|
93
|
+
(_b2 = (_a2 = item == null ? void 0 : item.selectedBundle) == null ? void 0 : _a2.forEach) == null ? void 0 : _b2.call(_a2, (s) => {
|
|
94
|
+
if ((s == null ? void 0 : s.id) === (v == null ? void 0 : v.bundle_id) && (s == null ? void 0 : s.group_id) === (v == null ? void 0 : v.bundle_group_id) && (s == null ? void 0 : s._bundle_product_id) === (v == null ? void 0 : v.bundle_product_id)) {
|
|
95
|
+
bundle_item_discount.push(...(s == null ? void 0 : s.discount_list) || []);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
console.log("bundle_item_discount", bundle_item_discount);
|
|
99
|
+
const newBundleItem = { ...v || {} };
|
|
100
|
+
if (bundle_item_discount == null ? void 0 : bundle_item_discount.length) {
|
|
101
|
+
newBundleItem.metadata = {
|
|
102
|
+
custom_product_bundle_map_id: (_d = (_c2 = bundle_item_discount == null ? void 0 : bundle_item_discount[0]) == null ? void 0 : _c2.metadata) == null ? void 0 : _d.custom_product_bundle_map_id,
|
|
103
|
+
product_discount_difference: handleProductDiscountDifference(bundle_item_discount)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return newBundleItem;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
newOriginData.product = product;
|
|
110
|
+
return newOriginData;
|
|
61
111
|
});
|
|
112
|
+
console.log("bookings>>>>", bookings);
|
|
62
113
|
return bookings;
|
|
63
114
|
};
|
|
115
|
+
var handleProductDiscountDifference = (discount_list) => {
|
|
116
|
+
const product_discount_difference = discount_list == null ? void 0 : discount_list.reduce(
|
|
117
|
+
(pre, cur) => {
|
|
118
|
+
var _a;
|
|
119
|
+
return pre.plus(
|
|
120
|
+
new import_decimal.default(((_a = cur == null ? void 0 : cur.metadata) == null ? void 0 : _a.product_discount_difference) || 0)
|
|
121
|
+
);
|
|
122
|
+
},
|
|
123
|
+
new import_decimal.default(0)
|
|
124
|
+
);
|
|
125
|
+
return product_discount_difference.toNumber();
|
|
126
|
+
};
|
|
64
127
|
var formatValues = (params) => {
|
|
65
128
|
var _a, _b;
|
|
66
129
|
const { state, otherValue, platform, excludeDisabled, extra } = params;
|
|
@@ -40,6 +40,7 @@ var import_Cart = require("../Cart");
|
|
|
40
40
|
var import_utils = require("./utils");
|
|
41
41
|
var import_Init = require("../Init");
|
|
42
42
|
var import_serve = require("./serve");
|
|
43
|
+
var import_useEngineContext = require("../../../hooks/useEngineContext");
|
|
43
44
|
var defaultState = {};
|
|
44
45
|
var SummaryContext = (0, import_react.createContext)(
|
|
45
46
|
void 0
|
|
@@ -47,15 +48,18 @@ var SummaryContext = (0, import_react.createContext)(
|
|
|
47
48
|
var SummaryProvider = ({
|
|
48
49
|
children
|
|
49
50
|
}) => {
|
|
51
|
+
const pisellos = (0, import_useEngineContext.usePisellOS)();
|
|
50
52
|
const { cartData } = (0, import_Cart.useCart)();
|
|
51
53
|
const { initData } = (0, import_Init.useInit)();
|
|
52
54
|
const [isAgreeDepositPolicy, setIsAgreeDepositPolicy] = (0, import_react.useState)(false);
|
|
55
|
+
const summaryModule = pisellos.getModule("summary");
|
|
53
56
|
const summaryData = (0, import_react.useMemo)(() => {
|
|
54
57
|
return (0, import_utils.calculatePriceDetails)(
|
|
55
58
|
(initData == null ? void 0 : initData.shop) || {},
|
|
56
|
-
cartData.cartItems
|
|
59
|
+
cartData.cartItems,
|
|
60
|
+
summaryModule
|
|
57
61
|
);
|
|
58
|
-
}, [cartData.cartItems, initData == null ? void 0 : initData.shop]);
|
|
62
|
+
}, [cartData.cartItems, initData == null ? void 0 : initData.shop, summaryModule]);
|
|
59
63
|
const contextValue = {
|
|
60
64
|
// 商品总价
|
|
61
65
|
subtotal: summaryData.subtotal,
|
|
@@ -64,6 +68,8 @@ var SummaryProvider = ({
|
|
|
64
68
|
taxTitle: summaryData.taxTitle,
|
|
65
69
|
totalTaxFee: summaryData.totalTaxFee,
|
|
66
70
|
isPriceIncludeTax: summaryData.isPriceIncludeTax,
|
|
71
|
+
taxRate: summaryData.taxRate,
|
|
72
|
+
surcharge: summaryData.surcharge,
|
|
67
73
|
deposit: summaryData.deposit,
|
|
68
74
|
isAgreeDepositPolicy,
|
|
69
75
|
setIsAgreeDepositPolicy,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
interface CartItem {
|
|
2
|
+
price: number | string;
|
|
3
|
+
quantity?: number;
|
|
4
|
+
[k: string]: any;
|
|
5
|
+
}
|
|
6
|
+
interface PriceDetail {
|
|
7
|
+
subtotal: string;
|
|
8
|
+
total: string;
|
|
9
|
+
taxTitle?: string;
|
|
10
|
+
totalTaxFee?: string;
|
|
11
|
+
isPriceIncludeTax?: 0 | 1;
|
|
12
|
+
taxRate?: number;
|
|
13
|
+
surcharge?: any;
|
|
14
|
+
deposit?: {
|
|
15
|
+
total: string;
|
|
16
|
+
protocols: any[];
|
|
17
|
+
hasDeposit: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 计算商品小计(不含其他费用)
|
|
22
|
+
* @param items - 购物车商品数组
|
|
23
|
+
* @returns 商品总价字符串,保留2位小数
|
|
24
|
+
*/
|
|
25
|
+
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
26
|
+
/**
|
|
27
|
+
* @description: 将购物车数据格式化成summaryModule需要的格式
|
|
28
|
+
* @param {any} items 购物车数据
|
|
29
|
+
* @return {*}
|
|
30
|
+
*/
|
|
31
|
+
export declare const formatCartsToSummaryModule: (items: any[]) => any[];
|
|
32
|
+
/**
|
|
33
|
+
* @title: 单个商品的税费
|
|
34
|
+
* @description:
|
|
35
|
+
* 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
|
|
36
|
+
* $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
|
|
37
|
+
* @return {*}
|
|
38
|
+
* @Author: xiangfeng.xue
|
|
39
|
+
*/
|
|
40
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[], summaryModule: any) => any;
|
|
41
|
+
/**
|
|
42
|
+
* 计算所有价格明细
|
|
43
|
+
* @param items - 购物车商品数组
|
|
44
|
+
* @param options - 其他费用配置
|
|
45
|
+
* @returns 价格明细对象
|
|
46
|
+
*/
|
|
47
|
+
export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[], summaryModule: any) => PriceDetail;
|
|
48
|
+
/**
|
|
49
|
+
* @title: 计算定金
|
|
50
|
+
* @param items - 购物车商品数组
|
|
51
|
+
* @returns 定金字符串,保留2位小数
|
|
52
|
+
*/
|
|
53
|
+
export declare const calculateDeposit: (items: CartItem[]) => {
|
|
54
|
+
total: string;
|
|
55
|
+
protocols: any[];
|
|
56
|
+
hasDeposit: never;
|
|
57
|
+
} | undefined;
|
|
58
|
+
export {};
|
|
@@ -32,7 +32,8 @@ __export(utils_exports, {
|
|
|
32
32
|
calculateDeposit: () => calculateDeposit,
|
|
33
33
|
calculatePriceDetails: () => calculatePriceDetails,
|
|
34
34
|
calculateSubtotal: () => calculateSubtotal,
|
|
35
|
-
calculateTaxFee: () => calculateTaxFee
|
|
35
|
+
calculateTaxFee: () => calculateTaxFee,
|
|
36
|
+
formatCartsToSummaryModule: () => formatCartsToSummaryModule
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(utils_exports);
|
|
38
39
|
var import_decimal = __toESM(require("decimal.js"));
|
|
@@ -45,25 +46,46 @@ var calculateSubtotal = (items) => {
|
|
|
45
46
|
}, new import_decimal.default(0));
|
|
46
47
|
return subtotal.toFixed(2);
|
|
47
48
|
};
|
|
48
|
-
var
|
|
49
|
+
var formatCartsToSummaryModule = (items) => {
|
|
50
|
+
if (!Array.isArray(items) || !(items == null ? void 0 : items.length)) return [];
|
|
51
|
+
return items.map((item) => {
|
|
52
|
+
const { selectedBundle, selectedOptions, ...rest } = item;
|
|
53
|
+
return {
|
|
54
|
+
...rest,
|
|
55
|
+
bundle: selectedBundle || [],
|
|
56
|
+
option: selectedOptions || []
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var calculateTaxFee = (shopInfo, items, summaryModule) => {
|
|
49
61
|
if (!(items == null ? void 0 : items.length)) {
|
|
50
62
|
return "0.00";
|
|
51
63
|
}
|
|
52
64
|
const { is_price_include_tax, tax_rate } = shopInfo || {};
|
|
53
65
|
console.log("shopInfo>>>", is_price_include_tax, tax_rate);
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const subtotal = new import_decimal.default(calculateSubtotal(items));
|
|
67
|
+
const totalTax = summaryModule.getTaxforUtils(
|
|
68
|
+
items,
|
|
69
|
+
{
|
|
70
|
+
tax_rate: Number(tax_rate),
|
|
71
|
+
is_price_include_tax: Number(is_price_include_tax || 0)
|
|
72
|
+
},
|
|
73
|
+
subtotal
|
|
74
|
+
);
|
|
75
|
+
const totalTaxFee = totalTax == null ? void 0 : totalTax.tax;
|
|
60
76
|
return totalTaxFee;
|
|
61
77
|
};
|
|
62
|
-
var calculatePriceDetails = (shopInfo, items) => {
|
|
78
|
+
var calculatePriceDetails = (shopInfo, items, summaryModule) => {
|
|
63
79
|
const subtotal = new import_decimal.default(calculateSubtotal(items));
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
80
|
+
const _carts = formatCartsToSummaryModule(items);
|
|
81
|
+
const surcharge = summaryModule.getSurchargeforUtils(_carts);
|
|
82
|
+
const surchargeFee = new import_decimal.default((surcharge == null ? void 0 : surcharge.surchargeAmount) || 0);
|
|
83
|
+
const totalTaxFee = new import_decimal.default(
|
|
84
|
+
calculateTaxFee(shopInfo, _carts, summaryModule)
|
|
85
|
+
);
|
|
86
|
+
const taxRate = new import_decimal.default((shopInfo == null ? void 0 : shopInfo.tax_rate) || 0).div(100);
|
|
87
|
+
let total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal : subtotal.plus(totalTaxFee);
|
|
88
|
+
total = total.plus(surchargeFee);
|
|
67
89
|
const deposit = calculateDeposit(items);
|
|
68
90
|
return {
|
|
69
91
|
subtotal: subtotal.toFixed(2),
|
|
@@ -71,6 +93,8 @@ var calculatePriceDetails = (shopInfo, items) => {
|
|
|
71
93
|
taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
|
|
72
94
|
totalTaxFee: totalTaxFee.toFixed(2),
|
|
73
95
|
isPriceIncludeTax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax,
|
|
96
|
+
taxRate: taxRate.toNumber(),
|
|
97
|
+
surcharge,
|
|
74
98
|
deposit
|
|
75
99
|
};
|
|
76
100
|
};
|
|
@@ -104,5 +128,6 @@ var calculateDeposit = (items) => {
|
|
|
104
128
|
calculateDeposit,
|
|
105
129
|
calculatePriceDetails,
|
|
106
130
|
calculateSubtotal,
|
|
107
|
-
calculateTaxFee
|
|
131
|
+
calculateTaxFee,
|
|
132
|
+
formatCartsToSummaryModule
|
|
108
133
|
});
|