@licklist/design 0.71.18-dev.8 → 0.71.18
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/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/auth/Layout/AuthNavComponent.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +1 -2
- package/dist/auth/Login/LoginFormComponent.d.ts.map +1 -1
- package/dist/auth/Logout/Logout.js +0 -1
- package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
- package/dist/auth/Register/RegisterFormComponent.d.ts.map +1 -1
- package/dist/auth/ResetPassword/ResetPasswordFormComponent.d.ts.map +1 -1
- package/dist/auth/Router.d.ts.map +1 -1
- package/dist/auth/Router.js +0 -2
- package/dist/calendar/utils/index.d.ts +1 -1
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -3
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/events/event-card/utils.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +1 -2
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +1 -2
- package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +0 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +4 -11
- package/dist/iframe/activity-card/ActivityCard.d.ts +2 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +7 -1
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts +1 -2
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts.map +1 -1
- package/dist/iframe/event/ticket-description/TicketDescription.js +3 -4
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +2 -15
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js +3 -3
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +0 -4
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +2 -27
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +2 -106
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -3
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -95
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/hooks/useTableData.js +10 -83
- package/dist/iframe/payment/order-items-table/utils/index.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/utils/index.js +0 -15
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +2 -2
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +2 -2
- package/dist/iframe/ryft/RyftPaymentForm.js +0 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +5 -4
- package/dist/index.js +1 -2
- package/dist/layout/DropDown.d.ts +1 -2
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +0 -3
- package/dist/notification/sms-template/card/SmsTemplateCard.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +2 -48
- package/dist/product-set/form/ProductSetForm.d.ts +2 -7
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +5 -7
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +2 -0
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +5 -25
- package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +3 -0
- package/dist/product-set/form/VenueMapsControl.d.ts +1 -1
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +3 -0
- package/dist/product-set/form/context.d.ts +1 -3
- package/dist/product-set/form/context.d.ts.map +1 -1
- package/dist/product-set/form/context.js +1 -2
- package/dist/product-set/product/ProductControl.d.ts +0 -8
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -25
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +0 -3
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
- package/dist/product-set/utils/index.d.ts +0 -88
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -19
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
- package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -2
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.js +2 -4
- package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.js +0 -3
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +0 -3
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +2 -0
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +0 -21
- package/dist/sales/coupon/utils/index.d.ts +1 -2
- package/dist/sales/coupon/utils/index.d.ts.map +1 -1
- package/dist/sales/life-time-sales/LifeTimeSalesChart.js +0 -1
- package/dist/sales/manual-booking/select-event/SelectEvent.js +0 -1
- package/dist/sales/manual-booking/select-menu/SelectMenu.js +0 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +0 -1
- package/dist/sales/modals/refund-modal/RefundModal.d.ts +2 -6
- package/dist/sales/modals/refund-modal/RefundModal.d.ts.map +1 -1
- package/dist/sales/modals/refund-modal/RefundModal.js +4 -8
- package/dist/sales/modals/refund-modal/index.d.ts +2 -2
- package/dist/sales/modals/refund-modal/index.d.ts.map +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
- package/dist/setting/admin/PaymentFeeForm.js +1 -16
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
- package/dist/setting/dashboard/snippet-templates/card/SnippetTemplateCard.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -3
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +4 -10
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +0 -3
- package/dist/static/date-range-input/utils/index.d.ts +1 -1
- package/dist/static/date-range-input/utils/index.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +0 -3
- package/dist/static/loader/LoaderIndicator.d.ts +3 -2
- package/dist/static/loader/LoaderIndicator.d.ts.map +1 -1
- package/dist/static/loader/LoaderIndicator.js +2 -4
- package/dist/static/loader/index.d.ts +0 -1
- package/dist/static/loader/index.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +0 -3
- package/dist/styles/availability-indicator/AvailabilityIndicator.scss +4 -1
- package/dist/styles/date-time-button/DateTimeButton.scss +1 -10
- package/dist/styles/events/EditEventModal.scss +0 -2
- package/dist/styles/iframe-events/Calendar.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/iframe-page/Page.scss +0 -16
- package/dist/styles/iframe-page/PageBody.scss +0 -4
- package/dist/styles/modals/Modals.scss +0 -16
- package/dist/styles/product-set/EditProductSetElement.scss +0 -1
- package/dist/styles/product-set/ProductSetForm.scss +0 -33
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +4 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/ManualBooking.scss +0 -6
- package/dist/styles/static/Loader.scss +0 -9
- package/dist/styles/themes/bookedit/index.scss +0 -19
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +0 -3
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +0 -3
- package/package.json +6 -8
- package/src/affiliate/form/AffiliateForm.tsx +0 -1
- package/src/auth/Layout/AuthNavComponent.tsx +0 -4
- package/src/auth/Login/LoginComponent.tsx +1 -3
- package/src/auth/Login/LoginFormComponent.tsx +0 -2
- package/src/auth/Register/RegisterComponent.tsx +0 -2
- package/src/auth/Register/RegisterFormComponent.tsx +0 -4
- package/src/auth/ResetPassword/ResetPasswordFormComponent.tsx +0 -4
- package/src/auth/Router.tsx +0 -2
- package/src/calendar/Calendar.stories.tsx +2 -2
- package/src/calendar/utils/index.ts +1 -1
- package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +7 -9
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/events/event-card/utils.ts +9 -10
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -3
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +1 -2
- package/src/events/event-statistic-modal/utils/index.ts +1 -2
- package/src/events/event-venue-map/EventVenueMap.tsx +0 -1
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +1 -5
- package/src/iframe/activity-card/ActivityCard.stories.tsx +2 -0
- package/src/iframe/activity-card/ActivityCard.tsx +4 -0
- package/src/iframe/event/ticket-description/TicketDescription.tsx +3 -5
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -21
- package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.tsx +11 -13
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +4 -47
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +75 -155
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -58
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +2 -1
- package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +14 -84
- package/src/iframe/payment/order-items-table/utils/index.ts +0 -23
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +2 -3
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +20 -19
- package/src/iframe/ryft/utils/ryft-form.ts +5 -6
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/card/EmailTemplateCard.tsx +0 -2
- package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
- package/src/notification/sms-template/card/SmsTemplateCard.tsx +0 -2
- package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -3
- package/src/product-set/control/DateInput.tsx +4 -3
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
- package/src/product-set/form/ProductSetForm.tsx +5 -17
- package/src/product-set/form/ProductZonesControl.tsx +4 -1
- package/src/product-set/form/ProductsControl.tsx +15 -33
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/form/VenueMapsControl.tsx +4 -1
- package/src/product-set/form/context.tsx +0 -5
- package/src/product-set/product/ProductControl.tsx +2 -37
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
- package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
- package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
- package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/product-set/utils/index.ts +0 -19
- package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
- package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +0 -3
- package/src/resource/form/components/CapacityControl.tsx +0 -1
- package/src/resource/form/components/SortControl.tsx +0 -1
- package/src/sales/booking/results/components/ResultCard.tsx +2 -0
- package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
- package/src/sales/coupon/utils/index.ts +3 -5
- package/src/sales/modals/refund-modal/RefundModal.tsx +6 -15
- package/src/sales/modals/refund-modal/index.ts +2 -7
- package/src/setting/admin/AdminSettingForm.tsx +0 -4
- package/src/setting/admin/PaymentFeeForm.tsx +0 -5
- package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
- package/src/setting/dashboard/snippet-templates/card/SnippetTemplateCard.tsx +0 -2
- package/src/snippet/snippet-template/preview/Preview.tsx +2 -1
- package/src/sortable-tree/SortableTreeItem.tsx +0 -6
- package/src/static/CurrencyNumberInput.tsx +0 -1
- package/src/static/date-range-input/utils/index.ts +1 -1
- package/src/static/form-number-input/FormNumberInput.tsx +0 -1
- package/src/static/loader/LoaderIndicator.tsx +3 -6
- package/src/static/loader/index.ts +0 -1
- package/src/static/number-input/NumberInput.tsx +0 -1
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +4 -1
- package/src/styles/date-time-button/DateTimeButton.scss +1 -10
- package/src/styles/events/EditEventModal.scss +0 -2
- package/src/styles/iframe-events/Calendar.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/iframe-page/Page.scss +0 -16
- package/src/styles/iframe-page/PageBody.scss +0 -4
- package/src/styles/modals/Modals.scss +0 -16
- package/src/styles/product-set/EditProductSetElement.scss +0 -1
- package/src/styles/product-set/ProductSetForm.scss +0 -33
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +4 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/ManualBooking.scss +0 -6
- package/src/styles/static/Loader.scss +0 -9
- package/src/styles/themes/bookedit/index.scss +0 -19
- package/src/zone/form/components/GameDurationControl.tsx +0 -1
- package/src/zone/form/components/SortControl.tsx +0 -1
- package/yarn.lock +269 -277
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts +0 -18
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.js +0 -289
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts +0 -15
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +0 -89
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts +0 -14
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +0 -404
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts +0 -10
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.js +0 -87
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts +0 -2
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/index.d.ts +0 -2
- package/dist/iframe/ProductWithModifierModal/index.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/utils.d.ts +0 -5
- package/dist/iframe/ProductWithModifierModal/utils.d.ts.map +0 -1
- package/dist/iframe/ProductWithModifierModal/utils.js +0 -21
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts +0 -23
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts.map +0 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.js +0 -62
- package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts +0 -2
- package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts.map +0 -1
- package/dist/iframe/order-process/components/CategoryProduct/constants.js +0 -4
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts +0 -6
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts.map +0 -1
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.js +0 -18
- package/dist/static/loader/FullScreenLoader.d.ts +0 -8
- package/dist/static/loader/FullScreenLoader.d.ts.map +0 -1
- package/dist/static/loader/FullScreenLoader.js +0 -41
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.tsx +0 -212
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +0 -75
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +0 -393
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.tsx +0 -98
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/index.ts +0 -1
- package/src/iframe/ProductWithModifierModal/index.ts +0 -1
- package/src/iframe/ProductWithModifierModal/utils.ts +0 -29
- package/src/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.tsx +0 -86
- package/src/iframe/order-process/components/CategoryProduct/constants.ts +0 -1
- package/src/iframe/order-process/components/utils/useOnWindowUnmount.ts +0 -25
- package/src/static/loader/FullScreenLoader.tsx +0 -16
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper'
|
|
2
|
-
import {
|
|
3
|
-
OrderModifierByProduct
|
|
4
|
-
} from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
5
1
|
import { QuantityCheckProductInfo } from '@licklist/plugins/dist/types/Api/verifyStock'
|
|
6
2
|
import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
|
|
7
3
|
|
|
@@ -9,64 +5,25 @@ export const cartSumByOrderProducts = ({
|
|
|
9
5
|
orderProducts,
|
|
10
6
|
isTotalSum,
|
|
11
7
|
}: {
|
|
12
|
-
orderProducts?: OrderItem[]
|
|
13
|
-
isTotalSum?: boolean
|
|
8
|
+
orderProducts?: OrderItem[];
|
|
9
|
+
isTotalSum?: boolean;
|
|
14
10
|
}) => {
|
|
15
11
|
if (!orderProducts || !orderProducts.length) {
|
|
16
12
|
return 0
|
|
17
13
|
}
|
|
18
14
|
return orderProducts.reduce((prevSumValue: number, product) => {
|
|
19
15
|
if (!product) return 0
|
|
20
|
-
|
|
21
|
-
product?.orderModifiersSets,
|
|
22
|
-
)
|
|
23
|
-
|
|
16
|
+
|
|
24
17
|
const price = isTotalSum
|
|
25
18
|
? product?.price
|
|
26
19
|
: product.hasDeposit
|
|
27
20
|
? product?.deposit
|
|
28
21
|
: product?.price
|
|
29
22
|
|
|
30
|
-
return prevSumValue + price * product.quantity
|
|
23
|
+
return prevSumValue + price * product.quantity
|
|
31
24
|
}, 0)
|
|
32
25
|
}
|
|
33
26
|
|
|
34
|
-
export const getModifierName = (
|
|
35
|
-
modifier: OrderModifierByProduct,
|
|
36
|
-
isManualBooking: boolean,
|
|
37
|
-
) => {
|
|
38
|
-
const modifierName = (orderModifier: OrderModifier) =>
|
|
39
|
-
isManualBooking ? orderModifier.modifier.name : orderModifier?.name
|
|
40
|
-
return `${modifier.modifiers.map((item) => (
|
|
41
|
-
item?.quantity > 1 ? `${item?.quantity}x - ${modifierName(item)}` : modifierName(item))).join(', ')}`
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const calculateTotalModifiersPrice = (
|
|
45
|
-
orderModifiersSets: OrderModifierByProduct[],
|
|
46
|
-
) =>
|
|
47
|
-
orderModifiersSets
|
|
48
|
-
?.map((set) =>
|
|
49
|
-
set.modifiers.reduce(
|
|
50
|
-
(sum, modifier) =>
|
|
51
|
-
sum + modifier.price * modifier.quantity * set.productQuantity,
|
|
52
|
-
0,
|
|
53
|
-
),
|
|
54
|
-
)
|
|
55
|
-
.reduce((total, setTotal) => total + setTotal, 0)
|
|
56
|
-
|
|
57
|
-
export const getOrderProductModifiersPrice = (
|
|
58
|
-
modifierFromProduct: OrderModifierByProduct,
|
|
59
|
-
) => {
|
|
60
|
-
const { modifiers, productQuantity } = modifierFromProduct
|
|
61
|
-
const modifiersPrices = modifiers.reduce(
|
|
62
|
-
(prevSumModifier: number, modifier: OrderModifier) =>
|
|
63
|
-
prevSumModifier + modifier.price * modifier.quantity,
|
|
64
|
-
0,
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
return modifiersPrices * productQuantity
|
|
68
|
-
}
|
|
69
|
-
|
|
70
27
|
export const getProductError = (
|
|
71
28
|
productsWithErrors: QuantityCheckProductInfo[],
|
|
72
29
|
productId: OrderItem['id'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo
|
|
1
|
+
import { useEffect, useMemo } from 'react'
|
|
2
2
|
import { useFormContext, Controller } from 'react-hook-form'
|
|
3
3
|
import clsx from 'clsx'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
@@ -10,14 +10,8 @@ import {
|
|
|
10
10
|
Product,
|
|
11
11
|
ProductCategory,
|
|
12
12
|
} from '@licklist/plugins/dist/types/context/sale/menuSteps'
|
|
13
|
-
import { Button } from 'react-bootstrap'
|
|
14
|
-
import { FaTrashAlt } from 'react-icons/fa'
|
|
15
|
-
import { ProductWithModifierSetModal } from 'src/iframe/ProductWithModifierModal'
|
|
16
|
-
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
17
13
|
import { TicketDescription } from '../../../event/ticket-description'
|
|
18
14
|
import { ProductQuantityInput } from './components/ProductQuantityInput'
|
|
19
|
-
import { FormOrderItem } from './components/ProductQuantityInput/ProductQuantityInput'
|
|
20
|
-
import { ProductWithModifier } from './components/ProductWithModifier/ProductWithModifier'
|
|
21
15
|
|
|
22
16
|
interface CategoryProductProps {
|
|
23
17
|
product: Product
|
|
@@ -37,9 +31,7 @@ export const CategoryProduct = ({
|
|
|
37
31
|
const { formatNumber } = useIntl()
|
|
38
32
|
const { t } = useTranslation(['Design', 'Validation'])
|
|
39
33
|
const { control, clearErrors, setError } = useFormContext()
|
|
40
|
-
|
|
41
|
-
useState<OrderModifierByProduct>(undefined)
|
|
42
|
-
const [modifierIndex, setModifierIndex] = useState<number>(undefined)
|
|
34
|
+
|
|
43
35
|
const hasDeposits = category.allowDeposits && product?.deposit < product.price
|
|
44
36
|
|
|
45
37
|
const productQuantityError = useMemo(() => {
|
|
@@ -126,155 +118,83 @@ export const CategoryProduct = ({
|
|
|
126
118
|
render={({
|
|
127
119
|
field: { onChange, value: productInfo = {}, ref },
|
|
128
120
|
fieldState: { invalid, error },
|
|
129
|
-
}) =>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return (
|
|
176
|
-
<div
|
|
177
|
-
id={String(product.id)}
|
|
178
|
-
className='iframe-event__category-product'
|
|
179
|
-
>
|
|
180
|
-
<div className={clsx('iframe-event__product', invalid && 'error')}>
|
|
181
|
-
<TicketDescription
|
|
182
|
-
title={product.name}
|
|
183
|
-
description={product.description}
|
|
184
|
-
className={clsx('iframe-event__product-description')}
|
|
185
|
-
images={product.images}
|
|
186
|
-
isRequired={product.isRequired}
|
|
187
|
-
canExpand={canExpandDescription}
|
|
188
|
-
/>
|
|
121
|
+
}) => (
|
|
122
|
+
<div id={String(product.id)} className='iframe-event__category-product'>
|
|
123
|
+
<div className={clsx('iframe-event__product', invalid && 'error')}>
|
|
124
|
+
<TicketDescription
|
|
125
|
+
title={product.name}
|
|
126
|
+
description={product.description}
|
|
127
|
+
className={clsx('iframe-event__product-description')}
|
|
128
|
+
images={product.images}
|
|
129
|
+
isRequired={product.isRequired}
|
|
130
|
+
canExpand={canExpandDescription}
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
<div className='iframe-event__product-price-wrapper'>
|
|
134
|
+
<span className='product-price'>
|
|
135
|
+
{formatNumber(product.price, {
|
|
136
|
+
style: 'currency',
|
|
137
|
+
currency: Config.Currency.GBP,
|
|
138
|
+
})}
|
|
139
|
+
</span>
|
|
140
|
+
<ProductQuantityInput
|
|
141
|
+
onChange={onChange}
|
|
142
|
+
productInfo={productInfo}
|
|
143
|
+
refCallback={ref}
|
|
144
|
+
clearErrors={clearErrors}
|
|
145
|
+
product={{
|
|
146
|
+
...product,
|
|
147
|
+
isSoldOut: product?.isSoldOut || checkIfSoldOutProduct(),
|
|
148
|
+
}}
|
|
149
|
+
category={category}
|
|
150
|
+
invalid={invalid}
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
{hasDeposits && !category?.remainderExpireAfter && (
|
|
154
|
+
<div className='mt-4'>
|
|
155
|
+
{t('Design:payNowAndUponArrival', {
|
|
156
|
+
deposit: formatNumber(product?.deposit, {
|
|
157
|
+
style: 'currency',
|
|
158
|
+
currency: Config.Currency.GBP,
|
|
159
|
+
}),
|
|
160
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
161
|
+
style: 'currency',
|
|
162
|
+
currency: Config.Currency.GBP,
|
|
163
|
+
}),
|
|
164
|
+
})}
|
|
189
165
|
</div>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
166
|
+
)}
|
|
167
|
+
|
|
168
|
+
{hasDeposits && category?.remainderExpireAfter > 0 && (
|
|
169
|
+
<div className='mt-4'>
|
|
170
|
+
{t('Design:payNowAndReminderDays', {
|
|
171
|
+
deposit: formatNumber(product?.deposit, {
|
|
172
|
+
style: 'currency',
|
|
173
|
+
currency: Config.Currency.GBP,
|
|
174
|
+
}),
|
|
175
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
193
176
|
style: 'currency',
|
|
194
177
|
currency: Config.Currency.GBP,
|
|
195
|
-
})
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
onChange={onChange}
|
|
199
|
-
productInfo={productInfo}
|
|
200
|
-
refCallback={ref}
|
|
201
|
-
clearErrors={clearErrors}
|
|
202
|
-
product={{
|
|
203
|
-
...product,
|
|
204
|
-
isSoldOut: product?.isSoldOut || checkIfSoldOutProduct(),
|
|
205
|
-
}}
|
|
206
|
-
category={category}
|
|
207
|
-
invalid={invalid}
|
|
208
|
-
/>
|
|
178
|
+
}),
|
|
179
|
+
days: category?.remainderExpireAfter,
|
|
180
|
+
})}
|
|
209
181
|
</div>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
{(productInfo as FormOrderItem).orderModifiersSets.map(
|
|
227
|
-
(modifier, index) => (
|
|
228
|
-
<ProductWithModifier
|
|
229
|
-
key={modifier.productQuantity.toString()}
|
|
230
|
-
modifier={modifier}
|
|
231
|
-
modifierKey={index}
|
|
232
|
-
editOrderModifierSet={editOrderModifierSet}
|
|
233
|
-
deleteOrderModifier={deleteOrderModifier}
|
|
234
|
-
/>
|
|
235
|
-
),
|
|
236
|
-
)}
|
|
237
|
-
</>
|
|
238
|
-
)}
|
|
239
|
-
{hasDeposits && category?.remainderExpireAfter > 0 && (
|
|
240
|
-
<div className='mt-4'>
|
|
241
|
-
{t('Design:payNowAndReminderDays', {
|
|
242
|
-
deposit: formatNumber(product?.deposit, {
|
|
243
|
-
style: 'currency',
|
|
244
|
-
currency: Config.Currency.GBP,
|
|
245
|
-
}),
|
|
246
|
-
remainder: formatNumber(product.price - product?.deposit, {
|
|
247
|
-
style: 'currency',
|
|
248
|
-
currency: Config.Currency.GBP,
|
|
249
|
-
}),
|
|
250
|
-
days: category?.remainderExpireAfter,
|
|
251
|
-
})}
|
|
252
|
-
</div>
|
|
253
|
-
)}
|
|
254
|
-
{invalid && (
|
|
255
|
-
<div className='d-flex mt-3 w-100'>
|
|
256
|
-
<p className='iframe-event__message-error'>
|
|
257
|
-
{HookFormService.hasError(error, 'required') &&
|
|
258
|
-
t('Design:pleaseSelectAtLeastFrom', {
|
|
259
|
-
min: 1,
|
|
260
|
-
type: 'item',
|
|
261
|
-
from: 'this category',
|
|
262
|
-
})}
|
|
263
|
-
{HookFormService.hasError(error, 'validate') && error.message}
|
|
264
|
-
</p>
|
|
265
|
-
</div>
|
|
266
|
-
)}
|
|
267
|
-
<ProductWithModifierSetModal
|
|
268
|
-
show={!!editOrderModifierIndex}
|
|
269
|
-
onHide={() => setEditOrderModifierIndex(undefined)}
|
|
270
|
-
editOrderModifier={editOrderModifierIndex}
|
|
271
|
-
onChange={onChangeWithModifierSets}
|
|
272
|
-
product={product}
|
|
273
|
-
category={category}
|
|
274
|
-
/>
|
|
275
|
-
</div>
|
|
276
|
-
)
|
|
277
|
-
}}
|
|
182
|
+
)}
|
|
183
|
+
{invalid && (
|
|
184
|
+
<div className='d-flex mt-3 w-100'>
|
|
185
|
+
<p className='iframe-event__message-error'>
|
|
186
|
+
{HookFormService.hasError(error, 'required') &&
|
|
187
|
+
t('Design:pleaseSelectAtLeastFrom', {
|
|
188
|
+
min: 1,
|
|
189
|
+
type: 'item',
|
|
190
|
+
from: 'this category',
|
|
191
|
+
})}
|
|
192
|
+
{HookFormService.hasError(error, 'validate') && error.message}
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
)}
|
|
196
|
+
</div>
|
|
197
|
+
)}
|
|
278
198
|
/>
|
|
279
199
|
)
|
|
280
200
|
}
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -89,7 +89,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
89
89
|
<FormControl
|
|
90
90
|
type='number'
|
|
91
91
|
onChange={(e) => handleChangeValue(Number(e.target.value))}
|
|
92
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
93
92
|
value={value}
|
|
94
93
|
min={0}
|
|
95
94
|
max={max}
|
|
@@ -102,14 +101,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
102
101
|
<button
|
|
103
102
|
type='button'
|
|
104
103
|
onClick={handleArrowUpClick}
|
|
105
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
106
|
-
onFocus={(event) =>
|
|
107
|
-
event.target.addEventListener(
|
|
108
|
-
'wheel',
|
|
109
|
-
(event) => event.preventDefault(),
|
|
110
|
-
{ passive: false },
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
104
|
className={`payment-number-input__btn-up ${
|
|
114
105
|
plusButtonGreyedOut && 'disabled-number-input-button'
|
|
115
106
|
}`}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { useState } from 'react'
|
|
2
1
|
import clsx from 'clsx'
|
|
3
2
|
import { Button } from 'react-bootstrap'
|
|
4
|
-
import { isEmpty } from 'lodash'
|
|
5
3
|
import { useTranslation } from 'react-i18next'
|
|
6
4
|
import { FieldValues, RefCallBack, UseFormClearErrors } from 'react-hook-form'
|
|
7
5
|
import {
|
|
8
6
|
Product,
|
|
9
7
|
ProductCategory,
|
|
10
8
|
} from '@licklist/plugins/dist/types/context/sale/menuSteps'
|
|
11
|
-
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
12
9
|
import { NumberInput } from '../NumberInput'
|
|
13
|
-
// eslint-disable-next-line
|
|
14
|
-
import { ProductWithModifierSetModal } from '../../../../../ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal'
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
interface FormOrderItem {
|
|
17
12
|
id: number
|
|
18
13
|
name: string
|
|
19
14
|
price: number
|
|
@@ -22,7 +17,6 @@ export interface FormOrderItem {
|
|
|
22
17
|
deposit?: number | null
|
|
23
18
|
quantity: number
|
|
24
19
|
capacity?: number | null
|
|
25
|
-
orderModifiersSets?: OrderModifierByProduct[] | null
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
interface ProductQuantityInputProps {
|
|
@@ -46,7 +40,6 @@ export const ProductQuantityInput = ({
|
|
|
46
40
|
invalid,
|
|
47
41
|
}: ProductQuantityInputProps) => {
|
|
48
42
|
const { t } = useTranslation('Design')
|
|
49
|
-
const [open, handleOpenModal] = useState(false)
|
|
50
43
|
|
|
51
44
|
const onChange = (quantity: number | null) => {
|
|
52
45
|
_onChange({
|
|
@@ -55,35 +48,12 @@ export const ProductQuantityInput = ({
|
|
|
55
48
|
deposit: product?.deposit,
|
|
56
49
|
hasDeposit: category.allowDeposits && product?.deposit < product.price,
|
|
57
50
|
price: product.price,
|
|
58
|
-
orderModifiersSets: [],
|
|
59
51
|
productCategoryId: category.id,
|
|
60
52
|
quantity,
|
|
61
53
|
capacity: product?.capacity,
|
|
62
54
|
})
|
|
63
55
|
}
|
|
64
56
|
|
|
65
|
-
const onChangeWithModifierSets = (productOrder: FormOrderItem) => {
|
|
66
|
-
if (isEmpty(productInfo)) {
|
|
67
|
-
_onChange(productOrder)
|
|
68
|
-
return handleOpenModal(false)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
_onChange({
|
|
72
|
-
id: productInfo.id,
|
|
73
|
-
name: productInfo.name,
|
|
74
|
-
deposit: productInfo?.deposit,
|
|
75
|
-
hasDeposit: productInfo.hasDeposit,
|
|
76
|
-
price: productInfo.price,
|
|
77
|
-
orderModifiersSets: productInfo.orderModifiersSets?.concat(
|
|
78
|
-
productOrder.orderModifiersSets,
|
|
79
|
-
),
|
|
80
|
-
productCategoryId: category.id,
|
|
81
|
-
quantity: productInfo.quantity + productOrder.quantity,
|
|
82
|
-
capacity: productInfo?.capacity,
|
|
83
|
-
})
|
|
84
|
-
return handleOpenModal(false)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
57
|
if (product.isSoldOut) {
|
|
88
58
|
return (
|
|
89
59
|
<div className='iframe-event__sold-out-wrapper'>
|
|
@@ -92,33 +62,6 @@ export const ProductQuantityInput = ({
|
|
|
92
62
|
)
|
|
93
63
|
}
|
|
94
64
|
|
|
95
|
-
if ((product as Product).modifiersSet.length) {
|
|
96
|
-
return (
|
|
97
|
-
<>
|
|
98
|
-
<Button
|
|
99
|
-
ref={refCallback}
|
|
100
|
-
disabled={product.isSoldOut}
|
|
101
|
-
className={clsx(
|
|
102
|
-
`iframe-event__${
|
|
103
|
-
productInfo?.quantity ? 'unselect-product' : 'select-product'
|
|
104
|
-
}`,
|
|
105
|
-
invalid && 'error',
|
|
106
|
-
)}
|
|
107
|
-
onClick={() => handleOpenModal(true)}
|
|
108
|
-
>
|
|
109
|
-
+
|
|
110
|
-
</Button>
|
|
111
|
-
<ProductWithModifierSetModal
|
|
112
|
-
show={open}
|
|
113
|
-
onHide={() => handleOpenModal(false)}
|
|
114
|
-
onChange={onChangeWithModifierSets}
|
|
115
|
-
product={product}
|
|
116
|
-
category={category}
|
|
117
|
-
/>
|
|
118
|
-
</>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
65
|
if (product?.maxAmount === 1) {
|
|
123
66
|
return (
|
|
124
67
|
<Button
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'react'
|
|
2
|
-
import { uniqueId
|
|
2
|
+
import { uniqueId } from 'lodash'
|
|
3
3
|
import { useIntl } from 'react-intl'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { Product } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
|
|
6
|
-
import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper'
|
|
7
6
|
import {
|
|
8
7
|
PAYMENT_TYPE_VAT,
|
|
9
8
|
PAYMENT_TYPE_FEE,
|
|
@@ -13,10 +12,6 @@ import { StaticTableData } from '../../../../table'
|
|
|
13
12
|
import { getProductQuantityAndPrice, getTotalSumByCategory } from '../utils'
|
|
14
13
|
import { OrderItemsTableProps, SummaryItem } from '../types'
|
|
15
14
|
import { getOrderSummaryItems } from '../utils/paymentSummary'
|
|
16
|
-
import { Order } from '@licklist/core/dist/DataMapper'
|
|
17
|
-
import { OrderPayment } from '@licklist/core/dist/DataMapper/Order/OrderPaymentDataMapper'
|
|
18
|
-
import { OrderProduct } from '@licklist/core/dist/DataMapper/Order/OrderProductDataMapper'
|
|
19
|
-
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
20
15
|
|
|
21
16
|
const CURRENCY_DEFAULT = 'GBP'
|
|
22
17
|
export const PAYMENT_TYPE_TRANSLATE_KEYS = {
|
|
@@ -55,67 +50,19 @@ export const useTableData = ({
|
|
|
55
50
|
),
|
|
56
51
|
})
|
|
57
52
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
deletedAt: order.deletedAt ?? null,
|
|
64
|
-
id: `${order.id}-${idx + 1}`, // Ensuring uniqueness with string concatenation
|
|
65
|
-
orderId: order.orderId ?? null,
|
|
66
|
-
price: order.price ?? 0,
|
|
67
|
-
productId: order.productId ?? '',
|
|
68
|
-
quantity: modGroup.productQuantity ?? 1,
|
|
69
|
-
deposit: order.deposit ?? 0,
|
|
70
|
-
orderProductModifiers: modGroup.modifiers.map((mod) => ({
|
|
71
|
-
modifierId: mod.modifierId ?? '',
|
|
72
|
-
price: mod.price ?? 0,
|
|
73
|
-
productId: mod.productId ?? '',
|
|
74
|
-
quantity: mod.quantity ?? 1,
|
|
75
|
-
modifierSetId: mod.modifierSetId ?? '',
|
|
76
|
-
modifier: mod.modifier ?? null,
|
|
77
|
-
})),
|
|
78
|
-
}))
|
|
79
|
-
})
|
|
80
|
-
: []
|
|
81
|
-
|
|
82
|
-
const renderProductItem = ({
|
|
83
|
-
product,
|
|
84
|
-
productsForCategory,
|
|
85
|
-
}: {
|
|
86
|
-
product: OrderProduct
|
|
87
|
-
productsForCategory: Product[]
|
|
88
|
-
}) => {
|
|
89
|
-
if (product.quantity === 0) {
|
|
90
|
-
return null
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const name =
|
|
94
|
-
productsForCategory.find((item) => item.id === product.productId)?.name || ''
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
key: product.id,
|
|
98
|
-
name,
|
|
99
|
-
quantity: (
|
|
100
|
-
<div className='quantity'>
|
|
101
|
-
<div className='multiplier'>x</div>
|
|
102
|
-
{product.quantity}
|
|
103
|
-
</div>
|
|
104
|
-
),
|
|
105
|
-
price: formatPrice(product.price),
|
|
106
|
-
modifier: product?.orderProductModifiers?.map(renderModifierItem) || [],
|
|
107
|
-
}
|
|
108
|
-
}
|
|
53
|
+
const renderProductItem = (product: Product) => {
|
|
54
|
+
const { quantity, price } = getProductQuantityAndPrice(
|
|
55
|
+
order.orderProducts,
|
|
56
|
+
product,
|
|
57
|
+
)
|
|
109
58
|
|
|
110
|
-
const renderModifierItem = (orderModifier: OrderModifier) => {
|
|
111
|
-
const { quantity, modifier, modifierId, price } = orderModifier
|
|
112
59
|
if (quantity === 0) {
|
|
113
60
|
return null
|
|
114
61
|
}
|
|
115
62
|
|
|
116
63
|
return {
|
|
117
|
-
key:
|
|
118
|
-
name:
|
|
64
|
+
key: product.id,
|
|
65
|
+
name: product.name,
|
|
119
66
|
quantity: (
|
|
120
67
|
<div className='quantity'>
|
|
121
68
|
<div className='multiplier'>x</div>
|
|
@@ -133,33 +80,15 @@ export const useTableData = ({
|
|
|
133
80
|
|
|
134
81
|
return productCategories.reduce(
|
|
135
82
|
(previousValues: StaticTableData[], categoryId) => {
|
|
136
|
-
const
|
|
83
|
+
const products = order.products.filter(
|
|
137
84
|
(product) => product.productCategoryId === categoryId,
|
|
138
85
|
)
|
|
139
86
|
|
|
140
|
-
const products = order.orderProducts.filter((el) =>
|
|
141
|
-
productsForCategory
|
|
142
|
-
.map((product) => product.id)
|
|
143
|
-
.includes(el.productId),
|
|
144
|
-
)
|
|
145
|
-
|
|
146
87
|
if (!products.length) {
|
|
147
88
|
return previousValues
|
|
148
89
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return reworkProductStructure(product)
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
const filteredProducts = flatten(productsWithReworkedModifier).map(
|
|
155
|
-
(product) =>
|
|
156
|
-
renderProductItem({ product , productsForCategory }),
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
const productWithModifier = flatMap(filteredProducts, (item) => [
|
|
160
|
-
item,
|
|
161
|
-
...item.modifier,
|
|
162
|
-
])
|
|
90
|
+
|
|
91
|
+
const filteredProducts = products.map(renderProductItem).filter(Boolean)
|
|
163
92
|
|
|
164
93
|
if (!filteredProducts.length) {
|
|
165
94
|
return previousValues
|
|
@@ -167,8 +96,8 @@ export const useTableData = ({
|
|
|
167
96
|
|
|
168
97
|
return [
|
|
169
98
|
...previousValues,
|
|
170
|
-
renderCategoryItem(
|
|
171
|
-
...
|
|
99
|
+
renderCategoryItem(products),
|
|
100
|
+
...filteredProducts,
|
|
172
101
|
]
|
|
173
102
|
},
|
|
174
103
|
[],
|
|
@@ -204,5 +133,6 @@ export const useTableData = ({
|
|
|
204
133
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
205
134
|
[order, externalDiscount, isPaymentProcessed],
|
|
206
135
|
)
|
|
136
|
+
|
|
207
137
|
return data
|
|
208
138
|
}
|
|
@@ -6,7 +6,6 @@ import { Product } from '@licklist/core/dist/DataMapper/Product/ProductDataMappe
|
|
|
6
6
|
import { PAYMENT_TYPE_DISCOUNT } from '@licklist/core/dist/DataMapper/Order/PaymentDataMapper'
|
|
7
7
|
import { PaymentDetail } from '@licklist/core/dist/DataMapper/Order/PaymentDetailDataMapper'
|
|
8
8
|
import { PAYMENT_TYPE_TRANSLATE_KEYS } from '../hooks/useTableData'
|
|
9
|
-
import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper'
|
|
10
9
|
|
|
11
10
|
const TRANSLATE_KEYS = {
|
|
12
11
|
totalAmount: 'totalPaid',
|
|
@@ -29,7 +28,6 @@ export const calculateTotalPrice = (
|
|
|
29
28
|
order: Order,
|
|
30
29
|
externalPaymentDetails?: ExternalPaymnetDetail[],
|
|
31
30
|
) => {
|
|
32
|
-
|
|
33
31
|
const totalPrice =
|
|
34
32
|
order?.orderProducts?.reduce(
|
|
35
33
|
(total: number, product) =>
|
|
@@ -127,26 +125,5 @@ export const getTotalSumByCategory = (
|
|
|
127
125
|
product,
|
|
128
126
|
)
|
|
129
127
|
|
|
130
|
-
const modifierFromProduct = orderProducts.find(
|
|
131
|
-
(orderProduct) => orderProduct.productId === product.id,
|
|
132
|
-
)?.orderProductModifiers
|
|
133
|
-
if (modifierFromProduct) {
|
|
134
|
-
const modifierPrice = modifierFromProduct.reduce(
|
|
135
|
-
(prevSum: number, { modifiers }) => {
|
|
136
|
-
const modifiersPrices = modifiers.reduce(
|
|
137
|
-
(prevSumModifier: number, modifier: OrderModifier) =>
|
|
138
|
-
prevSumModifier + modifier.price * modifier.quantity,
|
|
139
|
-
0,
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
return prevSum + modifiersPrices
|
|
143
|
-
},
|
|
144
|
-
0,
|
|
145
|
-
)
|
|
146
|
-
const priceWithModifier = price + modifierPrice
|
|
147
|
-
|
|
148
|
-
return prevSum + priceWithModifier * quantity
|
|
149
|
-
}
|
|
150
|
-
|
|
151
128
|
return prevSum + price * quantity
|
|
152
129
|
}, 0)
|