@pisell/private-materials 6.7.9 → 6.8.1
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 +7 -7
- 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 +2 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/components/footer/amount.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +548 -84
- package/es/components/booking/components/footer/index.js +77 -56
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +194 -73
- package/es/components/booking/components/voucher/index.js +23 -7
- package/es/components/booking/hooks/useQuotation.js +4 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/cartClientCard/index.js +30 -6
- package/es/components/booking/info2/index.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +2 -3
- package/es/components/booking/info2/service/editNormalService/index.js +6 -0
- package/es/components/booking/info2/service/editService/index.js +16 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/es/components/booking/info2/service/editService/utils.js +66 -0
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +16 -3
- package/es/components/checkout/PaymentModal.d.ts +13 -5
- package/es/components/checkout/PaymentModal.js +304 -252
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +52 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +5 -6
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/components/SearchAndClientModule/index.js +39 -40
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +6 -0
- package/es/components/checkout/plugin.d.ts +2 -0
- package/es/components/checkout/plugin.js +303 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- 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 +14 -6
- package/es/components/eftposPay/payo/config.js +70 -32
- package/es/components/eftposPay/payo/payment.d.ts +66 -0
- package/es/components/eftposPay/payo/payment.js +579 -0
- 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 +12 -0
- package/es/components/eftposPay/utils/log/index.d.ts +110 -0
- package/es/components/eftposPay/utils/log/index.js +371 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/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 +2 -1
- package/es/components/index.js +2 -1
- package/es/components/list/List.js +99 -56
- package/es/components/list/hooks/useListState.d.ts +5 -3
- package/es/components/list/hooks/useListState.js +10 -2
- package/es/components/list/styles/base.less +4 -0
- package/es/components/list/styles/content.less +1 -1
- package/es/components/list/styles/header.less +4 -4
- package/es/components/list/types.d.ts +1 -0
- package/es/components/list/utils/index.d.ts +13 -1
- package/es/components/list/utils/index.js +43 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- 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 +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/es/components/pay/toC/index.js +7 -4
- package/es/components/pay/toC/locales.d.ts +3 -0
- package/es/components/pay/toC/locales.js +6 -3
- package/es/components/pay/toC/status.d.ts +1 -0
- package/es/components/pay/toC/status.js +3 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/subTotal/index.js +1 -1
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/es/components/{checkout/PaymentPlugin.js → systemSettings/registry/components/GroupModal.js} +132 -171
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
- package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
- package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SectionList.js +174 -0
- package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
- package/es/components/systemSettings/registry/components/index.d.ts +4 -0
- package/es/components/systemSettings/registry/components/index.js +4 -0
- package/es/components/systemSettings/registry/index.d.ts +5 -0
- package/es/components/systemSettings/registry/index.js +1059 -0
- package/es/components/systemSettings/registry/index.less +410 -0
- package/es/components/systemSettings/registry/locales.d.ts +272 -0
- package/es/components/systemSettings/registry/locales.js +300 -0
- package/es/components/systemSettings/registry/services.d.ts +77 -0
- package/es/components/systemSettings/registry/services.js +472 -0
- package/es/components/systemSettings/registry/types.d.ts +126 -0
- package/es/components/systemSettings/registry/types.js +1 -0
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
- package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/es/components/systemSettings/registry/utils/validators.js +44 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +58 -11
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +149 -36
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -86
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +29 -18
- package/es/components/ticketBooking/locales.d.ts +9 -0
- package/es/components/ticketBooking/locales.js +12 -3
- package/es/components/ticketBooking/utils/index.d.ts +3 -0
- package/es/components/ticketBooking/utils/index.js +36 -13
- package/es/components/wallet/Detail/index.js +34 -2
- package/es/components/wallet/Detail/index.less +11 -0
- package/es/components/wallet/Detail/locales.d.ts +6 -0
- package/es/components/wallet/Detail/locales.js +14 -2
- package/es/components/wallet/Voucher/index.js +11 -10
- package/es/components/wallet/components/WalletCard.js +5 -1
- package/es/components/wallet/index.js +4 -2
- package/es/components/wallet/serve.d.ts +7 -0
- package/es/components/wallet/utils.d.ts +48 -0
- package/es/components/wallet/utils.js +342 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +6 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/es/plus/productSelect/CategoryTabs/index.js +2 -1
- package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
- package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +84 -31
- package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
- package/es/plus/walletPassGallery/index.js +7 -3
- package/es/plus/walletPassGallery/serve.d.ts +3 -0
- package/es/plus/walletPassGallery/serve.js +4 -2
- package/es/pro/Login2.0/index.less +15 -8
- package/es/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/es/pro/Selector/BatchSelectorDemo.js +470 -0
- package/es/pro/Selector/Selector.d.ts +5 -0
- package/es/pro/Selector/Selector.js +283 -0
- package/es/pro/Selector/SelectorGroup.d.ts +11 -0
- package/es/pro/Selector/SelectorGroup.js +537 -0
- package/es/pro/Selector/components/Card/index.d.ts +27 -0
- package/es/pro/Selector/components/Card/index.js +96 -0
- package/es/pro/Selector/components/Card/index.less +132 -0
- package/es/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/es/pro/Selector/components/IntersectionObserver.js +384 -0
- package/es/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/es/pro/Selector/components/NumericStepper/index.js +198 -0
- package/es/pro/Selector/components/NumericStepper/index.less +221 -0
- package/es/pro/Selector/components/index.d.ts +2 -0
- package/es/pro/Selector/components/index.js +2 -0
- package/es/pro/Selector/demo.d.ts +3 -0
- package/es/pro/Selector/demo.js +158 -0
- package/es/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/es/pro/Selector/hooks/useSelectionController.js +414 -0
- package/es/pro/Selector/index.d.ts +8 -0
- package/es/pro/Selector/index.js +5 -0
- package/es/pro/Selector/locales.d.ts +42 -0
- package/es/pro/Selector/locales.js +80 -0
- package/es/pro/Selector/selector.less +3 -0
- package/es/pro/Selector/selectorGroup.less +8 -0
- package/es/pro/Selector/types.d.ts +114 -0
- package/es/pro/Selector/types.js +1 -0
- package/es/pro/Selector/utils/index.d.ts +49 -0
- package/es/pro/Selector/utils/index.js +229 -0
- 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 +45 -36
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/components/footer/amount.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +293 -41
- package/lib/components/booking/components/footer/index.js +30 -11
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +138 -41
- package/lib/components/booking/components/voucher/index.js +25 -9
- package/lib/components/booking/hooks/useQuotation.js +2 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/cartClientCard/index.js +25 -5
- package/lib/components/booking/info2/index.js +7 -2
- package/lib/components/booking/info2/service/addService/index.js +1 -2
- package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
- package/lib/components/booking/info2/service/editService/index.js +12 -3
- package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/lib/components/booking/info2/service/editService/utils.js +40 -3
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/PaymentModal.d.ts +13 -5
- package/lib/components/checkout/PaymentModal.js +190 -147
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +52 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +5 -6
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/components/SearchAndClientModule/index.js +29 -3
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +6 -0
- package/lib/components/checkout/plugin.d.ts +2 -0
- package/lib/components/checkout/plugin.js +263 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- 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 +12 -6
- package/lib/components/eftposPay/payo/config.js +98 -73
- package/lib/components/eftposPay/payo/payment.d.ts +66 -0
- package/lib/components/eftposPay/payo/payment.js +357 -0
- 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 +12 -0
- package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
- package/lib/components/eftposPay/utils/log/index.js +294 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/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 +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/list/List.js +58 -36
- package/lib/components/list/hooks/useListState.d.ts +5 -3
- package/lib/components/list/hooks/useListState.js +9 -1
- package/lib/components/list/styles/base.less +4 -0
- package/lib/components/list/styles/content.less +1 -1
- package/lib/components/list/styles/header.less +4 -4
- package/lib/components/list/types.d.ts +1 -0
- package/lib/components/list/utils/index.d.ts +13 -1
- package/lib/components/list/utils/index.js +27 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- 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 +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/lib/components/pay/toC/index.js +4 -1
- package/lib/components/pay/toC/locales.d.ts +3 -0
- package/lib/components/pay/toC/locales.js +6 -3
- package/lib/components/pay/toC/status.d.ts +1 -0
- package/lib/components/pay/toC/status.js +5 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/subTotal/index.js +1 -1
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
- package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
- package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
- package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/index.js +48 -0
- package/lib/components/systemSettings/registry/index.d.ts +5 -0
- package/lib/components/systemSettings/registry/index.js +529 -0
- package/lib/components/systemSettings/registry/index.less +410 -0
- package/lib/components/systemSettings/registry/locales.d.ts +272 -0
- package/lib/components/systemSettings/registry/locales.js +324 -0
- package/lib/components/systemSettings/registry/services.d.ts +77 -0
- package/lib/components/systemSettings/registry/services.js +290 -0
- package/lib/components/systemSettings/registry/types.d.ts +126 -0
- package/lib/components/systemSettings/registry/types.js +17 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
- package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/lib/components/systemSettings/registry/utils/validators.js +54 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +40 -5
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +93 -24
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +17 -13
- package/lib/components/ticketBooking/locales.d.ts +9 -0
- package/lib/components/ticketBooking/locales.js +12 -3
- package/lib/components/ticketBooking/utils/index.d.ts +3 -0
- package/lib/components/ticketBooking/utils/index.js +20 -6
- package/lib/components/wallet/Detail/index.js +31 -3
- package/lib/components/wallet/Detail/index.less +11 -0
- package/lib/components/wallet/Detail/locales.d.ts +6 -0
- package/lib/components/wallet/Detail/locales.js +14 -2
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/components/WalletCard.js +4 -0
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/serve.d.ts +7 -0
- package/lib/components/wallet/utils.d.ts +48 -0
- package/lib/components/wallet/utils.js +287 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +15 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +2 -1
- package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
- package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +54 -15
- package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
- package/lib/plus/walletPassGallery/index.js +7 -3
- package/lib/plus/walletPassGallery/serve.d.ts +3 -0
- package/lib/plus/walletPassGallery/serve.js +3 -2
- package/lib/pro/Login2.0/index.less +15 -8
- package/lib/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/lib/pro/Selector/BatchSelectorDemo.js +376 -0
- package/lib/pro/Selector/Selector.d.ts +5 -0
- package/lib/pro/Selector/Selector.js +264 -0
- package/lib/pro/Selector/SelectorGroup.d.ts +11 -0
- package/lib/pro/Selector/SelectorGroup.js +463 -0
- package/lib/pro/Selector/components/Card/index.d.ts +27 -0
- package/lib/pro/Selector/components/Card/index.js +114 -0
- package/lib/pro/Selector/components/Card/index.less +132 -0
- package/lib/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/lib/pro/Selector/components/IntersectionObserver.js +281 -0
- package/lib/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/lib/pro/Selector/components/NumericStepper/index.js +221 -0
- package/lib/pro/Selector/components/NumericStepper/index.less +221 -0
- package/lib/pro/Selector/components/index.d.ts +2 -0
- package/lib/pro/Selector/components/index.js +42 -0
- package/lib/pro/Selector/demo.d.ts +3 -0
- package/lib/pro/Selector/demo.js +102 -0
- package/lib/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/lib/pro/Selector/hooks/useSelectionController.js +338 -0
- package/lib/pro/Selector/index.d.ts +8 -0
- package/lib/pro/Selector/index.js +39 -0
- package/lib/pro/Selector/locales.d.ts +42 -0
- package/lib/pro/Selector/locales.js +80 -0
- package/lib/pro/Selector/selector.less +3 -0
- package/lib/pro/Selector/selectorGroup.less +8 -0
- package/lib/pro/Selector/types.d.ts +114 -0
- package/lib/pro/Selector/types.js +17 -0
- package/lib/pro/Selector/utils/index.d.ts +49 -0
- package/lib/pro/Selector/utils/index.js +221 -0
- 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 +42 -43
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lowcode/payment-modal/meta.ts +135 -0
- package/lowcode/selector/meta.ts +352 -0
- package/lowcode/selector.group/meta.ts +200 -0
- package/lowcode/settings-registry/meta.ts +29 -0
- package/lowcode/wallet-pass-detail/meta.ts +89 -0
- package/package.json +4 -4
- package/es/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
import React, { useMemo, useCallback, useEffect, useRef, useReducer, forwardRef, useImperativeHandle, useState } from 'react';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import { isEqual } from 'lodash';
|
|
24
|
+
import { locales } from '@pisell/utils';
|
|
25
|
+
import localeTexts from "./locales";
|
|
26
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
27
|
+
import Selector from "./Selector";
|
|
28
|
+
import { normalizeRules, computeAutoHiddenGroups, computeEffects, getSelectedSet, pruneValuesByAllowOnly, generateSimpleUUID } from "./utils";
|
|
29
|
+
import { IntersectionObserverProvider, IntersectionItem } from "./components/IntersectionObserver";
|
|
30
|
+
import CategoryTabs, { CategorySkeleton } from "../../plus/productSelect/CategoryTabs";
|
|
31
|
+
import { getOffsetTopRelativeToScrollContainer } from "../../plus/productSelect/utils";
|
|
32
|
+
import "./selectorGroup.less";
|
|
33
|
+
var SelectorGroup = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
+
var _context$appHelper, _props$tabProps2;
|
|
35
|
+
var context = useEngineContext();
|
|
36
|
+
locales.init(localeTexts, (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.storage) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.get('umi_locale')) || 'en');
|
|
37
|
+
var dataSource = props.dataSource,
|
|
38
|
+
linkageRules = props.linkageRules,
|
|
39
|
+
_props$allowedValuesP = props.allowedValuesPolicy,
|
|
40
|
+
allowedValuesPolicy = _props$allowedValuesP === void 0 ? 'strict' : _props$allowedValuesP,
|
|
41
|
+
_props$preserve = props.preserve,
|
|
42
|
+
preserveDefault = _props$preserve === void 0 ? false : _props$preserve;
|
|
43
|
+
var _useState = useState(-1),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
activeIndex = _useState2[0],
|
|
46
|
+
setActiveIndex = _useState2[1];
|
|
47
|
+
// 手动切换索引时,不触发onFirstVisibleIndexChange回调
|
|
48
|
+
var isManualChangeIndexRef = useRef(false);
|
|
49
|
+
var containerRef = useRef(null);
|
|
50
|
+
// 页面可能存在多个产品选择器,需要使用唯一id隔离
|
|
51
|
+
var _uniqueId = useMemo(function () {
|
|
52
|
+
return generateSimpleUUID();
|
|
53
|
+
}, []);
|
|
54
|
+
var groupRefs = useRef({});
|
|
55
|
+
var reducer = function reducer(state, action) {
|
|
56
|
+
switch (action.type) {
|
|
57
|
+
case 'commit':
|
|
58
|
+
return action.payload;
|
|
59
|
+
case 'patch':
|
|
60
|
+
return _objectSpread(_objectSpread({}, state), action.payload);
|
|
61
|
+
default:
|
|
62
|
+
return state;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var _useReducer = useReducer(reducer, {
|
|
66
|
+
values: {},
|
|
67
|
+
visibleGroups: {},
|
|
68
|
+
optionEffects: {}
|
|
69
|
+
}),
|
|
70
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
71
|
+
state = _useReducer2[0],
|
|
72
|
+
dispatch = _useReducer2[1];
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
var _value;
|
|
75
|
+
var initial = ((_value = props === null || props === void 0 ? void 0 : props.value) !== null && _value !== void 0 ? _value : props === null || props === void 0 ? void 0 : props.defaultValue) || {};
|
|
76
|
+
if (initial && _typeof(initial) === 'object') {
|
|
77
|
+
applyValues(_objectSpread({}, initial));
|
|
78
|
+
}
|
|
79
|
+
}, []);
|
|
80
|
+
|
|
81
|
+
// 避免父组件每次传入新对象导致 effect 反复触发
|
|
82
|
+
var rulesStableKey = useMemo(function () {
|
|
83
|
+
try {
|
|
84
|
+
return JSON.stringify(linkageRules !== null && linkageRules !== void 0 ? linkageRules : null);
|
|
85
|
+
} catch (_unused) {
|
|
86
|
+
return String(linkageRules);
|
|
87
|
+
}
|
|
88
|
+
}, [linkageRules]);
|
|
89
|
+
var normalizedRules = useMemo(function () {
|
|
90
|
+
return normalizeRules(linkageRules);
|
|
91
|
+
}, [rulesStableKey]);
|
|
92
|
+
|
|
93
|
+
// 收集所有 show 的目标分组,作为“受控分组”,默认隐藏
|
|
94
|
+
var autoHiddenGroups = useMemo(function () {
|
|
95
|
+
return computeAutoHiddenGroups(normalizedRules);
|
|
96
|
+
}, [normalizedRules]);
|
|
97
|
+
|
|
98
|
+
// 初始化可见性:受控分组(出现在 show Groups 中)默认隐藏,其它分组默认可见
|
|
99
|
+
var hasInitializedVisibilityRef = useRef(false);
|
|
100
|
+
useEffect(function () {
|
|
101
|
+
// 仅在尚未初始化可见性时设置默认可见性
|
|
102
|
+
if (!hasInitializedVisibilityRef.current && (!state.visibleGroups || Object.keys(state.visibleGroups).length === 0)) {
|
|
103
|
+
var initVisible = {};
|
|
104
|
+
(dataSource || []).forEach(function (group) {
|
|
105
|
+
var _group$id;
|
|
106
|
+
var gid = String((_group$id = group.id) !== null && _group$id !== void 0 ? _group$id : '');
|
|
107
|
+
initVisible[gid] = autoHiddenGroups.has(gid) ? false : true;
|
|
108
|
+
});
|
|
109
|
+
hasInitializedVisibilityRef.current = true;
|
|
110
|
+
dispatch({
|
|
111
|
+
type: 'patch',
|
|
112
|
+
payload: {
|
|
113
|
+
visibleGroups: initVisible
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, [dataSource, autoHiddenGroups]);
|
|
118
|
+
|
|
119
|
+
// 计算显隐与联动、裁剪不允许值,并一次性提交
|
|
120
|
+
var lastEmittedRef = useRef(null);
|
|
121
|
+
var applyValues = useCallback(function (nextValues, visibleOverride) {
|
|
122
|
+
var maskValues = function maskValues(vals, visibleMap) {
|
|
123
|
+
var out = _objectSpread({}, vals || {});
|
|
124
|
+
(dataSource || []).forEach(function (group) {
|
|
125
|
+
var _group$id2;
|
|
126
|
+
var gid = String((_group$id2 = group.id) !== null && _group$id2 !== void 0 ? _group$id2 : '');
|
|
127
|
+
var preserve = typeof group.preserve === 'boolean' ? group.preserve : preserveDefault;
|
|
128
|
+
if (visibleMap[gid] === false && preserve === false) out[gid] = undefined;
|
|
129
|
+
});
|
|
130
|
+
return out;
|
|
131
|
+
};
|
|
132
|
+
var baseVisible = visibleOverride || state.visibleGroups;
|
|
133
|
+
var valuesForEffects = maskValues(nextValues, baseVisible);
|
|
134
|
+
var _computeEffects = computeEffects(dataSource, normalizedRules, valuesForEffects),
|
|
135
|
+
newVisible = _computeEffects.visibleGroups,
|
|
136
|
+
newEffects = _computeEffects.optionEffects;
|
|
137
|
+
|
|
138
|
+
// 严格模式下裁剪不允许值;若裁剪前后一致则复用第一次计算结果
|
|
139
|
+
var finalValues = nextValues;
|
|
140
|
+
var finalVisible = newVisible;
|
|
141
|
+
var finalEffects = newEffects;
|
|
142
|
+
if (allowedValuesPolicy === 'strict') {
|
|
143
|
+
var pruned = pruneValuesByAllowOnly(nextValues, newEffects);
|
|
144
|
+
var didPrune = !isEqual(pruned, nextValues);
|
|
145
|
+
if (didPrune) {
|
|
146
|
+
finalValues = pruned;
|
|
147
|
+
var valuesForEffects2 = maskValues(finalValues, newVisible);
|
|
148
|
+
var recomputed = computeEffects(dataSource, normalizedRules, valuesForEffects2);
|
|
149
|
+
finalVisible = recomputed.visibleGroups;
|
|
150
|
+
finalEffects = recomputed.optionEffects;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// 避免无意义变更
|
|
155
|
+
var noStateChange = isEqual(state.values, finalValues) && isEqual(state.visibleGroups, finalVisible) && isEqual(state.optionEffects, finalEffects);
|
|
156
|
+
if (!noStateChange) {
|
|
157
|
+
dispatch({
|
|
158
|
+
type: 'commit',
|
|
159
|
+
payload: {
|
|
160
|
+
values: _objectSpread({}, finalValues || {}),
|
|
161
|
+
visibleGroups: finalVisible,
|
|
162
|
+
optionEffects: finalEffects
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (typeof (props === null || props === void 0 ? void 0 : props.onChange) === 'function') {
|
|
167
|
+
var out = {};
|
|
168
|
+
(dataSource || []).forEach(function (group) {
|
|
169
|
+
var _group$id3;
|
|
170
|
+
var gid = String((_group$id3 = group.id) !== null && _group$id3 !== void 0 ? _group$id3 : '');
|
|
171
|
+
var preserve = typeof group.preserve === 'boolean' ? group.preserve : preserveDefault;
|
|
172
|
+
if (finalVisible[gid] === false && preserve === false) return;
|
|
173
|
+
var v = finalValues[gid];
|
|
174
|
+
if (v !== undefined) out[gid] = v;
|
|
175
|
+
});
|
|
176
|
+
if (!isEqual(lastEmittedRef.current, out)) {
|
|
177
|
+
lastEmittedRef.current = out;
|
|
178
|
+
props.onChange(out);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, [dataSource, normalizedRules, allowedValuesPolicy, preserveDefault, state.visibleGroups, state.values, state.optionEffects, props === null || props === void 0 ? void 0 : props.onChange]);
|
|
182
|
+
var getValuesInternal = useCallback(function (includeHidden, visibleOverride) {
|
|
183
|
+
if (includeHidden) return _objectSpread({}, state.values || {});
|
|
184
|
+
var visibleMap = visibleOverride || state.visibleGroups;
|
|
185
|
+
var result = {};
|
|
186
|
+
(dataSource || []).forEach(function (group) {
|
|
187
|
+
var _group$id4;
|
|
188
|
+
var gid = String((_group$id4 = group.id) !== null && _group$id4 !== void 0 ? _group$id4 : '');
|
|
189
|
+
var preserve = typeof group.preserve === 'boolean' ? group.preserve : preserveDefault;
|
|
190
|
+
if (visibleMap[gid] === false && preserve === false) return;
|
|
191
|
+
var v = state.values[gid];
|
|
192
|
+
if (v !== undefined) result[gid] = v;
|
|
193
|
+
});
|
|
194
|
+
return result;
|
|
195
|
+
}, [dataSource, state.visibleGroups, preserveDefault, state.values]);
|
|
196
|
+
|
|
197
|
+
// 避免父组件每次 render 传入新数组引用导致 effect 反复触发
|
|
198
|
+
var dataSourceStableKey = useMemo(function () {
|
|
199
|
+
try {
|
|
200
|
+
return JSON.stringify(dataSource !== null && dataSource !== void 0 ? dataSource : null);
|
|
201
|
+
} catch (_unused2) {
|
|
202
|
+
return String((dataSource || []).length);
|
|
203
|
+
}
|
|
204
|
+
}, [dataSource]);
|
|
205
|
+
|
|
206
|
+
// 当数据源或规则变化时,基于当前值重新计算一次,保持一致
|
|
207
|
+
useEffect(function () {
|
|
208
|
+
applyValues(_objectSpread({}, state.values || {}));
|
|
209
|
+
}, [dataSourceStableKey, normalizedRules, allowedValuesPolicy]);
|
|
210
|
+
useEffect(function () {
|
|
211
|
+
var external = props === null || props === void 0 ? void 0 : props.value;
|
|
212
|
+
if (external && _typeof(external) === 'object') {
|
|
213
|
+
var prev = state.values || {};
|
|
214
|
+
var next = external || {};
|
|
215
|
+
var isDifferent = !isEqual(prev, next);
|
|
216
|
+
if (isDifferent) {
|
|
217
|
+
applyValues(_objectSpread({}, next));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
221
|
+
var handleGroupChange = useCallback(function (groupId, v) {
|
|
222
|
+
var nextValues = _objectSpread(_objectSpread({}, state.values || {}), {}, _defineProperty({}, groupId, v));
|
|
223
|
+
applyValues(nextValues);
|
|
224
|
+
}, [state.values, applyValues]);
|
|
225
|
+
|
|
226
|
+
// 暴露方法
|
|
227
|
+
useImperativeHandle(ref, function () {
|
|
228
|
+
return {
|
|
229
|
+
getValues: function getValues(includeHidden) {
|
|
230
|
+
return getValuesInternal(includeHidden);
|
|
231
|
+
},
|
|
232
|
+
setValues: function setValues(values) {
|
|
233
|
+
applyValues(_objectSpread({}, values || {}));
|
|
234
|
+
},
|
|
235
|
+
validate: function () {
|
|
236
|
+
var _validate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
237
|
+
var tasks, results, errorsByGroup, hasErrors;
|
|
238
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
239
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
tasks = Object.keys(groupRefs.current).map( /*#__PURE__*/function () {
|
|
242
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(gid) {
|
|
243
|
+
var inst;
|
|
244
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
245
|
+
while (1) switch (_context.prev = _context.next) {
|
|
246
|
+
case 0:
|
|
247
|
+
if (!(state.visibleGroups[gid] === false)) {
|
|
248
|
+
_context.next = 2;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
return _context.abrupt("return", {
|
|
252
|
+
gid: gid,
|
|
253
|
+
ok: true,
|
|
254
|
+
errors: []
|
|
255
|
+
});
|
|
256
|
+
case 2:
|
|
257
|
+
inst = groupRefs.current[gid];
|
|
258
|
+
if (!(inst !== null && inst !== void 0 && inst.validate)) {
|
|
259
|
+
_context.next = 13;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
_context.prev = 4;
|
|
263
|
+
_context.next = 7;
|
|
264
|
+
return inst.validate();
|
|
265
|
+
case 7:
|
|
266
|
+
return _context.abrupt("return", {
|
|
267
|
+
gid: gid,
|
|
268
|
+
ok: true,
|
|
269
|
+
errors: []
|
|
270
|
+
});
|
|
271
|
+
case 10:
|
|
272
|
+
_context.prev = 10;
|
|
273
|
+
_context.t0 = _context["catch"](4);
|
|
274
|
+
return _context.abrupt("return", {
|
|
275
|
+
gid: gid,
|
|
276
|
+
ok: false,
|
|
277
|
+
errors: Array.isArray(_context.t0) ? _context.t0 : []
|
|
278
|
+
});
|
|
279
|
+
case 13:
|
|
280
|
+
return _context.abrupt("return", {
|
|
281
|
+
gid: gid,
|
|
282
|
+
ok: true,
|
|
283
|
+
errors: []
|
|
284
|
+
});
|
|
285
|
+
case 14:
|
|
286
|
+
case "end":
|
|
287
|
+
return _context.stop();
|
|
288
|
+
}
|
|
289
|
+
}, _callee, null, [[4, 10]]);
|
|
290
|
+
}));
|
|
291
|
+
return function (_x) {
|
|
292
|
+
return _ref.apply(this, arguments);
|
|
293
|
+
};
|
|
294
|
+
}());
|
|
295
|
+
_context2.next = 3;
|
|
296
|
+
return Promise.all(tasks);
|
|
297
|
+
case 3:
|
|
298
|
+
results = _context2.sent;
|
|
299
|
+
errorsByGroup = {};
|
|
300
|
+
results.forEach(function (r) {
|
|
301
|
+
if (!r.ok && r.errors && r.errors.length > 0) {
|
|
302
|
+
errorsByGroup[r.gid] = r.errors;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
hasErrors = Object.keys(errorsByGroup).length > 0;
|
|
306
|
+
if (!hasErrors) {
|
|
307
|
+
_context2.next = 11;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
return _context2.abrupt("return", Promise.reject(errorsByGroup));
|
|
311
|
+
case 11:
|
|
312
|
+
return _context2.abrupt("return", Promise.resolve({}));
|
|
313
|
+
case 12:
|
|
314
|
+
case "end":
|
|
315
|
+
return _context2.stop();
|
|
316
|
+
}
|
|
317
|
+
}, _callee2);
|
|
318
|
+
}));
|
|
319
|
+
function validate() {
|
|
320
|
+
return _validate.apply(this, arguments);
|
|
321
|
+
}
|
|
322
|
+
return validate;
|
|
323
|
+
}(),
|
|
324
|
+
reset: function reset() {
|
|
325
|
+
// 优先重置为 defaultValue,否则清空
|
|
326
|
+
var nextValues = (props === null || props === void 0 ? void 0 : props.defaultValue) || {};
|
|
327
|
+
applyValues(_objectSpread({}, nextValues || {}));
|
|
328
|
+
// 同步重置子组件的本地状态与错误
|
|
329
|
+
Object.keys(groupRefs.current).forEach(function (gid) {
|
|
330
|
+
var _inst$reset;
|
|
331
|
+
var inst = groupRefs.current[gid];
|
|
332
|
+
inst === null || inst === void 0 || (_inst$reset = inst.reset) === null || _inst$reset === void 0 || _inst$reset.call(inst);
|
|
333
|
+
});
|
|
334
|
+
},
|
|
335
|
+
clear: function clear() {
|
|
336
|
+
// 清空所有分组值
|
|
337
|
+
applyValues({});
|
|
338
|
+
Object.keys(groupRefs.current).forEach(function (gid) {
|
|
339
|
+
var _inst$clear;
|
|
340
|
+
var inst = groupRefs.current[gid];
|
|
341
|
+
inst === null || inst === void 0 || (_inst$clear = inst.clear) === null || _inst$clear === void 0 || _inst$clear.call(inst);
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
});
|
|
346
|
+
if (!Array.isArray(dataSource)) return null;
|
|
347
|
+
var patchedDataSourceMap = useMemo(function () {
|
|
348
|
+
var map = {};
|
|
349
|
+
(dataSource || []).forEach(function (group) {
|
|
350
|
+
var _group$id5, _group$fieldNames;
|
|
351
|
+
var gid = String((_group$id5 = group.id) !== null && _group$id5 !== void 0 ? _group$id5 : '');
|
|
352
|
+
var fieldValue = (group === null || group === void 0 || (_group$fieldNames = group.fieldNames) === null || _group$fieldNames === void 0 ? void 0 : _group$fieldNames.value) || 'value';
|
|
353
|
+
var effects = state.optionEffects[gid];
|
|
354
|
+
var ds = Array.isArray(group.dataSource) ? group.dataSource : [];
|
|
355
|
+
map[gid] = ds.map(function (opt) {
|
|
356
|
+
var val = opt[fieldValue];
|
|
357
|
+
var notAllowed = (effects === null || effects === void 0 ? void 0 : effects.allowOnly) && !effects.allowOnly.has(val);
|
|
358
|
+
return notAllowed ? _objectSpread(_objectSpread({}, opt), {}, {
|
|
359
|
+
disabled: true
|
|
360
|
+
}) : opt;
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
return map;
|
|
364
|
+
}, [dataSource, state.optionEffects]);
|
|
365
|
+
var validationMaps = useMemo(function () {
|
|
366
|
+
var titleTipMap = {};
|
|
367
|
+
var customValidatorMap = {};
|
|
368
|
+
(dataSource || []).forEach(function (group) {
|
|
369
|
+
var _group$id6, _state$optionEffects$;
|
|
370
|
+
var gid = String((_group$id6 = group.id) !== null && _group$id6 !== void 0 ? _group$id6 : '');
|
|
371
|
+
var req = (_state$optionEffects$ = state.optionEffects[gid]) === null || _state$optionEffects$ === void 0 ? void 0 : _state$optionEffects$.requireOneOf;
|
|
372
|
+
if (req) {
|
|
373
|
+
var _state$values;
|
|
374
|
+
var currentSel = getSelectedSet((_state$values = state.values) === null || _state$values === void 0 ? void 0 : _state$values[gid]);
|
|
375
|
+
var ok = _toConsumableArray(req.values).some(function (v) {
|
|
376
|
+
return currentSel.has(v);
|
|
377
|
+
});
|
|
378
|
+
titleTipMap[gid] = ok ? undefined : req.tip || locales.getText('pisell2.pro.selector.validate.requireOneOf-msg');
|
|
379
|
+
customValidatorMap[gid] = /*#__PURE__*/function () {
|
|
380
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
|
|
381
|
+
var sel, match;
|
|
382
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
383
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
384
|
+
case 0:
|
|
385
|
+
sel = getSelectedSet(value);
|
|
386
|
+
match = _toConsumableArray(req.values).some(function (v) {
|
|
387
|
+
return sel.has(v);
|
|
388
|
+
});
|
|
389
|
+
if (match) {
|
|
390
|
+
_context3.next = 4;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
throw {
|
|
394
|
+
type: 'requireOneOf',
|
|
395
|
+
message: req.message || locales.getText('pisell2.pro.selector.validate.requireOneOf-msg')
|
|
396
|
+
};
|
|
397
|
+
case 4:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context3.stop();
|
|
400
|
+
}
|
|
401
|
+
}, _callee3);
|
|
402
|
+
}));
|
|
403
|
+
return function (_x2) {
|
|
404
|
+
return _ref2.apply(this, arguments);
|
|
405
|
+
};
|
|
406
|
+
}();
|
|
407
|
+
} else {
|
|
408
|
+
titleTipMap[gid] = undefined;
|
|
409
|
+
customValidatorMap[gid] = undefined;
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
return {
|
|
413
|
+
titleTipMap: titleTipMap,
|
|
414
|
+
customValidatorMap: customValidatorMap
|
|
415
|
+
};
|
|
416
|
+
}, [dataSource, state.optionEffects, state.values]);
|
|
417
|
+
var _categories = useMemo(function () {
|
|
418
|
+
return dataSource.filter(function (item) {
|
|
419
|
+
var _item$id;
|
|
420
|
+
return state.visibleGroups[String((_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : '')] !== false;
|
|
421
|
+
}).map(function (item) {
|
|
422
|
+
var _item$id2;
|
|
423
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
424
|
+
key: String((_item$id2 = item.id) !== null && _item$id2 !== void 0 ? _item$id2 : ''),
|
|
425
|
+
label: item.title
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
}, [dataSource, state.visibleGroups]);
|
|
429
|
+
var debounceIndicator = useCallback(function (delay) {
|
|
430
|
+
isManualChangeIndexRef.current = true;
|
|
431
|
+
var timeoutId = setTimeout(function () {
|
|
432
|
+
isManualChangeIndexRef.current = false;
|
|
433
|
+
}, delay);
|
|
434
|
+
return function () {
|
|
435
|
+
return clearTimeout(timeoutId);
|
|
436
|
+
};
|
|
437
|
+
}, []);
|
|
438
|
+
var activeKey = useMemo(function () {
|
|
439
|
+
var _categories$activeInd;
|
|
440
|
+
return (_categories$activeInd = _categories[activeIndex]) === null || _categories$activeInd === void 0 ? void 0 : _categories$activeInd.key;
|
|
441
|
+
}, [activeIndex, _categories]);
|
|
442
|
+
var switchCategory = function switchCategory(key) {
|
|
443
|
+
var _idx = _categories.findIndex(function (item) {
|
|
444
|
+
return item.key === key;
|
|
445
|
+
});
|
|
446
|
+
setActiveIndex(_idx);
|
|
447
|
+
debounceIndicator(300);
|
|
448
|
+
var categoryIndex = dataSource.findIndex(function (item) {
|
|
449
|
+
return String(item.id) === key;
|
|
450
|
+
});
|
|
451
|
+
// 获取可滚动祖先元素
|
|
452
|
+
var _scrollParent = props.customScrollParent || containerRef.current;
|
|
453
|
+
if (!_scrollParent || !containerRef.current) return;
|
|
454
|
+
var target = document.getElementById("pisell-pro-selector-".concat(key));
|
|
455
|
+
if (!target) return;
|
|
456
|
+
// 获取产品选择器包装容器
|
|
457
|
+
var batchSelectorWrapper = document.querySelector(".pisell-batch-selector-".concat(_uniqueId));
|
|
458
|
+
// 获取标签页包装容器
|
|
459
|
+
var tabsWrapper = document.getElementById("pisell-batch-selector-".concat(_uniqueId, "_tabs"));
|
|
460
|
+
var tabsHeight = (tabsWrapper === null || tabsWrapper === void 0 ? void 0 : tabsWrapper.offsetHeight) || 0;
|
|
461
|
+
// 获取额外偏移元素(如固定头部等)
|
|
462
|
+
// const offsetElement: any = getElementByIdentifier(offsetDom);
|
|
463
|
+
var extraOffset = 0;
|
|
464
|
+
if (categoryIndex === 0) {
|
|
465
|
+
// 如果是第一个tab,滚动到产品选择器包装容器的位置
|
|
466
|
+
if (batchSelectorWrapper) {
|
|
467
|
+
var wrapperOffsetTop = getOffsetTopRelativeToScrollContainer(batchSelectorWrapper, _scrollParent);
|
|
468
|
+
_scrollParent.scrollTop = wrapperOffsetTop - extraOffset;
|
|
469
|
+
}
|
|
470
|
+
return;
|
|
471
|
+
} else {
|
|
472
|
+
// 其他tab,滚动到对应列表元素位置,需要减去标签页高度
|
|
473
|
+
var listOffsetTop = getOffsetTopRelativeToScrollContainer(target, _scrollParent);
|
|
474
|
+
_scrollParent.scrollTop = listOffsetTop - tabsHeight - extraOffset;
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
var renderTabs = function renderTabs() {
|
|
478
|
+
var _props$tabProps;
|
|
479
|
+
if (((_props$tabProps = props.tabProps) === null || _props$tabProps === void 0 ? void 0 : _props$tabProps.visible) === false) return null;
|
|
480
|
+
return /*#__PURE__*/React.createElement(CategoryTabs, {
|
|
481
|
+
activeKey: activeKey ? String(activeKey) : '',
|
|
482
|
+
items: _categories,
|
|
483
|
+
onChange: switchCategory,
|
|
484
|
+
loading: props.loading,
|
|
485
|
+
skeleton: /*#__PURE__*/React.createElement(CategorySkeleton, null),
|
|
486
|
+
id: "pisell-batch-selector-".concat(_uniqueId, "_tabs")
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
490
|
+
className: "pisell-batch-selector pisell-batch-selector-".concat(_uniqueId),
|
|
491
|
+
ref: containerRef
|
|
492
|
+
}, renderTabs(), /*#__PURE__*/React.createElement(IntersectionObserverProvider, {
|
|
493
|
+
rootMargin: "-70px 0px 0px 0px",
|
|
494
|
+
disabled: ((_props$tabProps2 = props.tabProps) === null || _props$tabProps2 === void 0 ? void 0 : _props$tabProps2.visible) === false,
|
|
495
|
+
onFirstVisibleIndexChange: function onFirstVisibleIndexChange(index) {
|
|
496
|
+
if (!isManualChangeIndexRef.current) {
|
|
497
|
+
if (index === -1 || index === activeIndex) return;
|
|
498
|
+
setActiveIndex(index);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
502
|
+
className: "pisell-batch-selector__content"
|
|
503
|
+
}, dataSource.filter(function (item) {
|
|
504
|
+
var _item$id3;
|
|
505
|
+
return state.visibleGroups[String((_item$id3 = item.id) !== null && _item$id3 !== void 0 ? _item$id3 : '')] !== false;
|
|
506
|
+
}).map(function (item, index) {
|
|
507
|
+
var _item$id4, _state$values2, _titleProps, _titleProps2, _titleProps3;
|
|
508
|
+
var gid = String((_item$id4 = item.id) !== null && _item$id4 !== void 0 ? _item$id4 : '');
|
|
509
|
+
return /*#__PURE__*/React.createElement(IntersectionItem, {
|
|
510
|
+
key: gid,
|
|
511
|
+
index: index
|
|
512
|
+
}, /*#__PURE__*/React.createElement(Selector, _extends({}, item, {
|
|
513
|
+
ref: function ref(el) {
|
|
514
|
+
if (el) {
|
|
515
|
+
groupRefs.current[gid] = el;
|
|
516
|
+
} else {
|
|
517
|
+
delete groupRefs.current[gid];
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
value: (_state$values2 = state.values) === null || _state$values2 === void 0 ? void 0 : _state$values2[gid],
|
|
521
|
+
onChange: function onChange(v) {
|
|
522
|
+
return handleGroupChange(gid, v);
|
|
523
|
+
},
|
|
524
|
+
ruleConfig: _objectSpread(_objectSpread({}, item.ruleConfig), {}, {
|
|
525
|
+
customValidator: validationMaps.customValidatorMap[gid]
|
|
526
|
+
}),
|
|
527
|
+
dataSource: patchedDataSourceMap[gid],
|
|
528
|
+
titleProps: _objectSpread(_objectSpread({}, (item === null || item === void 0 ? void 0 : item.titleProps) || {}), validationMaps.titleTipMap[gid] === undefined ? {} : {
|
|
529
|
+
tip: _objectSpread(_objectSpread({}, (item === null || item === void 0 || (_titleProps = item.titleProps) === null || _titleProps === void 0 ? void 0 : _titleProps.tip) || {}), {}, {
|
|
530
|
+
text: validationMaps.titleTipMap[gid],
|
|
531
|
+
visible: (item === null || item === void 0 || (_titleProps2 = item.titleProps) === null || _titleProps2 === void 0 || (_titleProps2 = _titleProps2.tip) === null || _titleProps2 === void 0 ? void 0 : _titleProps2.visible) !== undefined ? item === null || item === void 0 || (_titleProps3 = item.titleProps) === null || _titleProps3 === void 0 || (_titleProps3 = _titleProps3.tip) === null || _titleProps3 === void 0 ? void 0 : _titleProps3.visible : true
|
|
532
|
+
})
|
|
533
|
+
})
|
|
534
|
+
})));
|
|
535
|
+
}))));
|
|
536
|
+
});
|
|
537
|
+
export default SelectorGroup;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface CardItemProps {
|
|
4
|
+
dataSource: any;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
layout?: 'vertical' | 'horizontal';
|
|
9
|
+
selectedTypeVariant?: 'default' | 'filled' | 'cornered';
|
|
10
|
+
selectedIcon?: React.ReactNode;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
numberSelector?: React.ReactNode;
|
|
13
|
+
trigger?: React.ReactNode;
|
|
14
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
15
|
+
renderContent?: (dataSource: any) => React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 自定义内容渲染函数
|
|
19
|
+
* 1. 默认展示最精简内容,仅展示label信息,另外 numberSelector 不为空则展示
|
|
20
|
+
* 2. selectedIcon 仅在最精简模式,且 selected 为 true, 且 numberSelector 为空时展示
|
|
21
|
+
* 3. 当传入 renderContent 函数时,优先使用自定义内容渲染函数
|
|
22
|
+
* a. triger 及 numberSelector 默认展示在卡片右侧或者底部局中位置(根据 layout 确定)
|
|
23
|
+
* b. numberSelector 优先级高于 trigger
|
|
24
|
+
* c. layout 为 vertical, 且 selectedTypeVariant 为 cornered 时,trigger 展示在 卡片右上角
|
|
25
|
+
*/
|
|
26
|
+
declare const CardItem: React.FC<CardItemProps>;
|
|
27
|
+
export default CardItem;
|