@pisell/private-materials 6.5.12 → 6.5.14
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 +164 -148
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/actionButtons/index.js +15 -9
- package/es/components/booking/components/footer/index.js +2 -2
- package/es/components/booking/components/voucher/index.js +23 -19
- package/es/components/booking/forms/footer.js +4 -13
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/cartClientCard/index.js +7 -3
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +17 -12
- package/es/components/checkout/components/CashPaymentModule/index.js +9 -9
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +40 -22
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/list/List.d.ts +5 -0
- package/es/components/list/List.js +957 -0
- package/es/components/list/List.less +2 -0
- package/es/components/list/ResponsiveWrapper.d.ts +16 -0
- package/es/components/list/ResponsiveWrapper.js +130 -0
- package/es/components/list/TestResponsiveWrapper.d.ts +8 -0
- package/es/components/list/TestResponsiveWrapper.js +816 -0
- package/es/components/list/TestResponsiveWrapper.less +968 -0
- package/es/components/list/components/EmptyState/EmptyState.d.ts +20 -0
- package/es/components/list/components/EmptyState/EmptyState.js +75 -0
- package/es/components/list/components/EmptyState/EmptyState.less +121 -0
- package/es/components/list/components/EmptyState/index.d.ts +2 -0
- package/es/components/list/components/EmptyState/index.js +1 -0
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +13 -0
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.js +39 -0
- package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.less +29 -0
- package/es/components/list/components/ListItemSkeleton/index.d.ts +2 -0
- package/es/components/list/components/ListItemSkeleton/index.js +2 -0
- package/es/components/list/components/Pagination/Pagination.d.ts +30 -0
- package/es/components/list/components/Pagination/Pagination.js +240 -0
- package/es/components/list/components/Pagination/Pagination.less +439 -0
- package/es/components/list/components/Pagination/index.d.ts +1 -0
- package/es/components/list/components/Pagination/index.js +1 -0
- package/es/components/list/components/ScrollLoader/ScrollLoader.d.ts +18 -0
- package/es/components/list/components/ScrollLoader/ScrollLoader.js +18 -0
- package/es/components/list/components/ScrollLoader/ScrollLoader.less +3 -0
- package/es/components/list/components/ScrollLoader/index.d.ts +2 -0
- package/es/components/list/components/ScrollLoader/index.js +1 -0
- package/es/components/list/components/Tab/Tab.d.ts +5 -0
- package/es/components/list/components/Tab/Tab.js +43 -0
- package/es/components/list/components/Tab/Tab.less +139 -0
- package/es/components/list/components/Tab/index.d.ts +2 -0
- package/es/components/list/components/Tab/index.js +1 -0
- package/es/components/list/components/Tab/types.d.ts +14 -0
- package/es/components/list/components/Tab/types.js +1 -0
- package/es/components/list/components/TabSkeleton/TabSkeleton.d.ts +11 -0
- package/es/components/list/components/TabSkeleton/TabSkeleton.js +28 -0
- package/es/components/list/components/TabSkeleton/TabSkeleton.less +38 -0
- package/es/components/list/components/TabSkeleton/index.d.ts +2 -0
- package/es/components/list/components/TabSkeleton/index.js +2 -0
- package/es/components/list/components/WaterfallList/WaterfallList.d.ts +33 -0
- package/es/components/list/components/WaterfallList/WaterfallList.js +191 -0
- package/es/components/list/components/WaterfallList/WaterfallList.less +201 -0
- package/es/components/list/components/WaterfallList/index.d.ts +2 -0
- package/es/components/list/components/WaterfallList/index.js +1 -0
- package/es/components/list/examples/GroupedListExample.d.ts +3 -0
- package/es/components/list/examples/GroupedListExample.js +207 -0
- package/es/components/list/hooks/index.d.ts +5 -0
- package/es/components/list/hooks/index.js +3 -0
- package/es/components/list/hooks/useDevice.d.ts +24 -0
- package/es/components/list/hooks/useDevice.js +102 -0
- package/es/components/list/hooks/useListState.d.ts +43 -0
- package/es/components/list/hooks/useListState.js +176 -0
- package/es/components/list/hooks/useWaterfall.d.ts +34 -0
- package/es/components/list/hooks/useWaterfall.js +161 -0
- package/es/components/list/index.d.ts +10 -0
- package/es/components/list/index.js +7 -0
- package/es/components/list/locales.d.ts +66 -0
- package/es/components/list/locales.js +107 -0
- package/es/components/list/styles/base.less +39 -0
- package/es/components/list/styles/content.less +415 -0
- package/es/components/list/styles/floatButton.less +107 -0
- package/es/components/list/styles/footer.less +49 -0
- package/es/components/list/styles/header.less +69 -0
- package/es/components/list/styles/responsive.less +166 -0
- package/es/components/list/types.d.ts +177 -0
- package/es/components/list/types.js +1 -0
- package/es/components/list/utils/getText.d.ts +53 -0
- package/es/components/list/utils/getText.js +150 -0
- package/es/components/list/utils/index.d.ts +4 -0
- package/es/components/list/utils/index.js +5 -0
- package/es/components/pay/toB/store/hooks.js +19 -5
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +27 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +143 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.d.ts +7 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.js +7 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +41 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +115 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/types.js +273 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +50 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +130 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +20 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +32 -10
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +2 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -2
- package/es/components/ticketBooking/components/menuBar/index.d.ts +5 -1
- package/es/components/ticketBooking/components/menuBar/index.js +40 -17
- package/es/components/ticketBooking/components/menuBar/index.less +27 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +20 -10
- package/es/components/ticketBooking/components/timeBar/index.less +1 -0
- package/es/components/ticketBooking/context/IsActiveContext.d.ts +26 -0
- package/es/components/ticketBooking/context/IsActiveContext.js +37 -0
- package/es/components/ticketBooking/context/OsKeyContext.d.ts +26 -0
- package/es/components/ticketBooking/context/OsKeyContext.js +37 -0
- package/es/components/ticketBooking/context/index.d.ts +2 -0
- package/es/components/ticketBooking/context/index.js +2 -0
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +5 -0
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.js +13 -1
- package/es/components/ticketBooking/hooks/pisellos/index.d.ts +1 -0
- package/es/components/ticketBooking/hooks/pisellos/index.js +2 -1
- package/es/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +21 -0
- package/es/components/ticketBooking/hooks/pisellos/useActiveExecute.js +50 -0
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +12 -4
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.js +5 -2
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.js +7 -2
- package/es/components/ticketBooking/hooks/pisellos/useShopDiscountModule.d.ts +6 -0
- package/es/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +17 -0
- package/es/components/ticketBooking/index.d.ts +6 -0
- package/es/components/ticketBooking/index.js +86 -12
- package/es/components/ticketBooking/utils/index.d.ts +28 -1
- package/es/components/ticketBooking/utils/index.js +40 -0
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.less +8 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.less +17 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.js +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.less +2 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +7 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.js +100 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.less +8 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.js +32 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +7 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +239 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.less +44 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +7 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.less +14 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.js +33 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.less +30 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +4 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +75 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.less +46 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +7 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.js +39 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.less +9 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.js +53 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.less +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.js +58 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.less +11 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +7 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.js +85 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.less +24 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.js +121 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Price/index.less +57 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.js +95 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.less +18 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.js +47 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.less +13 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.js +95 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.less +18 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.js +31 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.less +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.js +34 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.less +13 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.js +39 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.less +22 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +3 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.js +20 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.less +20 -0
- package/es/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.d.ts +6 -0
- package/es/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.js +55 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +8 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.js +38 -0
- package/es/plus/productSelect/ProductCard/SkuCard/locales.d.ts +42 -0
- package/es/plus/productSelect/ProductCard/SkuCard/locales.js +41 -0
- package/es/plus/productSelect/ProductCard/SkuCard/status.d.ts +162 -0
- package/es/plus/productSelect/ProductCard/SkuCard/status.js +481 -0
- package/es/plus/productSelect/ProductCard/SkuCard/type.d.ts +298 -0
- package/es/plus/productSelect/ProductCard/SkuCard/type.js +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/utils.d.ts +9 -0
- package/es/plus/productSelect/ProductCard/SkuCard/utils.js +21 -0
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +2 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +7 -5
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +20 -10
- package/es/pro/priceKeyboard/components/cashKeyboard/index.less +1 -2
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/actionButtons/index.js +22 -17
- package/lib/components/booking/components/footer/index.js +2 -2
- package/lib/components/booking/components/voucher/index.js +33 -40
- package/lib/components/booking/forms/footer.js +7 -13
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/cartClientCard/index.js +7 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +15 -12
- package/lib/components/checkout/components/CashPaymentModule/index.js +0 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +61 -46
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/list/List.d.ts +5 -0
- package/lib/components/list/List.js +771 -0
- package/lib/components/list/List.less +2 -0
- package/lib/components/list/ResponsiveWrapper.d.ts +16 -0
- package/lib/components/list/ResponsiveWrapper.js +145 -0
- package/lib/components/list/TestResponsiveWrapper.d.ts +8 -0
- package/lib/components/list/TestResponsiveWrapper.js +493 -0
- package/lib/components/list/TestResponsiveWrapper.less +968 -0
- package/lib/components/list/components/EmptyState/EmptyState.d.ts +20 -0
- package/lib/components/list/components/EmptyState/EmptyState.js +75 -0
- package/lib/components/list/components/EmptyState/EmptyState.less +121 -0
- package/lib/components/list/components/EmptyState/index.d.ts +2 -0
- package/lib/components/list/components/EmptyState/index.js +35 -0
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +13 -0
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.js +75 -0
- package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.less +29 -0
- package/lib/components/list/components/ListItemSkeleton/index.d.ts +2 -0
- package/lib/components/list/components/ListItemSkeleton/index.js +41 -0
- package/lib/components/list/components/Pagination/Pagination.d.ts +30 -0
- package/lib/components/list/components/Pagination/Pagination.js +205 -0
- package/lib/components/list/components/Pagination/Pagination.less +439 -0
- package/lib/components/list/components/Pagination/index.d.ts +1 -0
- package/lib/components/list/components/Pagination/index.js +35 -0
- package/lib/components/list/components/ScrollLoader/ScrollLoader.d.ts +18 -0
- package/lib/components/list/components/ScrollLoader/ScrollLoader.js +37 -0
- package/lib/components/list/components/ScrollLoader/ScrollLoader.less +3 -0
- package/lib/components/list/components/ScrollLoader/index.d.ts +2 -0
- package/lib/components/list/components/ScrollLoader/index.js +35 -0
- package/lib/components/list/components/Tab/Tab.d.ts +5 -0
- package/lib/components/list/components/Tab/Tab.js +72 -0
- package/lib/components/list/components/Tab/Tab.less +139 -0
- package/lib/components/list/components/Tab/index.d.ts +2 -0
- package/lib/components/list/components/Tab/index.js +35 -0
- package/lib/components/list/components/Tab/types.d.ts +14 -0
- package/lib/components/list/components/Tab/types.js +17 -0
- package/lib/components/list/components/TabSkeleton/TabSkeleton.d.ts +11 -0
- package/lib/components/list/components/TabSkeleton/TabSkeleton.js +61 -0
- package/lib/components/list/components/TabSkeleton/TabSkeleton.less +38 -0
- package/lib/components/list/components/TabSkeleton/index.d.ts +2 -0
- package/lib/components/list/components/TabSkeleton/index.js +41 -0
- package/lib/components/list/components/WaterfallList/WaterfallList.d.ts +33 -0
- package/lib/components/list/components/WaterfallList/WaterfallList.js +178 -0
- package/lib/components/list/components/WaterfallList/WaterfallList.less +201 -0
- package/lib/components/list/components/WaterfallList/index.d.ts +2 -0
- package/lib/components/list/components/WaterfallList/index.js +35 -0
- package/lib/components/list/examples/GroupedListExample.d.ts +3 -0
- package/lib/components/list/examples/GroupedListExample.js +210 -0
- package/lib/components/list/hooks/index.d.ts +5 -0
- package/lib/components/list/hooks/index.js +47 -0
- package/lib/components/list/hooks/useDevice.d.ts +24 -0
- package/lib/components/list/hooks/useDevice.js +96 -0
- package/lib/components/list/hooks/useListState.d.ts +43 -0
- package/lib/components/list/hooks/useListState.js +149 -0
- package/lib/components/list/hooks/useWaterfall.d.ts +34 -0
- package/lib/components/list/hooks/useWaterfall.js +124 -0
- package/lib/components/list/index.d.ts +10 -0
- package/lib/components/list/index.js +60 -0
- package/lib/components/list/locales.d.ts +66 -0
- package/lib/components/list/locales.js +113 -0
- package/lib/components/list/styles/base.less +39 -0
- package/lib/components/list/styles/content.less +415 -0
- package/lib/components/list/styles/floatButton.less +107 -0
- package/lib/components/list/styles/footer.less +49 -0
- package/lib/components/list/styles/header.less +69 -0
- package/lib/components/list/styles/responsive.less +166 -0
- package/lib/components/list/types.d.ts +177 -0
- package/lib/components/list/types.js +17 -0
- package/lib/components/list/utils/getText.d.ts +53 -0
- package/lib/components/list/utils/getText.js +95 -0
- package/lib/components/list/utils/index.d.ts +4 -0
- package/lib/components/list/utils/index.js +43 -0
- package/lib/components/pay/toB/store/hooks.js +16 -8
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.d.ts +27 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +165 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.d.ts +7 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.js +45 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +41 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +115 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.js +247 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +50 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +100 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +20 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +36 -10
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +2 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +3 -2
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +5 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +24 -18
- package/lib/components/ticketBooking/components/menuBar/index.less +27 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +14 -9
- package/lib/components/ticketBooking/components/timeBar/index.less +1 -0
- package/lib/components/ticketBooking/context/IsActiveContext.d.ts +26 -0
- package/lib/components/ticketBooking/context/IsActiveContext.js +56 -0
- package/lib/components/ticketBooking/context/OsKeyContext.d.ts +26 -0
- package/lib/components/ticketBooking/context/OsKeyContext.js +56 -0
- package/lib/components/ticketBooking/context/index.d.ts +2 -0
- package/lib/components/ticketBooking/context/index.js +44 -0
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +5 -0
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.js +5 -1
- package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +1 -0
- package/lib/components/ticketBooking/hooks/pisellos/index.js +3 -1
- package/lib/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +21 -0
- package/lib/components/ticketBooking/hooks/pisellos/useActiveExecute.js +47 -0
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +17 -10
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.js +4 -2
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.js +6 -2
- package/lib/components/ticketBooking/hooks/pisellos/useShopDiscountModule.d.ts +6 -0
- package/lib/components/ticketBooking/hooks/pisellos/useShopDiscountModule.js +37 -0
- package/lib/components/ticketBooking/index.d.ts +6 -0
- package/lib/components/ticketBooking/index.js +69 -7
- package/lib/components/ticketBooking/utils/index.d.ts +28 -1
- package/lib/components/ticketBooking/utils/index.js +45 -2
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.less +8 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.less +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.js +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.less +2 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +7 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.js +129 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.less +8 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.js +52 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +7 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +178 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.less +44 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +7 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.js +52 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.less +14 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.js +63 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMoreText/index.less +30 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +4 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +131 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.less +46 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +7 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.js +62 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.less +9 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.js +78 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.less +31 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.js +94 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.less +11 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +7 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.js +115 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.less +24 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.js +139 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Price/index.less +57 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.js +97 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.less +18 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.js +58 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.js +56 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.less +13 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.js +97 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.less +18 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.js +51 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.less +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.js +56 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.less +13 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.js +58 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.less +22 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +3 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.js +49 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.less +20 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.d.ts +6 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.js +83 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +8 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.js +68 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/locales.d.ts +42 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/locales.js +65 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/status.d.ts +162 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/status.js +501 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/type.d.ts +298 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/type.js +17 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/utils.d.ts +9 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/utils.js +37 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +2 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +6 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +61 -27
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +1 -2
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/sku-card/meta.ts +1812 -0
- package/lowcode/sku-card/snippets.ts +372 -0
- package/lowcode/sku-list/meta.ts +410 -0
- package/package.json +1 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/**
|
|
8
|
+
* 格式化 SKU 数据源,适配 SkuCard 组件
|
|
9
|
+
*/
|
|
10
|
+
export var formatSkuDataSource = function formatSkuDataSource(dataSource) {
|
|
11
|
+
return {
|
|
12
|
+
id: dataSource.id,
|
|
13
|
+
title: dataSource.title,
|
|
14
|
+
subtitle: dataSource.subtitle,
|
|
15
|
+
cover: dataSource.cover,
|
|
16
|
+
price: dataSource.price,
|
|
17
|
+
original_price: dataSource.original_price,
|
|
18
|
+
stock: dataSource.stock_quantity,
|
|
19
|
+
sortKeys: ['title', 'subtitle', 'price']
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Tab 项接口定义(与 List 组件保持一致)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 产品分类信息接口
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 产品项接口
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 根据产品数据生成分类 Tabs(Switch 模式)
|
|
37
|
+
* 参考 TestResponsiveWrapper 的 generateSimpleTabItems 函数
|
|
38
|
+
*
|
|
39
|
+
* @param products 产品列表
|
|
40
|
+
* @param tabStyle tab 样式类型
|
|
41
|
+
* @returns TabItem 数组
|
|
42
|
+
*/
|
|
43
|
+
export var generateProductTabs = function generateProductTabs(products) {
|
|
44
|
+
var tabStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'switch';
|
|
45
|
+
if (!products || products.length === 0) {
|
|
46
|
+
return [{
|
|
47
|
+
key: 'all',
|
|
48
|
+
label: '全部'
|
|
49
|
+
}];
|
|
50
|
+
}
|
|
51
|
+
if (tabStyle === 'switch') {
|
|
52
|
+
// 切换模式:提取产品的分类信息,不显示动态数量
|
|
53
|
+
var categoryMap = new Map();
|
|
54
|
+
|
|
55
|
+
// 收集所有分类
|
|
56
|
+
products.forEach(function (product) {
|
|
57
|
+
if (product.category && Array.isArray(product.category)) {
|
|
58
|
+
product.category.forEach(function (cat) {
|
|
59
|
+
if (!categoryMap.has(cat.id)) {
|
|
60
|
+
categoryMap.set(cat.id, cat);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// 按 sort 字段排序(降序,sort 越大越靠前)
|
|
67
|
+
var sortedCategories = Array.from(categoryMap.values()).sort(function (a, b) {
|
|
68
|
+
return (b.sort || 0) - (a.sort || 0);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 生成 tabs
|
|
72
|
+
var tabs = [{
|
|
73
|
+
key: 'all',
|
|
74
|
+
label: '全部'
|
|
75
|
+
}];
|
|
76
|
+
sortedCategories.forEach(function (category) {
|
|
77
|
+
tabs.push({
|
|
78
|
+
key: String(category.id),
|
|
79
|
+
label: category.name,
|
|
80
|
+
group: String(category.id)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
return tabs;
|
|
84
|
+
} else {
|
|
85
|
+
// 锚点模式:基于实际数据统计数量
|
|
86
|
+
var categoryCount = products.reduce(function (acc, product) {
|
|
87
|
+
if (product.category && Array.isArray(product.category)) {
|
|
88
|
+
product.category.forEach(function (cat) {
|
|
89
|
+
var key = String(cat.id);
|
|
90
|
+
if (!acc[key]) {
|
|
91
|
+
acc[key] = {
|
|
92
|
+
count: 0,
|
|
93
|
+
category: cat
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
acc[key].count += 1;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return acc;
|
|
100
|
+
}, {});
|
|
101
|
+
|
|
102
|
+
// 生成 tabs
|
|
103
|
+
var _tabs = [{
|
|
104
|
+
key: 'all',
|
|
105
|
+
label: "\u5168\u90E8 (".concat(products.length, ")")
|
|
106
|
+
}];
|
|
107
|
+
|
|
108
|
+
// 按 sort 排序
|
|
109
|
+
var sortedEntries = Object.entries(categoryCount).sort(function (_ref, _ref2) {
|
|
110
|
+
var _ref3 = _slicedToArray(_ref, 2),
|
|
111
|
+
a = _ref3[1];
|
|
112
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
113
|
+
b = _ref4[1];
|
|
114
|
+
return (b.category.sort || 0) - (a.category.sort || 0);
|
|
115
|
+
});
|
|
116
|
+
sortedEntries.forEach(function (_ref5) {
|
|
117
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
118
|
+
key = _ref6[0],
|
|
119
|
+
_ref6$ = _ref6[1],
|
|
120
|
+
count = _ref6$.count,
|
|
121
|
+
category = _ref6$.category;
|
|
122
|
+
_tabs.push({
|
|
123
|
+
key: key,
|
|
124
|
+
label: "".concat(category.name, " (").concat(count, ")"),
|
|
125
|
+
group: key
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
return _tabs;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter';
|
|
1
2
|
import './index.less';
|
|
2
3
|
interface AddServiceProps {
|
|
3
4
|
onEdit?: any;
|
|
@@ -5,6 +6,25 @@ interface AddServiceProps {
|
|
|
5
6
|
state?: any;
|
|
6
7
|
renderMode?: 'current' | 'drawer';
|
|
7
8
|
onPrerenderComplete?: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* 产品展示配置
|
|
11
|
+
*
|
|
12
|
+
* 支持两种方式:
|
|
13
|
+
* 1. 简易模式:传入预设字符串,如 'product-select', 'sku-list-a1', 'sku-list-a2', 'sku-list-a5'
|
|
14
|
+
* 2. 完整配置模式:传入完整的配置对象
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // 简易模式
|
|
18
|
+
* <AddService productDisplayConfig="sku-list-a1" />
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // 完整配置模式
|
|
22
|
+
* <AddService productDisplayConfig={{
|
|
23
|
+
* displayMode: 'sku-list',
|
|
24
|
+
* skuListConfig: { ... }
|
|
25
|
+
* }} />
|
|
26
|
+
*/
|
|
27
|
+
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
8
28
|
}
|
|
9
29
|
declare const AddSerivce: (props: AddServiceProps) => JSX.Element | null;
|
|
10
30
|
export default AddSerivce;
|
|
@@ -26,7 +26,7 @@ import { getProductExtend } from "../../../booking/info2/service/addService/util
|
|
|
26
26
|
import { holderId, isDaysBooking, isNormalProductByDurationSchedule } from "../../../booking/info/service2/utils";
|
|
27
27
|
import { isBooking4Shop } from "../../../booking/info/utils";
|
|
28
28
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
29
|
-
import
|
|
29
|
+
import ProductDisplayAdapter, { resolveProductDisplayConfig } from "../ProductDisplayAdapter";
|
|
30
30
|
import "./index.less";
|
|
31
31
|
import { addService, addServiceScroll, createSimpleCacheItem, genServiceKey, getIsShowNumber, isSameProduct } from "../../utils";
|
|
32
32
|
import NotAvailable from "../notAvailable";
|
|
@@ -34,6 +34,7 @@ import dayjs from 'dayjs';
|
|
|
34
34
|
import { useProducts } from "../../hooks/pisellos";
|
|
35
35
|
import { createCacheItem, genValues, isBundle, isOption, setHandleSetService } from "./utils";
|
|
36
36
|
import { useToast } from '@pisell/materials';
|
|
37
|
+
import { useIsActive } from "../../context/IsActiveContext";
|
|
37
38
|
var productListLayout = {
|
|
38
39
|
grid: true,
|
|
39
40
|
config: '12:12'
|
|
@@ -53,11 +54,13 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
53
54
|
dispatch = props.dispatch,
|
|
54
55
|
_props$renderMode = props.renderMode,
|
|
55
56
|
renderMode = _props$renderMode === void 0 ? 'current' : _props$renderMode,
|
|
56
|
-
onPrerenderComplete = props.onPrerenderComplete
|
|
57
|
+
onPrerenderComplete = props.onPrerenderComplete,
|
|
58
|
+
productDisplayConfig = props.productDisplayConfig;
|
|
57
59
|
var context = useEngineContext();
|
|
58
60
|
var notAvailableRef = useRef(null);
|
|
59
61
|
var isLoadedServiceRef = useRef(false);
|
|
60
62
|
request.setRequest(context.appHelper.utils.request);
|
|
63
|
+
var isActive = useIsActive();
|
|
61
64
|
var Toast = useToast();
|
|
62
65
|
var _useService = useService({
|
|
63
66
|
renderMode: renderMode,
|
|
@@ -172,8 +175,10 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
172
175
|
});
|
|
173
176
|
});
|
|
174
177
|
useMemo(function () {
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
if (isActive) {
|
|
179
|
+
setHandleSetService(scanAddService);
|
|
180
|
+
}
|
|
181
|
+
}, [isActive]);
|
|
177
182
|
|
|
178
183
|
/*
|
|
179
184
|
const removeNotAvailableService = (list: any) => {
|
|
@@ -577,20 +582,37 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
577
582
|
});
|
|
578
583
|
}
|
|
579
584
|
}, [renderMode, currentDate, customerId, menuList, currentDatetime]);
|
|
585
|
+
|
|
586
|
+
// 产品展示配置,支持字符串预设或完整配置对象
|
|
587
|
+
var finalDisplayConfig = useMemo(function () {
|
|
588
|
+
// 解析配置(支持字符串或对象)
|
|
589
|
+
var resolvedConfig = resolveProductDisplayConfig(productDisplayConfig);
|
|
590
|
+
|
|
591
|
+
// 如果是 ProductSelect 模式,合并默认的 layout 和 setting
|
|
592
|
+
if (resolvedConfig.displayMode === 'product-select') {
|
|
593
|
+
var _resolvedConfig$produ, _resolvedConfig$produ2;
|
|
594
|
+
return _objectSpread(_objectSpread({}, resolvedConfig), {}, {
|
|
595
|
+
productSelectConfig: _objectSpread(_objectSpread({}, resolvedConfig.productSelectConfig), {}, {
|
|
596
|
+
layout: ((_resolvedConfig$produ = resolvedConfig.productSelectConfig) === null || _resolvedConfig$produ === void 0 ? void 0 : _resolvedConfig$produ.layout) || productListLayout,
|
|
597
|
+
productListSetting: ((_resolvedConfig$produ2 = resolvedConfig.productSelectConfig) === null || _resolvedConfig$produ2 === void 0 ? void 0 : _resolvedConfig$produ2.productListSetting) || productListSetting
|
|
598
|
+
})
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
return resolvedConfig;
|
|
602
|
+
}, [productDisplayConfig]);
|
|
580
603
|
return useMemo(function () {
|
|
581
604
|
if (renderMode === 'current') {
|
|
582
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
605
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProductDisplayAdapter, {
|
|
606
|
+
config: finalDisplayConfig,
|
|
583
607
|
dataSource: renderList,
|
|
584
|
-
layout: productListLayout,
|
|
585
|
-
onChange: handleSelectProduct,
|
|
586
|
-
value: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.id,
|
|
587
608
|
loading: !renderList.length && loading,
|
|
588
|
-
|
|
609
|
+
currentProductId: currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.id,
|
|
610
|
+
onSelectProduct: handleSelectProduct
|
|
589
611
|
}), /*#__PURE__*/React.createElement(NotAvailable, {
|
|
590
612
|
ref: notAvailableRef
|
|
591
613
|
}));
|
|
592
614
|
}
|
|
593
615
|
return null;
|
|
594
|
-
}, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
|
|
616
|
+
}, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4, finalDisplayConfig]);
|
|
595
617
|
};
|
|
596
618
|
export default AddSerivce;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
|
|
1
2
|
interface AddServiceVariantProps {
|
|
2
3
|
globalState: any;
|
|
3
4
|
setGlobalState: any;
|
|
4
5
|
onPrerenderComplete?: () => void;
|
|
6
|
+
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
5
7
|
}
|
|
6
8
|
declare const AddServiceVariant: (props: AddServiceVariantProps) => JSX.Element;
|
|
7
9
|
export default AddServiceVariant;
|
|
@@ -9,7 +9,8 @@ import AddService from "./addService";
|
|
|
9
9
|
var AddServiceVariant = function AddServiceVariant(props) {
|
|
10
10
|
var globalState = props.globalState,
|
|
11
11
|
setGlobalState = props.setGlobalState,
|
|
12
|
-
onPrerenderComplete = props.onPrerenderComplete
|
|
12
|
+
onPrerenderComplete = props.onPrerenderComplete,
|
|
13
|
+
productDisplayConfig = props.productDisplayConfig;
|
|
13
14
|
var stateRef = useRef(globalState);
|
|
14
15
|
stateRef.current = globalState;
|
|
15
16
|
var dispatch = function dispatch(_ref) {
|
|
@@ -24,7 +25,8 @@ var AddServiceVariant = function AddServiceVariant(props) {
|
|
|
24
25
|
return /*#__PURE__*/React.createElement(AddService, {
|
|
25
26
|
state: globalState,
|
|
26
27
|
dispatch: dispatch,
|
|
27
|
-
onPrerenderComplete: onPrerenderComplete
|
|
28
|
+
onPrerenderComplete: onPrerenderComplete,
|
|
29
|
+
productDisplayConfig: productDisplayConfig
|
|
28
30
|
});
|
|
29
31
|
};
|
|
30
32
|
export default AddServiceVariant;
|
|
@@ -4,9 +4,33 @@ import "./index.less";
|
|
|
4
4
|
import { Menu } from 'antd';
|
|
5
5
|
import { SettingOutlined } from '@ant-design/icons';
|
|
6
6
|
import { locales } from '@pisell/utils';
|
|
7
|
-
import { ConfigProvider } from '@pisell/materials';
|
|
8
|
-
var index = function index() {
|
|
7
|
+
import { ConfigProvider, Iconfont } from '@pisell/materials';
|
|
8
|
+
var index = function index(props) {
|
|
9
|
+
var _props$activeNavKey = props.activeNavKey,
|
|
10
|
+
activeNavKey = _props$activeNavKey === void 0 ? 'ticket' : _props$activeNavKey,
|
|
11
|
+
onNavChange = props.onNavChange;
|
|
9
12
|
var status = useNetworkStatus();
|
|
13
|
+
|
|
14
|
+
// 导航项配置
|
|
15
|
+
var navItems = [{
|
|
16
|
+
key: 'ticket',
|
|
17
|
+
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
18
|
+
type: "pisell2-ticket",
|
|
19
|
+
style: {
|
|
20
|
+
fontSize: 32
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
label: ''
|
|
24
|
+
}, {
|
|
25
|
+
key: 'food',
|
|
26
|
+
label: '',
|
|
27
|
+
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
28
|
+
type: "pisell2-food",
|
|
29
|
+
style: {
|
|
30
|
+
fontSize: 32
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}];
|
|
10
34
|
var items = [{
|
|
11
35
|
key: '1',
|
|
12
36
|
icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
|
|
@@ -43,6 +67,11 @@ var index = function index() {
|
|
|
43
67
|
window.location.href = '/login';
|
|
44
68
|
}
|
|
45
69
|
};
|
|
70
|
+
|
|
71
|
+
// 处理导航项点击
|
|
72
|
+
var handleNavClick = function handleNavClick(key) {
|
|
73
|
+
onNavChange === null || onNavChange === void 0 || onNavChange(key);
|
|
74
|
+
};
|
|
46
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
76
|
className: "pisell-ticket-booking-menu-bar"
|
|
48
77
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -58,21 +87,15 @@ var index = function index() {
|
|
|
58
87
|
fill: "#8157D5"
|
|
59
88
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
60
89
|
className: "nav-wrapper"
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, /*#__PURE__*/React.createElement("
|
|
70
|
-
d: "M13.8 7.05078V5.48828M13.8 14.082V12.5195M13.8 21.1133V19.5508M6.12 0.800781H27.88C29.6722 0.800781 30.5683 0.800781 31.2528 1.14139C31.8549 1.44099 32.3444 1.91905 32.6512 2.50706C33 3.17554 33 4.05062 33 5.80078V7.83203C29.9072 7.83203 27.4 10.2805 27.4 13.3008C27.4 16.3211 29.9072 18.7695 33 18.7695V20.8008C33 22.5509 33 23.426 32.6512 24.0945C32.3444 24.6825 31.8549 25.1606 31.2528 25.4602C30.5683 25.8008 29.6722 25.8008 27.88 25.8008H6.12C4.32783 25.8008 3.43175 25.8008 2.74723 25.4602C2.14511 25.1606 1.65557 24.6825 1.34878 24.0945C1 23.426 1 22.5509 1 20.8008V18.7695C4.09279 18.7695 6.6 16.3211 6.6 13.3008C6.6 10.2805 4.09279 7.83203 1 7.83203V5.80078C1 4.05062 1 3.17554 1.34878 2.50706C1.65557 1.91905 2.14511 1.44099 2.74723 1.14139C3.43175 0.800781 4.32783 0.800781 6.12 0.800781Z",
|
|
71
|
-
stroke: "white",
|
|
72
|
-
"stroke-width": "1.5",
|
|
73
|
-
"stroke-linecap": "round",
|
|
74
|
-
"stroke-linejoin": "round"
|
|
75
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
}, navItems.map(function (navItem) {
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
key: navItem.key,
|
|
93
|
+
className: "nav-item ".concat(activeNavKey === navItem.key ? 'active' : ''),
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return handleNavClick(navItem.key);
|
|
96
|
+
}
|
|
97
|
+
}, navItem.icon && navItem.icon, navItem.label && navItem.label);
|
|
98
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
76
99
|
className: "menu-wrapper"
|
|
77
100
|
}, /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
78
101
|
theme: {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-direction: column;
|
|
30
30
|
align-items: center;
|
|
31
|
+
gap: 12px;
|
|
31
32
|
|
|
32
33
|
.nav-item {
|
|
33
34
|
cursor: pointer;
|
|
@@ -38,10 +39,35 @@
|
|
|
38
39
|
justify-content: center;
|
|
39
40
|
align-items: center;
|
|
40
41
|
position: relative;
|
|
41
|
-
background:
|
|
42
|
+
background: transparent;
|
|
43
|
+
color: rgba(255, 255, 255, 0.75);
|
|
44
|
+
transition: all 0.3s ease;
|
|
45
|
+
|
|
46
|
+
svg {
|
|
47
|
+
transition: all 0.3s ease;
|
|
48
|
+
|
|
49
|
+
path {
|
|
50
|
+
stroke: rgba(255, 255, 255, 0.75);
|
|
51
|
+
transition: all 0.3s ease;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
background: rgba(129, 87, 213, 0.1);
|
|
57
|
+
color: rgba(255, 255, 255, 0.95);
|
|
58
|
+
|
|
59
|
+
svg path {
|
|
60
|
+
stroke: rgba(255, 255, 255, 0.95);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
42
63
|
|
|
43
64
|
&.active {
|
|
44
65
|
background: #8157d5;
|
|
66
|
+
color: #ffffff;
|
|
67
|
+
|
|
68
|
+
svg path {
|
|
69
|
+
stroke: #ffffff;
|
|
70
|
+
}
|
|
45
71
|
|
|
46
72
|
&::before {
|
|
47
73
|
display: block;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import './index.less';
|
|
2
|
+
import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
|
|
2
3
|
export declare const _formatBookingDetail: (data: any, modalState: any) => any;
|
|
3
4
|
interface TicketBookingProps {
|
|
4
5
|
onPrerenderComplete?: () => void;
|
|
6
|
+
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
7
|
+
isShowTimeBar?: boolean;
|
|
8
|
+
isShowFloatButtons?: boolean;
|
|
5
9
|
}
|
|
6
10
|
declare const TicketBooking: (props: TicketBookingProps) => JSX.Element;
|
|
7
11
|
export default TicketBooking;
|
|
@@ -49,6 +49,8 @@ import { useCustomer } from "../../hooks/pisellos";
|
|
|
49
49
|
import { useMemoizedFn } from 'ahooks';
|
|
50
50
|
import useScanManager from "../../hooks/pisellos/useScanManager";
|
|
51
51
|
import { useDebounceFn } from 'ahooks';
|
|
52
|
+
import { useIsActive } from "../../context/IsActiveContext";
|
|
53
|
+
import { useShopDiscountModule } from "../../hooks/pisellos/useShopDiscountModule";
|
|
52
54
|
export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
|
53
55
|
var _bookings$list, _bookings$list2;
|
|
54
56
|
var customer_id = data.customer_id,
|
|
@@ -220,7 +222,12 @@ var formatProductValues = function formatProductValues(data) {
|
|
|
220
222
|
};
|
|
221
223
|
var TicketBooking = function TicketBooking(props) {
|
|
222
224
|
var _engineContext$appHel2, _state$modalState2, _state$modalState4;
|
|
223
|
-
var onPrerenderComplete = props.onPrerenderComplete
|
|
225
|
+
var onPrerenderComplete = props.onPrerenderComplete,
|
|
226
|
+
productDisplayConfig = props.productDisplayConfig,
|
|
227
|
+
_props$isShowTimeBar = props.isShowTimeBar,
|
|
228
|
+
isShowTimeBar = _props$isShowTimeBar === void 0 ? true : _props$isShowTimeBar,
|
|
229
|
+
_props$isShowFloatBut = props.isShowFloatButtons,
|
|
230
|
+
isShowFloatButtons = _props$isShowFloatBut === void 0 ? true : _props$isShowFloatBut;
|
|
224
231
|
var _useStore = useStore(),
|
|
225
232
|
_useStore2 = _slicedToArray(_useStore, 2),
|
|
226
233
|
state = _useStore2[0],
|
|
@@ -255,6 +262,8 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
255
262
|
setShowTerminalUpgradeModal = _useState4[1];
|
|
256
263
|
var pisellFloatingPanelRef = useRef(null);
|
|
257
264
|
var closeRef = useRef(null);
|
|
265
|
+
var shopDiscount = useShopDiscountModule();
|
|
266
|
+
var isActive = useIsActive();
|
|
258
267
|
var bookingTicket = useBookingTicket();
|
|
259
268
|
var _useScanGlobal = useScanGlobal(),
|
|
260
269
|
openScan = _useScanGlobal.openScan,
|
|
@@ -303,16 +312,16 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
303
312
|
}
|
|
304
313
|
}
|
|
305
314
|
});
|
|
306
|
-
useMemo(function () {
|
|
307
|
-
openScan(function (data) {
|
|
308
|
-
handleScan(data);
|
|
309
|
-
});
|
|
310
|
-
}, []);
|
|
311
315
|
useEffect(function () {
|
|
316
|
+
if (isActive) {
|
|
317
|
+
openScan(function (data) {
|
|
318
|
+
handleScan(data);
|
|
319
|
+
});
|
|
320
|
+
}
|
|
312
321
|
return function () {
|
|
313
322
|
closeScan();
|
|
314
323
|
};
|
|
315
|
-
}, []);
|
|
324
|
+
}, [isActive]);
|
|
316
325
|
var _useDebounceFn = useDebounceFn(function (type, orderId) {
|
|
317
326
|
// 支付成功后清空状态
|
|
318
327
|
try {
|
|
@@ -1266,10 +1275,11 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
1266
1275
|
productExtensionType: state.productExtensionType,
|
|
1267
1276
|
isBookingTicket2: true
|
|
1268
1277
|
}),
|
|
1269
|
-
setGlobalState: _setModalState
|
|
1270
|
-
|
|
1278
|
+
setGlobalState: _setModalState,
|
|
1279
|
+
productDisplayConfig: productDisplayConfig
|
|
1280
|
+
}), isShowFloatButtons && /*#__PURE__*/React.createElement(FloatButtons, {
|
|
1271
1281
|
items: floatButtons
|
|
1272
|
-
})), /*#__PURE__*/React.createElement(TimeBar, {
|
|
1282
|
+
})), isShowTimeBar && /*#__PURE__*/React.createElement(TimeBar, {
|
|
1273
1283
|
onCreateClick: handleCreateClick,
|
|
1274
1284
|
setGlobalState: setState,
|
|
1275
1285
|
globalState: state,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* IsActive Context
|
|
4
|
+
* 用于在 TicketBooking 组件树中提供 isActive 状态
|
|
5
|
+
* isActive 用于标识当前组件是否处于激活状态
|
|
6
|
+
*/
|
|
7
|
+
interface IsActiveContextType {
|
|
8
|
+
/** 是否激活 */
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const IsActiveContext: React.Context<IsActiveContextType>;
|
|
12
|
+
interface IsActiveProviderProps {
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* IsActive Provider
|
|
18
|
+
* 提供 isActive 给子组件使用
|
|
19
|
+
*/
|
|
20
|
+
export declare const IsActiveProvider: React.FC<IsActiveProviderProps>;
|
|
21
|
+
/**
|
|
22
|
+
* useIsActive Hook
|
|
23
|
+
* 在子组件中使用此 hook 获取 isActive 状态
|
|
24
|
+
*/
|
|
25
|
+
export declare const useIsActive: () => boolean;
|
|
26
|
+
export default IsActiveContext;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* IsActive Context
|
|
5
|
+
* 用于在 TicketBooking 组件树中提供 isActive 状态
|
|
6
|
+
* isActive 用于标识当前组件是否处于激活状态
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var IsActiveContext = /*#__PURE__*/createContext({
|
|
10
|
+
isActive: true
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* IsActive Provider
|
|
14
|
+
* 提供 isActive 给子组件使用
|
|
15
|
+
*/
|
|
16
|
+
export var IsActiveProvider = function IsActiveProvider(_ref) {
|
|
17
|
+
var isActive = _ref.isActive,
|
|
18
|
+
children = _ref.children;
|
|
19
|
+
return /*#__PURE__*/React.createElement(IsActiveContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
isActive: isActive
|
|
22
|
+
}
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* useIsActive Hook
|
|
28
|
+
* 在子组件中使用此 hook 获取 isActive 状态
|
|
29
|
+
*/
|
|
30
|
+
export var useIsActive = function useIsActive() {
|
|
31
|
+
var context = useContext(IsActiveContext);
|
|
32
|
+
if (!context) {
|
|
33
|
+
throw new Error('useIsActive must be used within an IsActiveProvider');
|
|
34
|
+
}
|
|
35
|
+
return context.isActive;
|
|
36
|
+
};
|
|
37
|
+
export default IsActiveContext;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* OsKey Context
|
|
4
|
+
* 用于在 TicketBooking 组件树中提供 pisellos 的 osKey
|
|
5
|
+
* osKey 用于区分不同页面使用同一个组件时的模块标识
|
|
6
|
+
*/
|
|
7
|
+
interface OsKeyContextType {
|
|
8
|
+
/** pisellos 模块的唯一标识 */
|
|
9
|
+
osKey: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const OsKeyContext: React.Context<OsKeyContextType>;
|
|
12
|
+
interface OsKeyProviderProps {
|
|
13
|
+
osKey: string | undefined;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* OsKey Provider
|
|
18
|
+
* 提供 osKey 给子组件使用
|
|
19
|
+
*/
|
|
20
|
+
export declare const OsKeyProvider: React.FC<OsKeyProviderProps>;
|
|
21
|
+
/**
|
|
22
|
+
* useOsKey Hook
|
|
23
|
+
* 在子组件中使用此 hook 获取 osKey
|
|
24
|
+
*/
|
|
25
|
+
export declare const useOsKey: () => string | undefined;
|
|
26
|
+
export default OsKeyContext;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OsKey Context
|
|
5
|
+
* 用于在 TicketBooking 组件树中提供 pisellos 的 osKey
|
|
6
|
+
* osKey 用于区分不同页面使用同一个组件时的模块标识
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var OsKeyContext = /*#__PURE__*/createContext({
|
|
10
|
+
osKey: undefined
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* OsKey Provider
|
|
14
|
+
* 提供 osKey 给子组件使用
|
|
15
|
+
*/
|
|
16
|
+
export var OsKeyProvider = function OsKeyProvider(_ref) {
|
|
17
|
+
var osKey = _ref.osKey,
|
|
18
|
+
children = _ref.children;
|
|
19
|
+
return /*#__PURE__*/React.createElement(OsKeyContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
osKey: osKey
|
|
22
|
+
}
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* useOsKey Hook
|
|
28
|
+
* 在子组件中使用此 hook 获取 osKey
|
|
29
|
+
*/
|
|
30
|
+
export var useOsKey = function useOsKey() {
|
|
31
|
+
var context = useContext(OsKeyContext);
|
|
32
|
+
if (!context) {
|
|
33
|
+
throw new Error('useOsKey must be used within an OsKeyProvider');
|
|
34
|
+
}
|
|
35
|
+
return context.osKey;
|
|
36
|
+
};
|
|
37
|
+
export default OsKeyContext;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { usePisellOS } from "../../../../hooks/useEngineContext";
|
|
2
|
+
import { useOsKey } from "../../context/OsKeyContext";
|
|
3
|
+
import { getBookingTicketKey } from "../../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* useBookingTicket Hook
|
|
7
|
+
* 获取当前 TicketBooking 实例对应的 BookingTicket 模块
|
|
8
|
+
* 通过 osKey 区分不同页面的模块实例
|
|
9
|
+
*/
|
|
2
10
|
export var useBookingTicket = function useBookingTicket() {
|
|
3
11
|
var pisellOS = usePisellOS();
|
|
4
|
-
|
|
12
|
+
var osKey = useOsKey();
|
|
13
|
+
|
|
14
|
+
// 根据 osKey 生成模块名称
|
|
15
|
+
var moduleKey = getBookingTicketKey(osKey || '');
|
|
16
|
+
return pisellOS.getModule(moduleKey);
|
|
5
17
|
};
|