@pisell/private-materials 6.7.7 → 6.7.8
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 +2 -2
- package/build/lowcode/preview.js +17 -8
- 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/components/appointmentBooking/components/Voucher/index.js +1 -2
- package/es/components/booking/addons/index.js +17 -25
- package/es/components/booking/components/footer/amount.d.ts +0 -1
- package/es/components/booking/components/footer/amount.js +84 -548
- package/es/components/booking/components/footer/index.js +56 -77
- package/es/components/booking/components/footer/utils.d.ts +0 -19
- package/es/components/booking/components/footer/utils.js +73 -194
- package/es/components/booking/components/voucher/index.js +7 -23
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/hooks/useQuotation.js +1 -4
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +0 -1
- package/es/components/booking/info2/cartClientCard/index.js +6 -30
- package/es/components/booking/info2/index.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +3 -2
- package/es/components/booking/info2/service/editNormalService/index.js +0 -6
- package/es/components/booking/info2/service/editService/index.js +6 -16
- package/es/components/booking/info2/service/editService/utils.d.ts +0 -15
- package/es/components/booking/info2/service/editService/utils.js +0 -66
- package/es/components/booking/utils.d.ts +0 -1
- package/es/components/booking/utils.js +3 -16
- package/es/components/checkout/PaymentModal.d.ts +5 -13
- package/es/components/checkout/PaymentModal.js +252 -304
- package/es/components/checkout/PaymentPlugin.d.ts +3 -0
- package/es/components/{systemSettings/registry/components/GroupModal.js → checkout/PaymentPlugin.js} +171 -132
- package/es/components/checkout/components/AdditionalModule/index.d.ts +1 -3
- package/es/components/checkout/components/AdditionalModule/index.js +12 -52
- package/es/components/checkout/components/AmountSummary/index.js +76 -9
- package/es/components/checkout/components/AmountSummary/index.less +6 -5
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +1 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +2 -5
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +0 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +1 -6
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +0 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.js +1 -2
- package/es/components/checkout/components/PaymentOptionsModule/index.less +0 -4
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +0 -4
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +8 -31
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +33 -94
- package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +0 -6
- package/es/components/checkout/locales.js +0 -6
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +1 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.js +1 -11
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +6 -14
- package/es/components/eftposPay/payo/config.js +32 -70
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/tyro/index.js +0 -12
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/list/List.js +40 -56
- package/es/components/list/hooks/useListState.d.ts +3 -5
- package/es/components/list/hooks/useListState.js +2 -17
- package/es/components/list/styles/header.less +3 -3
- package/es/components/list/utils/index.d.ts +1 -13
- package/es/components/list/utils/index.js +1 -43
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +12 -14
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -4
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +0 -2
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +3 -13
- package/es/components/pay/toC/index.js +4 -7
- package/es/components/pay/toC/locales.d.ts +0 -3
- package/es/components/pay/toC/locales.js +3 -6
- package/es/components/pay/toC/status.d.ts +0 -1
- package/es/components/pay/toC/status.js +0 -3
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/subTotal/index.js +1 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +0 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +2 -33
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +36 -139
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +86 -2
- package/es/components/ticketBooking/components/menuBar/index.js +12 -109
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +7 -112
- package/es/components/ticketBooking/components/timeBar/index.less +0 -59
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +18 -29
- package/es/components/ticketBooking/locales.d.ts +0 -6
- package/es/components/ticketBooking/locales.js +3 -9
- package/es/components/ticketBooking/utils/index.d.ts +0 -3
- package/es/components/ticketBooking/utils/index.js +13 -36
- package/es/components/wallet/Detail/index.js +2 -34
- package/es/components/wallet/Detail/index.less +0 -11
- package/es/components/wallet/Detail/locales.d.ts +0 -6
- package/es/components/wallet/Detail/locales.js +2 -14
- package/es/components/wallet/Voucher/index.js +10 -11
- package/es/components/wallet/components/WalletCard.js +1 -5
- package/es/components/wallet/index.js +2 -4
- package/es/components/wallet/serve.d.ts +0 -7
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/index.d.ts +0 -4
- package/es/index.js +1 -5
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +30 -28
- package/es/plus/clinetSearch/locales.d.ts +0 -3
- package/es/plus/clinetSearch/locales.js +4 -7
- package/es/plus/clinetSearch/types.d.ts +0 -12
- package/es/plus/walletPassGallery/components/footerButton/index.js +4 -2
- package/es/plus/walletPassGallery/components/footerButton/index.less +59 -14
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passDetail/index.js +31 -84
- package/es/plus/walletPassGallery/components/passDetail/index.less +0 -4
- package/es/plus/walletPassGallery/components/recharge/index.js +8 -19
- package/es/plus/walletPassGallery/index.js +3 -7
- package/es/plus/walletPassGallery/serve.d.ts +0 -3
- package/es/plus/walletPassGallery/serve.js +2 -4
- package/es/pro/Login2.0/index.less +8 -15
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +36 -45
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +0 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +2 -4
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +0 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +1 -10
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +0 -14
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +0 -1
- package/es/pro/priceKeyboard/components/shortcuts/index.js +2 -5
- package/es/pro/priceKeyboard/components/shortcuts/index.less +0 -4
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -2
- package/lib/components/booking/addons/index.js +7 -15
- package/lib/components/booking/components/footer/amount.d.ts +0 -1
- package/lib/components/booking/components/footer/amount.js +41 -293
- package/lib/components/booking/components/footer/index.js +11 -30
- package/lib/components/booking/components/footer/utils.d.ts +0 -19
- package/lib/components/booking/components/footer/utils.js +41 -138
- package/lib/components/booking/components/voucher/index.js +9 -25
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/hooks/useQuotation.js +1 -2
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +0 -1
- package/lib/components/booking/info2/cartClientCard/index.js +5 -25
- package/lib/components/booking/info2/index.js +2 -7
- package/lib/components/booking/info2/service/addService/index.js +2 -1
- package/lib/components/booking/info2/service/editNormalService/index.js +0 -6
- package/lib/components/booking/info2/service/editService/index.js +3 -12
- package/lib/components/booking/info2/service/editService/utils.d.ts +0 -15
- package/lib/components/booking/info2/service/editService/utils.js +3 -40
- package/lib/components/booking/utils.d.ts +0 -1
- package/lib/components/booking/utils.js +0 -11
- package/lib/components/checkout/PaymentModal.d.ts +5 -13
- package/lib/components/checkout/PaymentModal.js +147 -190
- package/lib/components/checkout/PaymentPlugin.d.ts +3 -0
- package/lib/components/checkout/PaymentPlugin.js +181 -0
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +1 -3
- package/lib/components/checkout/components/AdditionalModule/index.js +11 -52
- package/lib/components/checkout/components/AmountSummary/index.js +46 -5
- package/lib/components/checkout/components/AmountSummary/index.less +6 -5
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +1 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +2 -5
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +0 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +1 -5
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +0 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +0 -6
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +0 -4
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +0 -4
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +5 -23
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +33 -94
- package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +0 -6
- package/lib/components/checkout/locales.js +0 -6
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +1 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +1 -11
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +6 -12
- package/lib/components/eftposPay/payo/config.js +73 -98
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/tyro/index.js +0 -12
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/list/List.js +16 -34
- package/lib/components/list/hooks/useListState.d.ts +3 -5
- package/lib/components/list/hooks/useListState.js +1 -14
- package/lib/components/list/styles/header.less +3 -3
- package/lib/components/list/utils/index.d.ts +1 -13
- package/lib/components/list/utils/index.js +0 -27
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +12 -14
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -4
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +3 -13
- package/lib/components/pay/toC/index.js +1 -4
- package/lib/components/pay/toC/locales.d.ts +0 -3
- package/lib/components/pay/toC/locales.js +3 -6
- package/lib/components/pay/toC/status.d.ts +0 -1
- package/lib/components/pay/toC/status.js +0 -5
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/subTotal/index.js +1 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +0 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +2 -33
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +24 -84
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +6 -42
- package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +4 -105
- package/lib/components/ticketBooking/components/timeBar/index.less +0 -59
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +13 -17
- package/lib/components/ticketBooking/locales.d.ts +0 -6
- package/lib/components/ticketBooking/locales.js +3 -9
- package/lib/components/ticketBooking/utils/index.d.ts +0 -3
- package/lib/components/ticketBooking/utils/index.js +6 -20
- package/lib/components/wallet/Detail/index.js +3 -31
- package/lib/components/wallet/Detail/index.less +0 -11
- package/lib/components/wallet/Detail/locales.d.ts +0 -6
- package/lib/components/wallet/Detail/locales.js +2 -14
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/components/WalletCard.js +0 -4
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/serve.d.ts +0 -7
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -12
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +8 -17
- package/lib/plus/clinetSearch/locales.d.ts +0 -3
- package/lib/plus/clinetSearch/locales.js +4 -7
- package/lib/plus/clinetSearch/types.d.ts +0 -12
- package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
- package/lib/plus/walletPassGallery/components/footerButton/index.less +59 -14
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.js +15 -54
- package/lib/plus/walletPassGallery/components/passDetail/index.less +0 -4
- package/lib/plus/walletPassGallery/components/recharge/index.js +1 -7
- package/lib/plus/walletPassGallery/index.js +3 -7
- package/lib/plus/walletPassGallery/serve.d.ts +0 -3
- package/lib/plus/walletPassGallery/serve.js +2 -3
- package/lib/pro/Login2.0/index.less +8 -15
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +43 -42
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +2 -3
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +1 -8
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +0 -14
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +2 -3
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +0 -4
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
- package/es/components/checkout/plugin.d.ts +0 -2
- package/es/components/checkout/plugin.js +0 -303
- package/es/components/eftposPay/payo/payment.d.ts +0 -66
- package/es/components/eftposPay/payo/payment.js +0 -579
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +0 -4
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/es/components/systemSettings/registry/components/ItemModal.js +0 -547
- package/es/components/systemSettings/registry/components/ModuleList.d.ts +0 -4
- package/es/components/systemSettings/registry/components/ModuleList.js +0 -54
- package/es/components/systemSettings/registry/components/SectionList.d.ts +0 -4
- package/es/components/systemSettings/registry/components/SectionList.js +0 -174
- package/es/components/systemSettings/registry/components/SettingsTable.d.ts +0 -4
- package/es/components/systemSettings/registry/components/SettingsTable.js +0 -765
- package/es/components/systemSettings/registry/components/index.d.ts +0 -4
- package/es/components/systemSettings/registry/components/index.js +0 -4
- package/es/components/systemSettings/registry/index.d.ts +0 -5
- package/es/components/systemSettings/registry/index.js +0 -1059
- package/es/components/systemSettings/registry/index.less +0 -410
- package/es/components/systemSettings/registry/locales.d.ts +0 -272
- package/es/components/systemSettings/registry/locales.js +0 -300
- package/es/components/systemSettings/registry/services.d.ts +0 -77
- package/es/components/systemSettings/registry/services.js +0 -472
- package/es/components/systemSettings/registry/types.d.ts +0 -126
- package/es/components/systemSettings/registry/types.js +0 -1
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/es/components/systemSettings/registry/utils/typeValidation.js +0 -284
- package/es/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/es/components/systemSettings/registry/utils/validators.js +0 -44
- package/es/components/wallet/utils.d.ts +0 -48
- package/es/components/wallet/utils.js +0 -342
- package/lib/components/checkout/plugin.d.ts +0 -2
- package/lib/components/checkout/plugin.js +0 -263
- package/lib/components/eftposPay/payo/payment.d.ts +0 -66
- package/lib/components/eftposPay/payo/payment.js +0 -357
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- package/lib/components/eftposPay/utils/log/index.js +0 -294
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/GroupModal.js +0 -177
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/ItemModal.js +0 -508
- package/lib/components/systemSettings/registry/components/ModuleList.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/ModuleList.js +0 -71
- package/lib/components/systemSettings/registry/components/SectionList.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/SectionList.js +0 -181
- package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/SettingsTable.js +0 -575
- package/lib/components/systemSettings/registry/components/index.d.ts +0 -4
- package/lib/components/systemSettings/registry/components/index.js +0 -48
- package/lib/components/systemSettings/registry/index.d.ts +0 -5
- package/lib/components/systemSettings/registry/index.js +0 -529
- package/lib/components/systemSettings/registry/index.less +0 -410
- package/lib/components/systemSettings/registry/locales.d.ts +0 -272
- package/lib/components/systemSettings/registry/locales.js +0 -324
- package/lib/components/systemSettings/registry/services.d.ts +0 -77
- package/lib/components/systemSettings/registry/services.js +0 -290
- package/lib/components/systemSettings/registry/types.d.ts +0 -126
- package/lib/components/systemSettings/registry/types.js +0 -17
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/lib/components/systemSettings/registry/utils/typeValidation.js +0 -228
- package/lib/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/lib/components/systemSettings/registry/utils/validators.js +0 -54
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/wallet/utils.js +0 -287
- package/lowcode/payment-modal/meta.ts +0 -135
- package/lowcode/settings-registry/meta.ts +0 -29
- package/lowcode/wallet-pass-detail/meta.ts +0 -89
|
@@ -140,17 +140,15 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
140
140
|
}
|
|
141
141
|
_context.next = 5;
|
|
142
142
|
return showPaymentResultToastSuccess({
|
|
143
|
-
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
144
143
|
title: calculateTitle(paymentStatus),
|
|
145
144
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
|
146
145
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
147
146
|
autoCloseDelay: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoCloseDelay) || 3000,
|
|
148
|
-
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
149
147
|
showCountdownProgress: true,
|
|
150
148
|
actionButtons: actionButtons || [],
|
|
151
149
|
onClose: onToastClose || function () {},
|
|
152
150
|
// 提供默认空函数
|
|
153
|
-
closable:
|
|
151
|
+
closable: false // 控制关闭按钮显示
|
|
154
152
|
});
|
|
155
153
|
case 5:
|
|
156
154
|
_context.next = 15;
|
|
@@ -162,14 +160,10 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
162
160
|
}
|
|
163
161
|
_context.next = 10;
|
|
164
162
|
return showPaymentResultToastSuccess({
|
|
165
|
-
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
166
163
|
title: calculateTitle(paymentStatus),
|
|
167
164
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
|
168
165
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
169
166
|
actionButtons: actionButtons || [],
|
|
170
|
-
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
171
|
-
closable: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose),
|
|
172
|
-
// 控制关闭按钮显示
|
|
173
167
|
onClose: onToastClose || function () {} // 提供默认空函数
|
|
174
168
|
});
|
|
175
169
|
case 10:
|
|
@@ -182,14 +176,10 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
182
176
|
}
|
|
183
177
|
_context.next = 15;
|
|
184
178
|
return showPaymentResultToastFailed({
|
|
185
|
-
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
186
179
|
title: calculateTitle(paymentStatus, failureReason),
|
|
187
180
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount / 100, gapAmount, getData),
|
|
188
181
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
189
182
|
actionButtons: actionButtons || [],
|
|
190
|
-
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
191
|
-
closable: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose),
|
|
192
|
-
// 控制关闭按钮显示
|
|
193
183
|
onClose: onToastClose || function () {} // 提供默认空函数
|
|
194
184
|
});
|
|
195
185
|
case 15:
|
|
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"loading" | "
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
@@ -14,8 +14,6 @@ import { LinklyActionStatus } from "../const";
|
|
|
14
14
|
var GlobalTimeout = 1000 * 60 * 2;
|
|
15
15
|
// 单次请求超时时间
|
|
16
16
|
var RequestTimeout = 1000 * 5;
|
|
17
|
-
// 轮询间隔时间(2秒)
|
|
18
|
-
var QUERY_INTERVAL = 1000 * 2;
|
|
19
17
|
export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, handleLinklySuccess) {
|
|
20
18
|
var dispatch = useDispatch();
|
|
21
19
|
var _useStoreRef = useStoreRef(),
|
|
@@ -40,8 +38,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
40
38
|
var isQueryFinishedRef = useRef(true);
|
|
41
39
|
// 每轮查询的唯一标识
|
|
42
40
|
var queryIdRef = useRef(null);
|
|
43
|
-
// 轮询间隔定时器
|
|
44
|
-
var queryIntervalTimerRef = useRef(null);
|
|
45
41
|
var _resultQuery = /*#__PURE__*/function () {
|
|
46
42
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
47
43
|
var _deviceRef$current;
|
|
@@ -110,9 +106,9 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
110
106
|
console.log('交易状态为0需要继续查询');
|
|
111
107
|
_log("Querying", result);
|
|
112
108
|
isQueryFinishedRef.current = false;
|
|
113
|
-
|
|
109
|
+
setTimeout(function () {
|
|
114
110
|
_resultQuery();
|
|
115
|
-
},
|
|
111
|
+
}, 1500);
|
|
116
112
|
return;
|
|
117
113
|
}
|
|
118
114
|
|
|
@@ -161,9 +157,9 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
161
157
|
_log("AbortError");
|
|
162
158
|
console.log('Error: 请求被取消,将继续查询');
|
|
163
159
|
isQueryFinishedRef.current = false;
|
|
164
|
-
|
|
160
|
+
setTimeout(function () {
|
|
165
161
|
_resultQuery();
|
|
166
|
-
},
|
|
162
|
+
}, 1500);
|
|
167
163
|
return;
|
|
168
164
|
}
|
|
169
165
|
|
|
@@ -172,9 +168,9 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
172
168
|
_log("NetworkError");
|
|
173
169
|
console.log('Error: 网关类报错,将继续查询');
|
|
174
170
|
isQueryFinishedRef.current = false;
|
|
175
|
-
|
|
171
|
+
setTimeout(function () {
|
|
176
172
|
_resultQuery();
|
|
177
|
-
},
|
|
173
|
+
}, 1500);
|
|
178
174
|
return;
|
|
179
175
|
}
|
|
180
176
|
_log("Error", error);
|
|
@@ -246,10 +242,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
246
242
|
clearTimeout(requestTimeoutIdRef.current);
|
|
247
243
|
requestTimeoutIdRef.current = null;
|
|
248
244
|
}
|
|
249
|
-
if (queryIntervalTimerRef.current) {
|
|
250
|
-
clearTimeout(queryIntervalTimerRef.current);
|
|
251
|
-
queryIntervalTimerRef.current = null;
|
|
252
|
-
}
|
|
253
245
|
if (controllerRef.current) {
|
|
254
246
|
controllerRef.current.abort();
|
|
255
247
|
controllerRef.current = null;
|
|
@@ -27,7 +27,6 @@ import { getUuid, getPayParams } from "../helper";
|
|
|
27
27
|
import { useFail, useStoreRef } from "../hooks";
|
|
28
28
|
import { useContextData, useDispatch, updateNextStep, updateComponent, updateState, updateCustom } from "../store";
|
|
29
29
|
import { useValidate } from "./hooks";
|
|
30
|
-
import { usePayment, ActionType } from "./payment";
|
|
31
30
|
|
|
32
31
|
// 注意断网与卸载未完成的回调将终止处理
|
|
33
32
|
export var POS = function POS(_ref) {
|
|
@@ -60,16 +59,6 @@ export var POS = function POS(_ref) {
|
|
|
60
59
|
var _useValidate = useValidate(1000 * 60),
|
|
61
60
|
_useValidate2 = _slicedToArray(_useValidate, 1),
|
|
62
61
|
check = _useValidate2[0];
|
|
63
|
-
var _usePayment = usePayment({
|
|
64
|
-
payApi: api.pay,
|
|
65
|
-
checkApi: api.check,
|
|
66
|
-
shouldContinue: function shouldContinue() {
|
|
67
|
-
// 无网 或 已卸载 则不进行处理
|
|
68
|
-
return !(unloadRef.current || !netRef.current);
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
paymentRun = _usePayment.run,
|
|
72
|
-
paymentClean = _usePayment.clean;
|
|
73
62
|
useEffect(function () {
|
|
74
63
|
failRef.current = fail;
|
|
75
64
|
}, [fail]);
|
|
@@ -162,18 +151,17 @@ export var POS = function POS(_ref) {
|
|
|
162
151
|
}));
|
|
163
152
|
controllerRef.current = new AbortController();
|
|
164
153
|
// 支付 or 退款
|
|
165
|
-
var
|
|
166
|
-
var apiParams = isPay ? _objectSpread(_objectSpread({}, custom !== null && custom !== void 0 && custom.platform ? {
|
|
154
|
+
var resultPromise = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay ? api.pay(_objectSpread(_objectSpread({}, custom !== null && custom !== void 0 && custom.platform ? {
|
|
167
155
|
operator_id: custom.operator_id,
|
|
168
156
|
operator_type: custom.operator_type,
|
|
169
157
|
platform: custom.platform,
|
|
170
|
-
custom_payment_id: custom.custom_payment_id
|
|
171
|
-
} : {}), {}, {
|
|
172
|
-
original_amount: payRef.current.amount,
|
|
158
|
+
custom_payment_id: custom.custom_payment_id,
|
|
173
159
|
service_charge: {
|
|
174
160
|
amount: payRef.current.surMoney,
|
|
175
161
|
percentage: payRef.current.surPercentRate
|
|
176
162
|
},
|
|
163
|
+
original_amount: payRef.current.amount
|
|
164
|
+
} : {}), {}, {
|
|
177
165
|
order_id: orderIdRef.current,
|
|
178
166
|
amount: payRef.current.total,
|
|
179
167
|
card_reader_type: eftposRef.current,
|
|
@@ -182,7 +170,9 @@ export var POS = function POS(_ref) {
|
|
|
182
170
|
pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
183
171
|
number: numRef.current
|
|
184
172
|
})))))
|
|
185
|
-
})
|
|
173
|
+
}), {
|
|
174
|
+
signal: controllerRef.current.signal
|
|
175
|
+
}) : api.refund({
|
|
186
176
|
order_id: orderIdRef.current,
|
|
187
177
|
amount: amountRef.current,
|
|
188
178
|
card_reader_type: eftposRef.current,
|
|
@@ -191,58 +181,31 @@ export var POS = function POS(_ref) {
|
|
|
191
181
|
pay_param_base64: encodeURIComponent(btoa(encodeURIComponent(JSON.stringify(_objectSpread(_objectSpread({}, dataRef.current), {}, {
|
|
192
182
|
number: numRef.current
|
|
193
183
|
})))))
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
} else {
|
|
220
|
-
var resultPromise = api.refund(apiParams, {
|
|
221
|
-
signal: controllerRef.current.signal
|
|
222
|
-
});
|
|
223
|
-
resultPromise.then(function (res) {
|
|
224
|
-
console.log('netRef.current111 = ', netRef.current);
|
|
225
|
-
if (unloadRef.current || !netRef.current) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
if (res && "".concat(res.code) === '200') {
|
|
229
|
-
success(res);
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
return Promise.reject(res);
|
|
233
|
-
}).catch(function (err) {
|
|
234
|
-
console.log('netRef.current222 = ', netRef.current, unloadRef.current, err);
|
|
235
|
-
if (unloadRef.current || !netRef.current) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
// 支付接口超时 进行支付状态查询(超时或者其它错误)
|
|
239
|
-
if (!(err !== null && err !== void 0 && err.code) || "".concat(err.code) === PayStatus.Timeout) {
|
|
240
|
-
checkApi();
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
failRef.current(err, true);
|
|
244
|
-
});
|
|
245
|
-
}
|
|
184
|
+
}, {
|
|
185
|
+
signal: controllerRef.current.signal
|
|
186
|
+
});
|
|
187
|
+
resultPromise.then(function (res) {
|
|
188
|
+
console.log('netRef.current111 = ', netRef.current);
|
|
189
|
+
if (unloadRef.current || !netRef.current) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (res && "".concat(res.code) === '200') {
|
|
193
|
+
success(res);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
return Promise.reject(res);
|
|
197
|
+
}).catch(function (err) {
|
|
198
|
+
console.log('netRef.current222 = ', netRef.current, unloadRef.current, err);
|
|
199
|
+
if (unloadRef.current || !netRef.current) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
// 支付接口超时 进行支付状态查询(超时或者其它错误)
|
|
203
|
+
if (!(err !== null && err !== void 0 && err.code) || "".concat(err.code) === PayStatus.Timeout) {
|
|
204
|
+
checkApi();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
failRef.current(err, true);
|
|
208
|
+
});
|
|
246
209
|
}, [api, check, dispatch, onChange]);
|
|
247
210
|
useEffect(function () {
|
|
248
211
|
return function () {
|
|
@@ -252,7 +215,6 @@ export var POS = function POS(_ref) {
|
|
|
252
215
|
if (clearRef.current) {
|
|
253
216
|
clearTimeout(clearRef.current);
|
|
254
217
|
}
|
|
255
|
-
paymentClean();
|
|
256
218
|
};
|
|
257
219
|
}, []);
|
|
258
220
|
return /*#__PURE__*/React.createElement(Step, props);
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "loading" | "
|
|
177
|
+
status: "loading" | "warn" | "success" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
295
295
|
name?: string | undefined;
|
|
296
296
|
symbol?: string | undefined;
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
|
-
mode?: "
|
|
298
|
+
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
300
|
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
301
|
-
action?: "
|
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
304
304
|
title?: string | undefined;
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "loading" | "
|
|
311
|
+
status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -180,12 +180,6 @@ export default (function (_ref) {
|
|
|
180
180
|
response: {},
|
|
181
181
|
metadata: {
|
|
182
182
|
receipt: []
|
|
183
|
-
},
|
|
184
|
-
_config: {
|
|
185
|
-
retry: {
|
|
186
|
-
count: 10,
|
|
187
|
-
delay: 500
|
|
188
|
-
}
|
|
189
183
|
}
|
|
190
184
|
}).then(function (res) {
|
|
191
185
|
requestIdRef.current = res.data.id;
|
|
@@ -260,12 +254,6 @@ export default (function (_ref) {
|
|
|
260
254
|
response: {},
|
|
261
255
|
metadata: {
|
|
262
256
|
receipt: []
|
|
263
|
-
},
|
|
264
|
-
_config: {
|
|
265
|
-
retry: {
|
|
266
|
-
count: 10,
|
|
267
|
-
delay: 500
|
|
268
|
-
}
|
|
269
257
|
}
|
|
270
258
|
}).then(function (res) {
|
|
271
259
|
requestIdRef.current = res.data.id;
|
package/es/components/index.d.ts
CHANGED
|
@@ -20,5 +20,4 @@ import StepController from './stepController';
|
|
|
20
20
|
import PinModal from './pinModal';
|
|
21
21
|
import PinVerifyModal from './pinVerifyModal';
|
|
22
22
|
import { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from './authentication/admin';
|
|
23
|
-
|
|
24
|
-
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry, };
|
|
23
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, };
|
package/es/components/index.js
CHANGED
|
@@ -20,5 +20,4 @@ import StepController from "./stepController";
|
|
|
20
20
|
import PinModal from "./pinModal";
|
|
21
21
|
import PinVerifyModal from "./pinVerifyModal";
|
|
22
22
|
import { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from "./authentication/admin";
|
|
23
|
-
|
|
24
|
-
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth, Registry };
|
|
23
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
9
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -6,14 +11,10 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
6
11
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
7
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
import React, { useEffect, useMemo, useRef, useCallback, cloneElement, isValidElement } from 'react';
|
|
15
15
|
import { Button } from 'antd';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
+
import Tab from "./components/Tab";
|
|
17
18
|
import Pagination from "./components/Pagination";
|
|
18
19
|
import EmptyState from "./components/EmptyState";
|
|
19
20
|
import ScrollLoader from "./components/ScrollLoader";
|
|
@@ -21,13 +22,12 @@ import WaterfallList from "./components/WaterfallList";
|
|
|
21
22
|
import ListItemSkeleton from "./components/ListItemSkeleton";
|
|
22
23
|
import TabSkeleton from "./components/TabSkeleton";
|
|
23
24
|
import "./List.less";
|
|
24
|
-
import { Iconfont
|
|
25
|
+
import { Iconfont } from '@pisell/materials';
|
|
25
26
|
// import { locales } from '@pisell/utils';
|
|
26
27
|
import listLocales from "./locales";
|
|
27
28
|
import useWaterfall from "./hooks/useWaterfall";
|
|
28
29
|
import { useListState } from "./hooks/useListState";
|
|
29
30
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
30
|
-
import { findProductIdsByPath } from "./utils";
|
|
31
31
|
|
|
32
32
|
// 虚假数据常量,用于loading状态
|
|
33
33
|
var MOCK_LIST_DATA = function () {
|
|
@@ -145,7 +145,6 @@ var List = function List(props) {
|
|
|
145
145
|
externalCurrentPage: pagination === null || pagination === void 0 ? void 0 : pagination.current,
|
|
146
146
|
tabItems: tabItems,
|
|
147
147
|
defaultPageSize: defaultPageSize,
|
|
148
|
-
tabStyle: tabStyle,
|
|
149
148
|
onLoadData: onLoadData
|
|
150
149
|
}),
|
|
151
150
|
listState = _useListState.state,
|
|
@@ -175,11 +174,6 @@ var List = function List(props) {
|
|
|
175
174
|
// 否则使用严格相等比较
|
|
176
175
|
return fieldValue === targetValue;
|
|
177
176
|
};
|
|
178
|
-
var dataIdMap = useMemo(function () {
|
|
179
|
-
return data.reduce(function (pre, cur) {
|
|
180
|
-
return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, cur.id, cur));
|
|
181
|
-
}, {});
|
|
182
|
-
}, [data]);
|
|
183
177
|
|
|
184
178
|
// 数据分组处理 - 按tab分组数据
|
|
185
179
|
var processedData = useMemo(function () {
|
|
@@ -279,51 +273,40 @@ var List = function List(props) {
|
|
|
279
273
|
items: filteredData
|
|
280
274
|
}];
|
|
281
275
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
} else {
|
|
293
|
-
// 查找当前选中的tab
|
|
294
|
-
var currentTab = tabItems.find(function (tab) {
|
|
295
|
-
return tab.key === activeTab;
|
|
276
|
+
|
|
277
|
+
// 查找当前选中的tab
|
|
278
|
+
var currentTab = tabItems.find(function (tab) {
|
|
279
|
+
return tab.key === activeTab;
|
|
280
|
+
});
|
|
281
|
+
if (currentTab && currentTab.group) {
|
|
282
|
+
// 如果tab项有group属性,使用group值进行过滤
|
|
283
|
+
var filterField = 'category'; // 固定使用category字段,因为测试数据都使用这个字段
|
|
284
|
+
filteredData = filteredData.filter(function (item) {
|
|
285
|
+
return matchesFieldValue(item[filterField], currentTab.group);
|
|
296
286
|
});
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
var _loop2 = function _loop2() {
|
|
307
|
-
var field = _possibleFields[_i];
|
|
308
|
-
if (field && field !== '字段' && filteredData.some(function (item) {
|
|
287
|
+
} else if (currentTab) {
|
|
288
|
+
// 如果没有group属性,假设tab的key就是要过滤的值
|
|
289
|
+
var possibleFields = ['category', 'status', 'type', tabGroup];
|
|
290
|
+
var _loop2 = function _loop2() {
|
|
291
|
+
var field = _possibleFields[_i];
|
|
292
|
+
if (field && field !== '字段' && filteredData.some(function (item) {
|
|
293
|
+
return matchesFieldValue(item[field], activeTab);
|
|
294
|
+
})) {
|
|
295
|
+
filteredData = filteredData.filter(function (item) {
|
|
309
296
|
return matchesFieldValue(item[field], activeTab);
|
|
310
|
-
})
|
|
311
|
-
|
|
312
|
-
return matchesFieldValue(item[field], activeTab);
|
|
313
|
-
});
|
|
314
|
-
return 1; // break
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
for (var _i = 0, _possibleFields = possibleFields; _i < _possibleFields.length; _i++) {
|
|
318
|
-
if (_loop2()) break;
|
|
297
|
+
});
|
|
298
|
+
return 1; // break
|
|
319
299
|
}
|
|
300
|
+
};
|
|
301
|
+
for (var _i = 0, _possibleFields = possibleFields; _i < _possibleFields.length; _i++) {
|
|
302
|
+
if (_loop2()) break;
|
|
320
303
|
}
|
|
321
|
-
return [{
|
|
322
|
-
tabKey: activeTab,
|
|
323
|
-
tabLabel: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.label) || '',
|
|
324
|
-
items: filteredData
|
|
325
|
-
}];
|
|
326
304
|
}
|
|
305
|
+
return [{
|
|
306
|
+
tabKey: activeTab,
|
|
307
|
+
tabLabel: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.label) || '',
|
|
308
|
+
items: filteredData
|
|
309
|
+
}];
|
|
327
310
|
}
|
|
328
311
|
}, [data, activeTab, tabItems, tabGroup, tabStyle, loading]);
|
|
329
312
|
|
|
@@ -709,9 +692,10 @@ var List = function List(props) {
|
|
|
709
692
|
return /*#__PURE__*/React.createElement("div", {
|
|
710
693
|
ref: headerRef,
|
|
711
694
|
className: headerClasses
|
|
712
|
-
}, /*#__PURE__*/React.createElement(
|
|
713
|
-
|
|
714
|
-
|
|
695
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
|
696
|
+
className: classNames('pisell-list-tabs', "pisell-list-tabs-".concat(tabStyle)),
|
|
697
|
+
activeKey: activeTab,
|
|
698
|
+
items: tabItems,
|
|
715
699
|
onChange: handleTabChangeWithScroll
|
|
716
700
|
}));
|
|
717
701
|
};
|
|
@@ -6,7 +6,7 @@ export interface ListState {
|
|
|
6
6
|
}
|
|
7
7
|
export declare type ListAction = {
|
|
8
8
|
type: 'SET_ACTIVE_TAB';
|
|
9
|
-
payload: string
|
|
9
|
+
payload: string;
|
|
10
10
|
} | {
|
|
11
11
|
type: 'SET_CURRENT_PAGE';
|
|
12
12
|
payload: number;
|
|
@@ -25,8 +25,6 @@ export interface UseListStateProps {
|
|
|
25
25
|
defaultPageSize: number;
|
|
26
26
|
/** 数据加载回调 */
|
|
27
27
|
onLoadData?: (params: LoadDataParams) => void;
|
|
28
|
-
/** tab样式 */
|
|
29
|
-
tabStyle: 'anchor' | 'switch' | 'none';
|
|
30
28
|
}
|
|
31
29
|
export interface UseListStateReturn {
|
|
32
30
|
state: ListState;
|
|
@@ -34,7 +32,7 @@ export interface UseListStateReturn {
|
|
|
34
32
|
setCurrentPage: (page: number) => void;
|
|
35
33
|
setStickyActive: (active: boolean) => void;
|
|
36
34
|
resetPage: () => void;
|
|
37
|
-
handleTabChange: (key: string
|
|
35
|
+
handleTabChange: (key: string) => void;
|
|
38
36
|
handlePageChange: (page: number, size?: number) => void;
|
|
39
37
|
handleShowSizeChange: (current: number, size: number) => void;
|
|
40
38
|
handleLoadMore: () => void;
|
|
@@ -42,4 +40,4 @@ export interface UseListStateReturn {
|
|
|
42
40
|
handleScrollLoad: () => void;
|
|
43
41
|
actualCurrentPage: number;
|
|
44
42
|
}
|
|
45
|
-
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData,
|
|
43
|
+
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, }: UseListStateProps) => UseListStateReturn;
|
|
@@ -10,7 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
import { useReducer, useCallback
|
|
13
|
+
import { useReducer, useCallback } from 'react';
|
|
14
14
|
|
|
15
15
|
// 状态接口
|
|
16
16
|
|
|
@@ -48,32 +48,17 @@ export var useListState = function useListState(_ref) {
|
|
|
48
48
|
var externalCurrentPage = _ref.externalCurrentPage,
|
|
49
49
|
tabItems = _ref.tabItems,
|
|
50
50
|
defaultPageSize = _ref.defaultPageSize,
|
|
51
|
-
onLoadData = _ref.onLoadData
|
|
52
|
-
tabStyle = _ref.tabStyle;
|
|
51
|
+
onLoadData = _ref.onLoadData;
|
|
53
52
|
// 初始状态
|
|
54
53
|
var initialState = {
|
|
55
54
|
activeTab: tabItems.length > 0 ? tabItems[0].key : 'all',
|
|
56
55
|
currentPage: 1,
|
|
57
56
|
isStickyActive: false
|
|
58
57
|
};
|
|
59
|
-
|
|
60
|
-
// 是否设置过默认tab
|
|
61
|
-
var isSetDefaultTabRef = useRef(false);
|
|
62
58
|
var _useReducer = useReducer(listStateReducer, initialState),
|
|
63
59
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
64
60
|
state = _useReducer2[0],
|
|
65
61
|
dispatch = _useReducer2[1];
|
|
66
|
-
useEffect(function () {
|
|
67
|
-
if (tabStyle === 'switch' && tabItems.length > 0 && !isSetDefaultTabRef.current) {
|
|
68
|
-
var _tabItems$;
|
|
69
|
-
isSetDefaultTabRef.current = true;
|
|
70
|
-
var defaultTab = [tabItems[0].key];
|
|
71
|
-
if (((_tabItems$ = tabItems[0]) === null || _tabItems$ === void 0 || (_tabItems$ = _tabItems$.children) === null || _tabItems$ === void 0 ? void 0 : _tabItems$.length) > 0) {
|
|
72
|
-
defaultTab.push('0');
|
|
73
|
-
}
|
|
74
|
-
setActiveTab(defaultTab);
|
|
75
|
-
}
|
|
76
|
-
}, [tabItems, tabStyle]);
|
|
77
62
|
|
|
78
63
|
// 计算实际使用的当前页码
|
|
79
64
|
var actualCurrentPage = externalCurrentPage || state.currentPage;
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
top: 0;
|
|
59
59
|
z-index: 10;
|
|
60
60
|
/* 毛玻璃效果 */
|
|
61
|
-
background:
|
|
61
|
+
background: rgba(255, 255, 255, 0.80);
|
|
62
62
|
backdrop-filter: blur(12px);
|
|
63
|
-
|
|
63
|
+
border-bottom: 1px solid #D0D5DD;
|
|
64
|
+
padding-bottom: 12px;
|
|
64
65
|
box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
|
|
65
66
|
transition: box-shadow 0.2s ease, backdrop-filter 0.2s ease, background 0.2s ease;
|
|
66
|
-
border: none;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
}
|