@pisell/private-materials 6.3.3 → 6.3.5
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 +1 -1
- 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/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Content/index.js +1 -1
- package/es/components/appointmentBooking/components/Content/index.less +3 -3
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.js +2 -2
- package/es/components/appointmentBooking/index.js +8 -2
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +2 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +2 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/eventBooking/index.js +8 -1
- package/es/components/listComponent/index.js +5 -5
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +3 -0
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/components/wallet/model.d.ts +1 -9
- package/es/hooks/useComponents.js +1 -1
- package/es/hooks/useWindowSize.js +8 -1
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.js +29 -0
- package/es/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/es/plus/productSelect/CategoryTabs/index.js +171 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.js +37 -0
- package/es/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/es/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/es/plus/productSelect/ProductCard/index.js +170 -0
- package/es/plus/productSelect/ProductCard/index.less +270 -0
- package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/es/plus/productSelect/ProductList/gridComponents.js +149 -0
- package/es/plus/productSelect/ProductList/index.d.ts +22 -0
- package/es/plus/productSelect/ProductList/index.js +72 -0
- package/es/plus/productSelect/ProductList/index.less +0 -0
- package/es/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/es/plus/productSelect/components/IntersectionObserver.js +276 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.js +357 -0
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/es/plus/productSelect/components/TabsStructure/hooks.js +243 -0
- package/es/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/es/plus/productSelect/components/TabsStructure/index.js +13 -0
- package/es/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/es/plus/productSelect/components/TabsStructure/styles.js +87 -0
- package/es/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/es/plus/productSelect/components/TabsStructure/types.js +1 -0
- package/es/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/es/plus/productSelect/components/TabsStructure/utils.js +56 -0
- package/es/plus/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/es/plus/productSelect/components/pisellPriceText/index.js +43 -0
- package/es/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/es/plus/productSelect/hooks/useToken.js +34 -0
- package/es/plus/productSelect/index.d.ts +31 -0
- package/es/plus/productSelect/index.js +270 -0
- package/es/plus/productSelect/index.less +56 -0
- package/es/plus/productSelect/locales.d.ts +18 -0
- package/es/plus/productSelect/locales.js +17 -0
- package/es/plus/productSelect/theme/token.d.ts +17 -0
- package/es/plus/productSelect/theme/token.js +19 -0
- package/es/plus/productSelect/utils.d.ts +39 -0
- package/es/plus/productSelect/utils.js +162 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Content/index.js +1 -1
- package/lib/components/appointmentBooking/components/Content/index.less +3 -3
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/index.js +6 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/utils.js +2 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +2 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +2 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/eventBooking/index.js +6 -1
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +2 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -0
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/hooks/useWindowSize.js +6 -1
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.js +62 -0
- package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +18 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +183 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.js +58 -0
- package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
- package/lib/plus/productSelect/ProductCard/index.d.ts +45 -0
- package/lib/plus/productSelect/ProductCard/index.js +184 -0
- package/lib/plus/productSelect/ProductCard/index.less +270 -0
- package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
- package/lib/plus/productSelect/ProductList/gridComponents.js +148 -0
- package/lib/plus/productSelect/ProductList/index.d.ts +22 -0
- package/lib/plus/productSelect/ProductList/index.js +86 -0
- package/lib/plus/productSelect/ProductList/index.less +0 -0
- package/lib/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
- package/lib/plus/productSelect/components/IntersectionObserver.js +269 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.js +393 -0
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
- package/lib/plus/productSelect/components/TabsStructure/hooks.js +209 -0
- package/lib/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
- package/lib/plus/productSelect/components/TabsStructure/index.js +92 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
- package/lib/plus/productSelect/components/TabsStructure/styles.js +122 -0
- package/lib/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
- package/lib/plus/productSelect/components/TabsStructure/types.js +17 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
- package/lib/plus/productSelect/components/TabsStructure/utils.js +72 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +11 -0
- package/lib/plus/productSelect/components/pisellPriceText/index.js +72 -0
- package/lib/plus/productSelect/hooks/useToken.d.ts +18 -0
- package/lib/plus/productSelect/hooks/useToken.js +50 -0
- package/lib/plus/productSelect/index.d.ts +31 -0
- package/lib/plus/productSelect/index.js +299 -0
- package/lib/plus/productSelect/index.less +56 -0
- package/lib/plus/productSelect/locales.d.ts +18 -0
- package/lib/plus/productSelect/locales.js +41 -0
- package/lib/plus/productSelect/theme/token.d.ts +17 -0
- package/lib/plus/productSelect/theme/token.js +47 -0
- package/lib/plus/productSelect/utils.d.ts +39 -0
- package/lib/plus/productSelect/utils.js +138 -0
- package/package.json +2 -2
@@ -0,0 +1,34 @@
|
|
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 { useMemo } from 'react';
|
14
|
+
import { defaultToken } from "../theme/token";
|
15
|
+
export function useToken(customToken) {
|
16
|
+
return useMemo(function () {
|
17
|
+
// 预留 context 获取逻辑的位置
|
18
|
+
var contextToken = null;
|
19
|
+
return _objectSpread(_objectSpread(_objectSpread({}, defaultToken), contextToken || {}), customToken || {});
|
20
|
+
}, [customToken]);
|
21
|
+
}
|
22
|
+
export function genCSSVars(token) {
|
23
|
+
var cssVars = {};
|
24
|
+
Object.entries(token).forEach(function (_ref) {
|
25
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
26
|
+
key = _ref2[0],
|
27
|
+
value = _ref2[1];
|
28
|
+
var cssKey = "--ps-".concat(key.replace(/[A-Z]/g, function (m) {
|
29
|
+
return "-".concat(m.toLowerCase());
|
30
|
+
}));
|
31
|
+
cssVars[cssKey] = value;
|
32
|
+
});
|
33
|
+
return cssVars;
|
34
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './index.less';
|
3
|
+
interface ProductSelectProps {
|
4
|
+
dataSource: any[];
|
5
|
+
showSearch?: boolean;
|
6
|
+
showTab?: boolean;
|
7
|
+
layout?: {
|
8
|
+
grid: boolean;
|
9
|
+
config: string;
|
10
|
+
};
|
11
|
+
onChange: (value: any) => void;
|
12
|
+
value?: number;
|
13
|
+
loading?: boolean;
|
14
|
+
style?: React.CSSProperties;
|
15
|
+
emptyDescription?: string;
|
16
|
+
/** 当前滚动元素 */
|
17
|
+
scrollDom?: string;
|
18
|
+
/** 商品列表上方的其它组件 */
|
19
|
+
offsetDom?: any;
|
20
|
+
/** 样式变量 */
|
21
|
+
token?: Partial<any>;
|
22
|
+
/** 后台装修单选模式下的已选中项 */
|
23
|
+
selectedItems?: Array<any>;
|
24
|
+
/** 后台装修配置 */
|
25
|
+
productListSetting?: Partial<any>;
|
26
|
+
/** 兼容scrollDom */
|
27
|
+
customScrollParent?: HTMLElement | string;
|
28
|
+
}
|
29
|
+
export declare const PREFIX = "pisell-product-select";
|
30
|
+
declare const index: ({ dataSource, emptyDescription, showSearch, scrollDom, offsetDom, style, token: customToken, onChange, value, selectedItems, productListSetting, customScrollParent, loading, layout, ...rest }: ProductSelectProps) => JSX.Element;
|
31
|
+
export default index;
|
@@ -0,0 +1,270 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["dataSource", "emptyDescription", "showSearch", "scrollDom", "offsetDom", "style", "token", "onChange", "value", "selectedItems", "productListSetting", "customScrollParent", "loading", "layout"];
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
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; }
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
9
|
+
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."); }
|
10
|
+
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); }
|
11
|
+
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; }
|
12
|
+
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; } }
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
16
|
+
import React, { useEffect, useCallback, useMemo, useRef, useState, useLayoutEffect } from 'react';
|
17
|
+
import classNames from 'classnames';
|
18
|
+
import { Input } from '@pisell/materials';
|
19
|
+
import { locales } from '@pisell/utils';
|
20
|
+
import SearchLg from '@pisell/icon/es/SearchLg';
|
21
|
+
import CategoryTabs, { CategorySkeleton } from "./CategoryTabs";
|
22
|
+
import ProductList, { createGridComponents } from "./ProductList";
|
23
|
+
import { useToken, genCSSVars } from "./hooks/useToken";
|
24
|
+
import { groupProductsByCategory, getElementByIdentifier, getOffsetTopRelativeToScrollContainer } from "./utils";
|
25
|
+
import IntersectionObserverProvider from "./components/IntersectionObserver";
|
26
|
+
import ProductCard, { ProductCardSkeleton } from "./ProductCard";
|
27
|
+
import localeTexts from "./locales";
|
28
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
29
|
+
import { PisellEmpty } from '@pisell/materials';
|
30
|
+
import "./index.less";
|
31
|
+
// 虚假数据常量,用于loading状态
|
32
|
+
var MOCK_DATA = function () {
|
33
|
+
var mockData = [];
|
34
|
+
// 添加分类项
|
35
|
+
mockData.push({
|
36
|
+
__typename: 'category',
|
37
|
+
id: '_c1_1'
|
38
|
+
});
|
39
|
+
// 添加该分类下的商品
|
40
|
+
for (var productIndex = 0; productIndex < 4; productIndex++) {
|
41
|
+
mockData.push({
|
42
|
+
__typename: 'product',
|
43
|
+
id: '_pi' + productIndex
|
44
|
+
});
|
45
|
+
}
|
46
|
+
return mockData;
|
47
|
+
}();
|
48
|
+
export var PREFIX = 'pisell-product-select';
|
49
|
+
var CONTAINER_CLASS = "".concat(PREFIX, "-wrapper");
|
50
|
+
var index = function index(_ref) {
|
51
|
+
var _ref$dataSource = _ref.dataSource,
|
52
|
+
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
53
|
+
emptyDescription = _ref.emptyDescription,
|
54
|
+
_ref$showSearch = _ref.showSearch,
|
55
|
+
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
56
|
+
scrollDom = _ref.scrollDom,
|
57
|
+
offsetDom = _ref.offsetDom,
|
58
|
+
_ref$style = _ref.style,
|
59
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
60
|
+
customToken = _ref.token,
|
61
|
+
onChange = _ref.onChange,
|
62
|
+
value = _ref.value,
|
63
|
+
selectedItems = _ref.selectedItems,
|
64
|
+
_ref$productListSetti = _ref.productListSetting,
|
65
|
+
productListSetting = _ref$productListSetti === void 0 ? {} : _ref$productListSetti,
|
66
|
+
customScrollParent = _ref.customScrollParent,
|
67
|
+
_ref$loading = _ref.loading,
|
68
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
69
|
+
layout = _ref.layout,
|
70
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
71
|
+
var searchRef = useRef(null);
|
72
|
+
var _useState = useState(''),
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
74
|
+
keyword = _useState2[0],
|
75
|
+
setKeyword = _useState2[1];
|
76
|
+
var _useState3 = useState(''),
|
77
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
78
|
+
activeKey = _useState4[0],
|
79
|
+
setActiveKey = _useState4[1];
|
80
|
+
var _useState5 = useState(null),
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
82
|
+
scrollParent = _useState6[0],
|
83
|
+
setScrollParent = _useState6[1];
|
84
|
+
var isIndicatorVisibleRef = useRef(false);
|
85
|
+
var containerRef = useRef(null);
|
86
|
+
var _customScrollParent = customScrollParent || scrollDom;
|
87
|
+
var gridComponents = useMemo(function () {
|
88
|
+
return createGridComponents(layout);
|
89
|
+
}, [layout]);
|
90
|
+
var context = useEngineContext();
|
91
|
+
useEffect(function () {
|
92
|
+
var _context$appHelper$ut;
|
93
|
+
locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en');
|
94
|
+
}, []);
|
95
|
+
var _filteredList = useMemo(function () {
|
96
|
+
if (!keyword) return dataSource;
|
97
|
+
return dataSource.filter(function (product) {
|
98
|
+
if (typeof (product === null || product === void 0 ? void 0 : product.title) !== 'string') return false;
|
99
|
+
return product.title.toLowerCase().indexOf(keyword.toLowerCase()) !== -1;
|
100
|
+
});
|
101
|
+
}, [keyword, dataSource]);
|
102
|
+
var _groupedList = useMemo(function () {
|
103
|
+
var _list = _filteredList || [];
|
104
|
+
return groupProductsByCategory(_list);
|
105
|
+
}, [_filteredList]);
|
106
|
+
var _categories = useMemo(function () {
|
107
|
+
return _groupedList.filter(function (item) {
|
108
|
+
return item.__typename === 'category';
|
109
|
+
}).map(function (item) {
|
110
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
111
|
+
key: String(item.id),
|
112
|
+
label: item.name
|
113
|
+
});
|
114
|
+
});
|
115
|
+
}, [_groupedList]);
|
116
|
+
useEffect(function () {
|
117
|
+
if (!(_categories !== null && _categories !== void 0 && _categories.length)) {
|
118
|
+
setActiveKey('');
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
if (!activeKey) {
|
122
|
+
switchCategory(_categories[0].key);
|
123
|
+
} else {
|
124
|
+
var found = _categories.find(function (category) {
|
125
|
+
return category.key === activeKey;
|
126
|
+
});
|
127
|
+
if (!found) switchCategory(_categories[0].key);
|
128
|
+
}
|
129
|
+
}, [_categories]);
|
130
|
+
useLayoutEffect(function () {
|
131
|
+
if (_customScrollParent) {
|
132
|
+
var sp = getElementByIdentifier(_customScrollParent);
|
133
|
+
setScrollParent(sp);
|
134
|
+
}
|
135
|
+
}, [_customScrollParent]);
|
136
|
+
var token = useToken(customToken);
|
137
|
+
var cssVars = useMemo(function () {
|
138
|
+
return genCSSVars(token);
|
139
|
+
}, [token]);
|
140
|
+
var mergedStyle = useMemo(function () {
|
141
|
+
var baseStyle = _objectSpread(_objectSpread({}, cssVars), style);
|
142
|
+
if (!scrollParent) return baseStyle;
|
143
|
+
if (scrollParent !== containerRef.current) {
|
144
|
+
return _objectSpread(_objectSpread({}, baseStyle), {}, {
|
145
|
+
overflow: 'unset',
|
146
|
+
height: 'unset'
|
147
|
+
});
|
148
|
+
}
|
149
|
+
return baseStyle;
|
150
|
+
}, [cssVars, style, scrollParent]);
|
151
|
+
var disabled = useMemo(function () {
|
152
|
+
return !!(productListSetting !== null && productListSetting !== void 0 && productListSetting.list_max_length) && Array.isArray(selectedItems) && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > 0;
|
153
|
+
}, [productListSetting, selectedItems]);
|
154
|
+
var _onChange = useCallback(function (value) {
|
155
|
+
if (disabled) return;
|
156
|
+
onChange === null || onChange === void 0 || onChange(value);
|
157
|
+
}, [disabled, onChange]);
|
158
|
+
var debounceIndicator = useCallback(function (delay) {
|
159
|
+
isIndicatorVisibleRef.current = true;
|
160
|
+
var timeoutId = setTimeout(function () {
|
161
|
+
isIndicatorVisibleRef.current = false;
|
162
|
+
}, delay);
|
163
|
+
return function () {
|
164
|
+
return clearTimeout(timeoutId);
|
165
|
+
};
|
166
|
+
}, []);
|
167
|
+
var lastActiveKeyRef = useRef('');
|
168
|
+
|
169
|
+
// 项目进入视口时的回调
|
170
|
+
var handleItemIntersectionIn = useCallback(function (item) {
|
171
|
+
var _key = String(item.__categoryId);
|
172
|
+
if (!isIndicatorVisibleRef.current && _key && _key !== lastActiveKeyRef.current) {
|
173
|
+
setActiveKey(_key);
|
174
|
+
lastActiveKeyRef.current = _key;
|
175
|
+
}
|
176
|
+
}, []);
|
177
|
+
var switchCategory = function switchCategory(key) {
|
178
|
+
setActiveKey(key);
|
179
|
+
lastActiveKeyRef.current = key; // 同步ref值
|
180
|
+
debounceIndicator(300);
|
181
|
+
var categoryIndex = _groupedList.findIndex(function (item) {
|
182
|
+
return item.__typename === 'category' && String(item.id) === key;
|
183
|
+
});
|
184
|
+
// 获取可滚动祖先元素
|
185
|
+
var _scrollParent = scrollParent || containerRef.current;
|
186
|
+
if (!_scrollParent || !containerRef.current) return;
|
187
|
+
var target = document.getElementById("ps_category_".concat(key));
|
188
|
+
if (!target) return;
|
189
|
+
// 获取产品选择器包装容器
|
190
|
+
var productSelectWrapper = document.querySelector(".".concat(PREFIX, "-wrapper"));
|
191
|
+
// 获取标签页包装容器
|
192
|
+
var tabsWrapper = document.querySelector(".".concat(PREFIX, "__tabs-wrapper"));
|
193
|
+
var tabsHeight = (tabsWrapper === null || tabsWrapper === void 0 ? void 0 : tabsWrapper.offsetHeight) || 0;
|
194
|
+
// 获取额外偏移元素(如固定头部等)
|
195
|
+
var offsetElement = getElementByIdentifier(offsetDom);
|
196
|
+
var extraOffset = offsetElement ? offsetElement.clientHeight : 0;
|
197
|
+
if (categoryIndex === 0) {
|
198
|
+
// 如果是第一个tab,滚动到产品选择器包装容器的位置
|
199
|
+
if (productSelectWrapper) {
|
200
|
+
var wrapperOffsetTop = getOffsetTopRelativeToScrollContainer(productSelectWrapper, _scrollParent);
|
201
|
+
_scrollParent.scrollTop = wrapperOffsetTop - extraOffset;
|
202
|
+
}
|
203
|
+
return;
|
204
|
+
} else {
|
205
|
+
// 其他tab,滚动到对应列表元素位置,需要减去标签页高度
|
206
|
+
var listOffsetTop = getOffsetTopRelativeToScrollContainer(target, _scrollParent);
|
207
|
+
_scrollParent.scrollTop = listOffsetTop - tabsHeight - extraOffset;
|
208
|
+
}
|
209
|
+
};
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
211
|
+
ref: containerRef,
|
212
|
+
className: classNames(PREFIX, CONTAINER_CLASS, {
|
213
|
+
disabled: disabled
|
214
|
+
}),
|
215
|
+
style: mergedStyle
|
216
|
+
}, showSearch ? /*#__PURE__*/React.createElement("div", {
|
217
|
+
className: "".concat(PREFIX, "__search-wrapper")
|
218
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
219
|
+
ref: searchRef,
|
220
|
+
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
221
|
+
style: {
|
222
|
+
height: 44
|
223
|
+
},
|
224
|
+
placeholder: locales.getText('pisell2.product-select.search'),
|
225
|
+
allowClear: true,
|
226
|
+
value: keyword,
|
227
|
+
onChange: function onChange(e) {
|
228
|
+
// switchCategory('');
|
229
|
+
setKeyword(e.target.value);
|
230
|
+
}
|
231
|
+
})) : null, /*#__PURE__*/React.createElement(CategoryTabs, {
|
232
|
+
activeKey: activeKey,
|
233
|
+
items: _categories,
|
234
|
+
onChange: switchCategory,
|
235
|
+
loading: loading,
|
236
|
+
skeleton: /*#__PURE__*/React.createElement(CategorySkeleton, null)
|
237
|
+
}), !loading && !(_groupedList !== null && _groupedList !== void 0 && _groupedList.length) ? /*#__PURE__*/React.createElement(PisellEmpty, {
|
238
|
+
description: emptyDescription || locales.getText('pisell2.product-select.empty')
|
239
|
+
}) : /*#__PURE__*/React.createElement(IntersectionObserverProvider, {
|
240
|
+
rootMargin: "-270px 0px -270px 0px",
|
241
|
+
priorityMode: "top"
|
242
|
+
}, /*#__PURE__*/React.createElement(ProductList, {
|
243
|
+
className: "".concat(PREFIX, "__product-list"),
|
244
|
+
loading: loading,
|
245
|
+
data: loading ? MOCK_DATA : _groupedList,
|
246
|
+
context: {
|
247
|
+
onItemIntersectionIn: handleItemIntersectionIn,
|
248
|
+
onItemIntersectionOut: function onItemIntersectionOut() {}
|
249
|
+
},
|
250
|
+
_customScrollParent: scrollParent,
|
251
|
+
components: gridComponents,
|
252
|
+
itemContent: function itemContent(index, item, context) {
|
253
|
+
if (loading) {
|
254
|
+
return /*#__PURE__*/React.createElement(ProductCardSkeleton, {
|
255
|
+
index: index,
|
256
|
+
item: item
|
257
|
+
});
|
258
|
+
}
|
259
|
+
return /*#__PURE__*/React.createElement(ProductCard, {
|
260
|
+
index: index,
|
261
|
+
item: item,
|
262
|
+
context: context,
|
263
|
+
onSelect: _onChange,
|
264
|
+
isSelected: item.id === value,
|
265
|
+
decorateConfig: productListSetting
|
266
|
+
});
|
267
|
+
}
|
268
|
+
})));
|
269
|
+
};
|
270
|
+
export default index;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
.pisell-product-select {
|
2
|
+
&-wrapper {
|
3
|
+
height: 100%;
|
4
|
+
background: var(--ps-container-bg, #ffffff);
|
5
|
+
overflow-y: auto;
|
6
|
+
|
7
|
+
&::-webkit-scrollbar {
|
8
|
+
display: none !important;
|
9
|
+
}
|
10
|
+
|
11
|
+
&.disabled {
|
12
|
+
.pisell-product-select__product-card {
|
13
|
+
background: var(--ps-card-hover-bg, #eaecf0);
|
14
|
+
cursor: not-allowed;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
&__search-wrapper {
|
20
|
+
padding: 12px 12px 0px;
|
21
|
+
line-height: 0;
|
22
|
+
margin-top: 0 !important;
|
23
|
+
|
24
|
+
.pisell-lowcode-input-affix-wrapper {
|
25
|
+
&:hover,
|
26
|
+
&:focus,
|
27
|
+
&:focus-within {
|
28
|
+
border-color: var(--ps-color-primary, #8157d5) !important;
|
29
|
+
box-shadow: none !important;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
> span {
|
34
|
+
background: var(--ps-container-bg, #ffffff);
|
35
|
+
color: var(--ps-search-input-color, #98a2b3);
|
36
|
+
}
|
37
|
+
|
38
|
+
input {
|
39
|
+
background: transparent;
|
40
|
+
color: var(--ps-search-input-color, #98a2b3);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
&__product-list {
|
45
|
+
padding: 0px 12px 12px;
|
46
|
+
}
|
47
|
+
|
48
|
+
&__tabs-wrapper {
|
49
|
+
position: sticky;
|
50
|
+
top: 0;
|
51
|
+
z-index: 10;
|
52
|
+
// 基础样式采用原pill样式
|
53
|
+
padding: 16px 12px;
|
54
|
+
background: var(--ps-container-bg, #fff);
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
en: {
|
3
|
+
'pisell2.product-select.search': string;
|
4
|
+
'pisell2.product-select.stock': string;
|
5
|
+
'pisell2.product-select.empty': string;
|
6
|
+
};
|
7
|
+
'zh-CN': {
|
8
|
+
'pisell2.product-select.search': string;
|
9
|
+
'pisell2.product-select.stock': string;
|
10
|
+
'pisell2.product-select.empty': string;
|
11
|
+
};
|
12
|
+
'zh-HK': {
|
13
|
+
'pisell2.product-select.search': string;
|
14
|
+
'pisell2.product-select.stock': string;
|
15
|
+
'pisell2.product-select.empty': string;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export default {
|
2
|
+
en: {
|
3
|
+
'pisell2.product-select.search': 'Search',
|
4
|
+
'pisell2.product-select.stock': 'Stock',
|
5
|
+
'pisell2.product-select.empty': 'No Data'
|
6
|
+
},
|
7
|
+
'zh-CN': {
|
8
|
+
'pisell2.product-select.search': '搜索',
|
9
|
+
'pisell2.product-select.stock': '库存',
|
10
|
+
'pisell2.product-select.empty': '暂无数据'
|
11
|
+
},
|
12
|
+
'zh-HK': {
|
13
|
+
'pisell2.product-select.search': '搜索',
|
14
|
+
'pisell2.product-select.stock': '庫存',
|
15
|
+
'pisell2.product-select.empty': '暂无数据'
|
16
|
+
}
|
17
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export interface ProductSelectToken {
|
2
|
+
colorPrimary: string;
|
3
|
+
colorText: string;
|
4
|
+
colorTextSecondary: string;
|
5
|
+
searchInputColor: string;
|
6
|
+
containerBg: string;
|
7
|
+
tabItemBg: string;
|
8
|
+
tabItemHoverBg: string;
|
9
|
+
tabItemActiveBg: string;
|
10
|
+
categoryTextColor: string;
|
11
|
+
cardBg: string;
|
12
|
+
cardHoverBg: string;
|
13
|
+
cardSelectedBg: string;
|
14
|
+
cardSelectedTextColor: string;
|
15
|
+
cardSelectedSecondaryTextColor: string;
|
16
|
+
}
|
17
|
+
export declare const defaultToken: ProductSelectToken;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export var defaultToken = {
|
2
|
+
colorPrimary: '#8157D5',
|
3
|
+
colorText: '#1B1B1B',
|
4
|
+
colorTextSecondary: '#4E4E4E',
|
5
|
+
containerBg: '#4E4E4E',
|
6
|
+
// search
|
7
|
+
searchInputColor: '#98a2b3',
|
8
|
+
// tab
|
9
|
+
tabItemBg: '#FFFFFF',
|
10
|
+
tabItemHoverBg: '#FFFFFF',
|
11
|
+
tabItemActiveBg: '#8157D5',
|
12
|
+
// category
|
13
|
+
categoryTextColor: '#FFFFFF',
|
14
|
+
cardBg: '#FFFFFF',
|
15
|
+
cardHoverBg: '#eaecf0',
|
16
|
+
cardSelectedBg: '#8157D5',
|
17
|
+
cardSelectedTextColor: '#ffffff',
|
18
|
+
cardSelectedSecondaryTextColor: 'rgba(255, 255, 255, 0.7)'
|
19
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
interface Product {
|
2
|
+
id: number;
|
3
|
+
title: string;
|
4
|
+
sort?: number;
|
5
|
+
category: Array<{
|
6
|
+
id: number;
|
7
|
+
name: string;
|
8
|
+
icon?: string;
|
9
|
+
slug: string;
|
10
|
+
sort: number;
|
11
|
+
}>;
|
12
|
+
[key: string]: any;
|
13
|
+
}
|
14
|
+
interface CategoryItem {
|
15
|
+
__typename: 'category';
|
16
|
+
id: number;
|
17
|
+
name: string;
|
18
|
+
icon?: string;
|
19
|
+
slug: string;
|
20
|
+
sort: number;
|
21
|
+
}
|
22
|
+
interface ProductItem extends Product {
|
23
|
+
__typename?: 'product';
|
24
|
+
}
|
25
|
+
declare type ListItem = CategoryItem | ProductItem;
|
26
|
+
/**
|
27
|
+
* 按目录对商品进行分组,产出平级的数据结构用于虚拟列表渲染
|
28
|
+
* @param products 商品列表
|
29
|
+
* @returns 包含目录项和商品项的平级数组
|
30
|
+
*/
|
31
|
+
export declare function groupProductsByCategory(products: Product[]): ListItem[];
|
32
|
+
/**
|
33
|
+
* 根据传入的元素标识符获取DOM元素
|
34
|
+
* @param elementIdentifier 元素标识符,可以是HTMLElement、带'#'的id、带'.'的类名或CSS选择器
|
35
|
+
* @returns 找到的DOM元素或null
|
36
|
+
*/
|
37
|
+
export declare function getElementByIdentifier(elementIdentifier: HTMLElement | string | null | undefined): HTMLElement | null;
|
38
|
+
export declare const getOffsetTopRelativeToScrollContainer: (targetElement: HTMLElement, scrollContainer: HTMLElement) => number;
|
39
|
+
export {};
|