@pisell/private-materials 6.5.2 → 6.5.4
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 +150 -164
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/booking/components/actionButtons/index.js +2 -2
- package/es/components/booking/components/customiseItemModal/index.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +48 -42
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +18 -4
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/cartClientCard/index.js +33 -20
- package/es/components/booking/info2/cartClientCard/utils.d.ts +2 -2
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +719 -432
- package/es/components/checkout/PaymentPlugin.d.ts +1 -0
- package/es/components/checkout/components/AdditionalModule/index.d.ts +1 -1
- package/es/components/checkout/components/AdditionalModule/index.js +80 -49
- package/es/components/checkout/components/AdditionalModule/index.less +33 -34
- package/es/components/checkout/components/AdditionalModule/locales.d.ts +3 -0
- package/es/components/checkout/components/AdditionalModule/locales.js +7 -4
- package/es/components/checkout/components/AmountSummary/index.d.ts +2 -1
- package/es/components/checkout/components/AmountSummary/index.js +69 -31
- package/es/components/checkout/components/AmountSummary/index.less +27 -9
- package/es/components/checkout/components/CashPaymentModule/index.js +8 -1
- package/es/components/checkout/components/CashPaymentModule/index.less +0 -2
- package/es/components/checkout/components/PaymentDetailModal/index.js +55 -10
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.js +40 -25
- package/es/components/checkout/components/PaymentOptionsModule/index.less +11 -6
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +42 -9
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +512 -82
- package/es/components/checkout/components/PaymentResultToast/index.d.ts +2 -1
- package/es/components/checkout/components/PaymentResultToast/index.js +90 -35
- package/es/components/checkout/components/PaymentResultToast/index.less +445 -77
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +3 -3
- package/es/components/checkout/components/PaymentResultToast/utils.d.ts +26 -0
- package/es/components/checkout/components/PaymentResultToast/utils.js +81 -2
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/components/SearchAndClientModule/index.js +17 -16
- package/es/components/checkout/components/SearchAndClientModule/index.less +29 -8
- package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/components/WalletPassHeader/index.js +3 -1
- package/es/components/checkout/components/WalletPassModule/index.less +3 -3
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +1 -1
- package/es/components/checkout/index.d.ts +1 -1
- package/es/components/checkout/index.js +1 -1
- package/es/components/checkout/index.less +56 -38
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +9 -3
- package/es/components/checkout/payment-modal-utils.js +5 -5
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +3 -3
- package/es/components/checkout/utils/PaymentResultToastUtils.js +111 -72
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/linkly/index.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/es/components/pay/toB/components/Card/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Footer.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toB/components/EFTPOS/index.js +91 -58
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -3
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/bookingDataPanel/index.js +1 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/es/components/ticketBooking/components/menuBar/index.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.js +4 -2
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/plus/clientCard/index.js +3 -2
- package/es/plus/clientCard/index.less +3 -32
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/noteModal/AddTempModal.d.ts +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- package/es/pro/comprehensiveSearch/components/searchSection/index.js +9 -12
- package/es/pro/comprehensiveSearch/components/searchSection/index.less +22 -19
- package/es/pro/pisellPhoneKeyboard/index.d.ts +1 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/booking/components/actionButtons/index.js +2 -1
- package/lib/components/booking/components/customiseItemModal/index.js +2 -2
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +3 -0
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +15 -3
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/cartClientCard/index.js +16 -5
- package/lib/components/booking/info2/cartClientCard/utils.d.ts +2 -2
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +241 -109
- package/lib/components/checkout/PaymentPlugin.d.ts +1 -0
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +1 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +98 -34
- package/lib/components/checkout/components/AdditionalModule/index.less +33 -34
- package/lib/components/checkout/components/AdditionalModule/locales.d.ts +3 -0
- package/lib/components/checkout/components/AdditionalModule/locales.js +7 -4
- package/lib/components/checkout/components/AmountSummary/index.d.ts +2 -1
- package/lib/components/checkout/components/AmountSummary/index.js +103 -47
- package/lib/components/checkout/components/AmountSummary/index.less +27 -9
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -1
- package/lib/components/checkout/components/CashPaymentModule/index.less +0 -2
- package/lib/components/checkout/components/PaymentDetailModal/index.js +56 -11
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -8
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +11 -6
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +42 -9
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +279 -73
- package/lib/components/checkout/components/PaymentResultToast/index.d.ts +2 -1
- package/lib/components/checkout/components/PaymentResultToast/index.js +69 -22
- package/lib/components/checkout/components/PaymentResultToast/index.less +445 -77
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +3 -3
- package/lib/components/checkout/components/PaymentResultToast/utils.d.ts +26 -0
- package/lib/components/checkout/components/PaymentResultToast/utils.js +58 -4
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/components/SearchAndClientModule/index.js +17 -15
- package/lib/components/checkout/components/SearchAndClientModule/index.less +29 -8
- package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/components/WalletPassHeader/index.js +12 -2
- package/lib/components/checkout/components/WalletPassModule/index.less +3 -3
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +2 -2
- package/lib/components/checkout/index.d.ts +1 -1
- package/lib/components/checkout/index.js +2 -0
- package/lib/components/checkout/index.less +56 -38
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +9 -3
- package/lib/components/checkout/payment-modal-utils.js +5 -5
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +3 -3
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +26 -18
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/linkly/index.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Card/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Footer.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toB/components/EFTPOS/index.js +25 -10
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -6
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/bookingDataPanel/index.js +2 -2
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.js +2 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.js +2 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.js +5 -13
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/plus/clientCard/index.js +5 -4
- package/lib/plus/clientCard/index.less +3 -32
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/noteModal/AddTempModal.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/index.js +6 -18
- package/lib/pro/comprehensiveSearch/components/searchSection/index.less +22 -19
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +12 -12
package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts
CHANGED
@@ -21,16 +21,20 @@ interface ShowPaymentResultToastConfig {
|
|
21
21
|
onCountdownComplete?: () => void;
|
22
22
|
/** 自定义关闭回调 */
|
23
23
|
onClose?: () => void;
|
24
|
+
/** 是否显示右上角关闭按钮 */
|
25
|
+
closable?: boolean;
|
24
26
|
}
|
25
27
|
interface PaymentResultToastContextType {
|
26
28
|
/** 显示成功弹窗 */
|
27
|
-
showSuccess: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) =>
|
29
|
+
showSuccess: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => string;
|
28
30
|
/** 显示失败弹窗 */
|
29
|
-
showFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) =>
|
31
|
+
showFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => string;
|
30
32
|
/** 显示钱包通行证失败弹窗 */
|
31
|
-
showWalletPassFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) =>
|
33
|
+
showWalletPassFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => string;
|
34
|
+
/** 显示部分支付弹窗 */
|
35
|
+
showPartiallyPaid: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => string;
|
32
36
|
/** 显示自定义状态弹窗 */
|
33
|
-
showToast: (config: ShowPaymentResultToastConfig) =>
|
37
|
+
showToast: (config: ShowPaymentResultToastConfig) => string;
|
34
38
|
/** 关闭弹窗 */
|
35
39
|
closeToast: () => void;
|
36
40
|
/** 是否正在显示弹窗 */
|
@@ -40,9 +44,38 @@ export declare const PaymentResultToastProvider: React.FC<{
|
|
40
44
|
children: React.ReactNode;
|
41
45
|
}>;
|
42
46
|
export declare const usePaymentResultToast: () => PaymentResultToastContextType;
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
declare class GlobalToastManager {
|
48
|
+
private instances;
|
49
|
+
private nextId;
|
50
|
+
private readonly TOAST_HEIGHT;
|
51
|
+
private readonly TOAST_MARGIN;
|
52
|
+
private readonly BOTTOM_OFFSET;
|
53
|
+
private readonly LEFT_OFFSET;
|
54
|
+
private cachedBottomOffset;
|
55
|
+
private cachedCenterOffset;
|
56
|
+
private tillButton;
|
57
|
+
setTillButton(tillButton: any): void;
|
58
|
+
private generateId;
|
59
|
+
private calculateAndCacheBottomOffset;
|
60
|
+
private calculateAndCacheCenterOffset;
|
61
|
+
private resetBottomOffsetCache;
|
62
|
+
private calculateBottomPosition;
|
63
|
+
private updatePositions;
|
64
|
+
addToast(config: ShowPaymentResultToastConfig): string;
|
65
|
+
removeToast(id: string): void;
|
66
|
+
clearAll(): void;
|
67
|
+
getCount(): number;
|
68
|
+
initializeResizeListener(): () => void;
|
69
|
+
}
|
70
|
+
declare const globalToastManager: GlobalToastManager;
|
71
|
+
export declare const showPaymentResultToastSuccess: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => Promise<string>;
|
72
|
+
export declare const showPaymentResultToastFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => Promise<string>;
|
73
|
+
export declare const showPaymentResultToastWalletPassFailed: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => Promise<string>;
|
74
|
+
export declare const showPaymentResultToastPartiallyPaid: (config: Omit<ShowPaymentResultToastConfig, 'statusClassName'>) => Promise<string>;
|
75
|
+
export declare const showPaymentResultToast: (config: ShowPaymentResultToastConfig) => Promise<string>;
|
76
|
+
export declare const closePaymentResultToast: (id?: string) => void;
|
77
|
+
export declare const clearAllPaymentResultToasts: () => void;
|
78
|
+
export declare const getPaymentResultToastCount: () => number;
|
48
79
|
export type { ShowPaymentResultToastConfig, PaymentResultToastContextType };
|
80
|
+
export declare const setTillButton: (tillButton: any) => void;
|
81
|
+
export { globalToastManager };
|
@@ -30,9 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
var PaymentResultToastProvider_exports = {};
|
31
31
|
__export(PaymentResultToastProvider_exports, {
|
32
32
|
PaymentResultToastProvider: () => PaymentResultToastProvider,
|
33
|
+
clearAllPaymentResultToasts: () => clearAllPaymentResultToasts,
|
33
34
|
closePaymentResultToast: () => closePaymentResultToast,
|
35
|
+
getPaymentResultToastCount: () => getPaymentResultToastCount,
|
36
|
+
globalToastManager: () => globalToastManager,
|
37
|
+
setTillButton: () => setTillButton,
|
34
38
|
showPaymentResultToast: () => showPaymentResultToast,
|
35
39
|
showPaymentResultToastFailed: () => showPaymentResultToastFailed,
|
40
|
+
showPaymentResultToastPartiallyPaid: () => showPaymentResultToastPartiallyPaid,
|
36
41
|
showPaymentResultToastSuccess: () => showPaymentResultToastSuccess,
|
37
42
|
showPaymentResultToastWalletPassFailed: () => showPaymentResultToastWalletPassFailed,
|
38
43
|
usePaymentResultToast: () => usePaymentResultToast
|
@@ -41,66 +46,65 @@ module.exports = __toCommonJS(PaymentResultToastProvider_exports);
|
|
41
46
|
var import_react = __toESM(require("react"));
|
42
47
|
var import_react_dom = require("react-dom");
|
43
48
|
var import_index = __toESM(require("./index"));
|
49
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
44
50
|
var PaymentResultToastContext = (0, import_react.createContext)(null);
|
45
51
|
var globalPaymentResultToastContext = null;
|
46
52
|
var DEFAULT_TOAST_CONFIG = {
|
47
53
|
width: 680,
|
48
|
-
mask:
|
49
|
-
maskClosable:
|
50
|
-
closable: true
|
51
|
-
zIndex
|
54
|
+
mask: false,
|
55
|
+
maskClosable: false,
|
56
|
+
closable: true
|
57
|
+
// 移除强制的zIndex设置,让Toast使用默认层级或由外部控制
|
52
58
|
};
|
53
59
|
var PaymentResultToastProvider = ({ children }) => {
|
54
|
-
|
55
|
-
const
|
56
|
-
const
|
60
|
+
var _a, _b, _c;
|
61
|
+
const [contextToastIds, setContextToastIds] = (0, import_react.useState)([]);
|
62
|
+
const context = (0, import_useEngineContext.default)();
|
63
|
+
const { interaction } = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
|
64
|
+
(_c = (_b = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _b.asyncDataManager) == null ? void 0 : _c.call(_b, {
|
65
|
+
module: "get",
|
66
|
+
key: "till_button"
|
67
|
+
}).then((res) => {
|
68
|
+
globalToastManager.setTillButton(res);
|
69
|
+
}).catch((err) => {
|
70
|
+
console.error("Failed to get till_button from asyncDataManager:", err);
|
71
|
+
});
|
57
72
|
const closeToast = (0, import_react.useCallback)(() => {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
closeToast();
|
64
|
-
}, [closeToast]);
|
65
|
-
const handleCountdownComplete = (0, import_react.useCallback)(() => {
|
66
|
-
var _a;
|
67
|
-
(_a = customOnCountdownCompleteRef.current) == null ? void 0 : _a.call(customOnCountdownCompleteRef);
|
68
|
-
}, []);
|
73
|
+
contextToastIds.forEach((id) => {
|
74
|
+
globalToastManager.removeToast(id);
|
75
|
+
});
|
76
|
+
setContextToastIds([]);
|
77
|
+
}, [contextToastIds]);
|
69
78
|
const showToast = (0, import_react.useCallback)((config) => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
autoCloseDelay: config.autoCloseDelay || 5,
|
82
|
-
showCountdownProgress: config.showCountdownProgress,
|
83
|
-
onCountdownComplete: handleCountdownComplete,
|
84
|
-
// 使用稳定的handleCountdownComplete函数
|
85
|
-
onClose: handleClose
|
86
|
-
// 使用稳定的handleClose函数
|
87
|
-
};
|
88
|
-
setToastProps(finalConfig);
|
89
|
-
}, [handleClose, handleCountdownComplete]);
|
79
|
+
const toastId = globalToastManager.addToast({
|
80
|
+
...config,
|
81
|
+
onClose: () => {
|
82
|
+
var _a2;
|
83
|
+
(_a2 = config.onClose) == null ? void 0 : _a2.call(config);
|
84
|
+
setContextToastIds((prev) => prev.filter((id) => id !== toastId));
|
85
|
+
}
|
86
|
+
});
|
87
|
+
setContextToastIds((prev) => [...prev, toastId]);
|
88
|
+
return toastId;
|
89
|
+
}, []);
|
90
90
|
const showSuccess = (0, import_react.useCallback)((config) => {
|
91
|
-
showToast({ ...config, statusClassName: "success" });
|
91
|
+
return showToast({ ...config, statusClassName: "success" });
|
92
92
|
}, [showToast]);
|
93
93
|
const showFailed = (0, import_react.useCallback)((config) => {
|
94
|
-
showToast({ ...config, statusClassName: "failed" });
|
94
|
+
return showToast({ ...config, statusClassName: "failed" });
|
95
95
|
}, [showToast]);
|
96
96
|
const showWalletPassFailed = (0, import_react.useCallback)((config) => {
|
97
|
-
showToast({ ...config, statusClassName: "wallet-pass-failed" });
|
97
|
+
return showToast({ ...config, statusClassName: "wallet-pass-failed" });
|
98
|
+
}, [showToast]);
|
99
|
+
const showPartiallyPaid = (0, import_react.useCallback)((config) => {
|
100
|
+
return showToast({ ...config, statusClassName: "partially-paid" });
|
98
101
|
}, [showToast]);
|
99
|
-
const isVisible =
|
102
|
+
const isVisible = contextToastIds.length > 0;
|
100
103
|
const contextValue = {
|
101
104
|
showSuccess,
|
102
105
|
showFailed,
|
103
106
|
showWalletPassFailed,
|
107
|
+
showPartiallyPaid,
|
104
108
|
showToast,
|
105
109
|
closeToast,
|
106
110
|
isVisible
|
@@ -111,10 +115,7 @@ var PaymentResultToastProvider = ({ children }) => {
|
|
111
115
|
globalPaymentResultToastContext = null;
|
112
116
|
};
|
113
117
|
}, [contextValue]);
|
114
|
-
return /* @__PURE__ */ import_react.default.createElement(PaymentResultToastContext.Provider, { value: contextValue }, children
|
115
|
-
/* @__PURE__ */ import_react.default.createElement(import_index.default, { ...toastProps }),
|
116
|
-
document.body
|
117
|
-
));
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement(PaymentResultToastContext.Provider, { value: contextValue }, children);
|
118
119
|
};
|
119
120
|
var usePaymentResultToast = () => {
|
120
121
|
const context = (0, import_react.useContext)(PaymentResultToastContext);
|
@@ -123,47 +124,252 @@ var usePaymentResultToast = () => {
|
|
123
124
|
}
|
124
125
|
return context;
|
125
126
|
};
|
126
|
-
var
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
127
|
+
var GlobalToastManager = class {
|
128
|
+
instances = /* @__PURE__ */ new Map();
|
129
|
+
nextId = 1;
|
130
|
+
TOAST_HEIGHT = 160;
|
131
|
+
// 单个Toast的高度(估算:内容约128px + padding 32px)
|
132
|
+
TOAST_MARGIN = 8;
|
133
|
+
// Toast之间的间距
|
134
|
+
BOTTOM_OFFSET = 110;
|
135
|
+
// 距离底部的距离
|
136
|
+
LEFT_OFFSET = 96;
|
137
|
+
// 距离左边的距离
|
138
|
+
cachedBottomOffset = null;
|
139
|
+
// 缓存计算的bottom位置
|
140
|
+
cachedCenterOffset = null;
|
141
|
+
// 缓存计算的center位置
|
142
|
+
tillButton = null;
|
143
|
+
// 缓存的tillButton数据
|
144
|
+
setTillButton(tillButton) {
|
145
|
+
this.tillButton = tillButton;
|
131
146
|
}
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
globalPaymentResultToastContext.showFailed(config);
|
136
|
-
} else {
|
137
|
-
console.error("PaymentResultToastProvider not found. Please wrap your app with PaymentResultToastProvider.");
|
147
|
+
// 生成唯一ID
|
148
|
+
generateId() {
|
149
|
+
return `toast-${this.nextId++}`;
|
138
150
|
}
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
151
|
+
// 计算并缓存 .ticket-booking-left-panel-content 组件的 bottom 位置
|
152
|
+
calculateAndCacheBottomOffset() {
|
153
|
+
var _a;
|
154
|
+
if (this.cachedBottomOffset !== null) {
|
155
|
+
return this.cachedBottomOffset;
|
156
|
+
}
|
157
|
+
if ((_a = this.tillButton) == null ? void 0 : _a.y) {
|
158
|
+
console.log("使用钱箱按钮位置", this.tillButton);
|
159
|
+
this.cachedBottomOffset = window.innerHeight - this.tillButton.y + 8 + this.tillButton.size;
|
160
|
+
console.log("计算钱箱按钮位置得到的bottom位置", this.cachedBottomOffset);
|
161
|
+
return this.cachedBottomOffset;
|
162
|
+
}
|
163
|
+
const ticketBookingElement = document.querySelector(".ticket-booking-left-panel-content");
|
164
|
+
if (ticketBookingElement) {
|
165
|
+
const rect = ticketBookingElement.getBoundingClientRect();
|
166
|
+
const windowHeight = window.innerHeight;
|
167
|
+
this.cachedBottomOffset = windowHeight - rect.bottom + 16;
|
168
|
+
} else {
|
169
|
+
this.cachedBottomOffset = this.BOTTOM_OFFSET;
|
170
|
+
}
|
171
|
+
return this.cachedBottomOffset;
|
145
172
|
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
173
|
+
calculateAndCacheCenterOffset() {
|
174
|
+
if (this.cachedCenterOffset !== null) {
|
175
|
+
return this.cachedCenterOffset;
|
176
|
+
}
|
177
|
+
const ticketBookingElement = document.querySelector(".ticket-booking-left-panel-content");
|
178
|
+
if (ticketBookingElement) {
|
179
|
+
const rect = ticketBookingElement.getBoundingClientRect();
|
180
|
+
this.cachedCenterOffset = {
|
181
|
+
x: rect.width / 2,
|
182
|
+
y: rect.height / 2
|
183
|
+
};
|
184
|
+
} else {
|
185
|
+
this.cachedCenterOffset = { x: 0, y: 0 };
|
186
|
+
}
|
187
|
+
return this.cachedCenterOffset;
|
188
|
+
}
|
189
|
+
// 重置缓存的 bottom 位置(当窗口大小变化或组件位置变化时调用)
|
190
|
+
resetBottomOffsetCache() {
|
191
|
+
this.cachedBottomOffset = null;
|
152
192
|
}
|
193
|
+
// 计算Toast的bottom位置
|
194
|
+
// 新逻辑:最新的Toast在最底部,旧Toast向上位移
|
195
|
+
calculateBottomPosition(offsetIndex, totalCount) {
|
196
|
+
const reversedIndex = totalCount - 1 - offsetIndex;
|
197
|
+
const dynamicBottomOffset = this.calculateAndCacheBottomOffset();
|
198
|
+
return dynamicBottomOffset + (this.TOAST_HEIGHT + this.TOAST_MARGIN) * reversedIndex;
|
199
|
+
}
|
200
|
+
// 更新所有Toast的位置(新Toast在底部,旧Toast平滑向上位移)
|
201
|
+
updatePositions() {
|
202
|
+
const instances = Array.from(this.instances.values());
|
203
|
+
const totalCount = instances.length;
|
204
|
+
instances.forEach((instance, index) => {
|
205
|
+
instance.offsetIndex = index;
|
206
|
+
const bottomPosition = this.calculateBottomPosition(index, totalCount);
|
207
|
+
if (instance.container) {
|
208
|
+
instance.container.classList.add("toast-moving");
|
209
|
+
instance.container.style.position = "fixed";
|
210
|
+
instance.container.style.left = `${this.LEFT_OFFSET}px`;
|
211
|
+
instance.container.style.bottom = `${bottomPosition}px`;
|
212
|
+
instance.container.style.top = "auto";
|
213
|
+
instance.container.style.right = "auto";
|
214
|
+
instance.container.style.transition = "all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)";
|
215
|
+
instance.container.style.pointerEvents = "none";
|
216
|
+
instance.container.style.width = "auto";
|
217
|
+
instance.container.style.height = "auto";
|
218
|
+
instance.container.style.transform = "none";
|
219
|
+
instance.container.style.margin = "0";
|
220
|
+
setTimeout(() => {
|
221
|
+
if (instance.container) {
|
222
|
+
instance.container.classList.remove("toast-moving");
|
223
|
+
}
|
224
|
+
}, 400);
|
225
|
+
}
|
226
|
+
});
|
227
|
+
}
|
228
|
+
// 添加新的Toast实例
|
229
|
+
addToast(config) {
|
230
|
+
const id = this.generateId();
|
231
|
+
this.resetBottomOffsetCache();
|
232
|
+
const finalConfig = {
|
233
|
+
...DEFAULT_TOAST_CONFIG,
|
234
|
+
visible: true,
|
235
|
+
statusClassName: config.statusClassName,
|
236
|
+
title: config.title,
|
237
|
+
subtitle: config.subtitle,
|
238
|
+
changeDueText: config.changeDueText,
|
239
|
+
actionButtons: config.actionButtons || [],
|
240
|
+
autoClose: config.autoClose,
|
241
|
+
autoCloseDelay: config.autoCloseDelay || 30,
|
242
|
+
showCountdownProgress: config.showCountdownProgress,
|
243
|
+
onCountdownComplete: config.onCountdownComplete,
|
244
|
+
onClose: () => {
|
245
|
+
var _a;
|
246
|
+
(_a = config.onClose) == null ? void 0 : _a.call(config);
|
247
|
+
this.removeToast(id);
|
248
|
+
},
|
249
|
+
closable: config.closable !== void 0 ? config.closable : DEFAULT_TOAST_CONFIG.closable
|
250
|
+
};
|
251
|
+
const container = document.createElement("div");
|
252
|
+
container.setAttribute("data-toast-id", id);
|
253
|
+
const dynamicBottomOffset = this.calculateAndCacheBottomOffset();
|
254
|
+
container.style.position = "fixed";
|
255
|
+
container.style.left = `${this.LEFT_OFFSET}px`;
|
256
|
+
container.style.bottom = `${dynamicBottomOffset}px`;
|
257
|
+
container.style.top = "auto";
|
258
|
+
container.style.right = "auto";
|
259
|
+
container.style.pointerEvents = "none";
|
260
|
+
container.style.width = "auto";
|
261
|
+
container.style.height = "auto";
|
262
|
+
container.style.margin = "0";
|
263
|
+
document.body.appendChild(container);
|
264
|
+
const instance = {
|
265
|
+
id,
|
266
|
+
container,
|
267
|
+
props: finalConfig,
|
268
|
+
offsetIndex: this.instances.size
|
269
|
+
};
|
270
|
+
this.instances.set(id, instance);
|
271
|
+
(0, import_react_dom.render)(/* @__PURE__ */ import_react.default.createElement(import_index.default, { ...finalConfig }), container);
|
272
|
+
return id;
|
273
|
+
}
|
274
|
+
// 移除Toast实例(带动画效果)
|
275
|
+
removeToast(id) {
|
276
|
+
const instance = this.instances.get(id);
|
277
|
+
if (instance) {
|
278
|
+
if (instance.container) {
|
279
|
+
instance.container.classList.add("toast-exiting");
|
280
|
+
setTimeout(() => {
|
281
|
+
if (instance.container) {
|
282
|
+
(0, import_react_dom.unmountComponentAtNode)(instance.container);
|
283
|
+
if (document.body.contains(instance.container)) {
|
284
|
+
document.body.removeChild(instance.container);
|
285
|
+
}
|
286
|
+
}
|
287
|
+
this.instances.delete(id);
|
288
|
+
this.updatePositions();
|
289
|
+
}, 300);
|
290
|
+
} else {
|
291
|
+
this.instances.delete(id);
|
292
|
+
this.updatePositions();
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}
|
296
|
+
// 清理所有Toast
|
297
|
+
clearAll() {
|
298
|
+
this.instances.forEach((instance) => {
|
299
|
+
if (instance.container) {
|
300
|
+
(0, import_react_dom.unmountComponentAtNode)(instance.container);
|
301
|
+
if (document.body.contains(instance.container)) {
|
302
|
+
document.body.removeChild(instance.container);
|
303
|
+
}
|
304
|
+
}
|
305
|
+
});
|
306
|
+
this.instances.clear();
|
307
|
+
}
|
308
|
+
// 获取当前Toast数量
|
309
|
+
getCount() {
|
310
|
+
return this.instances.size;
|
311
|
+
}
|
312
|
+
// 初始化窗口大小变化监听器
|
313
|
+
initializeResizeListener() {
|
314
|
+
const handleResize = () => {
|
315
|
+
this.resetBottomOffsetCache();
|
316
|
+
this.updatePositions();
|
317
|
+
};
|
318
|
+
window.addEventListener("resize", handleResize);
|
319
|
+
return () => {
|
320
|
+
window.removeEventListener("resize", handleResize);
|
321
|
+
};
|
322
|
+
}
|
323
|
+
};
|
324
|
+
var globalToastManager = new GlobalToastManager();
|
325
|
+
if (typeof window !== "undefined") {
|
326
|
+
globalToastManager.initializeResizeListener();
|
327
|
+
}
|
328
|
+
var renderGlobalToast = (config) => {
|
329
|
+
return globalToastManager.addToast(config);
|
330
|
+
};
|
331
|
+
var showPaymentResultToastSuccess = async (config) => {
|
332
|
+
return renderGlobalToast({ ...config, statusClassName: "success" });
|
153
333
|
};
|
154
|
-
var
|
155
|
-
|
156
|
-
|
334
|
+
var showPaymentResultToastFailed = async (config) => {
|
335
|
+
return renderGlobalToast({ ...config, statusClassName: "failed" });
|
336
|
+
};
|
337
|
+
var showPaymentResultToastWalletPassFailed = async (config) => {
|
338
|
+
return renderGlobalToast({ ...config, statusClassName: "wallet-pass-failed" });
|
339
|
+
};
|
340
|
+
var showPaymentResultToastPartiallyPaid = async (config) => {
|
341
|
+
return renderGlobalToast({ ...config, statusClassName: "partially-paid" });
|
342
|
+
};
|
343
|
+
var showPaymentResultToast = async (config) => {
|
344
|
+
return renderGlobalToast(config);
|
345
|
+
};
|
346
|
+
var closePaymentResultToast = (id) => {
|
347
|
+
if (id) {
|
348
|
+
globalToastManager.removeToast(id);
|
157
349
|
} else {
|
158
|
-
|
350
|
+
globalToastManager.clearAll();
|
159
351
|
}
|
160
352
|
};
|
353
|
+
var clearAllPaymentResultToasts = () => {
|
354
|
+
globalToastManager.clearAll();
|
355
|
+
};
|
356
|
+
var getPaymentResultToastCount = () => {
|
357
|
+
return globalToastManager.getCount();
|
358
|
+
};
|
359
|
+
var setTillButton = (tillButton) => {
|
360
|
+
globalToastManager.setTillButton(tillButton);
|
361
|
+
};
|
161
362
|
// Annotate the CommonJS export names for ESM import in node:
|
162
363
|
0 && (module.exports = {
|
163
364
|
PaymentResultToastProvider,
|
365
|
+
clearAllPaymentResultToasts,
|
164
366
|
closePaymentResultToast,
|
367
|
+
getPaymentResultToastCount,
|
368
|
+
globalToastManager,
|
369
|
+
setTillButton,
|
165
370
|
showPaymentResultToast,
|
166
371
|
showPaymentResultToastFailed,
|
372
|
+
showPaymentResultToastPartiallyPaid,
|
167
373
|
showPaymentResultToastSuccess,
|
168
374
|
showPaymentResultToastWalletPassFailed,
|
169
375
|
usePaymentResultToast
|
@@ -3,6 +3,7 @@ import { PaymentResultToastProps, PaymentResultToastConfig } from './types';
|
|
3
3
|
import './index.less';
|
4
4
|
declare const PaymentResultToast: React.FC<PaymentResultToastProps & PaymentResultToastConfig>;
|
5
5
|
export default PaymentResultToast;
|
6
|
-
export { PaymentResultToastProvider, usePaymentResultToast, showPaymentResultToastSuccess, showPaymentResultToastFailed, showPaymentResultToastWalletPassFailed, showPaymentResultToast, closePaymentResultToast } from './PaymentResultToastProvider';
|
6
|
+
export { PaymentResultToastProvider, usePaymentResultToast, showPaymentResultToastSuccess, showPaymentResultToastFailed, showPaymentResultToastWalletPassFailed, showPaymentResultToastPartiallyPaid, showPaymentResultToast, closePaymentResultToast, clearAllPaymentResultToasts, getPaymentResultToastCount, setTillButton, globalToastManager } from './PaymentResultToastProvider';
|
7
|
+
export { closeAllPaymentResultToasts, hasActivePaymentResultToasts, getToastCount, debounce, getDefaultModalConfig } from './utils';
|
7
8
|
export type { PaymentResultToastProps, PaymentResultToastConfig, ActionButtonProps, ActionButtonGroupList, StatusClassName } from './types';
|
8
9
|
export type { ShowPaymentResultToastConfig, PaymentResultToastContextType } from './PaymentResultToastProvider';
|
@@ -30,10 +30,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
var PaymentResultToast_exports = {};
|
31
31
|
__export(PaymentResultToast_exports, {
|
32
32
|
PaymentResultToastProvider: () => import_PaymentResultToastProvider.PaymentResultToastProvider,
|
33
|
+
clearAllPaymentResultToasts: () => import_PaymentResultToastProvider.clearAllPaymentResultToasts,
|
34
|
+
closeAllPaymentResultToasts: () => import_utils2.closeAllPaymentResultToasts,
|
33
35
|
closePaymentResultToast: () => import_PaymentResultToastProvider.closePaymentResultToast,
|
36
|
+
debounce: () => import_utils2.debounce,
|
34
37
|
default: () => PaymentResultToast_default,
|
38
|
+
getDefaultModalConfig: () => import_utils2.getDefaultModalConfig,
|
39
|
+
getPaymentResultToastCount: () => import_PaymentResultToastProvider.getPaymentResultToastCount,
|
40
|
+
getToastCount: () => import_utils2.getToastCount,
|
41
|
+
globalToastManager: () => import_PaymentResultToastProvider.globalToastManager,
|
42
|
+
hasActivePaymentResultToasts: () => import_utils2.hasActivePaymentResultToasts,
|
43
|
+
setTillButton: () => import_PaymentResultToastProvider.setTillButton,
|
35
44
|
showPaymentResultToast: () => import_PaymentResultToastProvider.showPaymentResultToast,
|
36
45
|
showPaymentResultToastFailed: () => import_PaymentResultToastProvider.showPaymentResultToastFailed,
|
46
|
+
showPaymentResultToastPartiallyPaid: () => import_PaymentResultToastProvider.showPaymentResultToastPartiallyPaid,
|
37
47
|
showPaymentResultToastSuccess: () => import_PaymentResultToastProvider.showPaymentResultToastSuccess,
|
38
48
|
showPaymentResultToastWalletPassFailed: () => import_PaymentResultToastProvider.showPaymentResultToastWalletPassFailed,
|
39
49
|
usePaymentResultToast: () => import_PaymentResultToastProvider.usePaymentResultToast
|
@@ -42,9 +52,11 @@ module.exports = __toCommonJS(PaymentResultToast_exports);
|
|
42
52
|
var import_react = __toESM(require("react"));
|
43
53
|
var import_classnames = __toESM(require("classnames"));
|
44
54
|
var import_materials = require("@pisell/materials");
|
55
|
+
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
45
56
|
var import_utils = require("./utils");
|
46
57
|
var import_index = require("./index.less");
|
47
58
|
var import_PaymentResultToastProvider = require("./PaymentResultToastProvider");
|
59
|
+
var import_utils2 = require("./utils");
|
48
60
|
var COMPONENT_PREFIX = "payment-result-toast";
|
49
61
|
var getClassName = (...classNames) => {
|
50
62
|
return (0, import_classnames.default)(
|
@@ -71,14 +83,14 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
71
83
|
actionButtons = [],
|
72
84
|
// 倒计时配置
|
73
85
|
autoClose = false,
|
74
|
-
autoCloseDelay =
|
86
|
+
autoCloseDelay = 30,
|
75
87
|
showCountdownProgress = true,
|
76
88
|
onCountdownComplete,
|
77
89
|
// Modal 配置
|
78
90
|
width,
|
79
91
|
height,
|
80
|
-
mask =
|
81
|
-
maskClosable =
|
92
|
+
mask = false,
|
93
|
+
maskClosable = false,
|
82
94
|
closable = true,
|
83
95
|
zIndex
|
84
96
|
} = props;
|
@@ -126,26 +138,28 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
126
138
|
clearCountdown();
|
127
139
|
(_a = onCloseRef.current) == null ? void 0 : _a.call(onCloseRef);
|
128
140
|
}, [clearCountdown]);
|
129
|
-
const handleContentClick = (0, import_react.useCallback)((e) => {
|
130
|
-
e.stopPropagation();
|
131
|
-
if (autoClose && countdownTimeoutRef.current) {
|
132
|
-
clearCountdown();
|
133
|
-
}
|
134
|
-
}, [autoClose, clearCountdown]);
|
135
141
|
const renderTitle = () => {
|
136
|
-
return /* @__PURE__ */ import_react.default.createElement("h2", { className: getClassName(`${statusClassName}-title`) }, title);
|
137
|
-
};
|
138
|
-
const renderSubtitle = () => {
|
139
142
|
if (!subtitle) {
|
140
143
|
return null;
|
141
144
|
}
|
145
|
+
if (closable) {
|
146
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", gap: "16px" } }, subtitle, /* @__PURE__ */ import_react.default.createElement(
|
147
|
+
import_materials.Button,
|
148
|
+
{
|
149
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center" },
|
150
|
+
type: "text",
|
151
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_XClose.default, { style: { fontSize: "40px", color: "white" } }),
|
152
|
+
onClick: handleClose
|
153
|
+
}
|
154
|
+
));
|
155
|
+
}
|
142
156
|
return subtitle;
|
143
157
|
};
|
144
158
|
const renderChangeDueInfo = () => {
|
145
159
|
if (!changeDueText) {
|
146
160
|
return null;
|
147
161
|
}
|
148
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName("subtitle") }, /* @__PURE__ */ import_react.default.createElement("
|
162
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName("subtitle") }, /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName("subtitle-text change-due") }, changeDueText));
|
149
163
|
};
|
150
164
|
const renderCountdownProgress = () => {
|
151
165
|
if (!autoClose || !showCountdownProgress || !visible) {
|
@@ -166,11 +180,16 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
166
180
|
}
|
167
181
|
)));
|
168
182
|
};
|
183
|
+
const handleButtonClick = (0, import_react.useCallback)(() => {
|
184
|
+
if (autoClose && countdownTimeoutRef.current) {
|
185
|
+
clearCountdown();
|
186
|
+
}
|
187
|
+
}, [autoClose, clearCountdown]);
|
169
188
|
const renderActionButtons = () => {
|
170
189
|
if (!actionButtons || actionButtons.length === 0) {
|
171
190
|
return null;
|
172
191
|
}
|
173
|
-
return /* @__PURE__ */ import_react.default.createElement(import_materials.ButtonGroupPreview, { buttonGroupList: actionButtons });
|
192
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ...{ onClick: handleButtonClick } }, /* @__PURE__ */ import_react.default.createElement(import_materials.ButtonGroupPreview, { buttonGroupList: actionButtons }));
|
174
193
|
};
|
175
194
|
return /* @__PURE__ */ import_react.default.createElement(
|
176
195
|
import_materials.PisellModal,
|
@@ -181,27 +200,45 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
181
200
|
width: width || modalConfig.width,
|
182
201
|
mask,
|
183
202
|
maskClosable,
|
184
|
-
closable,
|
203
|
+
closable: false,
|
185
204
|
className: getBaseClassName(`${className} ${statusClassName}`),
|
186
|
-
|
205
|
+
wrapClassName: "toast-modal-wrap",
|
206
|
+
style: {
|
207
|
+
...height ? { height: `${height}px` } : {},
|
208
|
+
// 确保Modal不会被默认定位影响
|
209
|
+
position: "static",
|
210
|
+
top: "auto",
|
211
|
+
left: "auto",
|
212
|
+
right: "auto",
|
213
|
+
bottom: "auto",
|
214
|
+
transform: "none",
|
215
|
+
margin: 0,
|
216
|
+
padding: 0,
|
217
|
+
width: "100%",
|
218
|
+
maxWidth: "none"
|
219
|
+
},
|
187
220
|
destroyOnClose: false,
|
188
221
|
forceRender: true,
|
189
222
|
focusTriggerAfterClose: false,
|
190
223
|
transitionName: "",
|
191
|
-
maskTransitionName: ""
|
224
|
+
maskTransitionName: "",
|
225
|
+
centered: false,
|
226
|
+
getContainer: false
|
192
227
|
},
|
193
228
|
/* @__PURE__ */ import_react.default.createElement(
|
194
229
|
"div",
|
195
230
|
{
|
196
231
|
className: getClassName("content", statusClassName),
|
197
|
-
|
232
|
+
style: {
|
233
|
+
position: "relative",
|
234
|
+
zIndex: 1
|
235
|
+
}
|
198
236
|
},
|
199
237
|
renderTitle(),
|
200
|
-
renderSubtitle(),
|
201
238
|
renderChangeDueInfo(),
|
202
|
-
renderActionButtons()
|
203
|
-
|
204
|
-
|
239
|
+
renderActionButtons(),
|
240
|
+
renderCountdownProgress()
|
241
|
+
)
|
205
242
|
);
|
206
243
|
});
|
207
244
|
PaymentResultToast.displayName = "PaymentResultToast";
|
@@ -209,9 +246,19 @@ var PaymentResultToast_default = PaymentResultToast;
|
|
209
246
|
// Annotate the CommonJS export names for ESM import in node:
|
210
247
|
0 && (module.exports = {
|
211
248
|
PaymentResultToastProvider,
|
249
|
+
clearAllPaymentResultToasts,
|
250
|
+
closeAllPaymentResultToasts,
|
212
251
|
closePaymentResultToast,
|
252
|
+
debounce,
|
253
|
+
getDefaultModalConfig,
|
254
|
+
getPaymentResultToastCount,
|
255
|
+
getToastCount,
|
256
|
+
globalToastManager,
|
257
|
+
hasActivePaymentResultToasts,
|
258
|
+
setTillButton,
|
213
259
|
showPaymentResultToast,
|
214
260
|
showPaymentResultToastFailed,
|
261
|
+
showPaymentResultToastPartiallyPaid,
|
215
262
|
showPaymentResultToastSuccess,
|
216
263
|
showPaymentResultToastWalletPassFailed,
|
217
264
|
usePaymentResultToast
|