@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
|
@@ -1,765 +0,0 @@
|
|
|
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
|
-
var _excluded = ["record", "children", "className", "style"];
|
|
3
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
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."); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
-
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); }
|
|
18
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
import React, { useState, useMemo } from 'react';
|
|
22
|
-
import { Table, Tag, Space, Empty, Modal, Spin } from 'antd';
|
|
23
|
-
|
|
24
|
-
// 临时类型修复
|
|
25
|
-
var AntdTag = Tag;
|
|
26
|
-
var AntdSpace = Space;
|
|
27
|
-
import { Button } from '@pisell/materials';
|
|
28
|
-
import { PlusOutlined, EditOutlined, DeleteOutlined, CaretRightOutlined, CaretDownOutlined, HolderOutlined } from '@ant-design/icons';
|
|
29
|
-
import { locales } from '@pisell/utils';
|
|
30
|
-
import { DndContext, PointerSensor, useSensor, useSensors, DragOverlay, closestCenter, rectIntersection } from '@dnd-kit/core';
|
|
31
|
-
import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
32
|
-
import { useDroppable } from '@dnd-kit/core';
|
|
33
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
34
|
-
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
35
|
-
// 作用域值到 locales key 的映射(与 ItemModal 保持一致)
|
|
36
|
-
var scopeKeyMapping = {
|
|
37
|
-
'system': 'registry.scope.systemDefault',
|
|
38
|
-
'saas': 'registry.scope.saasDefault',
|
|
39
|
-
'organization': 'registry.scope.organization',
|
|
40
|
-
'business': 'registry.scope.business',
|
|
41
|
-
'channel': 'registry.scope.channel',
|
|
42
|
-
'board': 'registry.scope.board'
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// 工具函数:获取多语言文本的显示值
|
|
46
|
-
var getMultiLanguageText = function getMultiLanguageText(text, currentLocale) {
|
|
47
|
-
if (typeof text === 'string') {
|
|
48
|
-
return text;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 获取当前语言,优先使用传入的 currentLocale
|
|
52
|
-
var currentLang = currentLocale || localStorage.getItem('umi_locale') || 'zh-CN';
|
|
53
|
-
|
|
54
|
-
// 根据当前语言返回对应的文本,如果没有则使用 original
|
|
55
|
-
if (text[currentLang]) {
|
|
56
|
-
return text[currentLang];
|
|
57
|
-
}
|
|
58
|
-
return text.original || '';
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// 虚拟拖动容器类型
|
|
62
|
-
|
|
63
|
-
// 可拖拽行组件
|
|
64
|
-
|
|
65
|
-
// 创建一个 Context 来传递拖拽属性
|
|
66
|
-
var DragContext = /*#__PURE__*/React.createContext({});
|
|
67
|
-
|
|
68
|
-
// 拖拽句柄组件
|
|
69
|
-
var DragHandle = function DragHandle(_ref) {
|
|
70
|
-
var record = _ref.record,
|
|
71
|
-
isGroup = _ref.isGroup,
|
|
72
|
-
isExpanded = _ref.isExpanded,
|
|
73
|
-
onExpand = _ref.onExpand,
|
|
74
|
-
currentLocale = _ref.currentLocale;
|
|
75
|
-
var _React$useContext = React.useContext(DragContext),
|
|
76
|
-
attributes = _React$useContext.attributes,
|
|
77
|
-
listeners = _React$useContext.listeners;
|
|
78
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: "pisell-settings-registry-table-title",
|
|
80
|
-
style: {
|
|
81
|
-
paddingLeft: record.level * 24,
|
|
82
|
-
display: 'flex',
|
|
83
|
-
alignItems: 'center'
|
|
84
|
-
}
|
|
85
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
86
|
-
className: "drag-handle"
|
|
87
|
-
}, attributes || {}, listeners || {}, {
|
|
88
|
-
style: {
|
|
89
|
-
cursor: 'grab',
|
|
90
|
-
marginRight: 8,
|
|
91
|
-
color: '#999',
|
|
92
|
-
fontSize: '12px',
|
|
93
|
-
display: 'flex',
|
|
94
|
-
alignItems: 'center'
|
|
95
|
-
}
|
|
96
|
-
}), /*#__PURE__*/React.createElement(HolderOutlined, null)), isGroup && /*#__PURE__*/React.createElement(Button, {
|
|
97
|
-
type: "text",
|
|
98
|
-
size: "small",
|
|
99
|
-
icon: isExpanded ? /*#__PURE__*/React.createElement(CaretDownOutlined, null) : /*#__PURE__*/React.createElement(CaretRightOutlined, null),
|
|
100
|
-
onClick: function onClick() {
|
|
101
|
-
return onExpand(record.key);
|
|
102
|
-
},
|
|
103
|
-
style: {
|
|
104
|
-
marginRight: 8
|
|
105
|
-
}
|
|
106
|
-
}), /*#__PURE__*/React.createElement(AntdTag, {
|
|
107
|
-
color: isGroup ? 'blue' : 'green'
|
|
108
|
-
}, locales.getText(isGroup ? 'registry.level.group' : 'registry.level.item')), /*#__PURE__*/React.createElement("span", {
|
|
109
|
-
style: {
|
|
110
|
-
marginLeft: 8
|
|
111
|
-
}
|
|
112
|
-
}, getMultiLanguageText(record.data.title || record.data.name, currentLocale)));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// 移除了 DroppableVirtualContainer 组件,拖放逻辑已集成到行级别
|
|
116
|
-
|
|
117
|
-
var DraggableRow = function DraggableRow(_ref2) {
|
|
118
|
-
var record = _ref2.record,
|
|
119
|
-
children = _ref2.children,
|
|
120
|
-
className = _ref2.className,
|
|
121
|
-
style = _ref2.style,
|
|
122
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
123
|
-
// 如果没有有效的 record,返回普通的 tr
|
|
124
|
-
if (!record || !record.key) {
|
|
125
|
-
return /*#__PURE__*/React.createElement("tr", _extends({
|
|
126
|
-
className: className,
|
|
127
|
-
style: style
|
|
128
|
-
}, props), children);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// 普通的可拖拽行
|
|
132
|
-
var _useSortable = useSortable({
|
|
133
|
-
id: record.key,
|
|
134
|
-
data: {
|
|
135
|
-
type: record.type,
|
|
136
|
-
record: record,
|
|
137
|
-
groupId: record.type === 'item' ? record.data.groupId || record.data.group_id : record.data.id
|
|
138
|
-
}
|
|
139
|
-
}),
|
|
140
|
-
attributes = _useSortable.attributes,
|
|
141
|
-
listeners = _useSortable.listeners,
|
|
142
|
-
setNodeRef = _useSortable.setNodeRef,
|
|
143
|
-
transform = _useSortable.transform,
|
|
144
|
-
transition = _useSortable.transition,
|
|
145
|
-
isDragging = _useSortable.isDragging;
|
|
146
|
-
|
|
147
|
-
// 为组行添加拖放区域(用于接受设置项)
|
|
148
|
-
var dropResult = useDroppable({
|
|
149
|
-
id: record.type === 'group' ? "item-container-".concat(record.data.id) : "drop-".concat(record.key),
|
|
150
|
-
data: {
|
|
151
|
-
type: record.type === 'group' ? 'item-container' : 'item',
|
|
152
|
-
groupId: record.type === 'group' ? record.data.id : undefined,
|
|
153
|
-
acceptTypes: record.type === 'group' ? ['item'] : []
|
|
154
|
-
},
|
|
155
|
-
disabled: record.type !== 'group' // 只有组行才能接受拖放
|
|
156
|
-
});
|
|
157
|
-
var dragStyle = _objectSpread(_objectSpread({
|
|
158
|
-
transform: CSS.Transform.toString(transform),
|
|
159
|
-
transition: transition,
|
|
160
|
-
opacity: isDragging ? 0.5 : 1
|
|
161
|
-
}, record.type === 'group' && dropResult.isOver ? {
|
|
162
|
-
backgroundColor: 'rgba(24, 144, 255, 0.05)',
|
|
163
|
-
borderLeft: '3px solid #1890ff'
|
|
164
|
-
} : {}), style);
|
|
165
|
-
|
|
166
|
-
// 合并拖拽和拖放的 ref
|
|
167
|
-
var combinedRef = function combinedRef(node) {
|
|
168
|
-
setNodeRef(node);
|
|
169
|
-
dropResult.setNodeRef(node);
|
|
170
|
-
};
|
|
171
|
-
return /*#__PURE__*/React.createElement(DragContext.Provider, {
|
|
172
|
-
value: {
|
|
173
|
-
attributes: attributes,
|
|
174
|
-
listeners: listeners
|
|
175
|
-
}
|
|
176
|
-
}, /*#__PURE__*/React.createElement("tr", _extends({
|
|
177
|
-
ref: combinedRef,
|
|
178
|
-
style: dragStyle,
|
|
179
|
-
className: "".concat(className, " ").concat(isDragging ? 'dragging' : '', " ").concat(record.type === 'group' ? 'group-row' : '', " ").concat(dropResult.isOver && record.type === 'group' ? 'drop-over' : '')
|
|
180
|
-
}, props), children));
|
|
181
|
-
};
|
|
182
|
-
var SettingsTable = function SettingsTable(_ref3) {
|
|
183
|
-
var _context$engine;
|
|
184
|
-
var section = _ref3.section,
|
|
185
|
-
_ref3$groupList = _ref3.groupList,
|
|
186
|
-
groupList = _ref3$groupList === void 0 ? [] : _ref3$groupList,
|
|
187
|
-
_ref3$groupLoading = _ref3.groupLoading,
|
|
188
|
-
groupLoading = _ref3$groupLoading === void 0 ? false : _ref3$groupLoading,
|
|
189
|
-
onDataChange = _ref3.onDataChange,
|
|
190
|
-
onEditGroup = _ref3.onEditGroup,
|
|
191
|
-
onDeleteGroup = _ref3.onDeleteGroup,
|
|
192
|
-
onAddItem = _ref3.onAddItem,
|
|
193
|
-
onEditItem = _ref3.onEditItem,
|
|
194
|
-
onDeleteItem = _ref3.onDeleteItem,
|
|
195
|
-
onGroupReorder = _ref3.onGroupReorder,
|
|
196
|
-
onItemMove = _ref3.onItemMove;
|
|
197
|
-
var context = useEngineContext();
|
|
198
|
-
var _useState = useState([]),
|
|
199
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
200
|
-
expandedKeys = _useState2[0],
|
|
201
|
-
setExpandedKeys = _useState2[1];
|
|
202
|
-
var _useState3 = useState(null),
|
|
203
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
204
|
-
activeId = _useState4[0],
|
|
205
|
-
setActiveId = _useState4[1];
|
|
206
|
-
var _useState5 = useState(null),
|
|
207
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
208
|
-
dragOverZone = _useState6[0],
|
|
209
|
-
setDragOverZone = _useState6[1];
|
|
210
|
-
|
|
211
|
-
// 配置拖拽传感器
|
|
212
|
-
var sensors = useSensors(useSensor(PointerSensor, {
|
|
213
|
-
activationConstraint: {
|
|
214
|
-
distance: 8
|
|
215
|
-
}
|
|
216
|
-
}));
|
|
217
|
-
|
|
218
|
-
// 创建虚拟拖动区域
|
|
219
|
-
var virtualDropZones = useMemo(function () {
|
|
220
|
-
var zones = [];
|
|
221
|
-
|
|
222
|
-
// 为每个组创建一个组级别的拖动区域(用于组之间的排序)
|
|
223
|
-
groupList.forEach(function (group) {
|
|
224
|
-
zones.push({
|
|
225
|
-
id: "group-zone-".concat(group.id),
|
|
226
|
-
type: 'group',
|
|
227
|
-
groupId: group.id,
|
|
228
|
-
acceptTypes: ['group'],
|
|
229
|
-
key: "group-".concat(group.id)
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// 为每个组创建一个项目容器区域(用于项目的跨组移动)
|
|
233
|
-
zones.push({
|
|
234
|
-
id: "item-container-".concat(group.id),
|
|
235
|
-
type: 'item-container',
|
|
236
|
-
groupId: group.id,
|
|
237
|
-
acceptTypes: ['item'],
|
|
238
|
-
key: "item-".concat(group.id)
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
return zones;
|
|
242
|
-
}, [groupList]);
|
|
243
|
-
|
|
244
|
-
// 自定义碰撞检测,基于虚拟区域
|
|
245
|
-
var customCollisionDetection = function customCollisionDetection(args) {
|
|
246
|
-
var _standardCollisions$;
|
|
247
|
-
var active = args.active,
|
|
248
|
-
droppableContainers = args.droppableContainers;
|
|
249
|
-
|
|
250
|
-
// 首先尝试检测虚拟容器
|
|
251
|
-
var virtualContainers = Array.from(droppableContainers.values()).filter(function (container) {
|
|
252
|
-
var id = container.id;
|
|
253
|
-
return id.startsWith('item-container-') || id.startsWith('group-zone-');
|
|
254
|
-
});
|
|
255
|
-
if (virtualContainers.length > 0) {
|
|
256
|
-
// 对虚拟容器使用矩形相交检测
|
|
257
|
-
var virtualCollisions = rectIntersection(_objectSpread(_objectSpread({}, args), {}, {
|
|
258
|
-
droppableContainers: virtualContainers
|
|
259
|
-
}));
|
|
260
|
-
if (virtualCollisions && virtualCollisions.length > 0) {
|
|
261
|
-
console.log('虚拟容器碰撞检测:', virtualCollisions[0].id);
|
|
262
|
-
return virtualCollisions;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// 如果没有虚拟容器碰撞,则使用标准的最近中心点检测
|
|
267
|
-
var standardCollisions = closestCenter(args);
|
|
268
|
-
console.log('标准碰撞检测:', standardCollisions === null || standardCollisions === void 0 || (_standardCollisions$ = standardCollisions[0]) === null || _standardCollisions$ === void 0 ? void 0 : _standardCollisions$.id);
|
|
269
|
-
return standardCollisions;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// 获取当前语言
|
|
273
|
-
var currentLocale = (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || localStorage.getItem('umi_locale') || 'zh-CN';
|
|
274
|
-
|
|
275
|
-
// 将组数据转换为树形结构
|
|
276
|
-
var treeData = useMemo(function () {
|
|
277
|
-
if (!groupList || groupList.length === 0) return [];
|
|
278
|
-
var nodes = [];
|
|
279
|
-
groupList.forEach(function (group) {
|
|
280
|
-
var groupNode = {
|
|
281
|
-
key: "group-".concat(group.id),
|
|
282
|
-
type: 'group',
|
|
283
|
-
data: group,
|
|
284
|
-
children: []
|
|
285
|
-
};
|
|
286
|
-
group === null || group === void 0 || group.items.sort(function (a, b) {
|
|
287
|
-
return a.sort - b.sort || a.id - b.id;
|
|
288
|
-
}).forEach(function (item) {
|
|
289
|
-
var itemNode = {
|
|
290
|
-
key: "item-".concat(item.id),
|
|
291
|
-
type: 'item',
|
|
292
|
-
data: item,
|
|
293
|
-
parentKey: groupNode.key
|
|
294
|
-
};
|
|
295
|
-
groupNode.children.push(itemNode);
|
|
296
|
-
});
|
|
297
|
-
nodes.push(groupNode);
|
|
298
|
-
});
|
|
299
|
-
return nodes;
|
|
300
|
-
}, [groupList]);
|
|
301
|
-
|
|
302
|
-
// 初始化展开状态
|
|
303
|
-
React.useEffect(function () {
|
|
304
|
-
if (groupList && groupList.length > 0) {
|
|
305
|
-
var defaultExpanded = groupList.filter(function (group) {
|
|
306
|
-
return group.expanded !== false;
|
|
307
|
-
}).map(function (group) {
|
|
308
|
-
return "group-".concat(group.id);
|
|
309
|
-
});
|
|
310
|
-
setExpandedKeys(defaultExpanded);
|
|
311
|
-
}
|
|
312
|
-
}, [groupList]);
|
|
313
|
-
|
|
314
|
-
// 扁平化数据用于表格显示,包含虚拟容器
|
|
315
|
-
var flattenData = useMemo(function () {
|
|
316
|
-
var result = [];
|
|
317
|
-
treeData.forEach(function (groupNode, groupIndex) {
|
|
318
|
-
// 添加组行,包装在组级虚拟容器中
|
|
319
|
-
var groupZone = virtualDropZones.find(function (z) {
|
|
320
|
-
return z.id === "group-zone-".concat(groupNode.data.id);
|
|
321
|
-
});
|
|
322
|
-
result.push({
|
|
323
|
-
key: groupNode.key,
|
|
324
|
-
type: 'group',
|
|
325
|
-
data: groupNode.data,
|
|
326
|
-
level: 0,
|
|
327
|
-
virtualZone: groupZone
|
|
328
|
-
});
|
|
329
|
-
if (expandedKeys.includes(groupNode.key)) {
|
|
330
|
-
// 只添加实际的子项,不添加占位空行
|
|
331
|
-
if (groupNode.children && groupNode.children.length > 0) {
|
|
332
|
-
groupNode.children.forEach(function (itemNode) {
|
|
333
|
-
result.push({
|
|
334
|
-
key: itemNode.key,
|
|
335
|
-
type: 'item',
|
|
336
|
-
data: itemNode.data,
|
|
337
|
-
level: 1
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
return result;
|
|
344
|
-
}, [treeData, expandedKeys, virtualDropZones]);
|
|
345
|
-
|
|
346
|
-
// 处理展开/收起
|
|
347
|
-
var handleExpand = function handleExpand(key) {
|
|
348
|
-
setExpandedKeys(function (prev) {
|
|
349
|
-
return prev.includes(key) ? prev.filter(function (k) {
|
|
350
|
-
return k !== key;
|
|
351
|
-
}) : [].concat(_toConsumableArray(prev), [key]);
|
|
352
|
-
});
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
// 拖拽开始
|
|
356
|
-
var handleDragStart = function handleDragStart(event) {
|
|
357
|
-
setActiveId(event.active.id);
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
// 拖拽悬停
|
|
361
|
-
var handleDragOver = function handleDragOver(event) {
|
|
362
|
-
var active = event.active,
|
|
363
|
-
over = event.over;
|
|
364
|
-
if (!over) {
|
|
365
|
-
setDragOverZone(null);
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
var overId = over.id;
|
|
369
|
-
|
|
370
|
-
// 检查是否悬停在虚拟区域上
|
|
371
|
-
var zone = virtualDropZones.find(function (z) {
|
|
372
|
-
return z.id === overId;
|
|
373
|
-
});
|
|
374
|
-
if (zone) {
|
|
375
|
-
setDragOverZone(overId);
|
|
376
|
-
} else {
|
|
377
|
-
setDragOverZone(null);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
// 拖拽结束 - 基于虚拟拖动容器
|
|
382
|
-
var handleDragEnd = function handleDragEnd(event) {
|
|
383
|
-
var active = event.active,
|
|
384
|
-
over = event.over;
|
|
385
|
-
setActiveId(null);
|
|
386
|
-
setDragOverZone(null);
|
|
387
|
-
if (!over || active.id === over.id) return;
|
|
388
|
-
var activeData = active.data.current;
|
|
389
|
-
var overData = over.data.current;
|
|
390
|
-
if (!activeData) return;
|
|
391
|
-
var activeRecord = activeData.record;
|
|
392
|
-
var overId = over.id;
|
|
393
|
-
|
|
394
|
-
// 基于虚拟容器的拖拽处理
|
|
395
|
-
console.log('拖拽结束:', {
|
|
396
|
-
activeId: active.id,
|
|
397
|
-
overId: overId,
|
|
398
|
-
activeRecord: activeRecord.type
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
// 处理组与组之间的排序(拖拽到组的虚拟容器)
|
|
402
|
-
if (activeRecord.type === 'group') {
|
|
403
|
-
// 查找目标组的虚拟容器
|
|
404
|
-
var targetZone = virtualDropZones.find(function (z) {
|
|
405
|
-
return z.key === overId && z.type === 'group';
|
|
406
|
-
});
|
|
407
|
-
if (targetZone) {
|
|
408
|
-
var activeGroupId = activeRecord.data.id;
|
|
409
|
-
var targetGroupId = targetZone.groupId;
|
|
410
|
-
if (activeGroupId === targetGroupId) return; // 同一个组,不需要移动
|
|
411
|
-
|
|
412
|
-
var newGroupOrder = _toConsumableArray(groupList);
|
|
413
|
-
var activeIndex = newGroupOrder.findIndex(function (g) {
|
|
414
|
-
return g.id === activeGroupId;
|
|
415
|
-
});
|
|
416
|
-
var targetIndex = newGroupOrder.findIndex(function (g) {
|
|
417
|
-
return g.id === targetGroupId;
|
|
418
|
-
});
|
|
419
|
-
if (activeIndex !== -1 && targetIndex !== -1) {
|
|
420
|
-
var _newGroupOrder$splice = newGroupOrder.splice(activeIndex, 1),
|
|
421
|
-
_newGroupOrder$splice2 = _slicedToArray(_newGroupOrder$splice, 1),
|
|
422
|
-
movedGroup = _newGroupOrder$splice2[0];
|
|
423
|
-
newGroupOrder.splice(targetIndex, 0, movedGroup);
|
|
424
|
-
var groupIds = newGroupOrder.map(function (g) {
|
|
425
|
-
return g.id;
|
|
426
|
-
});
|
|
427
|
-
console.log('调用组重排序接口 (虚拟容器):', groupIds);
|
|
428
|
-
onGroupReorder === null || onGroupReorder === void 0 || onGroupReorder(groupIds);
|
|
429
|
-
}
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// 处理设置项拖放到虚拟容器(跨组移动)
|
|
435
|
-
if (activeRecord.type === 'item') {
|
|
436
|
-
// 查找目标虚拟容器
|
|
437
|
-
var _targetZone = virtualDropZones.find(function (z) {
|
|
438
|
-
return z.id === overId;
|
|
439
|
-
});
|
|
440
|
-
if (_targetZone && _targetZone.type === 'item-container') {
|
|
441
|
-
var _targetGroup$items;
|
|
442
|
-
var activeItemId = activeRecord.data.id;
|
|
443
|
-
var _targetGroupId = _targetZone.groupId;
|
|
444
|
-
|
|
445
|
-
// 获取当前设置项的原始位置信息
|
|
446
|
-
var currentGroup = groupList.find(function (g) {
|
|
447
|
-
return g.items && g.items.some(function (item) {
|
|
448
|
-
return item.id === activeItemId;
|
|
449
|
-
});
|
|
450
|
-
});
|
|
451
|
-
if (!currentGroup) return;
|
|
452
|
-
var currentGroupId = currentGroup.id;
|
|
453
|
-
|
|
454
|
-
// 如果是同一个组,不需要移动
|
|
455
|
-
if (currentGroupId === _targetGroupId) return;
|
|
456
|
-
|
|
457
|
-
// 移动到目标组的末尾
|
|
458
|
-
var targetGroup = groupList.find(function (g) {
|
|
459
|
-
return g.id === _targetGroupId;
|
|
460
|
-
});
|
|
461
|
-
var newOrder = (targetGroup === null || targetGroup === void 0 || (_targetGroup$items = targetGroup.items) === null || _targetGroup$items === void 0 ? void 0 : _targetGroup$items.length) || 0;
|
|
462
|
-
console.log('调用设置项移动接口 (虚拟容器):', {
|
|
463
|
-
activeItemId: activeItemId,
|
|
464
|
-
targetGroupId: _targetGroupId,
|
|
465
|
-
newOrder: newOrder
|
|
466
|
-
});
|
|
467
|
-
onItemMove === null || onItemMove === void 0 || onItemMove(activeItemId, _targetGroupId, newOrder);
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// 如果没有匹配到虚拟容器,则可能是直接拖拽到行上的情况
|
|
473
|
-
if (overData && overData.record) {
|
|
474
|
-
var overRecord = overData.record;
|
|
475
|
-
|
|
476
|
-
// 设置项拖放到组行上
|
|
477
|
-
if (activeRecord.type === 'item' && overRecord.type === 'group') {
|
|
478
|
-
var _targetGroup$items2;
|
|
479
|
-
var _activeItemId = activeRecord.data.id;
|
|
480
|
-
var _targetGroupId2 = overRecord.data.id;
|
|
481
|
-
var _currentGroup = groupList.find(function (g) {
|
|
482
|
-
return g.items && g.items.some(function (item) {
|
|
483
|
-
return item.id === _activeItemId;
|
|
484
|
-
});
|
|
485
|
-
});
|
|
486
|
-
if (!_currentGroup) return;
|
|
487
|
-
var _currentGroupId = _currentGroup.id;
|
|
488
|
-
if (_currentGroupId === _targetGroupId2) return;
|
|
489
|
-
var _targetGroup = groupList.find(function (g) {
|
|
490
|
-
return g.id === _targetGroupId2;
|
|
491
|
-
});
|
|
492
|
-
var _newOrder = (_targetGroup === null || _targetGroup === void 0 || (_targetGroup$items2 = _targetGroup.items) === null || _targetGroup$items2 === void 0 ? void 0 : _targetGroup$items2.length) || 0;
|
|
493
|
-
console.log('调用设置项移动接口 (直接拖放到组):', {
|
|
494
|
-
activeItemId: _activeItemId,
|
|
495
|
-
targetGroupId: _targetGroupId2,
|
|
496
|
-
newOrder: _newOrder
|
|
497
|
-
});
|
|
498
|
-
onItemMove === null || onItemMove === void 0 || onItemMove(_activeItemId, _targetGroupId2, _newOrder);
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// 设置项与设置项之间的排序
|
|
503
|
-
if (activeRecord.type === 'item' && overRecord.type === 'item') {
|
|
504
|
-
var _activeItemId2 = activeRecord.data.id;
|
|
505
|
-
var overItemId = overRecord.data.id;
|
|
506
|
-
var activeGroup = groupList.find(function (g) {
|
|
507
|
-
return g.items && g.items.some(function (item) {
|
|
508
|
-
return item.id === _activeItemId2;
|
|
509
|
-
});
|
|
510
|
-
});
|
|
511
|
-
var overGroup = groupList.find(function (g) {
|
|
512
|
-
return g.items && g.items.some(function (item) {
|
|
513
|
-
return item.id === overItemId;
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
if (!activeGroup || !overGroup) return;
|
|
517
|
-
if (activeGroup.id === overGroup.id) {
|
|
518
|
-
// 同组内排序
|
|
519
|
-
var _activeIndex = activeGroup.items.findIndex(function (item) {
|
|
520
|
-
return item.id === _activeItemId2;
|
|
521
|
-
});
|
|
522
|
-
var overIndex = activeGroup.items.findIndex(function (item) {
|
|
523
|
-
return item.id === overItemId;
|
|
524
|
-
});
|
|
525
|
-
if (_activeIndex !== -1 && overIndex !== -1 && _activeIndex !== overIndex) {
|
|
526
|
-
console.log('调用同组内设置项排序接口:', {
|
|
527
|
-
activeItemId: _activeItemId2,
|
|
528
|
-
targetGroupId: activeGroup.id,
|
|
529
|
-
newOrder: overIndex
|
|
530
|
-
});
|
|
531
|
-
onItemMove === null || onItemMove === void 0 || onItemMove(_activeItemId2, activeGroup.id, overIndex);
|
|
532
|
-
}
|
|
533
|
-
} else {
|
|
534
|
-
// 跨组移动
|
|
535
|
-
var _overIndex = overGroup.items.findIndex(function (item) {
|
|
536
|
-
return item.id === overItemId;
|
|
537
|
-
});
|
|
538
|
-
var _newOrder2 = _overIndex >= 0 ? _overIndex : 0;
|
|
539
|
-
console.log('调用跨组设置项移动接口:', {
|
|
540
|
-
activeItemId: _activeItemId2,
|
|
541
|
-
targetGroupId: overGroup.id,
|
|
542
|
-
newOrder: _newOrder2
|
|
543
|
-
});
|
|
544
|
-
onItemMove === null || onItemMove === void 0 || onItemMove(_activeItemId2, overGroup.id, _newOrder2);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
// 处理删除
|
|
551
|
-
var handleDelete = function handleDelete(record) {
|
|
552
|
-
if (record.type === 'group') {
|
|
553
|
-
// 检查组下是否有设置项
|
|
554
|
-
var hasItems = record.data.items && record.data.items.length > 0;
|
|
555
|
-
if (hasItems) {
|
|
556
|
-
// 如果组下有设置项,显示无法删除的提示
|
|
557
|
-
Modal.warning({
|
|
558
|
-
title: locales.getText('registry.modal.delete.group.hasItems.title'),
|
|
559
|
-
content: locales.getText('registry.modal.delete.group.hasItems.content')
|
|
560
|
-
});
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
Modal.confirm({
|
|
565
|
-
title: locales.getText('registry.modal.delete.title'),
|
|
566
|
-
content: locales.getText(record.type === 'group' ? 'registry.modal.delete.group.content' : 'registry.modal.delete.item.content'),
|
|
567
|
-
onOk: function onOk() {
|
|
568
|
-
if (record.type === 'group') {
|
|
569
|
-
// 调用删除组的回调函数
|
|
570
|
-
onDeleteGroup === null || onDeleteGroup === void 0 || onDeleteGroup(record.data.id);
|
|
571
|
-
} else {
|
|
572
|
-
// 调用删除设置项的回调函数
|
|
573
|
-
onDeleteItem === null || onDeleteItem === void 0 || onDeleteItem(record.data.id);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
// 获取当前拖拽的类型
|
|
580
|
-
var activeType = useMemo(function () {
|
|
581
|
-
if (!activeId) return undefined;
|
|
582
|
-
var activeItem = flattenData.find(function (item) {
|
|
583
|
-
return item.key === activeId;
|
|
584
|
-
});
|
|
585
|
-
return activeItem === null || activeItem === void 0 ? void 0 : activeItem.type;
|
|
586
|
-
}, [activeId, flattenData]);
|
|
587
|
-
|
|
588
|
-
// 表格列定义
|
|
589
|
-
var columns = [{
|
|
590
|
-
title: locales.getText('registry.table.title'),
|
|
591
|
-
dataIndex: 'name',
|
|
592
|
-
key: 'name',
|
|
593
|
-
width: '30%',
|
|
594
|
-
render: function render(_, record) {
|
|
595
|
-
var isGroup = record.type === 'group';
|
|
596
|
-
var isExpanded = expandedKeys.includes(record.key);
|
|
597
|
-
return /*#__PURE__*/React.createElement(DragHandle, {
|
|
598
|
-
record: record,
|
|
599
|
-
isGroup: isGroup,
|
|
600
|
-
isExpanded: isExpanded,
|
|
601
|
-
onExpand: handleExpand,
|
|
602
|
-
currentLocale: currentLocale
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
}, {
|
|
606
|
-
title: locales.getText('registry.table.key'),
|
|
607
|
-
dataIndex: 'key',
|
|
608
|
-
key: 'key',
|
|
609
|
-
width: '25%',
|
|
610
|
-
render: function render(_, record) {
|
|
611
|
-
if (record.type === 'group') {
|
|
612
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
613
|
-
className: "pisell-settings-registry-code"
|
|
614
|
-
}, record.data.code);
|
|
615
|
-
}
|
|
616
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
617
|
-
className: "pisell-settings-registry-key"
|
|
618
|
-
}, record.data.key || record.data.code);
|
|
619
|
-
}
|
|
620
|
-
}, {
|
|
621
|
-
title: locales.getText('registry.table.scopes'),
|
|
622
|
-
dataIndex: 'scopes',
|
|
623
|
-
key: 'scopes',
|
|
624
|
-
width: '25%',
|
|
625
|
-
render: function render(_, record) {
|
|
626
|
-
if (record.type === 'item' && record.data.scopes) {
|
|
627
|
-
return /*#__PURE__*/React.createElement(AntdSpace, {
|
|
628
|
-
wrap: true
|
|
629
|
-
}, record.data.scopes.map(function (scope) {
|
|
630
|
-
return /*#__PURE__*/React.createElement(AntdTag, {
|
|
631
|
-
key: scope,
|
|
632
|
-
size: "small"
|
|
633
|
-
}, locales.getText(scopeKeyMapping[scope] || "registry.scope.".concat(scope)));
|
|
634
|
-
}));
|
|
635
|
-
}
|
|
636
|
-
return '-';
|
|
637
|
-
}
|
|
638
|
-
}, {
|
|
639
|
-
title: locales.getText('registry.table.actions'),
|
|
640
|
-
key: 'actions',
|
|
641
|
-
width: '20%',
|
|
642
|
-
render: function render(_, record) {
|
|
643
|
-
var isGroup = record.type === 'group';
|
|
644
|
-
return /*#__PURE__*/React.createElement(AntdSpace, {
|
|
645
|
-
size: "small"
|
|
646
|
-
}, isGroup && /*#__PURE__*/React.createElement(Button, {
|
|
647
|
-
type: "text",
|
|
648
|
-
size: "small",
|
|
649
|
-
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
650
|
-
onClick: function onClick() {
|
|
651
|
-
return onAddItem === null || onAddItem === void 0 ? void 0 : onAddItem(record.data.id);
|
|
652
|
-
},
|
|
653
|
-
title: locales.getText('registry.action.add.item')
|
|
654
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
655
|
-
type: "text",
|
|
656
|
-
size: "small",
|
|
657
|
-
icon: /*#__PURE__*/React.createElement(EditOutlined, null),
|
|
658
|
-
onClick: function onClick() {
|
|
659
|
-
if (isGroup) {
|
|
660
|
-
onEditGroup === null || onEditGroup === void 0 || onEditGroup(record.data);
|
|
661
|
-
} else {
|
|
662
|
-
onEditItem === null || onEditItem === void 0 || onEditItem(record.data);
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
title: locales.getText('registry.action.edit')
|
|
666
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
667
|
-
type: "text",
|
|
668
|
-
size: "small",
|
|
669
|
-
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null),
|
|
670
|
-
danger: true,
|
|
671
|
-
onClick: function onClick() {
|
|
672
|
-
return handleDelete(record);
|
|
673
|
-
},
|
|
674
|
-
title: locales.getText('registry.action.delete')
|
|
675
|
-
}));
|
|
676
|
-
}
|
|
677
|
-
}];
|
|
678
|
-
if (!section) {
|
|
679
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
680
|
-
className: "pisell-settings-registry-table-empty"
|
|
681
|
-
}, /*#__PURE__*/React.createElement(Empty, {
|
|
682
|
-
description: locales.getText('registry.message.select.section'),
|
|
683
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
684
|
-
}));
|
|
685
|
-
}
|
|
686
|
-
if (groupLoading) {
|
|
687
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
688
|
-
className: "pisell-settings-registry-table-loading",
|
|
689
|
-
style: {
|
|
690
|
-
textAlign: 'center',
|
|
691
|
-
padding: '50px'
|
|
692
|
-
}
|
|
693
|
-
}, /*#__PURE__*/React.createElement(Spin, {
|
|
694
|
-
size: "large"
|
|
695
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
696
|
-
style: {
|
|
697
|
-
marginTop: '16px'
|
|
698
|
-
}
|
|
699
|
-
}, locales.getText('registry.message.loading.groups')));
|
|
700
|
-
}
|
|
701
|
-
if (flattenData.length === 0) {
|
|
702
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
703
|
-
className: "pisell-settings-registry-table-empty"
|
|
704
|
-
}, /*#__PURE__*/React.createElement(Empty, {
|
|
705
|
-
description: locales.getText('registry.message.no.settings'),
|
|
706
|
-
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
707
|
-
}));
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
// 获取所有可拖拽的项目ID
|
|
711
|
-
var sortableIds = flattenData.map(function (item) {
|
|
712
|
-
return item.key;
|
|
713
|
-
});
|
|
714
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
715
|
-
className: "pisell-settings-registry-table"
|
|
716
|
-
}, /*#__PURE__*/React.createElement(DndContext, {
|
|
717
|
-
sensors: sensors,
|
|
718
|
-
collisionDetection: customCollisionDetection,
|
|
719
|
-
onDragStart: handleDragStart,
|
|
720
|
-
onDragOver: handleDragOver,
|
|
721
|
-
onDragEnd: handleDragEnd
|
|
722
|
-
}, /*#__PURE__*/React.createElement(SortableContext, {
|
|
723
|
-
items: sortableIds,
|
|
724
|
-
strategy: verticalListSortingStrategy
|
|
725
|
-
}, /*#__PURE__*/React.createElement(Table, {
|
|
726
|
-
columns: columns,
|
|
727
|
-
dataSource: flattenData,
|
|
728
|
-
pagination: false,
|
|
729
|
-
rowKey: "key",
|
|
730
|
-
className: "pisell-settings-registry-table-content",
|
|
731
|
-
components: {
|
|
732
|
-
body: {
|
|
733
|
-
row: function row(props) {
|
|
734
|
-
// Antd Table 会通过 data-row-key 传递行的 key
|
|
735
|
-
var rowKey = props['data-row-key'];
|
|
736
|
-
// 从 dataSource 中找到对应的 record
|
|
737
|
-
var record = flattenData.find(function (item) {
|
|
738
|
-
return item.key === rowKey;
|
|
739
|
-
});
|
|
740
|
-
|
|
741
|
-
// 如果找不到 record,返回普通的 tr
|
|
742
|
-
if (!record) {
|
|
743
|
-
return /*#__PURE__*/React.createElement("tr", props);
|
|
744
|
-
}
|
|
745
|
-
return /*#__PURE__*/React.createElement(DraggableRow, _extends({}, props, {
|
|
746
|
-
record: record
|
|
747
|
-
}));
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
})), /*#__PURE__*/React.createElement(DragOverlay, null, activeId ? /*#__PURE__*/React.createElement("div", {
|
|
752
|
-
className: "pisell-settings-registry-drag-overlay"
|
|
753
|
-
}, function () {
|
|
754
|
-
var activeItem = flattenData.find(function (item) {
|
|
755
|
-
return item.key === activeId;
|
|
756
|
-
});
|
|
757
|
-
if (!activeItem) return null;
|
|
758
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
759
|
-
className: "pisell-settings-registry-drag-item"
|
|
760
|
-
}, /*#__PURE__*/React.createElement(AntdTag, {
|
|
761
|
-
color: activeItem.type === 'group' ? 'blue' : 'green'
|
|
762
|
-
}, locales.getText(activeItem.type === 'group' ? 'registry.level.group' : 'registry.level.item')), /*#__PURE__*/React.createElement("span", null, getMultiLanguageText(activeItem.data.title || activeItem.data.name, currentLocale)));
|
|
763
|
-
}()) : null)));
|
|
764
|
-
};
|
|
765
|
-
export default SettingsTable;
|