@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,207 @@
|
|
|
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
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { List } from "../index";
|
|
9
|
+
|
|
10
|
+
// 示例数据接口
|
|
11
|
+
|
|
12
|
+
// 示例组件:门票列表展示
|
|
13
|
+
var GroupedListExample = function GroupedListExample() {
|
|
14
|
+
// 模拟门票数据 - 使用 ticketType 字段进行分组
|
|
15
|
+
var mockTicketData = [{
|
|
16
|
+
id: '1',
|
|
17
|
+
title: '2hrs upgrade Unlimited',
|
|
18
|
+
description: 'Adult Day',
|
|
19
|
+
price: 90,
|
|
20
|
+
duration: '2 h',
|
|
21
|
+
ticketType: 'all-access',
|
|
22
|
+
category: 'Adult Day Pass'
|
|
23
|
+
}, {
|
|
24
|
+
id: '2',
|
|
25
|
+
title: '2hrs upgrade Unlimited',
|
|
26
|
+
description: 'Kid Day',
|
|
27
|
+
price: 90,
|
|
28
|
+
duration: '2 h',
|
|
29
|
+
ticketType: 'all-access',
|
|
30
|
+
category: 'Kids Day Pass'
|
|
31
|
+
}, {
|
|
32
|
+
id: '3',
|
|
33
|
+
title: '2hrs upgrade Unlimited',
|
|
34
|
+
description: 'Family Package',
|
|
35
|
+
price: 90,
|
|
36
|
+
duration: '2 h',
|
|
37
|
+
ticketType: 'all-access',
|
|
38
|
+
category: 'Family Pass'
|
|
39
|
+
}, {
|
|
40
|
+
id: '4',
|
|
41
|
+
title: 'Child Ticket - Morning',
|
|
42
|
+
description: 'Special price for children',
|
|
43
|
+
price: 45,
|
|
44
|
+
duration: '4 h',
|
|
45
|
+
ticketType: 'child',
|
|
46
|
+
category: 'Morning Session'
|
|
47
|
+
}, {
|
|
48
|
+
id: '5',
|
|
49
|
+
title: 'Child Ticket - Afternoon',
|
|
50
|
+
description: 'Afternoon activities',
|
|
51
|
+
price: 45,
|
|
52
|
+
duration: '4 h',
|
|
53
|
+
ticketType: 'child',
|
|
54
|
+
category: 'Afternoon Session'
|
|
55
|
+
}, {
|
|
56
|
+
id: '6',
|
|
57
|
+
title: 'Adult Standard',
|
|
58
|
+
description: 'Standard adult admission',
|
|
59
|
+
price: 70,
|
|
60
|
+
duration: '6 h',
|
|
61
|
+
ticketType: 'adult',
|
|
62
|
+
category: 'Standard Admission'
|
|
63
|
+
}, {
|
|
64
|
+
id: '7',
|
|
65
|
+
title: 'Adult Premium',
|
|
66
|
+
description: 'Premium experience',
|
|
67
|
+
price: 120,
|
|
68
|
+
duration: '8 h',
|
|
69
|
+
ticketType: 'adult',
|
|
70
|
+
category: 'Premium Experience'
|
|
71
|
+
}, {
|
|
72
|
+
id: '8',
|
|
73
|
+
title: 'Special Event',
|
|
74
|
+
description: 'Limited time offer',
|
|
75
|
+
price: 150,
|
|
76
|
+
duration: '3 h',
|
|
77
|
+
ticketType: 'category5',
|
|
78
|
+
category: 'Special Event'
|
|
79
|
+
}];
|
|
80
|
+
|
|
81
|
+
// Tab配置,group值对应数据中 ticketType 字段的值
|
|
82
|
+
var tabItems = [{
|
|
83
|
+
key: 'all-access',
|
|
84
|
+
label: "All-Access Ticket (".concat(mockTicketData.filter(function (item) {
|
|
85
|
+
return item.ticketType === 'all-access';
|
|
86
|
+
}).length, ")"),
|
|
87
|
+
group: 'all-access'
|
|
88
|
+
}, {
|
|
89
|
+
key: 'child',
|
|
90
|
+
label: "Child Ticket (".concat(mockTicketData.filter(function (item) {
|
|
91
|
+
return item.ticketType === 'child';
|
|
92
|
+
}).length, ")"),
|
|
93
|
+
group: 'child'
|
|
94
|
+
}, {
|
|
95
|
+
key: 'adult',
|
|
96
|
+
label: "Adult Ticket (".concat(mockTicketData.filter(function (item) {
|
|
97
|
+
return item.ticketType === 'adult';
|
|
98
|
+
}).length, ")"),
|
|
99
|
+
group: 'adult'
|
|
100
|
+
}, {
|
|
101
|
+
key: 'category5',
|
|
102
|
+
label: "Category 5 (".concat(mockTicketData.filter(function (item) {
|
|
103
|
+
return item.ticketType === 'category5';
|
|
104
|
+
}).length, ")"),
|
|
105
|
+
group: 'category5'
|
|
106
|
+
}];
|
|
107
|
+
|
|
108
|
+
// 状态管理
|
|
109
|
+
var _useState = useState(mockTicketData),
|
|
110
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
111
|
+
currentData = _useState2[0];
|
|
112
|
+
var _useState3 = useState(false),
|
|
113
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
114
|
+
loading = _useState4[0];
|
|
115
|
+
|
|
116
|
+
// 自定义渲染每个门票项
|
|
117
|
+
var renderTicketItem = function renderTicketItem(item, index) {
|
|
118
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
key: item.id,
|
|
120
|
+
style: {
|
|
121
|
+
background: '#FFF',
|
|
122
|
+
borderRadius: '12px',
|
|
123
|
+
padding: '16px',
|
|
124
|
+
border: '1px solid #E4E7EC',
|
|
125
|
+
boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.05)',
|
|
126
|
+
height: '160px',
|
|
127
|
+
display: 'flex',
|
|
128
|
+
flexDirection: 'column',
|
|
129
|
+
justifyContent: 'space-between'
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
style: {
|
|
133
|
+
height: '60px',
|
|
134
|
+
background: "linear-gradient(135deg, ".concat(item.ticketType === 'all-access' ? '#8157D5, #B794F6' : item.ticketType === 'child' ? '#F56565, #FC8181' : item.ticketType === 'adult' ? '#4299E1, #63B3ED' : '#ED8936, #F6AD55', ")"),
|
|
135
|
+
borderRadius: '8px',
|
|
136
|
+
marginBottom: '12px',
|
|
137
|
+
display: 'flex',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
justifyContent: 'center',
|
|
140
|
+
color: 'white',
|
|
141
|
+
fontWeight: 'bold',
|
|
142
|
+
fontSize: '18px'
|
|
143
|
+
}
|
|
144
|
+
}, item.description), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", {
|
|
145
|
+
style: {
|
|
146
|
+
fontSize: '16px',
|
|
147
|
+
fontWeight: '600',
|
|
148
|
+
margin: '0 0 4px 0',
|
|
149
|
+
color: '#101828'
|
|
150
|
+
}
|
|
151
|
+
}, item.title), /*#__PURE__*/React.createElement("p", {
|
|
152
|
+
style: {
|
|
153
|
+
fontSize: '14px',
|
|
154
|
+
color: '#667085',
|
|
155
|
+
margin: '0 0 8px 0'
|
|
156
|
+
}
|
|
157
|
+
}, item.duration), /*#__PURE__*/React.createElement("p", {
|
|
158
|
+
style: {
|
|
159
|
+
fontSize: '18px',
|
|
160
|
+
fontWeight: '700',
|
|
161
|
+
color: '#101828',
|
|
162
|
+
margin: 0
|
|
163
|
+
}
|
|
164
|
+
}, "A$ ", item.price)));
|
|
165
|
+
};
|
|
166
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
style: {
|
|
168
|
+
padding: '20px',
|
|
169
|
+
maxWidth: '1200px',
|
|
170
|
+
margin: '0 auto'
|
|
171
|
+
}
|
|
172
|
+
}, /*#__PURE__*/React.createElement("h1", {
|
|
173
|
+
style: {
|
|
174
|
+
marginBottom: '20px',
|
|
175
|
+
color: '#101828'
|
|
176
|
+
}
|
|
177
|
+
}, "\u95E8\u7968\u5206\u7EC4\u5C55\u793A\u793A\u4F8B"), /*#__PURE__*/React.createElement(List, {
|
|
178
|
+
data: currentData,
|
|
179
|
+
tabData: tabItems,
|
|
180
|
+
tabGroup: "ticketType" // 指定使用 ticketType 字段进行分组
|
|
181
|
+
,
|
|
182
|
+
tabStyle: "anchor",
|
|
183
|
+
displayStyle: "grid",
|
|
184
|
+
layoutDirection: "vertical",
|
|
185
|
+
columns: 2,
|
|
186
|
+
rows: 2,
|
|
187
|
+
columnGap: 16,
|
|
188
|
+
rowGap: 16,
|
|
189
|
+
height: "600px",
|
|
190
|
+
renderItem: renderTicketItem,
|
|
191
|
+
loading: loading,
|
|
192
|
+
emptyConfig: {
|
|
193
|
+
show: true,
|
|
194
|
+
text: '暂无门票数据',
|
|
195
|
+
description: '请稍后再试'
|
|
196
|
+
},
|
|
197
|
+
className: "ticket-list-example"
|
|
198
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
style: {
|
|
200
|
+
marginTop: '20px',
|
|
201
|
+
padding: '16px',
|
|
202
|
+
background: '#F8F9FA',
|
|
203
|
+
borderRadius: '8px'
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/React.createElement("h3", null, "\u4F7F\u7528\u8BF4\u660E\uFF1A"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "\u901A\u8FC7 ", /*#__PURE__*/React.createElement("code", null, "tabGroup=\"ticketType\""), " \u6307\u5B9A\u4F7F\u7528\u6570\u636E\u9879\u7684 ticketType \u5B57\u6BB5\u8FDB\u884C\u5206\u7EC4"), /*#__PURE__*/React.createElement("li", null, "Tab\u7684 group \u5C5E\u6027\u503C\u5BF9\u5E94\u6570\u636E\u9879\u4E2D ticketType \u5B57\u6BB5\u7684\u503C"), /*#__PURE__*/React.createElement("li", null, "\u70B9\u51FB\u4E0D\u540C\u7684\u6807\u7B7E\u9875\u53EF\u4EE5\u67E5\u770B\u4E0D\u540C\u5206\u7EC4\u7684\u95E8\u7968"), /*#__PURE__*/React.createElement("li", null, "\u6570\u636E\u4F1A\u6839\u636E\u9009\u62E9\u7684\u5206\u7EC4\u81EA\u52A8\u8FC7\u6EE4"), /*#__PURE__*/React.createElement("li", null, "\u6BCF\u4E2A\u6807\u7B7E\u9875\u663E\u793A\u5BF9\u5E94\u5206\u7EC4\u7684\u6570\u91CF"), /*#__PURE__*/React.createElement("li", null, "\u652F\u6301\u6240\u6709\u73B0\u6709\u7684List\u7EC4\u4EF6\u5E03\u5C40\u548C\u5206\u9875\u6A21\u5F0F"))));
|
|
206
|
+
};
|
|
207
|
+
export default GroupedListExample;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useDevice, getUserAgentInfo } from './useDevice';
|
|
2
|
+
export type { DeviceType, DeviceInfo } from './useDevice';
|
|
3
|
+
export { default as useWaterfall } from './useWaterfall';
|
|
4
|
+
export { useListState } from './useListState';
|
|
5
|
+
export type { ListState, ListAction, UseListStateProps, UseListStateReturn } from './useListState';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare type DeviceType = 'pc' | 'pad' | 'mobile';
|
|
2
|
+
export interface DeviceInfo {
|
|
3
|
+
type: DeviceType;
|
|
4
|
+
isMobile: boolean;
|
|
5
|
+
isPad: boolean;
|
|
6
|
+
isPc: boolean;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 设备检测Hook
|
|
12
|
+
* 根据屏幕宽度和用户代理判断当前设备类型
|
|
13
|
+
*/
|
|
14
|
+
export declare const useDevice: () => DeviceInfo;
|
|
15
|
+
/**
|
|
16
|
+
* 获取用户代理信息
|
|
17
|
+
* @returns 用户代理相关信息
|
|
18
|
+
*/
|
|
19
|
+
export declare const getUserAgentInfo: () => {
|
|
20
|
+
isMobileUA: boolean;
|
|
21
|
+
isTabletUA: boolean;
|
|
22
|
+
isDesktopUA: boolean;
|
|
23
|
+
userAgent: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* 设备检测Hook
|
|
10
|
+
* 根据屏幕宽度和用户代理判断当前设备类型
|
|
11
|
+
*/
|
|
12
|
+
export var useDevice = function useDevice() {
|
|
13
|
+
var _useState = useState(function () {
|
|
14
|
+
// 初始化时的默认值
|
|
15
|
+
var initialWidth = typeof window !== 'undefined' ? window.innerWidth : 1920;
|
|
16
|
+
var initialHeight = typeof window !== 'undefined' ? window.innerHeight : 1080;
|
|
17
|
+
var initialType = getDeviceType(initialWidth);
|
|
18
|
+
return {
|
|
19
|
+
type: initialType,
|
|
20
|
+
isMobile: initialType === 'mobile',
|
|
21
|
+
isPad: initialType === 'pad',
|
|
22
|
+
isPc: initialType === 'pc',
|
|
23
|
+
width: initialWidth,
|
|
24
|
+
height: initialHeight
|
|
25
|
+
};
|
|
26
|
+
}),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
deviceInfo = _useState2[0],
|
|
29
|
+
setDeviceInfo = _useState2[1];
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
var handleResize = function handleResize() {
|
|
32
|
+
var width = window.innerWidth;
|
|
33
|
+
var height = window.innerHeight;
|
|
34
|
+
var type = getDeviceType(width);
|
|
35
|
+
setDeviceInfo({
|
|
36
|
+
type: type,
|
|
37
|
+
isMobile: type === 'mobile',
|
|
38
|
+
isPad: type === 'pad',
|
|
39
|
+
isPc: type === 'pc',
|
|
40
|
+
width: width,
|
|
41
|
+
height: height
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// 初次加载时检测一次
|
|
46
|
+
handleResize();
|
|
47
|
+
|
|
48
|
+
// 监听窗口尺寸变化
|
|
49
|
+
window.addEventListener('resize', handleResize);
|
|
50
|
+
|
|
51
|
+
// 清理监听器
|
|
52
|
+
return function () {
|
|
53
|
+
window.removeEventListener('resize', handleResize);
|
|
54
|
+
};
|
|
55
|
+
}, []);
|
|
56
|
+
return deviceInfo;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 根据屏幕宽度判断设备类型
|
|
61
|
+
* @param width 屏幕宽度
|
|
62
|
+
* @returns 设备类型
|
|
63
|
+
*/
|
|
64
|
+
function getDeviceType(width) {
|
|
65
|
+
// 移动端:小于 768px
|
|
66
|
+
if (width < 768) {
|
|
67
|
+
return 'mobile';
|
|
68
|
+
}
|
|
69
|
+
// 平板:768px - 1200px
|
|
70
|
+
else if (width < 1200) {
|
|
71
|
+
return 'pad';
|
|
72
|
+
}
|
|
73
|
+
// PC端:大于等于 1200px
|
|
74
|
+
else {
|
|
75
|
+
return 'pc';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 获取用户代理信息
|
|
81
|
+
* @returns 用户代理相关信息
|
|
82
|
+
*/
|
|
83
|
+
export var getUserAgentInfo = function getUserAgentInfo() {
|
|
84
|
+
if (typeof window === 'undefined' || !window.navigator) {
|
|
85
|
+
return {
|
|
86
|
+
isMobileUA: false,
|
|
87
|
+
isTabletUA: false,
|
|
88
|
+
isDesktopUA: true,
|
|
89
|
+
userAgent: ''
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
var userAgent = window.navigator.userAgent.toLowerCase();
|
|
93
|
+
var isMobileUA = /mobile|android|iphone|ipod|phone/.test(userAgent);
|
|
94
|
+
var isTabletUA = /tablet|ipad/.test(userAgent) && !isMobileUA;
|
|
95
|
+
var isDesktopUA = !isMobileUA && !isTabletUA;
|
|
96
|
+
return {
|
|
97
|
+
isMobileUA: isMobileUA,
|
|
98
|
+
isTabletUA: isTabletUA,
|
|
99
|
+
isDesktopUA: isDesktopUA,
|
|
100
|
+
userAgent: userAgent
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TabItem, LoadDataParams } from '../types';
|
|
2
|
+
export interface ListState {
|
|
3
|
+
activeTab: string;
|
|
4
|
+
currentPage: number;
|
|
5
|
+
isStickyActive: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare type ListAction = {
|
|
8
|
+
type: 'SET_ACTIVE_TAB';
|
|
9
|
+
payload: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'SET_CURRENT_PAGE';
|
|
12
|
+
payload: number;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'SET_STICKY_ACTIVE';
|
|
15
|
+
payload: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'RESET_PAGE';
|
|
18
|
+
};
|
|
19
|
+
export interface UseListStateProps {
|
|
20
|
+
/** 外部传入的当前页码 */
|
|
21
|
+
externalCurrentPage?: number;
|
|
22
|
+
/** tab数据 */
|
|
23
|
+
tabItems: TabItem[];
|
|
24
|
+
/** 默认页面大小 */
|
|
25
|
+
defaultPageSize: number;
|
|
26
|
+
/** 数据加载回调 */
|
|
27
|
+
onLoadData?: (params: LoadDataParams) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface UseListStateReturn {
|
|
30
|
+
state: ListState;
|
|
31
|
+
setActiveTab: (tab: string) => void;
|
|
32
|
+
setCurrentPage: (page: number) => void;
|
|
33
|
+
setStickyActive: (active: boolean) => void;
|
|
34
|
+
resetPage: () => void;
|
|
35
|
+
handleTabChange: (key: string) => void;
|
|
36
|
+
handlePageChange: (page: number, size?: number) => void;
|
|
37
|
+
handleShowSizeChange: (current: number, size: number) => void;
|
|
38
|
+
handleLoadMore: () => void;
|
|
39
|
+
handleViewLess: () => void;
|
|
40
|
+
handleScrollLoad: () => void;
|
|
41
|
+
actualCurrentPage: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, }: UseListStateProps) => UseListStateReturn;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
import { useReducer, useCallback } from 'react';
|
|
14
|
+
|
|
15
|
+
// 状态接口
|
|
16
|
+
|
|
17
|
+
// 动作类型
|
|
18
|
+
|
|
19
|
+
// reducer函数
|
|
20
|
+
function listStateReducer(state, action) {
|
|
21
|
+
switch (action.type) {
|
|
22
|
+
case 'SET_ACTIVE_TAB':
|
|
23
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
24
|
+
activeTab: action.payload
|
|
25
|
+
});
|
|
26
|
+
case 'SET_CURRENT_PAGE':
|
|
27
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
28
|
+
currentPage: action.payload
|
|
29
|
+
});
|
|
30
|
+
case 'SET_STICKY_ACTIVE':
|
|
31
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
32
|
+
isStickyActive: action.payload
|
|
33
|
+
});
|
|
34
|
+
case 'RESET_PAGE':
|
|
35
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
36
|
+
currentPage: 1
|
|
37
|
+
});
|
|
38
|
+
default:
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Hook参数接口
|
|
44
|
+
|
|
45
|
+
// Hook返回值接口
|
|
46
|
+
|
|
47
|
+
export var useListState = function useListState(_ref) {
|
|
48
|
+
var externalCurrentPage = _ref.externalCurrentPage,
|
|
49
|
+
tabItems = _ref.tabItems,
|
|
50
|
+
defaultPageSize = _ref.defaultPageSize,
|
|
51
|
+
onLoadData = _ref.onLoadData;
|
|
52
|
+
// 初始状态
|
|
53
|
+
var initialState = {
|
|
54
|
+
activeTab: tabItems.length > 0 ? tabItems[0].key : 'all',
|
|
55
|
+
currentPage: 1,
|
|
56
|
+
isStickyActive: false
|
|
57
|
+
};
|
|
58
|
+
var _useReducer = useReducer(listStateReducer, initialState),
|
|
59
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
60
|
+
state = _useReducer2[0],
|
|
61
|
+
dispatch = _useReducer2[1];
|
|
62
|
+
|
|
63
|
+
// 计算实际使用的当前页码
|
|
64
|
+
var actualCurrentPage = externalCurrentPage || state.currentPage;
|
|
65
|
+
|
|
66
|
+
// 状态更新函数
|
|
67
|
+
var setActiveTab = useCallback(function (tab) {
|
|
68
|
+
dispatch({
|
|
69
|
+
type: 'SET_ACTIVE_TAB',
|
|
70
|
+
payload: tab
|
|
71
|
+
});
|
|
72
|
+
}, []);
|
|
73
|
+
var setCurrentPage = useCallback(function (page) {
|
|
74
|
+
dispatch({
|
|
75
|
+
type: 'SET_CURRENT_PAGE',
|
|
76
|
+
payload: page
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
79
|
+
var setStickyActive = useCallback(function (active) {
|
|
80
|
+
dispatch({
|
|
81
|
+
type: 'SET_STICKY_ACTIVE',
|
|
82
|
+
payload: active
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
85
|
+
var resetPage = useCallback(function () {
|
|
86
|
+
dispatch({
|
|
87
|
+
type: 'RESET_PAGE'
|
|
88
|
+
});
|
|
89
|
+
}, []);
|
|
90
|
+
|
|
91
|
+
// 统一的数据加载函数
|
|
92
|
+
var loadData = useCallback(function (params) {
|
|
93
|
+
onLoadData === null || onLoadData === void 0 || onLoadData(params);
|
|
94
|
+
}, [onLoadData]);
|
|
95
|
+
|
|
96
|
+
// 业务逻辑函数
|
|
97
|
+
var handleTabChange = useCallback(function (key) {
|
|
98
|
+
setActiveTab(key);
|
|
99
|
+
resetPage();
|
|
100
|
+
loadData({
|
|
101
|
+
trigger: 'tabChange',
|
|
102
|
+
currentPage: 1,
|
|
103
|
+
pageSize: defaultPageSize,
|
|
104
|
+
activeTab: key
|
|
105
|
+
});
|
|
106
|
+
}, [setActiveTab, resetPage, loadData, defaultPageSize]);
|
|
107
|
+
var handlePageChange = useCallback(function (page, size) {
|
|
108
|
+
var previousPage = actualCurrentPage;
|
|
109
|
+
var pageSize = size || defaultPageSize;
|
|
110
|
+
setCurrentPage(page);
|
|
111
|
+
loadData({
|
|
112
|
+
trigger: 'pagination',
|
|
113
|
+
currentPage: page,
|
|
114
|
+
pageSize: pageSize,
|
|
115
|
+
activeTab: state.activeTab,
|
|
116
|
+
previousPage: previousPage
|
|
117
|
+
});
|
|
118
|
+
}, [actualCurrentPage, defaultPageSize, setCurrentPage, loadData, state.activeTab]);
|
|
119
|
+
var handleShowSizeChange = useCallback(function (current, size) {
|
|
120
|
+
var previousPageSize = defaultPageSize;
|
|
121
|
+
setCurrentPage(current);
|
|
122
|
+
loadData({
|
|
123
|
+
trigger: 'pageSize',
|
|
124
|
+
currentPage: current,
|
|
125
|
+
pageSize: size,
|
|
126
|
+
activeTab: state.activeTab,
|
|
127
|
+
previousPageSize: previousPageSize
|
|
128
|
+
});
|
|
129
|
+
}, [defaultPageSize, setCurrentPage, loadData, state.activeTab]);
|
|
130
|
+
var handleLoadMore = useCallback(function () {
|
|
131
|
+
var nextPage = actualCurrentPage + 1;
|
|
132
|
+
setCurrentPage(nextPage);
|
|
133
|
+
loadData({
|
|
134
|
+
trigger: 'loadMore',
|
|
135
|
+
currentPage: nextPage,
|
|
136
|
+
pageSize: defaultPageSize,
|
|
137
|
+
activeTab: state.activeTab
|
|
138
|
+
});
|
|
139
|
+
}, [actualCurrentPage, setCurrentPage, loadData, defaultPageSize, state.activeTab]);
|
|
140
|
+
var handleViewLess = useCallback(function () {
|
|
141
|
+
resetPage();
|
|
142
|
+
loadData({
|
|
143
|
+
trigger: 'pagination',
|
|
144
|
+
currentPage: 1,
|
|
145
|
+
pageSize: defaultPageSize,
|
|
146
|
+
activeTab: state.activeTab,
|
|
147
|
+
previousPage: actualCurrentPage
|
|
148
|
+
});
|
|
149
|
+
}, [resetPage, loadData, defaultPageSize, state.activeTab, actualCurrentPage]);
|
|
150
|
+
|
|
151
|
+
// 处理滚动加载
|
|
152
|
+
var handleScrollLoad = useCallback(function () {
|
|
153
|
+
var nextPage = actualCurrentPage + 1;
|
|
154
|
+
setCurrentPage(nextPage);
|
|
155
|
+
loadData({
|
|
156
|
+
trigger: 'scroll',
|
|
157
|
+
currentPage: nextPage,
|
|
158
|
+
pageSize: defaultPageSize,
|
|
159
|
+
activeTab: state.activeTab
|
|
160
|
+
});
|
|
161
|
+
}, [actualCurrentPage, setCurrentPage, loadData, defaultPageSize, state.activeTab]);
|
|
162
|
+
return {
|
|
163
|
+
state: state,
|
|
164
|
+
setActiveTab: setActiveTab,
|
|
165
|
+
setCurrentPage: setCurrentPage,
|
|
166
|
+
setStickyActive: setStickyActive,
|
|
167
|
+
resetPage: resetPage,
|
|
168
|
+
handleTabChange: handleTabChange,
|
|
169
|
+
handlePageChange: handlePageChange,
|
|
170
|
+
handleShowSizeChange: handleShowSizeChange,
|
|
171
|
+
handleLoadMore: handleLoadMore,
|
|
172
|
+
handleViewLess: handleViewLess,
|
|
173
|
+
handleScrollLoad: handleScrollLoad,
|
|
174
|
+
actualCurrentPage: actualCurrentPage
|
|
175
|
+
};
|
|
176
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface WaterfallItem {
|
|
2
|
+
id: string | number;
|
|
3
|
+
data: any;
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface WaterfallTrack<T = any> {
|
|
8
|
+
items: T[];
|
|
9
|
+
size: number;
|
|
10
|
+
}
|
|
11
|
+
export interface WaterfallLayoutOptions {
|
|
12
|
+
tracks: number;
|
|
13
|
+
trackGap: number;
|
|
14
|
+
itemGap: number;
|
|
15
|
+
direction: 'vertical' | 'horizontal';
|
|
16
|
+
}
|
|
17
|
+
export interface WaterfallLayout<T = any> {
|
|
18
|
+
tracks: WaterfallTrack<T>[];
|
|
19
|
+
totalSize: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const useWaterfall: <T extends {
|
|
22
|
+
id: string | number;
|
|
23
|
+
height?: number | undefined;
|
|
24
|
+
width?: number | undefined;
|
|
25
|
+
}>(items: T[], options: WaterfallLayoutOptions) => {
|
|
26
|
+
layout: WaterfallLayout<T>;
|
|
27
|
+
registerItemRef: (id: string | number, element: HTMLElement | null) => void;
|
|
28
|
+
measureItemSize: (id: string | number) => {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
32
|
+
recalculateLayout: () => void;
|
|
33
|
+
};
|
|
34
|
+
export default useWaterfall;
|