@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,463 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/pro/Selector/SelectorGroup.tsx
|
|
30
|
+
var SelectorGroup_exports = {};
|
|
31
|
+
__export(SelectorGroup_exports, {
|
|
32
|
+
default: () => SelectorGroup_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SelectorGroup_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_locales = __toESM(require("./locales"));
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
40
|
+
var import_Selector = __toESM(require("./Selector"));
|
|
41
|
+
var import_utils2 = require("./utils");
|
|
42
|
+
var import_IntersectionObserver = require("./components/IntersectionObserver");
|
|
43
|
+
var import_CategoryTabs = __toESM(require("../../plus/productSelect/CategoryTabs"));
|
|
44
|
+
var import_utils3 = require("../../plus/productSelect/utils");
|
|
45
|
+
var import_selectorGroup = require("./selectorGroup.less");
|
|
46
|
+
var SelectorGroup = (0, import_react.forwardRef)(
|
|
47
|
+
(props, ref) => {
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
|
+
const context = (0, import_useEngineContext.default)();
|
|
50
|
+
import_utils.locales.init(
|
|
51
|
+
import_locales.default,
|
|
52
|
+
((_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.storage) == null ? void 0 : _c.get("umi_locale")) || "en"
|
|
53
|
+
);
|
|
54
|
+
const {
|
|
55
|
+
dataSource,
|
|
56
|
+
linkageRules,
|
|
57
|
+
allowedValuesPolicy = "strict",
|
|
58
|
+
preserve: preserveDefault = false
|
|
59
|
+
} = props;
|
|
60
|
+
const [activeIndex, setActiveIndex] = (0, import_react.useState)(-1);
|
|
61
|
+
const isManualChangeIndexRef = (0, import_react.useRef)(false);
|
|
62
|
+
const containerRef = (0, import_react.useRef)(null);
|
|
63
|
+
const _uniqueId = (0, import_react.useMemo)(() => (0, import_utils2.generateSimpleUUID)(), []);
|
|
64
|
+
const groupRefs = (0, import_react.useRef)({});
|
|
65
|
+
const reducer = (state2, action) => {
|
|
66
|
+
switch (action.type) {
|
|
67
|
+
case "commit":
|
|
68
|
+
return action.payload;
|
|
69
|
+
case "patch":
|
|
70
|
+
return { ...state2, ...action.payload };
|
|
71
|
+
default:
|
|
72
|
+
return state2;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const [state, dispatch] = (0, import_react.useReducer)(reducer, {
|
|
76
|
+
values: {},
|
|
77
|
+
visibleGroups: {},
|
|
78
|
+
optionEffects: {}
|
|
79
|
+
});
|
|
80
|
+
(0, import_react.useEffect)(() => {
|
|
81
|
+
const initial = ((props == null ? void 0 : props.value) ?? (props == null ? void 0 : props.defaultValue)) || {};
|
|
82
|
+
if (initial && typeof initial === "object") {
|
|
83
|
+
applyValues({ ...initial });
|
|
84
|
+
}
|
|
85
|
+
}, []);
|
|
86
|
+
const rulesStableKey = (0, import_react.useMemo)(() => {
|
|
87
|
+
try {
|
|
88
|
+
return JSON.stringify(linkageRules ?? null);
|
|
89
|
+
} catch {
|
|
90
|
+
return String(linkageRules);
|
|
91
|
+
}
|
|
92
|
+
}, [linkageRules]);
|
|
93
|
+
const normalizedRules = (0, import_react.useMemo)(
|
|
94
|
+
() => (0, import_utils2.normalizeRules)(linkageRules),
|
|
95
|
+
[rulesStableKey]
|
|
96
|
+
);
|
|
97
|
+
const autoHiddenGroups = (0, import_react.useMemo)(
|
|
98
|
+
() => (0, import_utils2.computeAutoHiddenGroups)(normalizedRules),
|
|
99
|
+
[normalizedRules]
|
|
100
|
+
);
|
|
101
|
+
const hasInitializedVisibilityRef = (0, import_react.useRef)(false);
|
|
102
|
+
(0, import_react.useEffect)(() => {
|
|
103
|
+
if (!hasInitializedVisibilityRef.current && (!state.visibleGroups || Object.keys(state.visibleGroups).length === 0)) {
|
|
104
|
+
const initVisible = {};
|
|
105
|
+
(dataSource || []).forEach((group) => {
|
|
106
|
+
const gid = String(group.id ?? "");
|
|
107
|
+
initVisible[gid] = autoHiddenGroups.has(gid) ? false : true;
|
|
108
|
+
});
|
|
109
|
+
hasInitializedVisibilityRef.current = true;
|
|
110
|
+
dispatch({ type: "patch", payload: { visibleGroups: initVisible } });
|
|
111
|
+
}
|
|
112
|
+
}, [dataSource, autoHiddenGroups]);
|
|
113
|
+
const lastEmittedRef = (0, import_react.useRef)(null);
|
|
114
|
+
const applyValues = (0, import_react.useCallback)(
|
|
115
|
+
(nextValues, visibleOverride) => {
|
|
116
|
+
const maskValues = (vals, visibleMap) => {
|
|
117
|
+
const out = {
|
|
118
|
+
...vals || {}
|
|
119
|
+
};
|
|
120
|
+
(dataSource || []).forEach((group) => {
|
|
121
|
+
const gid = String(group.id ?? "");
|
|
122
|
+
const preserve = typeof group.preserve === "boolean" ? group.preserve : preserveDefault;
|
|
123
|
+
if (visibleMap[gid] === false && preserve === false)
|
|
124
|
+
out[gid] = void 0;
|
|
125
|
+
});
|
|
126
|
+
return out;
|
|
127
|
+
};
|
|
128
|
+
const baseVisible = visibleOverride || state.visibleGroups;
|
|
129
|
+
const valuesForEffects = maskValues(nextValues, baseVisible);
|
|
130
|
+
const { visibleGroups: newVisible, optionEffects: newEffects } = (0, import_utils2.computeEffects)(
|
|
131
|
+
dataSource,
|
|
132
|
+
normalizedRules,
|
|
133
|
+
valuesForEffects
|
|
134
|
+
);
|
|
135
|
+
let finalValues = nextValues;
|
|
136
|
+
let finalVisible = newVisible;
|
|
137
|
+
let finalEffects = newEffects;
|
|
138
|
+
if (allowedValuesPolicy === "strict") {
|
|
139
|
+
const pruned = (0, import_utils2.pruneValuesByAllowOnly)(nextValues, newEffects);
|
|
140
|
+
const didPrune = !(0, import_lodash.isEqual)(pruned, nextValues);
|
|
141
|
+
if (didPrune) {
|
|
142
|
+
finalValues = pruned;
|
|
143
|
+
const valuesForEffects2 = maskValues(finalValues, newVisible);
|
|
144
|
+
const recomputed = (0, import_utils2.computeEffects)(
|
|
145
|
+
dataSource,
|
|
146
|
+
normalizedRules,
|
|
147
|
+
valuesForEffects2
|
|
148
|
+
);
|
|
149
|
+
finalVisible = recomputed.visibleGroups;
|
|
150
|
+
finalEffects = recomputed.optionEffects;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const noStateChange = (0, import_lodash.isEqual)(state.values, finalValues) && (0, import_lodash.isEqual)(state.visibleGroups, finalVisible) && (0, import_lodash.isEqual)(state.optionEffects, finalEffects);
|
|
154
|
+
if (!noStateChange) {
|
|
155
|
+
dispatch({
|
|
156
|
+
type: "commit",
|
|
157
|
+
payload: {
|
|
158
|
+
values: { ...finalValues || {} },
|
|
159
|
+
visibleGroups: finalVisible,
|
|
160
|
+
optionEffects: finalEffects
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (typeof (props == null ? void 0 : props.onChange) === "function") {
|
|
165
|
+
const out = {};
|
|
166
|
+
(dataSource || []).forEach((group) => {
|
|
167
|
+
const gid = String(group.id ?? "");
|
|
168
|
+
const preserve = typeof group.preserve === "boolean" ? group.preserve : preserveDefault;
|
|
169
|
+
if (finalVisible[gid] === false && preserve === false) return;
|
|
170
|
+
const v = finalValues[gid];
|
|
171
|
+
if (v !== void 0) out[gid] = v;
|
|
172
|
+
});
|
|
173
|
+
if (!(0, import_lodash.isEqual)(lastEmittedRef.current, out)) {
|
|
174
|
+
lastEmittedRef.current = out;
|
|
175
|
+
props.onChange(out);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
[
|
|
180
|
+
dataSource,
|
|
181
|
+
normalizedRules,
|
|
182
|
+
allowedValuesPolicy,
|
|
183
|
+
preserveDefault,
|
|
184
|
+
state.visibleGroups,
|
|
185
|
+
state.values,
|
|
186
|
+
state.optionEffects,
|
|
187
|
+
props == null ? void 0 : props.onChange
|
|
188
|
+
]
|
|
189
|
+
);
|
|
190
|
+
const getValuesInternal = (0, import_react.useCallback)(
|
|
191
|
+
(includeHidden, visibleOverride) => {
|
|
192
|
+
if (includeHidden) return { ...state.values || {} };
|
|
193
|
+
const visibleMap = visibleOverride || state.visibleGroups;
|
|
194
|
+
const result = {};
|
|
195
|
+
(dataSource || []).forEach((group) => {
|
|
196
|
+
const gid = String(group.id ?? "");
|
|
197
|
+
const preserve = typeof group.preserve === "boolean" ? group.preserve : preserveDefault;
|
|
198
|
+
if (visibleMap[gid] === false && preserve === false) return;
|
|
199
|
+
const v = state.values[gid];
|
|
200
|
+
if (v !== void 0) result[gid] = v;
|
|
201
|
+
});
|
|
202
|
+
return result;
|
|
203
|
+
},
|
|
204
|
+
[dataSource, state.visibleGroups, preserveDefault, state.values]
|
|
205
|
+
);
|
|
206
|
+
const dataSourceStableKey = (0, import_react.useMemo)(() => {
|
|
207
|
+
try {
|
|
208
|
+
return JSON.stringify(dataSource ?? null);
|
|
209
|
+
} catch {
|
|
210
|
+
return String((dataSource || []).length);
|
|
211
|
+
}
|
|
212
|
+
}, [dataSource]);
|
|
213
|
+
(0, import_react.useEffect)(() => {
|
|
214
|
+
applyValues({ ...state.values || {} });
|
|
215
|
+
}, [dataSourceStableKey, normalizedRules, allowedValuesPolicy]);
|
|
216
|
+
(0, import_react.useEffect)(() => {
|
|
217
|
+
const external = props == null ? void 0 : props.value;
|
|
218
|
+
if (external && typeof external === "object") {
|
|
219
|
+
const prev = state.values || {};
|
|
220
|
+
const next = external || {};
|
|
221
|
+
const isDifferent = !(0, import_lodash.isEqual)(prev, next);
|
|
222
|
+
if (isDifferent) {
|
|
223
|
+
applyValues({ ...next });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}, [props == null ? void 0 : props.value]);
|
|
227
|
+
const handleGroupChange = (0, import_react.useCallback)(
|
|
228
|
+
(groupId, v) => {
|
|
229
|
+
const nextValues = { ...state.values || {}, [groupId]: v };
|
|
230
|
+
applyValues(nextValues);
|
|
231
|
+
},
|
|
232
|
+
[state.values, applyValues]
|
|
233
|
+
);
|
|
234
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
235
|
+
getValues: (includeHidden) => getValuesInternal(includeHidden),
|
|
236
|
+
setValues: (values) => {
|
|
237
|
+
applyValues({ ...values || {} });
|
|
238
|
+
},
|
|
239
|
+
validate: async () => {
|
|
240
|
+
const tasks = Object.keys(groupRefs.current).map(async (gid) => {
|
|
241
|
+
if (state.visibleGroups[gid] === false)
|
|
242
|
+
return { gid, ok: true, errors: [] };
|
|
243
|
+
const inst = groupRefs.current[gid];
|
|
244
|
+
if (inst == null ? void 0 : inst.validate) {
|
|
245
|
+
try {
|
|
246
|
+
await inst.validate();
|
|
247
|
+
return { gid, ok: true, errors: [] };
|
|
248
|
+
} catch (errors) {
|
|
249
|
+
return {
|
|
250
|
+
gid,
|
|
251
|
+
ok: false,
|
|
252
|
+
errors: Array.isArray(errors) ? errors : []
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return { gid, ok: true, errors: [] };
|
|
257
|
+
});
|
|
258
|
+
const results = await Promise.all(tasks);
|
|
259
|
+
const errorsByGroup = {};
|
|
260
|
+
results.forEach((r) => {
|
|
261
|
+
if (!r.ok && r.errors && r.errors.length > 0) {
|
|
262
|
+
errorsByGroup[r.gid] = r.errors;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
const hasErrors = Object.keys(errorsByGroup).length > 0;
|
|
266
|
+
if (hasErrors) {
|
|
267
|
+
return Promise.reject(errorsByGroup);
|
|
268
|
+
} else {
|
|
269
|
+
return Promise.resolve({});
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
reset: () => {
|
|
273
|
+
const nextValues = (props == null ? void 0 : props.defaultValue) || {};
|
|
274
|
+
applyValues({ ...nextValues || {} });
|
|
275
|
+
Object.keys(groupRefs.current).forEach((gid) => {
|
|
276
|
+
var _a2;
|
|
277
|
+
const inst = groupRefs.current[gid];
|
|
278
|
+
(_a2 = inst == null ? void 0 : inst.reset) == null ? void 0 : _a2.call(inst);
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
clear: () => {
|
|
282
|
+
applyValues({});
|
|
283
|
+
Object.keys(groupRefs.current).forEach((gid) => {
|
|
284
|
+
var _a2;
|
|
285
|
+
const inst = groupRefs.current[gid];
|
|
286
|
+
(_a2 = inst == null ? void 0 : inst.clear) == null ? void 0 : _a2.call(inst);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}));
|
|
290
|
+
if (!Array.isArray(dataSource)) return null;
|
|
291
|
+
const patchedDataSourceMap = (0, import_react.useMemo)(() => {
|
|
292
|
+
const map = {};
|
|
293
|
+
(dataSource || []).forEach((group) => {
|
|
294
|
+
var _a2;
|
|
295
|
+
const gid = String(group.id ?? "");
|
|
296
|
+
const fieldValue = ((_a2 = group == null ? void 0 : group.fieldNames) == null ? void 0 : _a2.value) || "value";
|
|
297
|
+
const effects = state.optionEffects[gid];
|
|
298
|
+
const ds = Array.isArray(group.dataSource) ? group.dataSource : [];
|
|
299
|
+
map[gid] = ds.map((opt) => {
|
|
300
|
+
const val = opt[fieldValue];
|
|
301
|
+
const notAllowed = (effects == null ? void 0 : effects.allowOnly) && !effects.allowOnly.has(val);
|
|
302
|
+
return notAllowed ? { ...opt, disabled: true } : opt;
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
return map;
|
|
306
|
+
}, [dataSource, state.optionEffects]);
|
|
307
|
+
const validationMaps = (0, import_react.useMemo)(() => {
|
|
308
|
+
const titleTipMap = {};
|
|
309
|
+
const customValidatorMap = {};
|
|
310
|
+
(dataSource || []).forEach((group) => {
|
|
311
|
+
var _a2, _b2;
|
|
312
|
+
const gid = String(group.id ?? "");
|
|
313
|
+
const req = (_a2 = state.optionEffects[gid]) == null ? void 0 : _a2.requireOneOf;
|
|
314
|
+
if (req) {
|
|
315
|
+
const currentSel = (0, import_utils2.getSelectedSet)((_b2 = state.values) == null ? void 0 : _b2[gid]);
|
|
316
|
+
const ok = [...req.values].some((v) => currentSel.has(v));
|
|
317
|
+
titleTipMap[gid] = ok ? void 0 : req.tip || import_utils.locales.getText("pisell2.pro.selector.validate.requireOneOf-msg");
|
|
318
|
+
customValidatorMap[gid] = async (value) => {
|
|
319
|
+
const sel = (0, import_utils2.getSelectedSet)(value);
|
|
320
|
+
const match = [...req.values].some((v) => sel.has(v));
|
|
321
|
+
if (!match) {
|
|
322
|
+
throw {
|
|
323
|
+
type: "requireOneOf",
|
|
324
|
+
message: req.message || import_utils.locales.getText(
|
|
325
|
+
"pisell2.pro.selector.validate.requireOneOf-msg"
|
|
326
|
+
)
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
} else {
|
|
331
|
+
titleTipMap[gid] = void 0;
|
|
332
|
+
customValidatorMap[gid] = void 0;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
return { titleTipMap, customValidatorMap };
|
|
336
|
+
}, [dataSource, state.optionEffects, state.values]);
|
|
337
|
+
const _categories = (0, import_react.useMemo)(() => {
|
|
338
|
+
return dataSource.filter((item) => state.visibleGroups[String(item.id ?? "")] !== false).map((item) => {
|
|
339
|
+
return { ...item, key: String(item.id ?? ""), label: item.title };
|
|
340
|
+
});
|
|
341
|
+
}, [dataSource, state.visibleGroups]);
|
|
342
|
+
const debounceIndicator = (0, import_react.useCallback)((delay) => {
|
|
343
|
+
isManualChangeIndexRef.current = true;
|
|
344
|
+
const timeoutId = setTimeout(() => {
|
|
345
|
+
isManualChangeIndexRef.current = false;
|
|
346
|
+
}, delay);
|
|
347
|
+
return () => clearTimeout(timeoutId);
|
|
348
|
+
}, []);
|
|
349
|
+
const activeKey = (0, import_react.useMemo)(() => {
|
|
350
|
+
var _a2;
|
|
351
|
+
return (_a2 = _categories[activeIndex]) == null ? void 0 : _a2.key;
|
|
352
|
+
}, [activeIndex, _categories]);
|
|
353
|
+
const switchCategory = (key) => {
|
|
354
|
+
const _idx = _categories.findIndex((item) => item.key === key);
|
|
355
|
+
setActiveIndex(_idx);
|
|
356
|
+
debounceIndicator(300);
|
|
357
|
+
const categoryIndex = dataSource.findIndex(
|
|
358
|
+
(item) => String(item.id) === key
|
|
359
|
+
);
|
|
360
|
+
const _scrollParent = props.customScrollParent || containerRef.current;
|
|
361
|
+
if (!_scrollParent || !containerRef.current) return;
|
|
362
|
+
const target = document.getElementById(`pisell-pro-selector-${key}`);
|
|
363
|
+
if (!target) return;
|
|
364
|
+
const batchSelectorWrapper = document.querySelector(
|
|
365
|
+
`.pisell-batch-selector-${_uniqueId}`
|
|
366
|
+
);
|
|
367
|
+
const tabsWrapper = document.getElementById(
|
|
368
|
+
`pisell-batch-selector-${_uniqueId}_tabs`
|
|
369
|
+
);
|
|
370
|
+
const tabsHeight = (tabsWrapper == null ? void 0 : tabsWrapper.offsetHeight) || 0;
|
|
371
|
+
const extraOffset = 0;
|
|
372
|
+
if (categoryIndex === 0) {
|
|
373
|
+
if (batchSelectorWrapper) {
|
|
374
|
+
const wrapperOffsetTop = (0, import_utils3.getOffsetTopRelativeToScrollContainer)(
|
|
375
|
+
batchSelectorWrapper,
|
|
376
|
+
_scrollParent
|
|
377
|
+
);
|
|
378
|
+
_scrollParent.scrollTop = wrapperOffsetTop - extraOffset;
|
|
379
|
+
}
|
|
380
|
+
return;
|
|
381
|
+
} else {
|
|
382
|
+
const listOffsetTop = (0, import_utils3.getOffsetTopRelativeToScrollContainer)(
|
|
383
|
+
target,
|
|
384
|
+
_scrollParent
|
|
385
|
+
);
|
|
386
|
+
_scrollParent.scrollTop = listOffsetTop - tabsHeight - extraOffset;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
const renderTabs = () => {
|
|
390
|
+
var _a2;
|
|
391
|
+
if (((_a2 = props.tabProps) == null ? void 0 : _a2.visible) === false) return null;
|
|
392
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
393
|
+
import_CategoryTabs.default,
|
|
394
|
+
{
|
|
395
|
+
activeKey: activeKey ? String(activeKey) : "",
|
|
396
|
+
items: _categories,
|
|
397
|
+
onChange: switchCategory,
|
|
398
|
+
loading: props.loading,
|
|
399
|
+
skeleton: /* @__PURE__ */ import_react.default.createElement(import_CategoryTabs.CategorySkeleton, null),
|
|
400
|
+
id: `pisell-batch-selector-${_uniqueId}_tabs`
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
};
|
|
404
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
405
|
+
"div",
|
|
406
|
+
{
|
|
407
|
+
className: `pisell-batch-selector pisell-batch-selector-${_uniqueId}`,
|
|
408
|
+
ref: containerRef
|
|
409
|
+
},
|
|
410
|
+
renderTabs(),
|
|
411
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
412
|
+
import_IntersectionObserver.IntersectionObserverProvider,
|
|
413
|
+
{
|
|
414
|
+
rootMargin: "-70px 0px 0px 0px",
|
|
415
|
+
disabled: ((_d = props.tabProps) == null ? void 0 : _d.visible) === false,
|
|
416
|
+
onFirstVisibleIndexChange: (index) => {
|
|
417
|
+
if (!isManualChangeIndexRef.current) {
|
|
418
|
+
if (index === -1 || index === activeIndex) return;
|
|
419
|
+
setActiveIndex(index);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-batch-selector__content` }, dataSource.filter(
|
|
424
|
+
(item) => state.visibleGroups[String(item.id ?? "")] !== false
|
|
425
|
+
).map((item, index) => {
|
|
426
|
+
var _a2, _b2, _c2, _d2, _e, _f;
|
|
427
|
+
const gid = String(item.id ?? "");
|
|
428
|
+
return /* @__PURE__ */ import_react.default.createElement(import_IntersectionObserver.IntersectionItem, { key: gid, index }, /* @__PURE__ */ import_react.default.createElement(
|
|
429
|
+
import_Selector.default,
|
|
430
|
+
{
|
|
431
|
+
...item,
|
|
432
|
+
ref: (el) => {
|
|
433
|
+
if (el) {
|
|
434
|
+
groupRefs.current[gid] = el;
|
|
435
|
+
} else {
|
|
436
|
+
delete groupRefs.current[gid];
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
value: (_a2 = state.values) == null ? void 0 : _a2[gid],
|
|
440
|
+
onChange: (v) => handleGroupChange(gid, v),
|
|
441
|
+
ruleConfig: {
|
|
442
|
+
...item.ruleConfig,
|
|
443
|
+
customValidator: validationMaps.customValidatorMap[gid]
|
|
444
|
+
},
|
|
445
|
+
dataSource: patchedDataSourceMap[gid],
|
|
446
|
+
titleProps: {
|
|
447
|
+
...(item == null ? void 0 : item.titleProps) || {},
|
|
448
|
+
...validationMaps.titleTipMap[gid] === void 0 ? {} : {
|
|
449
|
+
tip: {
|
|
450
|
+
...((_b2 = item == null ? void 0 : item.titleProps) == null ? void 0 : _b2.tip) || {},
|
|
451
|
+
text: validationMaps.titleTipMap[gid],
|
|
452
|
+
visible: ((_d2 = (_c2 = item == null ? void 0 : item.titleProps) == null ? void 0 : _c2.tip) == null ? void 0 : _d2.visible) !== void 0 ? (_f = (_e = item == null ? void 0 : item.titleProps) == null ? void 0 : _e.tip) == null ? void 0 : _f.visible : true
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
));
|
|
458
|
+
}))
|
|
459
|
+
)
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
var SelectorGroup_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;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/pro/Selector/components/Card/index.tsx
|
|
30
|
+
var Card_exports = {};
|
|
31
|
+
__export(Card_exports, {
|
|
32
|
+
default: () => Card_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Card_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var stopPropagation = (e) => {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
};
|
|
41
|
+
var CardItem = ({
|
|
42
|
+
dataSource,
|
|
43
|
+
disabled,
|
|
44
|
+
selected,
|
|
45
|
+
bordered = true,
|
|
46
|
+
layout = "horizontal",
|
|
47
|
+
selectedTypeVariant = "default",
|
|
48
|
+
selectedIcon,
|
|
49
|
+
style,
|
|
50
|
+
onClick,
|
|
51
|
+
renderContent,
|
|
52
|
+
trigger,
|
|
53
|
+
numberSelector
|
|
54
|
+
}) => {
|
|
55
|
+
const isMinimalMode = typeof renderContent !== "function";
|
|
56
|
+
const isCorneredLayout = layout === "vertical" && selectedTypeVariant === "cornered";
|
|
57
|
+
const _renderMainContent = () => {
|
|
58
|
+
if (typeof renderContent === "function") {
|
|
59
|
+
return renderContent(dataSource);
|
|
60
|
+
}
|
|
61
|
+
const contentClass = (0, import_classnames.default)("pisell-selector_card-content", {
|
|
62
|
+
"content-start": selectedIcon || numberSelector
|
|
63
|
+
});
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: contentClass }, (dataSource == null ? void 0 : dataSource._label) || "");
|
|
65
|
+
};
|
|
66
|
+
const _renderExtra = () => {
|
|
67
|
+
let controller = null;
|
|
68
|
+
if (numberSelector) {
|
|
69
|
+
controller = numberSelector;
|
|
70
|
+
} else {
|
|
71
|
+
if (isMinimalMode) {
|
|
72
|
+
controller = selectedIcon && selected ? /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-selector_card-selected-icon" }, selectedIcon) : null;
|
|
73
|
+
} else {
|
|
74
|
+
controller = isCorneredLayout ? null : trigger;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!controller) return null;
|
|
78
|
+
const controllerClass = (0, import_classnames.default)("pisell-selector_card-extra", {
|
|
79
|
+
"extra-horizontal": layout === "horizontal",
|
|
80
|
+
"extra-vertical": layout === "vertical"
|
|
81
|
+
});
|
|
82
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: controllerClass,
|
|
86
|
+
onClick: numberSelector ? stopPropagation : void 0
|
|
87
|
+
},
|
|
88
|
+
controller
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
const _renderCorneredTrigger = () => {
|
|
92
|
+
if (isMinimalMode || !isCorneredLayout || !trigger) return null;
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-selector_card-trigger-cornered" }, trigger);
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
onClick,
|
|
99
|
+
style,
|
|
100
|
+
className: (0, import_classnames.default)("pisell-selector_card-item", {
|
|
101
|
+
[`pisell-selector_card-item-${layout}`]: layout,
|
|
102
|
+
[`selected-${selectedTypeVariant}`]: selected,
|
|
103
|
+
bordered,
|
|
104
|
+
disabled,
|
|
105
|
+
"has-extra": numberSelector || trigger,
|
|
106
|
+
"cornered-layout": isCorneredLayout
|
|
107
|
+
})
|
|
108
|
+
},
|
|
109
|
+
_renderCorneredTrigger(),
|
|
110
|
+
_renderMainContent(),
|
|
111
|
+
_renderExtra()
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
var Card_default = CardItem;
|