@pisell/private-materials 6.3.70 → 6.3.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +8 -7
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.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 +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -2
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/payo/config.d.ts +0 -1
- package/es/components/eftposPay/tip.d.ts +0 -1
- package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/kioskSkuDetail/index.d.ts +39 -0
- package/es/components/kioskSkuDetail/index.js +531 -0
- package/es/components/kioskSkuDetail/index.less +196 -0
- package/es/components/kioskSkuDetail/locales.d.ts +27 -0
- package/es/components/kioskSkuDetail/locales.js +26 -0
- package/es/components/login/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/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 +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/calendar/index.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/es/components/schedules/products/list/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/list/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/walletList/index.js +7 -2
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/es/plus/saasRegister/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/VariantCard/index.js +30 -1
- package/es/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
- package/es/plus/skuOptionsSelection/locales.d.ts +3 -0
- package/es/plus/skuOptionsSelection/locales.js +3 -0
- package/es/plus/skuOptionsSelection/store/actions.js +17 -2
- package/es/plus/skuOptionsSelection/types.d.ts +5 -0
- package/es/plus/skuOptionsSelection/types.js +2 -1
- package/es/plus/skuOptionsSelection/utils/transformVariantGroup.js +70 -3
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
- package/es/plus/walletPassGallery/index.js +2 -2
- package/es/pro/numberKeyboard/index.d.ts +28 -0
- package/es/pro/numberKeyboard/index.js +155 -0
- package/es/pro/numberKeyboard/index.less +25 -0
- package/es/pro/numberKeyboard/locales.d.ts +12 -0
- package/es/pro/numberKeyboard/locales.js +11 -0
- package/es/pro/pisellNumberSelector/example.d.ts +3 -0
- package/es/pro/pisellNumberSelector/example.js +68 -0
- package/es/pro/pisellNumberSelector/index.d.ts +29 -0
- package/es/pro/pisellNumberSelector/index.js +257 -0
- package/es/pro/pisellNumberSelector/index.less +235 -0
- package/es/pro/skuDetailModal/index.d.ts +4 -0
- package/es/pro/skuDetailModal/index.js +1031 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.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 +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -2
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.d.ts +0 -1
- package/lib/components/eftposPay/tip.d.ts +0 -1
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/kioskSkuDetail/index.d.ts +39 -0
- package/lib/components/kioskSkuDetail/index.js +393 -0
- package/lib/components/kioskSkuDetail/index.less +196 -0
- package/lib/components/kioskSkuDetail/locales.d.ts +27 -0
- package/lib/components/kioskSkuDetail/locales.js +50 -0
- package/lib/components/login/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/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 +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/calendar/index.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/lib/components/schedules/products/list/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/list/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/walletList/index.js +5 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +7 -1
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/lib/plus/saasRegister/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +32 -3
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
- package/lib/plus/skuOptionsSelection/locales.d.ts +3 -0
- package/lib/plus/skuOptionsSelection/locales.js +3 -0
- package/lib/plus/skuOptionsSelection/store/actions.js +25 -1
- package/lib/plus/skuOptionsSelection/types.d.ts +5 -0
- package/lib/plus/skuOptionsSelection/types.js +2 -1
- package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.js +51 -5
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/index.js +2 -2
- package/lib/pro/numberKeyboard/index.d.ts +28 -0
- package/lib/pro/numberKeyboard/index.js +182 -0
- package/lib/pro/numberKeyboard/index.less +25 -0
- package/lib/pro/numberKeyboard/locales.d.ts +12 -0
- package/lib/pro/numberKeyboard/locales.js +35 -0
- package/lib/pro/pisellNumberSelector/example.d.ts +3 -0
- package/lib/pro/pisellNumberSelector/example.js +93 -0
- package/lib/pro/pisellNumberSelector/index.d.ts +29 -0
- package/lib/pro/pisellNumberSelector/index.js +275 -0
- package/lib/pro/pisellNumberSelector/index.less +235 -0
- package/lib/pro/skuDetailModal/index.d.ts +4 -0
- package/lib/pro/skuDetailModal/index.js +736 -0
- package/lowcode/kiosk-sku-detail/meta.ts +264 -0
- package/package.json +4 -4
- package/es/components/Sales/Cart/utils.d.ts +0 -63
- package/es/components/Sales/Summary/utils.d.ts +0 -51
- package/es/components/appointmentBooking/locales.d.ts +0 -363
- package/es/components/booking/components/tabPane/index.d.ts +0 -4
- package/es/components/booking/dashboard/serve.d.ts +0 -1
- package/es/components/booking/editBookingModal/utils.d.ts +0 -12
- package/es/components/booking/forms/serve.d.ts +0 -18
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/es/components/booking/info/client/serve.d.ts +0 -2
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +0 -9
- package/es/components/booking/info/pet/serve.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/serve.d.ts +0 -5
- package/es/components/booking/info/service/editService/constants.d.ts +0 -1
- package/es/components/booking/info/service/serve.d.ts +0 -20
- package/es/components/booking/info2/serve.d.ts +0 -6
- package/es/components/booking/locales.d.ts +0 -843
- package/es/components/eftposPay/const.d.ts +0 -184
- package/es/components/eftposPay/locales.d.ts +0 -330
- package/es/components/eftposPay/manufacturer.d.ts +0 -7
- package/es/components/eftposPay/payo/payment.d.ts +0 -66
- package/es/components/pay/toC/PaymentList/utils.d.ts +0 -36
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -2
- package/es/components/pay/toC/locales.d.ts +0 -307
- package/es/components/pay/toC/status.d.ts +0 -13
- package/es/components/ruleSetting/locales.d.ts +0 -48
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/type.d.ts +0 -48
- package/es/components/subTotal/locales.d.ts +0 -42
- package/es/components/systemSettings/registry/locales.d.ts +0 -272
- package/es/components/systemSettings/registry/services.d.ts +0 -77
- package/es/components/systemSettings/registry/types.d.ts +0 -126
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/es/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/es/components/ticketBooking/locales.d.ts +0 -174
- package/es/components/wallet/utils.d.ts +0 -48
- package/es/components/walletList/locales.d.ts +0 -27
- package/es/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/es/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/es/hooks/useEngineContext.d.ts +0 -10
- package/es/hooks/useWindowSize.d.ts +0 -5
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +0 -30
- package/es/plus/selectHolder/locales.d.ts +0 -21
- package/es/plus/selectHolder/types.d.ts +0 -104
- package/es/plus/selectHolder/utils.d.ts +0 -9
- package/es/plus/skuOptionsSelection/hooks/useLanguage.d.ts +0 -2
- package/es/plus/skuOptionsSelection/hooks/useSymbol.d.ts +0 -2
- package/es/plus/skuOptionsSelection/store/createStore.d.ts +0 -15
- package/es/plus/skuOptionsSelection/utils/calculateOption.d.ts +0 -6
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/es/plus/walletEditor/locales.d.ts +0 -135
- package/es/plus/walletPassGallery/locales.d.ts +0 -285
- package/es/plus/walletPassGallery/utils.d.ts +0 -48
- package/es/pro/Login2.0/shared/types.d.ts +0 -232
- package/es/pro/NumericStepper/index.d.ts +0 -43
- package/es/pro/Selector/BatchSelectorDemo.d.ts +0 -3
- package/es/pro/Selector/Item.d.ts +0 -14
- package/es/pro/Selector/Selector.stories.d.ts +0 -78
- package/es/pro/Selector/components/Card/index.d.ts +0 -57
- package/es/pro/Selector/components/Card/types.d.ts +0 -1
- package/es/pro/Selector/components/Indicator/index.d.ts +0 -19
- package/es/pro/Selector/components/IntersectionObserver.d.ts +0 -105
- package/es/pro/Selector/components/LayoutContainer/index.d.ts +0 -16
- package/es/pro/Selector/components/Media/index.d.ts +0 -6
- package/es/pro/Selector/components/Media/types.d.ts +0 -47
- package/es/pro/Selector/components/index.d.ts +0 -4
- package/es/pro/Selector/demo.d.ts +0 -2
- package/es/pro/Selector/hooks/usePresetItemProps.d.ts +0 -43
- package/es/pro/Selector/hooks/usePresetProps.d.ts +0 -24
- package/es/pro/Selector/index.d.ts +0 -11
- package/es/pro/Selector/locales.d.ts +0 -36
- package/es/pro/Selector/types.d.ts +0 -173
- package/es/pro/Selector/utils/index.d.ts +0 -49
- package/es/test/setup.d.ts +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +0 -63
- package/lib/components/Sales/Summary/utils.d.ts +0 -51
- package/lib/components/appointmentBooking/locales.d.ts +0 -363
- package/lib/components/booking/components/tabPane/index.d.ts +0 -4
- package/lib/components/booking/dashboard/serve.d.ts +0 -1
- package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
- package/lib/components/booking/forms/serve.d.ts +0 -18
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
- package/lib/components/booking/info/client/serve.d.ts +0 -2
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +0 -9
- package/lib/components/booking/info/pet/serve.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/serve.d.ts +0 -5
- package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
- package/lib/components/booking/info/service/serve.d.ts +0 -20
- package/lib/components/booking/info2/serve.d.ts +0 -6
- package/lib/components/booking/locales.d.ts +0 -843
- package/lib/components/eftposPay/const.d.ts +0 -184
- package/lib/components/eftposPay/locales.d.ts +0 -330
- package/lib/components/eftposPay/manufacturer.d.ts +0 -7
- package/lib/components/eftposPay/payo/payment.d.ts +0 -66
- package/lib/components/pay/toC/PaymentList/utils.d.ts +0 -36
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -2
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -2
- package/lib/components/pay/toC/locales.d.ts +0 -307
- package/lib/components/pay/toC/status.d.ts +0 -13
- package/lib/components/ruleSetting/locales.d.ts +0 -48
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/type.d.ts +0 -48
- package/lib/components/subTotal/locales.d.ts +0 -42
- package/lib/components/systemSettings/registry/locales.d.ts +0 -272
- package/lib/components/systemSettings/registry/services.d.ts +0 -77
- package/lib/components/systemSettings/registry/types.d.ts +0 -126
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/lib/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/lib/components/ticketBooking/locales.d.ts +0 -174
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/walletList/locales.d.ts +0 -27
- package/lib/components/workSpaceList/components/AppearanceEdit/constants.d.ts +0 -8
- package/lib/components/workSpaceList/components/Card/constants.d.ts +0 -2
- package/lib/hooks/useEngineContext.d.ts +0 -10
- package/lib/hooks/useWindowSize.d.ts +0 -5
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +0 -30
- package/lib/plus/selectHolder/locales.d.ts +0 -21
- package/lib/plus/selectHolder/types.d.ts +0 -104
- package/lib/plus/selectHolder/utils.d.ts +0 -9
- package/lib/plus/skuOptionsSelection/hooks/useLanguage.d.ts +0 -2
- package/lib/plus/skuOptionsSelection/hooks/useSymbol.d.ts +0 -2
- package/lib/plus/skuOptionsSelection/store/createStore.d.ts +0 -15
- package/lib/plus/skuOptionsSelection/utils/calculateOption.d.ts +0 -6
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.d.ts +0 -4
- package/lib/plus/walletEditor/locales.d.ts +0 -135
- package/lib/plus/walletPassGallery/locales.d.ts +0 -285
- package/lib/plus/walletPassGallery/utils.d.ts +0 -48
- package/lib/pro/Login2.0/shared/types.d.ts +0 -232
- package/lib/pro/NumericStepper/index.d.ts +0 -43
- package/lib/pro/Selector/BatchSelectorDemo.d.ts +0 -3
- package/lib/pro/Selector/Item.d.ts +0 -14
- package/lib/pro/Selector/Selector.stories.d.ts +0 -78
- package/lib/pro/Selector/components/Card/index.d.ts +0 -57
- package/lib/pro/Selector/components/Card/types.d.ts +0 -1
- package/lib/pro/Selector/components/Indicator/index.d.ts +0 -19
- package/lib/pro/Selector/components/IntersectionObserver.d.ts +0 -105
- package/lib/pro/Selector/components/LayoutContainer/index.d.ts +0 -16
- package/lib/pro/Selector/components/Media/index.d.ts +0 -6
- package/lib/pro/Selector/components/Media/types.d.ts +0 -47
- package/lib/pro/Selector/components/index.d.ts +0 -4
- package/lib/pro/Selector/demo.d.ts +0 -2
- package/lib/pro/Selector/hooks/usePresetItemProps.d.ts +0 -43
- package/lib/pro/Selector/hooks/usePresetProps.d.ts +0 -24
- package/lib/pro/Selector/index.d.ts +0 -11
- package/lib/pro/Selector/locales.d.ts +0 -36
- package/lib/pro/Selector/types.d.ts +0 -173
- package/lib/pro/Selector/utils/index.d.ts +0 -49
- package/lib/test/setup.d.ts +0 -1
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/pro/skuDetailModal/index.tsx
|
|
30
|
+
var skuDetailModal_exports = {};
|
|
31
|
+
__export(skuDetailModal_exports, {
|
|
32
|
+
default: () => skuDetailModal_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(skuDetailModal_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_Delete_wght300_24px = __toESM(require("@pisell/icon/es/Delete_wght300_24px"));
|
|
40
|
+
var import_locales = __toESM(require("./locales"));
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var import_pisellNumberSelector = __toESM(require("../pisellNumberSelector"));
|
|
43
|
+
var import_noteModal = __toESM(require("../../plus/noteModal"));
|
|
44
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
45
|
+
var import_priceKeyboard = require("../priceKeyboard");
|
|
46
|
+
var import_skuOptionsSelection = __toESM(require("../../plus/skuOptionsSelection"));
|
|
47
|
+
var import_serve = require("../../components/booking/info/service/serve");
|
|
48
|
+
var import_utils2 = require("./utils");
|
|
49
|
+
var import_model = require("../../components/booking/info/model");
|
|
50
|
+
var import_useToast = __toESM(require("../../hooks/useToast"));
|
|
51
|
+
var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
53
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
54
|
+
const [productData, setProductData] = (0, import_react.useState)(null);
|
|
55
|
+
const [note, setNote] = (0, import_react.useState)("");
|
|
56
|
+
const [quantity, setQuantity] = (0, import_react.useState)(1);
|
|
57
|
+
const [priceOverride, setPriceOverride] = (0, import_react.useState)(null);
|
|
58
|
+
const [showPriceAdjustModal, setShowPriceAdjustModal] = (0, import_react.useState)(false);
|
|
59
|
+
const [discounts, setDiscounts] = (0, import_react.useState)([]);
|
|
60
|
+
const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
|
|
61
|
+
const [skuValue, setSkuValue] = (0, import_react.useState)({
|
|
62
|
+
price: 0,
|
|
63
|
+
product_id: 0,
|
|
64
|
+
product_variant_id: 0,
|
|
65
|
+
bundle: [],
|
|
66
|
+
option: []
|
|
67
|
+
});
|
|
68
|
+
const [skuDefaultValue, setSkuDefaultValue] = (0, import_react.useState)({
|
|
69
|
+
product_id: 0,
|
|
70
|
+
price: 0,
|
|
71
|
+
product_variant_id: 0,
|
|
72
|
+
bundle: [],
|
|
73
|
+
option: []
|
|
74
|
+
});
|
|
75
|
+
const openParamsRef = (0, import_react.useRef)(null);
|
|
76
|
+
const Toast = (0, import_useToast.default)();
|
|
77
|
+
const skuOptionsSelectionRef = (0, import_react.useRef)(null);
|
|
78
|
+
const [stockAlertOpen, setStockAlertOpen] = (0, import_react.useState)(false);
|
|
79
|
+
const [stockAlertDontShowAgainChecked, setStockAlertDontShowAgainChecked] = (0, import_react.useState)(false);
|
|
80
|
+
const pendingConfirmDataRef = (0, import_react.useRef)(null);
|
|
81
|
+
const [currentStep, setCurrentStep] = (0, import_react.useState)(0);
|
|
82
|
+
const procedureRef = (0, import_react.useRef)(null);
|
|
83
|
+
const context = (0, import_useEngineContext.default)();
|
|
84
|
+
const { store, getData } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
85
|
+
const { state: bookingState } = (0, import_react.useContext)(import_model.Context) || {};
|
|
86
|
+
const symbol = ((_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) || "$";
|
|
87
|
+
import_utils.locales.init(import_locales.default, ((_f = (_e = context == null ? void 0 : context.engine) == null ? void 0 : _e.props) == null ? void 0 : _f.locale) || "en");
|
|
88
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
89
|
+
open: async (data) => {
|
|
90
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q;
|
|
91
|
+
setCurrentStep(1);
|
|
92
|
+
if ("date" in data && !("_extend" in data)) {
|
|
93
|
+
openParamsRef.current = data;
|
|
94
|
+
const open_deposit = (getData == null ? void 0 : getData("bookingv2_deposit")) || 0;
|
|
95
|
+
const productDetail = await (0, import_serve.getProductDetail)(String(data.id), {
|
|
96
|
+
schedule_date: data.date,
|
|
97
|
+
is_eject: data.is_eject,
|
|
98
|
+
open_deposit
|
|
99
|
+
});
|
|
100
|
+
const apiData = (productDetail == null ? void 0 : productDetail.data) || {};
|
|
101
|
+
const basePrice = Number((apiData == null ? void 0 : apiData.price) || 0);
|
|
102
|
+
const hydratedData = {
|
|
103
|
+
...apiData,
|
|
104
|
+
id: (apiData == null ? void 0 : apiData.id) || data.id,
|
|
105
|
+
product_id: (apiData == null ? void 0 : apiData.product_id) || data.id,
|
|
106
|
+
_extend: {
|
|
107
|
+
...(apiData == null ? void 0 : apiData._extend) || {},
|
|
108
|
+
product_name: (apiData == null ? void 0 : apiData.title) || (apiData == null ? void 0 : apiData.product_name) || "",
|
|
109
|
+
quantity: 1,
|
|
110
|
+
price: basePrice,
|
|
111
|
+
total: basePrice,
|
|
112
|
+
origin_total: basePrice,
|
|
113
|
+
note: "",
|
|
114
|
+
skuValue: {
|
|
115
|
+
product_id: (apiData == null ? void 0 : apiData.id) || data.id,
|
|
116
|
+
product_variant_id: 0,
|
|
117
|
+
bundle: [],
|
|
118
|
+
option: []
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const isEject = Number((apiData == null ? void 0 : apiData.is_eject) ?? data.is_eject ?? 0) === 1;
|
|
123
|
+
if (!isEject) {
|
|
124
|
+
onConfirm == null ? void 0 : onConfirm(hydratedData);
|
|
125
|
+
modalCloseAction();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
setProductData(hydratedData);
|
|
129
|
+
setNote("");
|
|
130
|
+
setQuantity((apiData == null ? void 0 : apiData.min_num_unit) || 1);
|
|
131
|
+
setDiscounts([]);
|
|
132
|
+
setSkuValue({
|
|
133
|
+
product_id: hydratedData.id,
|
|
134
|
+
product_variant_id: 0,
|
|
135
|
+
bundle: [],
|
|
136
|
+
option: []
|
|
137
|
+
});
|
|
138
|
+
setSkuDefaultValue({
|
|
139
|
+
product_id: hydratedData.id,
|
|
140
|
+
product_variant_id: 0,
|
|
141
|
+
bundle: [],
|
|
142
|
+
option: [],
|
|
143
|
+
price: ((_a2 = hydratedData == null ? void 0 : hydratedData._extend) == null ? void 0 : _a2.price) || 0
|
|
144
|
+
});
|
|
145
|
+
setPriceOverride(null);
|
|
146
|
+
setShowPriceAdjustModal(false);
|
|
147
|
+
setOpen(true);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
openParamsRef.current = null;
|
|
151
|
+
const _data = safeClone(data);
|
|
152
|
+
setProductData(_data);
|
|
153
|
+
console.log(_data, "_data");
|
|
154
|
+
setNote(((_b2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _b2.note) || "");
|
|
155
|
+
setQuantity(((_c2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _c2.quantity) || 1);
|
|
156
|
+
setDiscounts((_data == null ? void 0 : _data.discount_list) || []);
|
|
157
|
+
console.log({
|
|
158
|
+
product_id: _data == null ? void 0 : _data.product_id,
|
|
159
|
+
product_variant_id: ((_e2 = (_d2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _d2.other) == null ? void 0 : _e2.product_variant_id) || 0,
|
|
160
|
+
bundle: ((_g2 = (_f2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _f2.other) == null ? void 0 : _g2.bundle) || [],
|
|
161
|
+
option: ((_i2 = (_h2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _h2.other) == null ? void 0 : _i2.option) || []
|
|
162
|
+
}, "skuValue");
|
|
163
|
+
setSkuDefaultValue({
|
|
164
|
+
product_id: _data == null ? void 0 : _data.product_id,
|
|
165
|
+
product_variant_id: ((_k = (_j2 = _data == null ? void 0 : _data._extend) == null ? void 0 : _j2.other) == null ? void 0 : _k.product_variant_id) || 0,
|
|
166
|
+
price: ((_l = _data == null ? void 0 : _data._extend) == null ? void 0 : _l.price) || 0,
|
|
167
|
+
bundle: ((_n = (_m = _data == null ? void 0 : _data._extend) == null ? void 0 : _m.other) == null ? void 0 : _n.bundle) || [],
|
|
168
|
+
option: ((_p = (_o = _data == null ? void 0 : _data._extend) == null ? void 0 : _o.other) == null ? void 0 : _p.option) || []
|
|
169
|
+
});
|
|
170
|
+
setPriceOverride(((_q = _data == null ? void 0 : _data._extend) == null ? void 0 : _q.priceOverride) || void 0);
|
|
171
|
+
setShowPriceAdjustModal(false);
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
setOpen(true);
|
|
174
|
+
}, 0);
|
|
175
|
+
}
|
|
176
|
+
}));
|
|
177
|
+
const priceText = (0, import_react.useMemo)(() => {
|
|
178
|
+
var _a2;
|
|
179
|
+
const price = ((_a2 = productData == null ? void 0 : productData._extend) == null ? void 0 : _a2.price) || 0;
|
|
180
|
+
const priceSign = Number(price) < 0 ? "-" : "";
|
|
181
|
+
return `${priceSign}${symbol}${Math.abs(Number(price))}`;
|
|
182
|
+
}, [(_g = productData == null ? void 0 : productData._extend) == null ? void 0 : _g.price, symbol]);
|
|
183
|
+
const unitPrice = (0, import_react.useMemo)(() => {
|
|
184
|
+
const activeSkuValue = (skuValue == null ? void 0 : skuValue.product_id) ? skuValue : skuDefaultValue;
|
|
185
|
+
return getSelectedUnitPrice({ productData, skuValue: activeSkuValue });
|
|
186
|
+
}, [productData, skuValue, skuDefaultValue]);
|
|
187
|
+
const displayUnitPrice = (0, import_react.useMemo)(() => {
|
|
188
|
+
if (priceOverride === null || typeof priceOverride === "undefined") return unitPrice;
|
|
189
|
+
return priceOverride;
|
|
190
|
+
}, [priceOverride, unitPrice]);
|
|
191
|
+
const subtotal = (0, import_react.useMemo)(() => {
|
|
192
|
+
return new import_decimal.default(unitPrice || 0);
|
|
193
|
+
}, [unitPrice]);
|
|
194
|
+
const subtotalText = (0, import_react.useMemo)(() => {
|
|
195
|
+
const priceSign = subtotal.toNumber() < 0 ? "-" : "";
|
|
196
|
+
return `${priceSign}${symbol}${subtotal.abs().toNumber().toFixed(2)}`;
|
|
197
|
+
}, [subtotal, symbol]);
|
|
198
|
+
const discountsCount = (0, import_react.useMemo)(() => {
|
|
199
|
+
return (discounts == null ? void 0 : discounts.length) || 0;
|
|
200
|
+
}, [discounts]);
|
|
201
|
+
const totalDiscounts = (0, import_react.useMemo)(() => {
|
|
202
|
+
if ((discounts == null ? void 0 : discounts.length) > 0) {
|
|
203
|
+
return discounts.reduce((sum, discount) => {
|
|
204
|
+
const includeType = ["discount_card", "product_discount_card"];
|
|
205
|
+
const _quantity = includeType.includes((discount == null ? void 0 : discount.type) || "") ? quantity : 1;
|
|
206
|
+
return sum.plus(new import_decimal.default((discount == null ? void 0 : discount.amount) || 0).mul(_quantity));
|
|
207
|
+
}, new import_decimal.default(0)).toNumber().toFixed(2);
|
|
208
|
+
}
|
|
209
|
+
return "0.00";
|
|
210
|
+
}, [discounts, quantity]);
|
|
211
|
+
const finalTotal = (0, import_react.useMemo)(() => {
|
|
212
|
+
const deTotal = new import_decimal.default(displayUnitPrice || "0");
|
|
213
|
+
const deQuantity = new import_decimal.default(quantity || "1");
|
|
214
|
+
return deTotal.mul(deQuantity);
|
|
215
|
+
}, [displayUnitPrice, quantity]);
|
|
216
|
+
const totalText = (0, import_react.useMemo)(() => {
|
|
217
|
+
const priceSign = finalTotal.toNumber() < 0 ? "-" : "";
|
|
218
|
+
return `${priceSign}${symbol}${finalTotal.abs().toNumber().toFixed(2)}`;
|
|
219
|
+
}, [finalTotal, symbol]);
|
|
220
|
+
const priceOverrideText = (0, import_react.useMemo)(() => {
|
|
221
|
+
if (priceOverride === null || typeof priceOverride === "undefined") return "";
|
|
222
|
+
const prefix = `(${import_utils.locales.getText("pisell2.text.sku.detail.modal.price.override")} `;
|
|
223
|
+
const overrideNumber = new import_decimal.default(priceOverride || 0);
|
|
224
|
+
const sign = overrideNumber.toNumber() < 0 ? "-" : "";
|
|
225
|
+
const absValue = overrideNumber.abs().toNumber().toFixed(2);
|
|
226
|
+
return `${prefix}${sign}${symbol}${absValue})`;
|
|
227
|
+
}, [priceOverride, symbol]);
|
|
228
|
+
const priceChangeText = (0, import_react.useMemo)(() => {
|
|
229
|
+
if (priceOverride === null || typeof priceOverride === "undefined") return "";
|
|
230
|
+
const diff = new import_decimal.default(priceOverride || 0).minus(new import_decimal.default(unitPrice || 0)).mul(new import_decimal.default(quantity || 1));
|
|
231
|
+
const diffNumber = diff.toNumber();
|
|
232
|
+
const diffSign = diffNumber > 0 ? "+" : diffNumber < 0 ? "-" : "";
|
|
233
|
+
const absDiff = diff.abs().toNumber().toFixed(2);
|
|
234
|
+
return `${diffSign}${symbol}${absDiff}`;
|
|
235
|
+
}, [priceOverride, unitPrice, quantity, symbol]);
|
|
236
|
+
const modalCloseAction = () => {
|
|
237
|
+
setOpen(false);
|
|
238
|
+
setProductData(null);
|
|
239
|
+
setNote("");
|
|
240
|
+
setQuantity(1);
|
|
241
|
+
setNoteModalOpen(false);
|
|
242
|
+
setPriceOverride(null);
|
|
243
|
+
setShowPriceAdjustModal(false);
|
|
244
|
+
setDiscounts([]);
|
|
245
|
+
openParamsRef.current = null;
|
|
246
|
+
};
|
|
247
|
+
const handleCancel = () => {
|
|
248
|
+
modalCloseAction();
|
|
249
|
+
onClose == null ? void 0 : onClose();
|
|
250
|
+
};
|
|
251
|
+
const handleCheckStock = (params) => {
|
|
252
|
+
var _a2, _b2;
|
|
253
|
+
const value = (params == null ? void 0 : params.value) || skuValue;
|
|
254
|
+
const data = (params == null ? void 0 : params.data) || productData;
|
|
255
|
+
if (!data) return true;
|
|
256
|
+
if ((value == null ? void 0 : value.product_variant_id) && data) {
|
|
257
|
+
const variantItem = (_a2 = data == null ? void 0 : data.variant) == null ? void 0 : _a2.find(
|
|
258
|
+
(item) => item.id === value.product_variant_id
|
|
259
|
+
);
|
|
260
|
+
const variantCanSell = (0, import_utils2.checkSkuStockCanSell)(variantItem);
|
|
261
|
+
if (!variantCanSell.hasStock) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (((_b2 = value == null ? void 0 : value.bundle) == null ? void 0 : _b2.length) > 0 && data) {
|
|
266
|
+
const bundleCanSell = value == null ? void 0 : value.bundle.every((item) => {
|
|
267
|
+
const data2 = (0, import_utils2.checkSkuStockCanSell)(item);
|
|
268
|
+
return data2.hasStock;
|
|
269
|
+
});
|
|
270
|
+
if (!bundleCanSell) {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const productCanSell = (0, import_utils2.checkSkuStockCanSell)(data);
|
|
275
|
+
if (!productCanSell.hasStock) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
return true;
|
|
279
|
+
};
|
|
280
|
+
const handleConfirm = async () => {
|
|
281
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
282
|
+
if (currentStep === 0) {
|
|
283
|
+
(_b2 = (_a2 = procedureRef.current) == null ? void 0 : _a2.goToStep) == null ? void 0 : _b2.call(_a2, 1);
|
|
284
|
+
setCurrentStep(1);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
const requiredOptionValidation = (_e2 = (_d2 = (_c2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _c2.config) == null ? void 0 : _d2.product_setting_tab) == null ? void 0 : _e2.required_option_validation;
|
|
288
|
+
const shouldValidate = Number(requiredOptionValidation ?? 1) !== 0;
|
|
289
|
+
if (shouldValidate) {
|
|
290
|
+
try {
|
|
291
|
+
const isValid = await ((_g2 = (_f2 = skuOptionsSelectionRef.current) == null ? void 0 : _f2.validate) == null ? void 0 : _g2.call(_f2));
|
|
292
|
+
if (!isValid) return;
|
|
293
|
+
} catch (error) {
|
|
294
|
+
console.log("sku_detail_modal_validate_error>>>>>", error);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (productData && onConfirm) {
|
|
299
|
+
const latestSkuValue = ((_i2 = (_h2 = skuOptionsSelectionRef.current) == null ? void 0 : _h2.getTransformValues) == null ? void 0 : _i2.call(_h2)) || skuValue || skuDefaultValue;
|
|
300
|
+
const updatedData = {
|
|
301
|
+
...productData,
|
|
302
|
+
discount_list: discounts || [],
|
|
303
|
+
_extend: {
|
|
304
|
+
...(productData == null ? void 0 : productData._extend) || {},
|
|
305
|
+
quantity,
|
|
306
|
+
note,
|
|
307
|
+
// 上层 getProductTotalPrice 依赖 other 来计算(组合规格/套餐/单规格)
|
|
308
|
+
other: getOtherFromSkuValue({
|
|
309
|
+
productData,
|
|
310
|
+
skuValue: latestSkuValue
|
|
311
|
+
}),
|
|
312
|
+
skuValue: getOtherFromSkuValue({
|
|
313
|
+
productData,
|
|
314
|
+
skuValue: latestSkuValue
|
|
315
|
+
}),
|
|
316
|
+
...priceOverride !== null && typeof priceOverride !== "undefined" ? { priceOverride } : {}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const stockValidation = Number(
|
|
320
|
+
((_l = (_k = (_j2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _j2.config) == null ? void 0 : _k.stock_setting) == null ? void 0 : _l.stock_validation) ?? 0
|
|
321
|
+
);
|
|
322
|
+
const allowAddToCartWhenOutStock = Number(
|
|
323
|
+
((_o = (_n = (_m = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _m.config) == null ? void 0 : _n.stock_setting) == null ? void 0 : _o.allow_add_to_cart_when_out_stock) ?? 0
|
|
324
|
+
);
|
|
325
|
+
const enableDontShowAgainToday = Number(
|
|
326
|
+
((_r = (_q = (_p = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _p.config) == null ? void 0 : _q.stock_setting) == null ? void 0 : _r.do_not_show_again_today) ?? 0
|
|
327
|
+
);
|
|
328
|
+
if (stockValidation === 1) {
|
|
329
|
+
const hasStock = handleCheckStock({
|
|
330
|
+
value: latestSkuValue,
|
|
331
|
+
data: productData
|
|
332
|
+
});
|
|
333
|
+
if (!hasStock) {
|
|
334
|
+
if (allowAddToCartWhenOutStock !== 1) {
|
|
335
|
+
Toast == null ? void 0 : Toast.fail(import_utils.locales.getText("pisell2.skuOptionsSelection.variantItemCard.soldOut"));
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const productId = Number((productData == null ? void 0 : productData.product_id) || 0);
|
|
339
|
+
const shouldSkipAlert = enableDontShowAgainToday === 1 && hasHiddenStockAlertForToday({ productId });
|
|
340
|
+
if (!shouldSkipAlert) {
|
|
341
|
+
pendingConfirmDataRef.current = updatedData;
|
|
342
|
+
setStockAlertDontShowAgainChecked(false);
|
|
343
|
+
setStockAlertOpen(true);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
onConfirm(updatedData);
|
|
349
|
+
modalCloseAction();
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
const handleStockAlertCancel = () => {
|
|
353
|
+
pendingConfirmDataRef.current = null;
|
|
354
|
+
setStockAlertOpen(false);
|
|
355
|
+
setStockAlertDontShowAgainChecked(false);
|
|
356
|
+
};
|
|
357
|
+
const handleStockAlertContinue = () => {
|
|
358
|
+
var _a2, _b2, _c2;
|
|
359
|
+
const pendingData = pendingConfirmDataRef.current;
|
|
360
|
+
if (!pendingData) {
|
|
361
|
+
setStockAlertOpen(false);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
const enableDontShowAgainToday = Number(
|
|
365
|
+
((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.do_not_show_again_today) ?? 0
|
|
366
|
+
);
|
|
367
|
+
if (enableDontShowAgainToday === 1 && stockAlertDontShowAgainChecked) {
|
|
368
|
+
const productId = Number((productData == null ? void 0 : productData.product_id) || 0);
|
|
369
|
+
setHiddenStockAlertForToday({ productId });
|
|
370
|
+
}
|
|
371
|
+
onConfirm == null ? void 0 : onConfirm(pendingData);
|
|
372
|
+
pendingConfirmDataRef.current = null;
|
|
373
|
+
setStockAlertOpen(false);
|
|
374
|
+
modalCloseAction();
|
|
375
|
+
};
|
|
376
|
+
const handleRemove = () => {
|
|
377
|
+
if (productData && onRemove) {
|
|
378
|
+
onRemove(productData);
|
|
379
|
+
modalCloseAction();
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
const handleQuantityChange = (value) => {
|
|
383
|
+
if (value && value > 0) {
|
|
384
|
+
setQuantity(value);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
const onNoteConfirm = (note2) => {
|
|
388
|
+
setNote(note2);
|
|
389
|
+
setNoteModalOpen(false);
|
|
390
|
+
};
|
|
391
|
+
const onNoteDelete = () => {
|
|
392
|
+
setNote("");
|
|
393
|
+
setNoteModalOpen(false);
|
|
394
|
+
};
|
|
395
|
+
const onNoteCancel = () => {
|
|
396
|
+
setNoteModalOpen(false);
|
|
397
|
+
};
|
|
398
|
+
const handleManualPriceChange = () => {
|
|
399
|
+
if (!productData) return;
|
|
400
|
+
setShowPriceAdjustModal(true);
|
|
401
|
+
};
|
|
402
|
+
const handlePriceAdjustConfirm = (value) => {
|
|
403
|
+
setPriceOverride(value);
|
|
404
|
+
setDiscounts([]);
|
|
405
|
+
setShowPriceAdjustModal(false);
|
|
406
|
+
};
|
|
407
|
+
const coverText = (0, import_react.useMemo)(() => {
|
|
408
|
+
var _a2;
|
|
409
|
+
const title = ((_a2 = productData == null ? void 0 : productData.title) == null ? void 0 : _a2.trim()) || "";
|
|
410
|
+
if (!title) return "";
|
|
411
|
+
return Array.from(title).slice(0, 2).join("");
|
|
412
|
+
}, [productData == null ? void 0 : productData.title]);
|
|
413
|
+
const isCreateMode = !!openParamsRef.current;
|
|
414
|
+
const leftContent = () => {
|
|
415
|
+
return (
|
|
416
|
+
/* 左侧商品图片和操作 */
|
|
417
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-image" }, (productData == null ? void 0 : productData.cover) ? /* @__PURE__ */ import_react.default.createElement("img", { src: (productData == null ? void 0 : productData.cover) || "" }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "product-cover-text" }, coverText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-name" }, (productData == null ? void 0 : productData.title) || ""), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-spec" }))), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-actions" }, /* @__PURE__ */ import_react.default.createElement(
|
|
418
|
+
import_materials.Button,
|
|
419
|
+
{
|
|
420
|
+
size: "large",
|
|
421
|
+
className: "add-note-btn",
|
|
422
|
+
onClick: () => setNoteModalOpen(true)
|
|
423
|
+
},
|
|
424
|
+
import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.add.note")
|
|
425
|
+
)), note && /* @__PURE__ */ import_react.default.createElement("div", { className: "note-section" }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.sku.detail.modal.note")), /* @__PURE__ */ import_react.default.createElement("div", { className: "note-text", onClick: () => setNoteModalOpen(true) }, note))), /* @__PURE__ */ import_react.default.createElement("div", { className: "price-summary-section" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item" }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.sku.detail.modal.subtotal")), /* @__PURE__ */ import_react.default.createElement("div", null, subtotalText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item" }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.sku.detail.modal.discount"), discountsCount > 0 && /* @__PURE__ */ import_react.default.createElement("span", { className: "price-item-danger" }, " (", discountsCount, ")")), /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item-danger" }, discountsCount > 0 ? "-" : "", symbol, totalDiscounts)), priceOverride !== null && typeof priceOverride !== "undefined" && /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item" }, /* @__PURE__ */ import_react.default.createElement("div", { onClick: handleManualPriceChange }, import_utils.locales.getText("pisell2.text.sku.detail.modal.manual.price.change"), /* @__PURE__ */ import_react.default.createElement("span", { className: "price-item-override" }, priceOverrideText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item-danger" }, priceChangeText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "price-item-total" }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.sku.detail.modal.total"), /* @__PURE__ */ import_react.default.createElement("span", { className: "price-item-total-gst" }, "(", (productData == null ? void 0 : productData.is_charge_tax) ? import_utils.locales.getText("pisell2.text.sku.detail.modal.gst.incl") : import_utils.locales.getText("pisell2.text.sku.detail.modal.gst.excl"), ")")), /* @__PURE__ */ import_react.default.createElement("div", null, totalText))))
|
|
426
|
+
);
|
|
427
|
+
};
|
|
428
|
+
if (!productData) return null;
|
|
429
|
+
const rightContent = () => {
|
|
430
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content" }, currentStep === 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-title" }, (productData == null ? void 0 : productData.title) || ""), /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-description" }, (productData == null ? void 0 : productData.subtitle) || "")), currentStep === 1 && /* @__PURE__ */ import_react.default.createElement(
|
|
431
|
+
import_skuOptionsSelection.default,
|
|
432
|
+
{
|
|
433
|
+
ref: skuOptionsSelectionRef,
|
|
434
|
+
dataSource: productData,
|
|
435
|
+
value: skuDefaultValue,
|
|
436
|
+
skuCardConfig: {
|
|
437
|
+
title: {
|
|
438
|
+
lineClamp: 1
|
|
439
|
+
},
|
|
440
|
+
subTitle: {
|
|
441
|
+
lineClamp: 1
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
onChange: (v) => {
|
|
445
|
+
setSkuValue(v);
|
|
446
|
+
},
|
|
447
|
+
customScrollParent: ".pisell-sku-detail-modal .sku-detail-right-content"
|
|
448
|
+
}
|
|
449
|
+
));
|
|
450
|
+
};
|
|
451
|
+
const leftHeaderClose = () => {
|
|
452
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left-close", onClick: handleCancel }, /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-x-close" }), import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.close"));
|
|
453
|
+
};
|
|
454
|
+
const leftHeaderBack = () => {
|
|
455
|
+
if (currentStep === 0) {
|
|
456
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-left-back-placeholder" });
|
|
457
|
+
}
|
|
458
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
459
|
+
"div",
|
|
460
|
+
{
|
|
461
|
+
className: "sku-detail-left-back",
|
|
462
|
+
onClick: () => {
|
|
463
|
+
var _a2, _b2;
|
|
464
|
+
(_b2 = (_a2 = procedureRef.current) == null ? void 0 : _a2.goToStep) == null ? void 0 : _b2.call(_a2, 0);
|
|
465
|
+
setCurrentStep(0);
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-arrow-left" }),
|
|
469
|
+
import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.back")
|
|
470
|
+
);
|
|
471
|
+
};
|
|
472
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
473
|
+
import_materials.PisellModal,
|
|
474
|
+
{
|
|
475
|
+
platform: "pc",
|
|
476
|
+
open,
|
|
477
|
+
header: null,
|
|
478
|
+
headerDivider: false,
|
|
479
|
+
footer: null,
|
|
480
|
+
onCancel: handleCancel,
|
|
481
|
+
closable: false,
|
|
482
|
+
destroyOnClose: true,
|
|
483
|
+
width: 880,
|
|
484
|
+
className: "pisell-sku-detail-modal"
|
|
485
|
+
},
|
|
486
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
487
|
+
import_materials.PisellProcedure,
|
|
488
|
+
{
|
|
489
|
+
ref: procedureRef,
|
|
490
|
+
className: "pisell-sku-procedure",
|
|
491
|
+
mode: "modal",
|
|
492
|
+
defaultCurrent: currentStep,
|
|
493
|
+
onStepsChange: (result) => {
|
|
494
|
+
setCurrentStep(result.currentStep);
|
|
495
|
+
},
|
|
496
|
+
headerProps: {
|
|
497
|
+
showBackOnFirstStep: true,
|
|
498
|
+
showSteps: true,
|
|
499
|
+
left: leftHeaderBack(),
|
|
500
|
+
right: leftHeaderClose(),
|
|
501
|
+
stepsProps: {
|
|
502
|
+
items: [
|
|
503
|
+
{
|
|
504
|
+
title: import_utils.locales.getText("pisell2.text.sku.detail.modal.step.details"),
|
|
505
|
+
description: ""
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
title: import_utils.locales.getText(
|
|
509
|
+
"pisell2.text.sku.detail.modal.step.select.bundle"
|
|
510
|
+
),
|
|
511
|
+
description: ""
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
onFirstStepBack: () => {
|
|
517
|
+
handleCancel();
|
|
518
|
+
},
|
|
519
|
+
showSideBar: true,
|
|
520
|
+
showFooter: true,
|
|
521
|
+
bodyProps: {
|
|
522
|
+
direction: "horizontal",
|
|
523
|
+
contentOrder: "sidebar-first",
|
|
524
|
+
contentSlot: rightContent(),
|
|
525
|
+
sidebarSlot: leftContent(),
|
|
526
|
+
sidebarContainerSelector: ".pisell-sku-detail-modal"
|
|
527
|
+
},
|
|
528
|
+
footerProps: {
|
|
529
|
+
position: "fixed-bottom",
|
|
530
|
+
style: { height: "72px !important" },
|
|
531
|
+
leftSlot: /* @__PURE__ */ import_react.default.createElement("div", { className: "quantity-section" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "quantity-section-title" }, import_utils.locales.getText("pisell2.text.sku.detail.modal.quantity")), /* @__PURE__ */ import_react.default.createElement(
|
|
532
|
+
import_pisellNumberSelector.default,
|
|
533
|
+
{
|
|
534
|
+
value: quantity,
|
|
535
|
+
width: "120px",
|
|
536
|
+
onChange: handleQuantityChange,
|
|
537
|
+
min: 1,
|
|
538
|
+
max: 99999,
|
|
539
|
+
step: 1,
|
|
540
|
+
size: "middle",
|
|
541
|
+
enablePriceAdjust: true
|
|
542
|
+
}
|
|
543
|
+
)),
|
|
544
|
+
actions: /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-content-footer" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "modal-actions" }, isCreateMode ? /* @__PURE__ */ import_react.default.createElement(
|
|
545
|
+
import_materials.Button,
|
|
546
|
+
{
|
|
547
|
+
type: "default",
|
|
548
|
+
size: "large",
|
|
549
|
+
className: "sku-detail-content-footer-remove-btn",
|
|
550
|
+
onClick: handleCancel
|
|
551
|
+
},
|
|
552
|
+
import_utils.locales.getText("pisell2.text.cancel") || "Cancel"
|
|
553
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
554
|
+
import_materials.Button,
|
|
555
|
+
{
|
|
556
|
+
type: "primary",
|
|
557
|
+
danger: true,
|
|
558
|
+
size: "large",
|
|
559
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_Delete_wght300_24px.default, { style: { fontSize: 20 } }),
|
|
560
|
+
className: "sku-detail-content-footer-remove-btn",
|
|
561
|
+
onClick: handleRemove
|
|
562
|
+
},
|
|
563
|
+
import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.remove")
|
|
564
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
565
|
+
import_materials.Button,
|
|
566
|
+
{
|
|
567
|
+
type: "default",
|
|
568
|
+
size: "large",
|
|
569
|
+
onClick: handleManualPriceChange,
|
|
570
|
+
className: "sku-detail-content-footer-price-btn"
|
|
571
|
+
},
|
|
572
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "sku-detail-content-footer-price-btn-text" }, import_utils.locales.getText(
|
|
573
|
+
"pisell2.text.sku.detail.modal.btn.manual.price.change"
|
|
574
|
+
))
|
|
575
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
576
|
+
import_materials.Button,
|
|
577
|
+
{
|
|
578
|
+
type: "primary",
|
|
579
|
+
size: "large",
|
|
580
|
+
onClick: handleConfirm,
|
|
581
|
+
className: "sku-detail-content-footer-confirm-btn"
|
|
582
|
+
},
|
|
583
|
+
currentStep === 0 ? /* @__PURE__ */ import_react.default.createElement("span", { className: "sku-detail-content-footer-confirm-btn-text" }, import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.next")) : /* @__PURE__ */ import_react.default.createElement("span", { className: "sku-detail-content-footer-confirm-btn-text" }, import_utils.locales.getText("pisell2.text.sku.detail.modal.btn.confirm"))
|
|
584
|
+
)))
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
),
|
|
588
|
+
noteModalOpen && /* @__PURE__ */ import_react.default.createElement(
|
|
589
|
+
import_noteModal.default,
|
|
590
|
+
{
|
|
591
|
+
open: noteModalOpen,
|
|
592
|
+
value: note,
|
|
593
|
+
onCancel: onNoteCancel,
|
|
594
|
+
onConfirm: onNoteConfirm,
|
|
595
|
+
onDelete: onNoteDelete
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
599
|
+
import_priceKeyboard.DiscountKeyboard,
|
|
600
|
+
{
|
|
601
|
+
containerProps: {
|
|
602
|
+
renderType: "modal",
|
|
603
|
+
open: showPriceAdjustModal,
|
|
604
|
+
onCancel: () => setShowPriceAdjustModal(false)
|
|
605
|
+
},
|
|
606
|
+
enableExceedMaxAmount: true,
|
|
607
|
+
originalValue: displayUnitPrice || 0,
|
|
608
|
+
defaultValue: displayUnitPrice || 0,
|
|
609
|
+
onEnter: (discountAmount) => {
|
|
610
|
+
const nextUnitPrice = new import_decimal.default(displayUnitPrice || 0).minus(discountAmount).toNumber();
|
|
611
|
+
handlePriceAdjustConfirm(nextUnitPrice);
|
|
612
|
+
},
|
|
613
|
+
selectType: "dark"
|
|
614
|
+
}
|
|
615
|
+
)
|
|
616
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
617
|
+
import_materials.PisellModal,
|
|
618
|
+
{
|
|
619
|
+
platform: "pc",
|
|
620
|
+
open: stockAlertOpen,
|
|
621
|
+
title: import_utils.locales.getText("pisell2.text.sku.detail.modal.stock.alert.title"),
|
|
622
|
+
headerDivider: false,
|
|
623
|
+
footer: /* @__PURE__ */ import_react.default.createElement("div", { style: { width: "100%", display: "flex", justifyContent: "flex-end", gap: 12 } }, /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { size: "large", onClick: handleStockAlertCancel }, import_utils.locales.getText(
|
|
624
|
+
"pisell2.text.sku.detail.modal.stock.alert.btn.cancel"
|
|
625
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { type: "primary", size: "large", onClick: handleStockAlertContinue }, import_utils.locales.getText(
|
|
626
|
+
"pisell2.text.sku.detail.modal.stock.alert.btn.continue"
|
|
627
|
+
))),
|
|
628
|
+
width: 520,
|
|
629
|
+
centered: true,
|
|
630
|
+
destroyOnClose: true,
|
|
631
|
+
maskClosable: false,
|
|
632
|
+
zIndex: 2e3,
|
|
633
|
+
onCancel: handleStockAlertCancel
|
|
634
|
+
},
|
|
635
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "40px 0 0 0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#344054", fontSize: 14, lineHeight: "22px" } }, import_utils.locales.getText("pisell2.text.sku.detail.modal.stock.alert.desc")), Number(
|
|
636
|
+
((_j = (_i = (_h = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _h.config) == null ? void 0 : _i.stock_setting) == null ? void 0 : _j.do_not_show_again_today) ?? 0
|
|
637
|
+
) === 1 && /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
638
|
+
import_materials.Checkbox,
|
|
639
|
+
{
|
|
640
|
+
checked: stockAlertDontShowAgainChecked,
|
|
641
|
+
onChange: (e) => {
|
|
642
|
+
var _a2;
|
|
643
|
+
setStockAlertDontShowAgainChecked(!!((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.checked));
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
import_utils.locales.getText(
|
|
647
|
+
"pisell2.text.sku.detail.modal.stock.alert.checkbox"
|
|
648
|
+
)
|
|
649
|
+
)))
|
|
650
|
+
));
|
|
651
|
+
};
|
|
652
|
+
var skuDetailModal_default = (0, import_react.forwardRef)(SkuDetailModal);
|
|
653
|
+
function getLocalDayKey() {
|
|
654
|
+
const now = /* @__PURE__ */ new Date();
|
|
655
|
+
const yyyy = String(now.getFullYear());
|
|
656
|
+
const mm = String(now.getMonth() + 1).padStart(2, "0");
|
|
657
|
+
const dd = String(now.getDate()).padStart(2, "0");
|
|
658
|
+
return `${yyyy}-${mm}-${dd}`;
|
|
659
|
+
}
|
|
660
|
+
function getStockAlertStorageKey(params) {
|
|
661
|
+
return `pisell2_stock_alert_hidden_${params.productId}`;
|
|
662
|
+
}
|
|
663
|
+
function hasHiddenStockAlertForToday(params) {
|
|
664
|
+
try {
|
|
665
|
+
if (!params.productId) return false;
|
|
666
|
+
if (typeof window === "undefined") return false;
|
|
667
|
+
const key = getStockAlertStorageKey(params);
|
|
668
|
+
const value = window.localStorage.getItem(key);
|
|
669
|
+
return value === getLocalDayKey();
|
|
670
|
+
} catch (error) {
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
function setHiddenStockAlertForToday(params) {
|
|
675
|
+
try {
|
|
676
|
+
if (!params.productId) return;
|
|
677
|
+
if (typeof window === "undefined") return;
|
|
678
|
+
const key = getStockAlertStorageKey(params);
|
|
679
|
+
window.localStorage.setItem(key, getLocalDayKey());
|
|
680
|
+
} catch (error) {
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function safeClone(value) {
|
|
684
|
+
try {
|
|
685
|
+
if (typeof structuredClone === "function") return structuredClone(value);
|
|
686
|
+
} catch (error) {
|
|
687
|
+
}
|
|
688
|
+
return JSON.parse(JSON.stringify(value));
|
|
689
|
+
}
|
|
690
|
+
function getSelectedUnitPrice(params) {
|
|
691
|
+
var _a, _b;
|
|
692
|
+
const { productData, skuValue } = params;
|
|
693
|
+
if (!productData) return 0;
|
|
694
|
+
let price = new import_decimal.default((productData == null ? void 0 : productData.base_price) ?? ((_a = productData == null ? void 0 : productData._extend) == null ? void 0 : _a.price) ?? 0);
|
|
695
|
+
if (skuValue == null ? void 0 : skuValue.product_variant_id) {
|
|
696
|
+
const variantItem = (_b = productData == null ? void 0 : productData.variant) == null ? void 0 : _b.find(
|
|
697
|
+
(item) => Number(item == null ? void 0 : item.id) === Number(skuValue.product_variant_id)
|
|
698
|
+
);
|
|
699
|
+
if (variantItem) {
|
|
700
|
+
price = new import_decimal.default((variantItem == null ? void 0 : variantItem.price) ?? (variantItem == null ? void 0 : variantItem.base_price) ?? 0);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (Array.isArray(skuValue == null ? void 0 : skuValue.bundle) && skuValue.bundle.length > 0) {
|
|
704
|
+
price = skuValue.bundle.reduce((accumulator, currentValue) => {
|
|
705
|
+
const currentPrice = new import_decimal.default((currentValue == null ? void 0 : currentValue.price) || 0);
|
|
706
|
+
const currentNum = new import_decimal.default((currentValue == null ? void 0 : currentValue.num) || 0);
|
|
707
|
+
return accumulator.add(currentPrice.mul(currentNum));
|
|
708
|
+
}, price);
|
|
709
|
+
}
|
|
710
|
+
if (Array.isArray(skuValue == null ? void 0 : skuValue.option) && skuValue.option.length > 0) {
|
|
711
|
+
price = skuValue.option.reduce((accumulator, currentValue) => {
|
|
712
|
+
const currentPrice = new import_decimal.default((currentValue == null ? void 0 : currentValue.price) || 0);
|
|
713
|
+
const currentNum = new import_decimal.default((currentValue == null ? void 0 : currentValue.num) || 0);
|
|
714
|
+
return accumulator.add(currentPrice.mul(currentNum));
|
|
715
|
+
}, price);
|
|
716
|
+
}
|
|
717
|
+
return price.toNumber();
|
|
718
|
+
}
|
|
719
|
+
function getOtherFromSkuValue(params) {
|
|
720
|
+
var _a;
|
|
721
|
+
const { productData, skuValue } = params;
|
|
722
|
+
const other = {
|
|
723
|
+
product_variant_id: (skuValue == null ? void 0 : skuValue.product_variant_id) || 0,
|
|
724
|
+
bundle: (skuValue == null ? void 0 : skuValue.bundle) || [],
|
|
725
|
+
option: (skuValue == null ? void 0 : skuValue.option) || []
|
|
726
|
+
};
|
|
727
|
+
if (other.product_variant_id && productData) {
|
|
728
|
+
const variantItem = (_a = productData == null ? void 0 : productData.variant) == null ? void 0 : _a.find(
|
|
729
|
+
(item) => Number(item == null ? void 0 : item.id) === Number(other.product_variant_id)
|
|
730
|
+
);
|
|
731
|
+
if (variantItem) {
|
|
732
|
+
other.price = Number((variantItem == null ? void 0 : variantItem.price) ?? (variantItem == null ? void 0 : variantItem.base_price) ?? 0);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return other;
|
|
736
|
+
}
|