@pisell/private-materials 6.5.27 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +146 -165
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/components/actionButtons/index.js +34 -20
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +66 -33
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +126 -99
- package/es/components/booking/components/voucher/index.js +25 -9
- package/es/components/booking/dashboard/serve.js +1 -6
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/serve.js +2 -12
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/client/serve.js +2 -11
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/pet/serve.js +1 -6
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +10 -4
- package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +25 -18
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +92 -56
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +49 -9
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/serve.js +1 -6
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +83 -14
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
- package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/es/components/booking/info2/service/editService/index.js +313 -57
- package/es/components/booking/info2/utilsByBooking.js +19 -14
- package/es/components/booking/locales.d.ts +36 -0
- package/es/components/booking/locales.js +48 -3
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/es/components/booking/utils/confirmHolderModal.js +318 -0
- package/es/components/booking/utils/confirmHolderModal.less +40 -0
- package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/es/components/booking/utils/selectHolderModal.js +407 -0
- package/es/components/booking/utils.d.ts +16 -7
- package/es/components/booking/utils.js +26 -37
- package/es/components/checkout/PaymentModal.js +61 -30
- package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/eftposPay/linkly/index.js +64 -2
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/list/List.js +3 -0
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -5
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +1 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.js +0 -2
- package/es/components/ticketBooking/serve.js +17 -119
- package/es/components/ticketBooking/utils/index.d.ts +7 -1
- package/es/components/ticketBooking/utils/index.js +44 -28
- package/es/hooks/useEngineContext.d.ts +0 -1
- package/es/hooks/useEngineContext.js +0 -7
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/es/plus/productSelect/ProductCard/index.js +1 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +273 -0
- package/es/plus/selectHolder/index.less +137 -0
- package/es/plus/selectHolder/locales.d.ts +24 -0
- package/es/plus/selectHolder/locales.js +29 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/components/actionButtons/index.js +11 -2
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +26 -5
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +120 -82
- package/lib/components/booking/components/voucher/index.js +10 -1
- package/lib/components/booking/dashboard/serve.js +1 -6
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/serve.js +2 -12
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/client/serve.js +2 -13
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/pet/serve.js +1 -6
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +5 -3
- package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +8 -17
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +38 -29
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +34 -5
- package/lib/components/booking/info2/index.js +11 -5
- package/lib/components/booking/info2/serve.js +1 -6
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +48 -11
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
- package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/lib/components/booking/info2/service/editService/index.js +254 -32
- package/lib/components/booking/info2/utilsByBooking.js +26 -19
- package/lib/components/booking/locales.d.ts +36 -0
- package/lib/components/booking/locales.js +42 -3
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/lib/components/booking/utils/confirmHolderModal.js +253 -0
- package/lib/components/booking/utils/confirmHolderModal.less +40 -0
- package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/lib/components/booking/utils/selectHolderModal.js +319 -0
- package/lib/components/booking/utils.d.ts +16 -7
- package/lib/components/booking/utils.js +18 -21
- package/lib/components/checkout/PaymentModal.js +41 -18
- package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/eftposPay/linkly/index.js +31 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/list/List.js +3 -0
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -8
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.js +0 -2
- package/lib/components/ticketBooking/serve.js +15 -117
- package/lib/components/ticketBooking/utils/index.d.ts +7 -1
- package/lib/components/ticketBooking/utils/index.js +29 -23
- package/lib/hooks/useEngineContext.d.ts +0 -1
- package/lib/hooks/useEngineContext.js +2 -10
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/lib/plus/productSelect/ProductCard/index.js +1 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +223 -0
- package/lib/plus/selectHolder/index.less +137 -0
- package/lib/plus/selectHolder/locales.d.ts +24 -0
- package/lib/plus/selectHolder/locales.js +47 -0
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/plus/selectHolder/utils.js +34 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +13 -11
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
|
@@ -94,7 +94,7 @@ var CardWrapper = (props) => {
|
|
|
94
94
|
(skuStatusOverlayConfig == null ? void 0 : skuStatusOverlayConfig.isOpen) && `${import_status.PREFIX}__card-wrapper-overlay`,
|
|
95
95
|
className
|
|
96
96
|
),
|
|
97
|
-
|
|
97
|
+
onClick: (e) => {
|
|
98
98
|
e.stopPropagation();
|
|
99
99
|
onCardClick == null ? void 0 : onCardClick(dataSource);
|
|
100
100
|
}
|
|
@@ -129,7 +129,7 @@ var ProductCard = (0, import_react.memo)(
|
|
|
129
129
|
className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className, {
|
|
130
130
|
selected: isSelected
|
|
131
131
|
}),
|
|
132
|
-
|
|
132
|
+
onClick: () => {
|
|
133
133
|
onSelect == null ? void 0 : onSelect(item);
|
|
134
134
|
},
|
|
135
135
|
"data-index": index,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/plus/selectHolder/components/ErrorTip/index.tsx
|
|
20
|
+
var ErrorTip_exports = {};
|
|
21
|
+
__export(ErrorTip_exports, {
|
|
22
|
+
default: () => ErrorTip_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ErrorTip_exports);
|
|
25
|
+
var import_materials = require("@pisell/materials");
|
|
26
|
+
var import_index = require("./index.less");
|
|
27
|
+
var ErrorTip = ({ text }) => {
|
|
28
|
+
return /* @__PURE__ */ React.createElement("div", { className: "event-booking-error-tip" }, /* @__PURE__ */ React.createElement("div", { className: "error-icon-wrapper" }, /* @__PURE__ */ React.createElement(import_materials.Iconfont, { type: "pisell2-alert-circle", className: "icon-warning" })), /* @__PURE__ */ React.createElement("span", null, text));
|
|
29
|
+
};
|
|
30
|
+
var ErrorTip_default = ErrorTip;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.event-booking-error-tip {
|
|
2
|
+
margin-bottom: 16px;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: 6px 16px 6px 6px;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
align-self: stretch;
|
|
8
|
+
border-radius: 12px;
|
|
9
|
+
border: 1px solid var(--Error-300, #fda29b);
|
|
10
|
+
background: var(--Error-25, #fffbfa);
|
|
11
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
12
|
+
color: var(--Error-700, #b42318);
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
|
|
16
|
+
.error-icon-wrapper {
|
|
17
|
+
position: relative;
|
|
18
|
+
width: 38px;
|
|
19
|
+
height: 38px;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
|
|
24
|
+
&::before {
|
|
25
|
+
content: '';
|
|
26
|
+
position: absolute;
|
|
27
|
+
width: 38px;
|
|
28
|
+
height: 38px;
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
border: 2px solid var(--Error-600, #d92d20);
|
|
31
|
+
opacity: 0.1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&::after {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
width: 28px;
|
|
38
|
+
height: 28px;
|
|
39
|
+
border-radius: 50%;
|
|
40
|
+
border: 2px solid var(--Error-600, #d92d20);
|
|
41
|
+
opacity: 0.3;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon-warning {
|
|
45
|
+
position: relative;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
font-size: 20px;
|
|
48
|
+
color: #ff4d4f;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/plus/selectHolder/components/HolderItem/index.tsx
|
|
30
|
+
var HolderItem_exports = {};
|
|
31
|
+
__export(HolderItem_exports, {
|
|
32
|
+
PREFIX: () => PREFIX,
|
|
33
|
+
default: () => HolderItem_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(HolderItem_exports);
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_materials = require("@pisell/materials");
|
|
38
|
+
var import_utils = require("../../utils");
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var PREFIX = "pisell-lowcode-holder-item";
|
|
41
|
+
var HolderItem = ({
|
|
42
|
+
item,
|
|
43
|
+
displayConfig,
|
|
44
|
+
value,
|
|
45
|
+
isAddItem
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
showAvatar = true,
|
|
49
|
+
showTitle = true,
|
|
50
|
+
showSubtitle = false,
|
|
51
|
+
selectType = "single",
|
|
52
|
+
direction = "vertical",
|
|
53
|
+
showExtraFields = false,
|
|
54
|
+
extraFields = []
|
|
55
|
+
} = displayConfig || {};
|
|
56
|
+
const isSelected = (0, import_react.useMemo)(() => {
|
|
57
|
+
if (!(value == null ? void 0 : value.length) || !(item == null ? void 0 : item.value)) return false;
|
|
58
|
+
return value.includes(item.value);
|
|
59
|
+
}, [value, item == null ? void 0 : item.value]);
|
|
60
|
+
const extraFieldsCom = (0, import_react.useMemo)(() => {
|
|
61
|
+
if (!showExtraFields || !(extraFields == null ? void 0 : extraFields.length)) return null;
|
|
62
|
+
return extraFields.map((field) => {
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-extra-field` }, (field == null ? void 0 : field.isShowLabel) && /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}-extra-field-label` }, field.label, ":"), (field == null ? void 0 : field.isShowValue) && (field == null ? void 0 : field.value) && /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}-extra-field-value` }, item == null ? void 0 : item[field.value]));
|
|
64
|
+
});
|
|
65
|
+
}, [showExtraFields, extraFields, item]);
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: `${PREFIX}-wrap ${isSelected ? `${PREFIX}-wrap-selected` : ""}`
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.PisellCard, { padding: 20, selected: isSelected }, /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: `${PREFIX}-card ${direction === "horizontal" ? `${PREFIX}-card-horizontal` : ""}`
|
|
75
|
+
},
|
|
76
|
+
showAvatar ? /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
import_materials.PisellAvatar,
|
|
78
|
+
{
|
|
79
|
+
src: item == null ? void 0 : item.avatar,
|
|
80
|
+
useTextAvatar: !(item == null ? void 0 : item.avatar) && !isAddItem,
|
|
81
|
+
className: `${isAddItem ? `${PREFIX}-add-avatar` : ""}`,
|
|
82
|
+
size: "xxl"
|
|
83
|
+
},
|
|
84
|
+
(0, import_utils.getAvatarText)(item.label)
|
|
85
|
+
) : null,
|
|
86
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-info` }, showTitle && /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}-name` }, item.label), showSubtitle && item.subtitle && /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}-subtitle` }, item.subtitle), extraFieldsCom),
|
|
87
|
+
selectType === "multiple" && /* @__PURE__ */ import_react.default.createElement(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: `${PREFIX}-check-icon ${isSelected ? `${PREFIX}-check-icon-selected` : ""}`
|
|
91
|
+
},
|
|
92
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "CheckCircleFilled" })
|
|
93
|
+
)
|
|
94
|
+
))
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
var HolderItem_default = HolderItem;
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
PREFIX
|
|
101
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.pisell-lowcode-holder-item {
|
|
2
|
+
&-wrap {
|
|
3
|
+
height: 100%;
|
|
4
|
+
border: 1px solid transparent;
|
|
5
|
+
|
|
6
|
+
.pisell-lowcode-card-body {
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-wrap-selected {
|
|
13
|
+
border: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-card {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
color: var(--Text-Text_1, #1b1b1b);
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
line-height: 20px;
|
|
28
|
+
width: 100%;
|
|
29
|
+
text-align: center;
|
|
30
|
+
|
|
31
|
+
// 确保头像不变形
|
|
32
|
+
.pisell-lowcode-avatar {
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-add-avatar {
|
|
38
|
+
background: #f4ebff !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-card-horizontal {
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
gap: 20px;
|
|
44
|
+
|
|
45
|
+
.pisell-lowcode-holder-item-info {
|
|
46
|
+
align-items: flex-start;
|
|
47
|
+
text-align: left;
|
|
48
|
+
flex: 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-check-icon {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 6px;
|
|
55
|
+
bottom: 6px;
|
|
56
|
+
color: #d0d5dd;
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-check-icon-selected {
|
|
61
|
+
color: #7f56d9;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-info {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
gap: 10px;
|
|
70
|
+
width: 100%;
|
|
71
|
+
color: #1b1b1b;
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
word-wrap: break-word;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-name {
|
|
78
|
+
width: 100%;
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
display: -webkit-box;
|
|
83
|
+
-webkit-line-clamp: 1;
|
|
84
|
+
line-clamp: 1;
|
|
85
|
+
-webkit-box-orient: vertical;
|
|
86
|
+
word-break: break-word;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&-subtitle {
|
|
90
|
+
width: 100%;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
display: -webkit-box;
|
|
94
|
+
-webkit-line-clamp: 2;
|
|
95
|
+
line-clamp: 2;
|
|
96
|
+
-webkit-box-orient: vertical;
|
|
97
|
+
word-break: break-word;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&-extra-field {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: 10px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HolderOption, HolderDisplayProps } from '../../types';
|
|
3
|
+
export interface HolderListProps {
|
|
4
|
+
/** 选项数据源 */
|
|
5
|
+
dataSource?: HolderOption[];
|
|
6
|
+
/** 当前选中的值数组 */
|
|
7
|
+
selectedValues?: any[];
|
|
8
|
+
/** 显示配置 */
|
|
9
|
+
displayConfig?: HolderDisplayProps;
|
|
10
|
+
/** 渲染添加项的函数 */
|
|
11
|
+
renderAddItem?: () => React.ReactNode;
|
|
12
|
+
/** 列数 */
|
|
13
|
+
columns?: number;
|
|
14
|
+
/** 水平间距 */
|
|
15
|
+
horizontalGap?: number;
|
|
16
|
+
/** 垂直间距 */
|
|
17
|
+
verticalGap?: number;
|
|
18
|
+
/** 是否允许添加 */
|
|
19
|
+
allowAdd?: boolean;
|
|
20
|
+
/** 点击事件处理函数 */
|
|
21
|
+
onClick?: (item: HolderOption) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @title: HolderList 选项列表组件
|
|
25
|
+
* @description: 抽离的选项列表组件,可以在 Modal 外部独立使用
|
|
26
|
+
* @Author: WangHan
|
|
27
|
+
* @Date: 2025-01-XX
|
|
28
|
+
*/
|
|
29
|
+
declare const HolderList: React.FC<HolderListProps>;
|
|
30
|
+
export default HolderList;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/plus/selectHolder/components/HolderList/index.tsx
|
|
30
|
+
var HolderList_exports = {};
|
|
31
|
+
__export(HolderList_exports, {
|
|
32
|
+
default: () => HolderList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(HolderList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_HolderItem = __toESM(require("../HolderItem"));
|
|
38
|
+
var HolderList = ({
|
|
39
|
+
dataSource = [],
|
|
40
|
+
selectedValues = [],
|
|
41
|
+
displayConfig,
|
|
42
|
+
renderAddItem,
|
|
43
|
+
columns = 3,
|
|
44
|
+
horizontalGap = 16,
|
|
45
|
+
verticalGap = 16,
|
|
46
|
+
allowAdd = true,
|
|
47
|
+
onClick
|
|
48
|
+
}) => {
|
|
49
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
50
|
+
import_materials.PisellCustomCheckboxGroup,
|
|
51
|
+
{
|
|
52
|
+
dataSource,
|
|
53
|
+
renderItem: (item) => /* @__PURE__ */ import_react.default.createElement(import_HolderItem.default, { item, displayConfig, value: selectedValues }),
|
|
54
|
+
renderAddItem,
|
|
55
|
+
columns,
|
|
56
|
+
horizontalGap,
|
|
57
|
+
verticalGap,
|
|
58
|
+
allowAdd,
|
|
59
|
+
onClick
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
var HolderList_default = HolderList;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PisellSelectHolderProps } from './types';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export declare const PREFIX = "pisell-lowcode-select-holder";
|
|
5
|
+
declare const PisellSelectHolder: React.FC<PisellSelectHolderProps>;
|
|
6
|
+
export default PisellSelectHolder;
|
|
7
|
+
export { default as HolderList } from './components/HolderList';
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/plus/selectHolder/index.tsx
|
|
30
|
+
var selectHolder_exports = {};
|
|
31
|
+
__export(selectHolder_exports, {
|
|
32
|
+
HolderList: () => import_HolderList2.default,
|
|
33
|
+
PREFIX: () => PREFIX,
|
|
34
|
+
default: () => selectHolder_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(selectHolder_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_materials = require("@pisell/materials");
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_ErrorTip = __toESM(require("./components/ErrorTip"));
|
|
41
|
+
var import_HolderItem = __toESM(require("./components/HolderItem"));
|
|
42
|
+
var import_HolderList = __toESM(require("./components/HolderList"));
|
|
43
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
44
|
+
var import_locales = __toESM(require("./locales"));
|
|
45
|
+
var import_index = require("./index.less");
|
|
46
|
+
var import_HolderList2 = __toESM(require("./components/HolderList"));
|
|
47
|
+
var PREFIX = "pisell-lowcode-select-holder";
|
|
48
|
+
var PisellSelectHolder = ({
|
|
49
|
+
dataSource,
|
|
50
|
+
open = true,
|
|
51
|
+
onClose,
|
|
52
|
+
onConfirm,
|
|
53
|
+
onSkip,
|
|
54
|
+
onAdd,
|
|
55
|
+
value,
|
|
56
|
+
modalConfig,
|
|
57
|
+
displayConfig,
|
|
58
|
+
allowAdd = true,
|
|
59
|
+
horizontalGap = 16,
|
|
60
|
+
verticalGap = 16,
|
|
61
|
+
maxSelectedCount = 2,
|
|
62
|
+
isInline = false,
|
|
63
|
+
className,
|
|
64
|
+
style
|
|
65
|
+
}) => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
const [errorTip, setErrorTip] = (0, import_react.useState)("");
|
|
68
|
+
const [selectedValues, setSelectedValues] = (0, import_react.useState)([]);
|
|
69
|
+
const mobile = (0, import_react.useMemo)(() => (0, import_utils.isMobile)(), []);
|
|
70
|
+
const context = (0, import_useEngineContext.default)();
|
|
71
|
+
import_utils.locales.init(import_locales.default, ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en");
|
|
72
|
+
(0, import_react.useEffect)(() => {
|
|
73
|
+
let _value = [];
|
|
74
|
+
if (Array.isArray(value)) {
|
|
75
|
+
_value = value;
|
|
76
|
+
} else {
|
|
77
|
+
_value = value ? [value] : [];
|
|
78
|
+
}
|
|
79
|
+
setSelectedValues(_value);
|
|
80
|
+
}, [value]);
|
|
81
|
+
(0, import_react.useEffect)(() => {
|
|
82
|
+
if ((displayConfig == null ? void 0 : displayConfig.selectType) !== "single") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (selectedValues.length > 0) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (value !== void 0 && value !== null && (value == null ? void 0 : value.length) > 0) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (Array.isArray(dataSource) && dataSource.length > 0) {
|
|
92
|
+
const firstValidOption = dataSource.find(
|
|
93
|
+
(item) => (item == null ? void 0 : item.value) !== null && (item == null ? void 0 : item.value) !== void 0
|
|
94
|
+
);
|
|
95
|
+
if (firstValidOption) {
|
|
96
|
+
handleClick(firstValidOption);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, [dataSource, displayConfig == null ? void 0 : displayConfig.selectType, selectedValues.length, value]);
|
|
100
|
+
const handleOk = (0, import_react.useCallback)(() => {
|
|
101
|
+
onConfirm == null ? void 0 : onConfirm(selectedValues);
|
|
102
|
+
}, [selectedValues]);
|
|
103
|
+
const handleClick = (0, import_react.useCallback)((item) => {
|
|
104
|
+
if (!(item == null ? void 0 : item.value)) {
|
|
105
|
+
return onAdd == null ? void 0 : onAdd();
|
|
106
|
+
}
|
|
107
|
+
const selectType = (displayConfig == null ? void 0 : displayConfig.selectType) || "single";
|
|
108
|
+
if (selectType === "single") {
|
|
109
|
+
setSelectedValues((prev) => {
|
|
110
|
+
return prev.includes(item.value) ? [] : [item.value];
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
setSelectedValues((prev) => {
|
|
114
|
+
const newValues = prev.includes(item.value) ? prev.filter((v) => v !== item.value) : [...prev, item.value];
|
|
115
|
+
return newValues;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, [displayConfig == null ? void 0 : displayConfig.selectType]);
|
|
119
|
+
const handleSkip = (0, import_react.useCallback)(() => {
|
|
120
|
+
onSkip == null ? void 0 : onSkip();
|
|
121
|
+
}, [onSkip]);
|
|
122
|
+
const addHolderLabel = import_utils.locales.getText("pisell-select-holder-create");
|
|
123
|
+
const renderAddItem = (0, import_react.useCallback)(() => {
|
|
124
|
+
if (!allowAdd) return void 0;
|
|
125
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
126
|
+
import_HolderItem.default,
|
|
127
|
+
{
|
|
128
|
+
item: {
|
|
129
|
+
label: addHolderLabel,
|
|
130
|
+
value: null
|
|
131
|
+
},
|
|
132
|
+
isAddItem: true
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}, [allowAdd]);
|
|
136
|
+
const modalClassName = (0, import_react.useMemo)(() => {
|
|
137
|
+
const classes = [`${PREFIX}-modal`];
|
|
138
|
+
if (mobile) {
|
|
139
|
+
classes.push(`${PREFIX}-modal-mobile`);
|
|
140
|
+
}
|
|
141
|
+
return classes.join(" ");
|
|
142
|
+
}, [mobile]);
|
|
143
|
+
const okButtonProps = (0, import_react.useMemo)(() => {
|
|
144
|
+
if ((displayConfig == null ? void 0 : displayConfig.selectType) === "multiple") {
|
|
145
|
+
return {
|
|
146
|
+
disabled: (selectedValues == null ? void 0 : selectedValues.length) > maxSelectedCount
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
disabled: !(selectedValues == null ? void 0 : selectedValues.length)
|
|
151
|
+
};
|
|
152
|
+
}, [selectedValues, maxSelectedCount, displayConfig == null ? void 0 : displayConfig.selectType]);
|
|
153
|
+
const footerCom = (0, import_react.useMemo)(() => {
|
|
154
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-footer` }, (displayConfig == null ? void 0 : displayConfig.isSkipable) ? /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { onClick: handleSkip }, import_utils.locales.getText("pisell-select-holder-skip")) : null, /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { onClick: handleOk, ...okButtonProps, type: "primary" }, modalConfig == null ? void 0 : modalConfig.confirmText));
|
|
155
|
+
}, [displayConfig == null ? void 0 : displayConfig.isSkipable, modalConfig == null ? void 0 : modalConfig.confirmText, okButtonProps]);
|
|
156
|
+
const renderContent = (0, import_react.useMemo)(() => {
|
|
157
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, mobile && (modalConfig == null ? void 0 : modalConfig.title) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-modal-title` }, modalConfig == null ? void 0 : modalConfig.title) : null, errorTip && /* @__PURE__ */ import_react.default.createElement(import_ErrorTip.default, { text: errorTip }), (displayConfig == null ? void 0 : displayConfig.selectType) === "multiple" && maxSelectedCount ? /* @__PURE__ */ import_react.default.createElement(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
className: `${PREFIX}-selected-info ${selectedValues.length === maxSelectedCount ? `${PREFIX}-selected-info-max` : ""}`
|
|
161
|
+
},
|
|
162
|
+
import_utils.locales.getText("pisell-select-holder-selected"),
|
|
163
|
+
selectedValues.length,
|
|
164
|
+
"/",
|
|
165
|
+
maxSelectedCount,
|
|
166
|
+
selectedValues.length > maxSelectedCount ? /* @__PURE__ */ import_react.default.createElement("span", null, " ", import_utils.locales.getText("pisell-select-holder-please-remove")(selectedValues.length - maxSelectedCount)) : null
|
|
167
|
+
) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
168
|
+
import_HolderList.default,
|
|
169
|
+
{
|
|
170
|
+
dataSource,
|
|
171
|
+
selectedValues,
|
|
172
|
+
displayConfig,
|
|
173
|
+
renderAddItem,
|
|
174
|
+
columns: mobile ? 2 : 3,
|
|
175
|
+
horizontalGap,
|
|
176
|
+
verticalGap,
|
|
177
|
+
allowAdd,
|
|
178
|
+
onClick: handleClick
|
|
179
|
+
}
|
|
180
|
+
));
|
|
181
|
+
}, [
|
|
182
|
+
isInline,
|
|
183
|
+
modalConfig,
|
|
184
|
+
dataSource,
|
|
185
|
+
errorTip,
|
|
186
|
+
maxSelectedCount,
|
|
187
|
+
selectedValues,
|
|
188
|
+
displayConfig,
|
|
189
|
+
renderAddItem,
|
|
190
|
+
mobile,
|
|
191
|
+
horizontalGap,
|
|
192
|
+
verticalGap,
|
|
193
|
+
allowAdd,
|
|
194
|
+
handleClick
|
|
195
|
+
]);
|
|
196
|
+
if (isInline) {
|
|
197
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-inline-wrap ${className}`, style }, renderContent);
|
|
198
|
+
}
|
|
199
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
200
|
+
import_materials.PisellModal,
|
|
201
|
+
{
|
|
202
|
+
open,
|
|
203
|
+
title: mobile ? "" : modalConfig == null ? void 0 : modalConfig.title,
|
|
204
|
+
platform: mobile ? "h5" : "pc",
|
|
205
|
+
closable: modalConfig == null ? void 0 : modalConfig.showClose,
|
|
206
|
+
bodyStyle: { padding: mobile ? "0 16px 16px" : 20 },
|
|
207
|
+
mobileModalHeight: "auto",
|
|
208
|
+
destroyOnClose: true,
|
|
209
|
+
className: modalClassName,
|
|
210
|
+
headerDivider: false,
|
|
211
|
+
width: mobile ? "100%" : "640px",
|
|
212
|
+
footer: footerCom,
|
|
213
|
+
onCancel: onClose
|
|
214
|
+
},
|
|
215
|
+
renderContent
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
var selectHolder_default = PisellSelectHolder;
|
|
219
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
220
|
+
0 && (module.exports = {
|
|
221
|
+
HolderList,
|
|
222
|
+
PREFIX
|
|
223
|
+
});
|