@licklist/design 0.44.486-dev.8 → 0.44.486-dev.80
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/assets/iframe/available.svg.js +1 -0
- package/dist/assets/iframe/limited.svg.js +1 -0
- package/dist/assets/iframe/soldOut.svg.js +1 -0
- package/dist/assets/logo/bookedit.svg +9 -11
- package/dist/assets/logo/bookedit.svg.js +1 -1
- package/dist/assets/logo/favicon.svg +12 -0
- package/dist/assets/logo/licklist.svg +0 -2
- package/dist/assets/logo/licklist.svg.js +1 -1
- package/dist/availability-indicator/AvailabilityIndicator.d.ts +10 -0
- package/dist/availability-indicator/AvailabilityIndicator.d.ts.map +1 -0
- package/dist/availability-indicator/AvailabilityIndicator.js +1 -0
- package/dist/availability-indicator/index.d.ts +2 -0
- package/dist/availability-indicator/index.d.ts.map +1 -0
- package/dist/calendar/Calendar.d.ts +19 -0
- package/dist/calendar/Calendar.d.ts.map +1 -0
- package/dist/calendar/Calendar.js +1 -0
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts +6 -0
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -0
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -0
- package/dist/calendar/components/CalendarButtons/index.d.ts.map +1 -0
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +5 -0
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -0
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -0
- package/dist/calendar/components/CalendarDates/index.d.ts.map +1 -0
- package/dist/calendar/components/CalendarSelect/CalendarSelect.d.ts.map +1 -0
- package/dist/calendar/components/CalendarSelect/CalendarSelect.js +1 -0
- package/dist/calendar/components/CalendarSelect/index.d.ts.map +1 -0
- package/dist/calendar/components/CalendarWeekdays/CalendarWeekdays.d.ts.map +1 -0
- package/dist/calendar/components/CalendarWeekdays/index.d.ts.map +1 -0
- package/dist/calendar/index.d.ts +4 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/utils/index.d.ts +5 -0
- package/dist/calendar/utils/index.d.ts.map +1 -0
- package/dist/calendar/utils/index.js +1 -0
- package/dist/date-time-button/DateTimeButton.d.ts +6 -1
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +1 -1
- package/dist/events/event-card/utils.d.ts +29 -0
- package/dist/events/event-card/utils.d.ts.map +1 -1
- package/dist/events/event-card/utils.js +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +3 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +2 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +1 -1
- package/dist/events/event-statistic-modal/utils/index.d.ts +1 -1
- package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/utils/index.js +1 -1
- package/dist/events/event-venue-map/hooks/useImage.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useImage.js +1 -1
- package/dist/file-upload/FileUpload.d.ts.map +1 -1
- package/dist/file-upload/FileUpload.js +1 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts +15 -0
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -0
- package/dist/iframe/activity-card/ActivityCard.js +1 -0
- package/dist/iframe/activity-card/index.d.ts +2 -0
- package/dist/iframe/activity-card/index.d.ts.map +1 -0
- package/dist/iframe/event/index.d.ts +0 -2
- package/dist/iframe/event/index.d.ts.map +1 -1
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts.map +1 -1
- package/dist/iframe/event/ticket-description/TicketDescription.js +1 -1
- package/dist/iframe/index.d.ts +2 -2
- package/dist/iframe/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +4 -1
- 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 -1
- package/dist/iframe/order-process/components/ErrorModal/ErrorModal.d.ts +2 -1
- package/dist/iframe/order-process/components/ErrorModal/ErrorModal.d.ts.map +1 -1
- package/dist/iframe/order-process/components/ErrorModal/ErrorModal.js +1 -1
- package/dist/iframe/order-process/components/Timer/utils/index.d.ts +1 -1
- package/dist/iframe/order-process/components/Timer/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/Timer/utils/index.js +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +4 -3
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -1
- package/dist/iframe/order-process/constants.d.ts +1 -0
- package/dist/iframe/order-process/constants.d.ts.map +1 -1
- package/dist/iframe/order-process/constants.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/number-of-people-input/NumberOfPeopleInput.d.ts.map +1 -0
- package/dist/number-of-people-input/NumberOfPeopleInput.js +1 -0
- package/dist/{iframe/event/event-details/components/number-of-people-input/component → number-of-people-input/components}/RenderNumberOfPeopleInputComponent.d.ts +2 -3
- package/dist/number-of-people-input/components/RenderNumberOfPeopleInputComponent.d.ts.map +1 -0
- package/dist/number-of-people-input/components/RenderNumberOfPeopleInputComponent.js +1 -0
- package/dist/number-of-people-input/components/index.d.ts +2 -0
- package/dist/number-of-people-input/components/index.d.ts.map +1 -0
- package/dist/number-of-people-input/index.d.ts +3 -0
- package/dist/number-of-people-input/index.d.ts.map +1 -0
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +5 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +6 -3
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.d.ts +2 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetRecurrenceControl.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +3 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +3 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts +2 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/product-set/utils/index.d.ts +10 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -1
- package/dist/provider/location-input/LocationInput.d.ts.map +1 -1
- package/dist/provider/location-input/LocationInput.js +1 -1
- package/dist/provider/location-input/components/FormGroupControll.d.ts +7 -0
- package/dist/provider/location-input/components/FormGroupControll.d.ts.map +1 -0
- package/dist/provider/location-input/components/FormGroupControll.js +1 -0
- package/dist/provider/location-input/components/index.d.ts +2 -0
- package/dist/provider/location-input/components/index.d.ts.map +1 -0
- package/dist/provider/location-input/index.d.ts +1 -0
- package/dist/provider/location-input/index.d.ts.map +1 -1
- package/dist/provider/provider-details-input/ProviderDetailsInput.d.ts.map +1 -1
- package/dist/provider/provider-details-input/ProviderDetailsInput.js +1 -1
- package/dist/provider/provider-form/ProviderForm.js +1 -1
- package/dist/provider/venue-form/VenueForm.d.ts +3 -1
- package/dist/provider/venue-form/VenueForm.d.ts.map +1 -1
- package/dist/provider/venue-form/VenueForm.js +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts +8 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +1 -1
- package/dist/recurrence-input/RecurrenceInput.d.ts +2 -1
- package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceInput.js +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts +4 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -0
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/report/form/ReportForm.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +1 -1
- package/dist/sales/filters/SaleFilters.d.ts +1 -0
- package/dist/sales/filters/SaleFilters.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts +3 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -1
- package/dist/sales/payment-form/SalePaymentForm.js +1 -1
- package/dist/sales/source-of-sales/SourceOfSalesChart.d.ts.map +1 -1
- package/dist/sales/source-of-sales/SourceOfSalesChart.js +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/static/RestrictedAccess.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.d.ts +2 -1
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +1 -1
- package/dist/styles/{iframe-customers-journey/ActivitiesCard.scss → activity-card/GridActivitiesCard.scss} +1 -9
- package/{src/styles/iframe-customers-journey/ActivitiesSelectedCard.scss → dist/styles/activity-card/ListActivitiesCard.scss} +2 -1
- package/dist/styles/activity-card/_index.scss +2 -0
- package/dist/styles/availability-indicator/AvailabilityIndicator.scss +7 -0
- package/dist/styles/availability-indicator/_index.scss +1 -0
- package/dist/styles/{iframe-customers-journey → date-time-button}/DateTimeButton.scss +6 -12
- package/dist/styles/date-time-button/_index.scss +1 -0
- package/dist/styles/events/EventCard.scss +12 -5
- package/dist/styles/form/CustomCheckbox.scss +6 -0
- package/dist/styles/header/Header.scss +0 -4
- package/dist/styles/iframe-events/Card.scss +1 -0
- package/dist/styles/notification/Notification.scss +4 -0
- package/dist/styles/packages.scss +3 -1
- package/dist/styles/resources-blocking/_index.scss +16 -0
- package/dist/styles/sales/BookingResults.scss +14 -6
- package/dist/styles/themes/bookedit/_index.scss +1 -0
- package/dist/styles/zones/ZoneForm.scss +3 -0
- package/dist/types/iframe.d.ts +1 -0
- package/dist/types/iframe.d.ts.map +1 -1
- package/dist/virtualized/components/VirtualizedWindowScroller.d.ts.map +1 -1
- package/dist/virtualized/components/VirtualizedWindowScroller.js +1 -1
- package/dist/zone/form/ZoneForm.d.ts +1 -1
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/AvailableTimesControl.d.ts +2 -0
- package/dist/zone/form/components/AvailableTimesControl.d.ts.map +1 -1
- package/dist/zone/form/components/AvailableTimesControl.js +1 -1
- package/dist/zone/form/components/GameDurationControl.d.ts +7 -0
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -0
- package/dist/zone/form/components/GameDurationControl.js +1 -0
- package/dist/zone/form/components/ZoneControl.d.ts +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/dist/zone/form/utils/dates.js +1 -1
- package/package.json +3 -3
- package/src/assets/logo/bookedit.svg +9 -11
- package/src/assets/logo/favicon.svg +12 -0
- package/src/assets/logo/licklist.svg +0 -2
- package/src/availability-indicator/AvailabilityIndicator.tsx +67 -0
- package/src/availability-indicator/index.ts +1 -0
- package/src/calendar/Calendar.stories.tsx +33 -0
- package/src/calendar/Calendar.tsx +45 -0
- package/src/{iframe/event/event-calendar → calendar}/components/CalendarButtons/CalendarButtons.tsx +31 -14
- package/src/{iframe/event/event-calendar → calendar}/components/CalendarDates/CalendarDates.tsx +24 -19
- package/src/{iframe/event/event-calendar → calendar}/components/CalendarSelect/CalendarSelect.tsx +1 -1
- package/src/calendar/index.ts +3 -0
- package/src/calendar/utils/index.ts +28 -0
- package/src/date-time-button/DateTimeButton.stories.tsx +17 -0
- package/src/date-time-button/DateTimeButton.tsx +24 -22
- package/src/events/edit-event-modal/IntervalInput.tsx +3 -0
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.stories.tsx +0 -12
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +1 -1
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +2 -2
- package/src/events/event-card/EventCard.tsx +6 -2
- package/src/events/event-card/utils.ts +89 -16
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +5 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +12 -5
- package/src/events/event-statistic-modal/utils/index.ts +39 -34
- package/src/events/event-venue-map/hooks/useImage.tsx +17 -8
- package/src/file-upload/FileUpload.tsx +3 -1
- package/src/iframe/activity-card/ActivityCard.stories.tsx +51 -0
- package/src/iframe/activity-card/ActivityCard.tsx +66 -0
- package/src/iframe/activity-card/index.ts +1 -0
- package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +1 -2
- package/src/iframe/event/index.ts +0 -7
- package/src/iframe/event/ticket-description/TicketDescription.stories.tsx +8 -2
- package/src/iframe/event/ticket-description/TicketDescription.tsx +7 -2
- package/src/iframe/index.ts +1 -3
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +4 -3
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +2 -1
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -0
- package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.stories.tsx +0 -1
- package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.tsx +17 -8
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +1 -15
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +15 -29
- package/src/iframe/order-process/components/ErrorModal/ErrorModal.tsx +12 -9
- package/src/iframe/order-process/components/Timer/utils/index.ts +6 -9
- package/src/iframe/order-process/components/utils/useCategoryVerification.ts +62 -32
- package/src/iframe/order-process/constants.ts +1 -0
- package/src/iframe/page/Page.stories.tsx +2 -2
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +13 -6
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +1 -1
- package/src/iframe/payment/payment-page/PaymentPage.tsx +4 -4
- package/src/index.ts +3 -0
- package/src/notification/email-template/control/EmailTemplateControl.tsx +26 -1
- package/src/{iframe/event/event-details/components/number-of-people-input → number-of-people-input}/NumberOfPeopleInput.tsx +1 -1
- package/src/number-of-people-input/components/RenderNumberOfPeopleInputComponent.stories.tsx +92 -0
- package/src/{iframe/event/event-details/components/number-of-people-input/component → number-of-people-input/components}/RenderNumberOfPeopleInputComponent.tsx +3 -3
- package/src/number-of-people-input/components/index.ts +1 -0
- package/src/number-of-people-input/index.ts +2 -0
- package/src/product-set/control/DateAndRecurrenceInput.tsx +75 -2
- package/src/product-set/control/ProductSetControl.stories.tsx +0 -2
- package/src/product-set/control/ProductSetControl.tsx +44 -10
- package/src/product-set/control/ProductSetRecurrenceControl.tsx +14 -5
- package/src/product-set/form/ProductCategoriesControl.tsx +2 -1
- package/src/product-set/form/ProductSetForm.stories.tsx +9 -12
- package/src/product-set/form/ProductSetForm.tsx +19 -3
- package/src/product-set/form/ProductsControl.tsx +10 -0
- package/src/product-set/product/ProductControl.tsx +28 -1
- package/src/product-set/product/duration/ProductDurationControl.tsx +1 -1
- package/src/product-set/product-category/ProductCategory.stories.tsx +0 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +1 -30
- package/src/product-set/utils/index.ts +38 -0
- package/src/provider/location-input/LocationInput.tsx +21 -20
- package/src/provider/location-input/LocationInputDescription.tsx +2 -2
- package/src/provider/location-input/components/FormGroupControll.tsx +16 -0
- package/src/provider/location-input/components/index.ts +1 -0
- package/src/provider/location-input/index.ts +1 -1
- package/src/provider/provider-details-input/ProviderDetailsInput.tsx +5 -13
- package/src/provider/venue-form/VenueForm.stories.tsx +24 -0
- package/src/provider/venue-form/VenueForm.tsx +55 -4
- package/src/recurrence-input/RecurrenceEndInput.tsx +28 -10
- package/src/recurrence-input/RecurrenceInput.tsx +12 -2
- package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +21 -11
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +9 -0
- package/src/report/form/ReportForm.tsx +1 -1
- package/src/sales/booking/results/BookingResults.stories.tsx +12 -7
- package/src/sales/booking/results/components/ResultCard.tsx +24 -3
- package/src/sales/coupon/control/CouponFormControl.tsx +5 -0
- package/src/sales/filters/SaleFilters.tsx +1 -0
- package/src/sales/guest-profile/previous-bookings/PreviousBookings.stories.tsx +0 -7
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +20 -5
- package/src/sales/source-of-sales/SourceOfSalesChart.tsx +31 -28
- package/src/snippet/snippet-template/preview/Preview.tsx +14 -2
- package/src/static/RestrictedAccess.tsx +1 -1
- package/src/static/form-number-input/FormNumberInput.tsx +8 -1
- package/src/styles/{iframe-customers-journey/ActivitiesCard.scss → activity-card/GridActivitiesCard.scss} +1 -9
- package/{dist/styles/iframe-customers-journey/ActivitiesSelectedCard.scss → src/styles/activity-card/ListActivitiesCard.scss} +2 -1
- package/src/styles/activity-card/_index.scss +2 -0
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +7 -0
- package/src/styles/availability-indicator/_index.scss +1 -0
- package/src/styles/{iframe-customers-journey → date-time-button}/DateTimeButton.scss +6 -12
- package/src/styles/date-time-button/_index.scss +1 -0
- package/src/styles/events/EventCard.scss +12 -5
- package/src/styles/form/CustomCheckbox.scss +6 -0
- package/src/styles/header/Header.scss +0 -4
- package/src/styles/iframe-events/Card.scss +1 -0
- package/src/styles/notification/Notification.scss +4 -0
- package/src/styles/packages.scss +3 -1
- package/src/styles/resources-blocking/_index.scss +16 -0
- package/src/styles/sales/BookingResults.scss +14 -6
- package/src/styles/themes/bookedit/_index.scss +1 -0
- package/src/styles/zones/ZoneForm.scss +3 -0
- package/src/types/iframe.ts +1 -0
- package/src/typings.d.ts +11 -0
- package/src/virtualized/components/VirtualizedWindowScroller.tsx +2 -1
- package/src/zone/form/ZoneForm.tsx +1 -2
- package/src/zone/form/components/AvailableTimesControl.tsx +89 -88
- package/src/zone/form/components/GameDurationControl.tsx +46 -0
- package/src/zone/form/components/ZoneControl.tsx +4 -5
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +3 -59
- package/src/zone/form/utils/dates.ts +29 -36
- package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts +0 -12
- package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts.map +0 -1
- package/dist/iframe/activity-cards/activity-card/ActivityCard.js +0 -1
- package/dist/iframe/activity-cards/index.d.ts +0 -3
- package/dist/iframe/activity-cards/index.d.ts.map +0 -1
- package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts +0 -12
- package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts.map +0 -1
- package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.js +0 -1
- package/dist/iframe/event/event-calendar/EventCalendar.d.ts +0 -7
- package/dist/iframe/event/event-calendar/EventCalendar.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/EventCalendar.js +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.d.ts +0 -6
- package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.js +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarButtons/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.d.ts +0 -12
- package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.js +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDate/index.d.ts +0 -3
- package/dist/iframe/event/event-calendar/components/CalendarDate/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts +0 -7
- package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.js +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarDates/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.js +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarSelect/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarWeekdays/CalendarWeekdays.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/components/CalendarWeekdays/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/index.d.ts +0 -4
- package/dist/iframe/event/event-calendar/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/types/index.d.ts +0 -6
- package/dist/iframe/event/event-calendar/types/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/utils/index.d.ts +0 -3
- package/dist/iframe/event/event-calendar/utils/index.d.ts.map +0 -1
- package/dist/iframe/event/event-calendar/utils/index.js +0 -1
- package/dist/iframe/event/event-details/EventDetails.d.ts +0 -10
- package/dist/iframe/event/event-details/EventDetails.d.ts.map +0 -1
- package/dist/iframe/event/event-details/EventDetails.js +0 -1
- package/dist/iframe/event/event-details/components/category-product/CategoryProduct.d.ts +0 -9
- package/dist/iframe/event/event-details/components/category-product/CategoryProduct.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/category-product/CategoryProduct.js +0 -1
- package/dist/iframe/event/event-details/components/category-product/index.d.ts +0 -2
- package/dist/iframe/event/event-details/components/category-product/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/event-details-form/EventDetailsForm.d.ts +0 -26
- package/dist/iframe/event/event-details/components/event-details-form/EventDetailsForm.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/event-details-form/EventDetailsForm.js +0 -1
- package/dist/iframe/event/event-details/components/event-details-form/index.d.ts +0 -2
- package/dist/iframe/event/event-details/components/event-details-form/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/NumberOfPeopleInput.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/NumberOfPeopleInput.js +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/component/RenderNumberOfPeopleInputComponent.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/component/RenderNumberOfPeopleInputComponent.js +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/component/index.d.ts +0 -2
- package/dist/iframe/event/event-details/components/number-of-people-input/component/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/number-of-people-input/index.d.ts +0 -2
- package/dist/iframe/event/event-details/components/number-of-people-input/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/product-category-view/ProductCategoryView.d.ts +0 -8
- package/dist/iframe/event/event-details/components/product-category-view/ProductCategoryView.d.ts.map +0 -1
- package/dist/iframe/event/event-details/components/product-category-view/ProductCategoryView.js +0 -1
- package/dist/iframe/event/event-details/components/product-category-view/index.d.ts +0 -2
- package/dist/iframe/event/event-details/components/product-category-view/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/index.d.ts +0 -2
- package/dist/iframe/event/event-details/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/utils/index.d.ts +0 -2
- package/dist/iframe/event/event-details/utils/index.d.ts.map +0 -1
- package/dist/iframe/event/event-details/utils/routes.d.ts +0 -2
- package/dist/iframe/event/event-details/utils/routes.d.ts.map +0 -1
- package/dist/iframe/event/event-details/utils/routes.js +0 -1
- package/dist/styles/iframe-customers-journey/_index.scss +0 -3
- package/src/iframe/activity-cards/activity-card/ActivityCard.stories.tsx +0 -52
- package/src/iframe/activity-cards/activity-card/ActivityCard.tsx +0 -38
- package/src/iframe/activity-cards/index.ts +0 -2
- package/src/iframe/activity-cards/list-activity-card/ListActivityCard.stories.tsx +0 -52
- package/src/iframe/activity-cards/list-activity-card/ListActivityCard.tsx +0 -49
- package/src/iframe/event/event-calendar/EventCalendar.stories.tsx +0 -36
- package/src/iframe/event/event-calendar/EventCalendar.tsx +0 -27
- package/src/iframe/event/event-calendar/components/CalendarDate/CalendarDate.tsx +0 -51
- package/src/iframe/event/event-calendar/components/CalendarDate/index.ts +0 -2
- package/src/iframe/event/event-calendar/index.ts +0 -6
- package/src/iframe/event/event-calendar/types/index.ts +0 -6
- package/src/iframe/event/event-calendar/utils/index.ts +0 -11
- package/src/iframe/event/event-details/EventDetails.stories.tsx +0 -187
- package/src/iframe/event/event-details/EventDetails.tsx +0 -92
- package/src/iframe/event/event-details/EventDetailsOneStepForm.stories.tsx +0 -123
- package/src/iframe/event/event-details/components/category-product/CategoryProduct.tsx +0 -109
- package/src/iframe/event/event-details/components/category-product/index.ts +0 -1
- package/src/iframe/event/event-details/components/event-details-form/EventDetailsForm.tsx +0 -250
- package/src/iframe/event/event-details/components/event-details-form/index.ts +0 -5
- package/src/iframe/event/event-details/components/number-of-people-input/component/index.ts +0 -1
- package/src/iframe/event/event-details/components/number-of-people-input/index.ts +0 -1
- package/src/iframe/event/event-details/components/product-category-view/ProductCategoryView.tsx +0 -34
- package/src/iframe/event/event-details/components/product-category-view/index.ts +0 -1
- package/src/iframe/event/event-details/index.ts +0 -1
- package/src/iframe/event/event-details/utils/index.ts +0 -1
- package/src/iframe/event/event-details/utils/routes.ts +0 -6
- package/src/styles/iframe-customers-journey/_index.scss +0 -3
- /package/dist/assets/iframe/{dateInfo/available.svg → available.svg} +0 -0
- /package/dist/assets/iframe/{dateInfo/limited.svg → limited.svg} +0 -0
- /package/dist/assets/iframe/{dateInfo/soldOut.svg → soldOut.svg} +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarButtons/index.d.ts +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarDates/index.d.ts +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarSelect/CalendarSelect.d.ts +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarSelect/index.d.ts +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.d.ts +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.js +0 -0
- /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/index.d.ts +0 -0
- /package/dist/{iframe/event/event-details/components/number-of-people-input → number-of-people-input}/NumberOfPeopleInput.d.ts +0 -0
- /package/src/assets/iframe/{dateInfo/available.svg → available.svg} +0 -0
- /package/src/assets/iframe/{dateInfo/limited.svg → limited.svg} +0 -0
- /package/src/assets/iframe/{dateInfo/soldOut.svg → soldOut.svg} +0 -0
- /package/src/{iframe/event/event-calendar → calendar}/components/CalendarButtons/index.ts +0 -0
- /package/src/{iframe/event/event-calendar → calendar}/components/CalendarDates/index.ts +0 -0
- /package/src/{iframe/event/event-calendar → calendar}/components/CalendarSelect/index.ts +0 -0
- /package/src/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.tsx +0 -0
- /package/src/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/index.ts +0 -0
|
@@ -1,53 +1,83 @@
|
|
|
1
|
+
import { ProductCategory } from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
2
|
+
import { Currency } from "@licklist/core/dist/Config";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
1
4
|
import { useTranslation } from "react-i18next";
|
|
2
|
-
import {
|
|
5
|
+
import { Order } from "src/types";
|
|
3
6
|
|
|
4
7
|
interface CategoryError {
|
|
5
8
|
message: string;
|
|
6
|
-
id
|
|
9
|
+
id?: number;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
// TODO it's temporary solution, please remove it later
|
|
10
13
|
export const useCategoryVerification = () => {
|
|
11
14
|
const { t } = useTranslation("Validation");
|
|
12
|
-
|
|
15
|
+
const { formatNumber } = useIntl();
|
|
13
16
|
return (
|
|
14
17
|
values: Record<Order["id"], Order>,
|
|
15
|
-
|
|
18
|
+
productCategories?: ProductCategory[],
|
|
19
|
+
isLastPage?: boolean
|
|
16
20
|
): CategoryError | void => {
|
|
17
|
-
let errorMessage;
|
|
18
|
-
|
|
21
|
+
let errorMessage: { id?: number; message: string } | void;
|
|
19
22
|
const productArray = Object.values(values).filter(
|
|
20
23
|
(product) => product?.quantity > 0
|
|
21
24
|
);
|
|
25
|
+
const sumOfMinSpends = productCategories.reduce((acc, productCategory) => {
|
|
26
|
+
const { products } = productCategory;
|
|
27
|
+
const selectedProducts = products.filter((product) =>
|
|
28
|
+
productArray.map((el) => el.id).includes(product?.id)
|
|
29
|
+
);
|
|
30
|
+
const productMinSpendsSum = selectedProducts.reduce((sum, product) => {
|
|
31
|
+
const quantity =
|
|
32
|
+
productArray.find((selected) => selected.id === product.id)
|
|
33
|
+
?.quantity || 1;
|
|
34
|
+
return sum + product.minSpend * quantity;
|
|
35
|
+
}, 0);
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
).length;
|
|
30
|
-
|
|
31
|
-
if (minSubItems && categoryProductsQuantity < minSubItems) {
|
|
32
|
-
const message = t("Validation:fieldMinNumber", {
|
|
33
|
-
min: minSubItems,
|
|
34
|
-
attribute: `number of products in the ${name} category`,
|
|
35
|
-
});
|
|
36
|
-
errorMessage = { id, message };
|
|
37
|
-
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (maxSubItems && categoryProductsQuantity > maxSubItems) {
|
|
42
|
-
const message = t("Validation:fieldMaxNumber", {
|
|
43
|
-
max: maxSubItems,
|
|
44
|
-
attribute: `number of products in the ${name} category`,
|
|
45
|
-
});
|
|
46
|
-
errorMessage = { id, message };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
37
|
+
return acc + productMinSpendsSum;
|
|
38
|
+
}, 0);
|
|
39
|
+
|
|
40
|
+
const totalPrice = productArray.reduce(
|
|
41
|
+
(total, product) => total + product.price * product.quantity,
|
|
42
|
+
0
|
|
49
43
|
);
|
|
50
44
|
|
|
45
|
+
productCategories.forEach(({ minSubItems, maxSubItems, id, name }) => {
|
|
46
|
+
if (!minSubItems && !maxSubItems) return;
|
|
47
|
+
|
|
48
|
+
const categoryProductsQuantity = productArray.filter(
|
|
49
|
+
(product) => product?.productsCategoryId === id
|
|
50
|
+
).length;
|
|
51
|
+
|
|
52
|
+
if (minSubItems && categoryProductsQuantity < minSubItems) {
|
|
53
|
+
const message = t("Validation:fieldMinNumber", {
|
|
54
|
+
min: minSubItems,
|
|
55
|
+
attribute: `number of products in the ${name} category`,
|
|
56
|
+
});
|
|
57
|
+
errorMessage = { id, message };
|
|
58
|
+
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (maxSubItems && categoryProductsQuantity > maxSubItems) {
|
|
63
|
+
const message = t("Validation:fieldMaxNumber", {
|
|
64
|
+
max: maxSubItems,
|
|
65
|
+
attribute: `number of products in the ${name} category`,
|
|
66
|
+
});
|
|
67
|
+
errorMessage = { id, message };
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (totalPrice < sumOfMinSpends && !errorMessage && isLastPage) {
|
|
72
|
+
const message = t("Design:minimumSpendSumValidation", {
|
|
73
|
+
minSpend: formatNumber(sumOfMinSpends, {
|
|
74
|
+
style: "currency",
|
|
75
|
+
currency: Currency.GBP,
|
|
76
|
+
}),
|
|
77
|
+
}) as string;
|
|
78
|
+
errorMessage = { message };
|
|
79
|
+
}
|
|
80
|
+
|
|
51
81
|
return errorMessage;
|
|
52
82
|
};
|
|
53
83
|
};
|
|
@@ -6,7 +6,7 @@ import { Page } from "./Page";
|
|
|
6
6
|
import { PageHeader } from "./components/PageHeader";
|
|
7
7
|
import { PageBody } from "./components/PageBody";
|
|
8
8
|
import { IframeEventCard } from "../event/event-card/IframeEventCard";
|
|
9
|
-
import { CalendarSelect } from "
|
|
9
|
+
import { CalendarSelect } from "../../calendar/components/CalendarSelect";
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: "Iframe/Page/Page",
|
|
@@ -219,7 +219,7 @@ export function Default() {
|
|
|
219
219
|
<>
|
|
220
220
|
<CalendarSelect
|
|
221
221
|
options={[{ label: "Floor 1", value: "1" }]}
|
|
222
|
-
value=
|
|
222
|
+
value="1"
|
|
223
223
|
onChange={(chagedId: string) => console.log({ chagedId })}
|
|
224
224
|
/>
|
|
225
225
|
</>
|
|
@@ -24,12 +24,19 @@ export const LeftBlock = ({
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<div className={clsx("left-block", className)} {...props}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
<div className="navigation">
|
|
28
|
+
{pageTitle && (
|
|
29
|
+
<>
|
|
30
|
+
{typeof pageTitle === "string" ? (
|
|
31
|
+
<div className="title">{pageTitle}</div>
|
|
32
|
+
) : (
|
|
33
|
+
pageTitle
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
37
|
+
|
|
38
|
+
{component}
|
|
39
|
+
</div>
|
|
33
40
|
<div
|
|
34
41
|
className={clsx("left-block-container", childrenClassName)}
|
|
35
42
|
style={leftBlockStyles}
|
|
@@ -100,18 +100,18 @@ export const PaymentPage = ({
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const
|
|
103
|
+
const orderTotalAmountByFormValues = cartSumByOrderProducts(
|
|
104
104
|
bookingSummaryProps && bookingSummaryProps?.formValues
|
|
105
105
|
? Object.values(bookingSummaryProps?.formValues)
|
|
106
106
|
: undefined
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
// User can fill
|
|
109
|
+
// User can fill promo code only in iframe application.
|
|
110
110
|
// It didn't possible via payment link. This check will
|
|
111
111
|
// be applied when there are no metadata and in case when
|
|
112
112
|
// orderValues sum is greater than amount in order.
|
|
113
113
|
const isCalculatedAmountGreaterThanOrderAmount =
|
|
114
|
-
|
|
114
|
+
orderTotalAmountByFormValues > data?.amount;
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
117
|
<Page
|
|
@@ -164,7 +164,7 @@ export const PaymentPage = ({
|
|
|
164
164
|
<SummaryTotalBlock
|
|
165
165
|
label={t("total")}
|
|
166
166
|
amount={
|
|
167
|
-
|
|
167
|
+
orderTotalAmountByFormValues +
|
|
168
168
|
(bookingSummaryProps?.transactionFee || 0)
|
|
169
169
|
}
|
|
170
170
|
/>
|
package/src/index.ts
CHANGED
|
@@ -314,13 +314,38 @@ export const EmailTemplateControl = React.forwardRef(
|
|
|
314
314
|
<Row className="mb-4">
|
|
315
315
|
<Form.Group as={Col}>
|
|
316
316
|
<Form.Label>{t("Design:emailBody")}</Form.Label>
|
|
317
|
-
|
|
317
|
+
|
|
318
|
+
<div className="alert alert-warning" role="alert">
|
|
319
|
+
Due to the mail services limitations on the length of the email
|
|
320
|
+
body that can be sent or received - maximum length is set to
|
|
321
|
+
65,535 characters.
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div className={`email-editor ${errors.body && "is-invalid"}`}>
|
|
318
325
|
<EmailEditor
|
|
319
326
|
ref={ref}
|
|
320
327
|
onReady={onReadyEditor}
|
|
321
328
|
style={{ height: "50rem" }}
|
|
322
329
|
/>
|
|
330
|
+
|
|
331
|
+
<input
|
|
332
|
+
type="hidden"
|
|
333
|
+
name="body"
|
|
334
|
+
{...register("body", {
|
|
335
|
+
maxLength: {
|
|
336
|
+
value: 65535,
|
|
337
|
+
message: t("Validation:fieldMaxLength", {
|
|
338
|
+
attribute: t("body"),
|
|
339
|
+
max: 65535,
|
|
340
|
+
}) as string,
|
|
341
|
+
},
|
|
342
|
+
})}
|
|
343
|
+
/>
|
|
323
344
|
</div>
|
|
345
|
+
|
|
346
|
+
<Form.Control.Feedback type="invalid">
|
|
347
|
+
{errors.body?.message}
|
|
348
|
+
</Form.Control.Feedback>
|
|
324
349
|
</Form.Group>
|
|
325
350
|
</Row>
|
|
326
351
|
<Row>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { RenderNumberOfPeopleInputComponent } from "./
|
|
3
|
+
import { RenderNumberOfPeopleInputComponent } from "./components";
|
|
4
4
|
|
|
5
5
|
const NUMBER_OF_PEOPLE = "numberOfPeople";
|
|
6
6
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Meta } from "@storybook/react";
|
|
3
|
+
import { RenderNumberOfPeopleInputComponent } from "./RenderNumberOfPeopleInputComponent";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "NumberOfPeopleInput/RenderNumberOfPeopleInputComponent",
|
|
7
|
+
component: RenderNumberOfPeopleInputComponent,
|
|
8
|
+
} as Meta;
|
|
9
|
+
|
|
10
|
+
const productCategories = [
|
|
11
|
+
{
|
|
12
|
+
id: 1,
|
|
13
|
+
name: "Early Bird General Admission",
|
|
14
|
+
products: [
|
|
15
|
+
{
|
|
16
|
+
id: 7,
|
|
17
|
+
name: "Beer",
|
|
18
|
+
description: `Ticket is valid for students and non students.
|
|
19
|
+
You do not need student ID for this event but do require regular age ID e.g. driving licence or passport.
|
|
20
|
+
Ticket valid for entry before 11.30pm for 12.30am showtime.`,
|
|
21
|
+
minQuantity: 1,
|
|
22
|
+
maxQuantity: 10,
|
|
23
|
+
price: 1,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 8,
|
|
27
|
+
name: "Wine",
|
|
28
|
+
description: `Ticket is valid for students and non students.
|
|
29
|
+
You do not need student ID for this event but do require regular age ID e.g. driving licence or passport.
|
|
30
|
+
Ticket valid for entry before 11.30pm for 12.30am showtime.`,
|
|
31
|
+
minQuantity: 1,
|
|
32
|
+
maxQuantity: 10,
|
|
33
|
+
price: 1,
|
|
34
|
+
isRequired: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 2,
|
|
40
|
+
name: "Nice",
|
|
41
|
+
products: [
|
|
42
|
+
{
|
|
43
|
+
id: 3,
|
|
44
|
+
name: "Beer",
|
|
45
|
+
description: `Ticket is valid for students and non students.
|
|
46
|
+
You do not need student ID for this event but do require regular age ID e.g. driving licence or passport.
|
|
47
|
+
Ticket valid for entry before 11.30pm for 12.30am showtime.`,
|
|
48
|
+
minQuantity: 1,
|
|
49
|
+
maxQuantity: 10,
|
|
50
|
+
price: 1,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 5,
|
|
54
|
+
name: "Wine",
|
|
55
|
+
description: `Ticket is valid for students and non students.
|
|
56
|
+
You do not need student ID for this event but do require regular age ID e.g. driving licence or passport.
|
|
57
|
+
Ticket valid for entry before 11.30pm for 12.30am showtime.`,
|
|
58
|
+
minQuantity: 1,
|
|
59
|
+
maxQuantity: 10,
|
|
60
|
+
price: 1,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
const menus = [
|
|
67
|
+
{
|
|
68
|
+
id: 1,
|
|
69
|
+
name: "Menu 1",
|
|
70
|
+
menuSteps: [
|
|
71
|
+
{
|
|
72
|
+
id: 1,
|
|
73
|
+
name: "Burger",
|
|
74
|
+
productCategories: productCategories,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export function Default() {
|
|
81
|
+
const [peopleAmount, setPeopleAmount] = useState(0);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div>
|
|
85
|
+
<RenderNumberOfPeopleInputComponent
|
|
86
|
+
peopleAmount={peopleAmount}
|
|
87
|
+
onChangePeopleAmount={(amount) => setPeopleAmount(amount)}
|
|
88
|
+
peopleAmountError={false}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useTranslation, Trans } from "react-i18next";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { NumberInput } from "
|
|
4
|
+
import { NumberInput } from "../../iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput";
|
|
5
5
|
|
|
6
6
|
const NUMBER_OF_PEOPLE = "numberOfPeople";
|
|
7
7
|
|
|
8
|
-
interface RenderNumberOfPeopleInputComponentProps {
|
|
8
|
+
export interface RenderNumberOfPeopleInputComponentProps {
|
|
9
9
|
onChangePeopleAmount: (value: number) => void;
|
|
10
10
|
peopleAmount: number;
|
|
11
|
-
peopleAmountError
|
|
11
|
+
peopleAmountError?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const RenderNumberOfPeopleInputComponent = ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RenderNumberOfPeopleInputComponent";
|
|
@@ -5,8 +5,11 @@ import { Form, OverlayTrigger, Popover } from "react-bootstrap";
|
|
|
5
5
|
import { useFieldArray, useFormContext } from "react-hook-form";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import { useClickAway } from "react-use";
|
|
8
|
+
import { DateTime } from "luxon";
|
|
9
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
8
10
|
import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
|
|
9
11
|
import { DndContext } from "@dnd-kit/core";
|
|
12
|
+
import { TIME_FORMAT } from "@licklist/core/dist/Config/Date";
|
|
10
13
|
import {
|
|
11
14
|
SortableContext,
|
|
12
15
|
verticalListSortingStrategy,
|
|
@@ -20,6 +23,11 @@ import {
|
|
|
20
23
|
RecurringDatePickerInputValues,
|
|
21
24
|
} from "../../recurring-date-picker-input/RecurringDatePickerInput";
|
|
22
25
|
import { ProductSetRecurrenceControl } from "./ProductSetRecurrenceControl";
|
|
26
|
+
import {
|
|
27
|
+
AvailableTimesControl,
|
|
28
|
+
AvailableTimesControlRef,
|
|
29
|
+
} from "../../zone/form/components/AvailableTimesControl";
|
|
30
|
+
|
|
23
31
|
// eslint-disable-next-line max-len
|
|
24
32
|
|
|
25
33
|
export interface DateAndRecurrenceInputValues {
|
|
@@ -28,10 +36,16 @@ export interface DateAndRecurrenceInputValues {
|
|
|
28
36
|
|
|
29
37
|
interface DateAndRecurrenceInputProps {
|
|
30
38
|
isEventEditProductSet?: boolean;
|
|
39
|
+
workHours?: WorkHour[];
|
|
40
|
+
providerHasBookingManagement: boolean;
|
|
41
|
+
isLoading?: boolean;
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
export const DateAndRecurrenceInput = ({
|
|
34
45
|
isEventEditProductSet,
|
|
46
|
+
providerHasBookingManagement,
|
|
47
|
+
workHours,
|
|
48
|
+
isLoading,
|
|
35
49
|
}: DateAndRecurrenceInputProps) => {
|
|
36
50
|
const {
|
|
37
51
|
control,
|
|
@@ -42,6 +56,9 @@ export const DateAndRecurrenceInput = ({
|
|
|
42
56
|
clearErrors,
|
|
43
57
|
} = useFormContext<DateAndRecurrenceInputValues>();
|
|
44
58
|
|
|
59
|
+
const [availableTimes, setAvailableTimes] = useState<string[]>([]);
|
|
60
|
+
const availableTimesFormRef = useRef<AvailableTimesControlRef>();
|
|
61
|
+
|
|
45
62
|
const { fields, append, update, move } = useFieldArray({
|
|
46
63
|
name: "menuRecurrences",
|
|
47
64
|
control,
|
|
@@ -78,13 +95,46 @@ export const DateAndRecurrenceInput = ({
|
|
|
78
95
|
const { t } = useTranslation("Design");
|
|
79
96
|
|
|
80
97
|
// in this method we should fulfill the form with a proper data
|
|
81
|
-
const handleRecurringDateChange = (
|
|
98
|
+
const handleRecurringDateChange = async (
|
|
99
|
+
next: RecurringDatePickerInputValues
|
|
100
|
+
) => {
|
|
101
|
+
const isAvailableTimesFormValid =
|
|
102
|
+
await availableTimesFormRef.current?.trigger();
|
|
103
|
+
|
|
104
|
+
if (next?.startTime && next?.endTime && isAvailableTimesFormValid) {
|
|
105
|
+
const startTime = DateTime.fromISO(next.startTime);
|
|
106
|
+
const endTime = DateTime.fromISO(next.endTime);
|
|
107
|
+
const { availableTimes } = availableTimesFormRef.current.getValues();
|
|
108
|
+
const validAvalilableTimes = availableTimes.every((time) => {
|
|
109
|
+
const currentAvailableTime = DateTime.fromFormat(time, TIME_FORMAT);
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
currentAvailableTime.diff(startTime, "minutes").minutes >= 0 &&
|
|
113
|
+
currentAvailableTime.diff(endTime, "minutes").minutes <= 0
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
if (!validAvalilableTimes) {
|
|
117
|
+
availableTimesFormRef.current.setError("availableTimes", {
|
|
118
|
+
message: t("Validation:fieldTimeBetween", {
|
|
119
|
+
attribute: t("Design:startTimesSmall"),
|
|
120
|
+
min: startTime.toFormat(TIME_FORMAT),
|
|
121
|
+
max: endTime.toFormat(TIME_FORMAT),
|
|
122
|
+
}),
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const availableTime = availableTimesFormRef?.current?.getValues()?.availableTimes || null;
|
|
130
|
+
|
|
82
131
|
const values = {
|
|
83
132
|
rrule: next.rrule,
|
|
84
133
|
startDate: next.startDate,
|
|
85
134
|
endDate: next.endDate,
|
|
86
135
|
startTime: next.startTime,
|
|
87
136
|
endTime: next.endTime,
|
|
137
|
+
availableTimes: availableTime,
|
|
88
138
|
} as Partial<ProductSetRecurrence>;
|
|
89
139
|
|
|
90
140
|
if (editState.values?.id) {
|
|
@@ -107,6 +157,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
107
157
|
// Hotfix for an issue with Popover close & open actions
|
|
108
158
|
setTimeout(() => {
|
|
109
159
|
setEditState({ index, values: next });
|
|
160
|
+
setAvailableTimes(next.availableTimes || []);
|
|
110
161
|
setIsDatePopoverVisible(() => true);
|
|
111
162
|
}, 100);
|
|
112
163
|
};
|
|
@@ -176,7 +227,25 @@ export const DateAndRecurrenceInput = ({
|
|
|
176
227
|
defaultValues={editState.values}
|
|
177
228
|
onChange={handleRecurringDateChange}
|
|
178
229
|
onDelete={handleDelete}
|
|
179
|
-
|
|
230
|
+
>
|
|
231
|
+
{providerHasBookingManagement && (
|
|
232
|
+
<AvailableTimesControl
|
|
233
|
+
workHours={workHours}
|
|
234
|
+
isLoading={isLoading}
|
|
235
|
+
defaultValues={availableTimes}
|
|
236
|
+
ref={availableTimesFormRef}
|
|
237
|
+
errorMessage={
|
|
238
|
+
errors?.menuRecurrences?.[`${editState?.index}`]
|
|
239
|
+
?.availableTimes?.message
|
|
240
|
+
}
|
|
241
|
+
clearErrorMessage={() =>
|
|
242
|
+
clearErrors(
|
|
243
|
+
`menuRecurrences.${editState?.index}.availableTimes`
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
/>
|
|
247
|
+
)}
|
|
248
|
+
</RecurringDatePickerInput>
|
|
180
249
|
</Popover.Content>
|
|
181
250
|
</Popover>
|
|
182
251
|
}
|
|
@@ -201,6 +270,10 @@ export const DateAndRecurrenceInput = ({
|
|
|
201
270
|
key={menuRecurrence._id}
|
|
202
271
|
menuRecurrence={menuRecurrence}
|
|
203
272
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
273
|
+
errorMessage={
|
|
274
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
275
|
+
?.message
|
|
276
|
+
}
|
|
204
277
|
/>
|
|
205
278
|
))}
|
|
206
279
|
</SortableContext>
|
|
@@ -67,7 +67,6 @@ Empty.args = {
|
|
|
67
67
|
type: "sale",
|
|
68
68
|
termsAndConditions: "",
|
|
69
69
|
operationalCost: OPERATIONAL_COST_CUSTOMER,
|
|
70
|
-
isDefault: false,
|
|
71
70
|
menuRecurrence: {
|
|
72
71
|
id: 38,
|
|
73
72
|
menuId: 257,
|
|
@@ -87,7 +86,6 @@ Default.args = {
|
|
|
87
86
|
type: "sale",
|
|
88
87
|
termsAndConditions: "",
|
|
89
88
|
operationalCost: OPERATIONAL_COST_CUSTOMER,
|
|
90
|
-
isDefault: true,
|
|
91
89
|
menuRecurrence: {
|
|
92
90
|
id: 38,
|
|
93
91
|
menuId: 257,
|
|
@@ -7,8 +7,13 @@ import {
|
|
|
7
7
|
OPERATIONAL_COST_CUSTOMER,
|
|
8
8
|
OPERATIONAL_COST_PROVIDER,
|
|
9
9
|
OPERATIONAL_COST_TYPES,
|
|
10
|
+
RELY_ON_PEOPLE_QUANTITY,
|
|
11
|
+
RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY,
|
|
12
|
+
RELY_ON_PEOPLE_PRODUCT_QUANTITY,
|
|
10
13
|
OperationalCostType,
|
|
11
14
|
ProductSetType,
|
|
15
|
+
RELY_ON_PEOPLE_TYPES,
|
|
16
|
+
RelyOnPeopleType,
|
|
12
17
|
} from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
13
18
|
import { useId } from "@react-aria/utils";
|
|
14
19
|
import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
|
|
@@ -16,6 +21,7 @@ import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/Email
|
|
|
16
21
|
import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper";
|
|
17
22
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
18
23
|
import { ruleForUrlWithProtocol } from "@licklist/plugins/dist/validation/Rules/urlRule";
|
|
24
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
19
25
|
import { WarningMessage } from "../../static";
|
|
20
26
|
import { SelectItem } from "../../types/generic/SelectItem";
|
|
21
27
|
import {
|
|
@@ -34,6 +40,12 @@ const OPERATIONAL_COST_TITLES = {
|
|
|
34
40
|
[OPERATIONAL_COST_CUSTOMER]: "operationalCostCustomer",
|
|
35
41
|
} as const;
|
|
36
42
|
|
|
43
|
+
const RELY_ON_PEOPLE_TYPE_TITLES = {
|
|
44
|
+
[RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]: "peopleProductCapacityQuantity",
|
|
45
|
+
[RELY_ON_PEOPLE_PRODUCT_QUANTITY]: "peopleProductQuantity",
|
|
46
|
+
[RELY_ON_PEOPLE_QUANTITY]: "peopleQuantity",
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
export interface TemplateItem {
|
|
38
50
|
id: string;
|
|
39
51
|
value: EmailTemplate | SmsTemplate;
|
|
@@ -45,9 +57,9 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
45
57
|
type: ProductSetType;
|
|
46
58
|
termsAndConditions: string;
|
|
47
59
|
thankYouPageUrl: string;
|
|
48
|
-
isDefault: boolean;
|
|
49
60
|
operationalCost: OperationalCostType;
|
|
50
61
|
productGroups?: SelectItem[];
|
|
62
|
+
relyOnPeopleType?: RelyOnPeopleType | null;
|
|
51
63
|
fieldSetId?: number;
|
|
52
64
|
steps?: Step[];
|
|
53
65
|
emailTemplates?: TemplateItem[];
|
|
@@ -72,6 +84,8 @@ export interface ProductSetControlProps {
|
|
|
72
84
|
fieldSets?: FieldSet[];
|
|
73
85
|
showEmailTemplate?: boolean;
|
|
74
86
|
showSmsTemplate?: boolean;
|
|
87
|
+
workHours?: WorkHour[];
|
|
88
|
+
providerHasBookingManagement?: boolean;
|
|
75
89
|
}
|
|
76
90
|
|
|
77
91
|
export function ProductSetControl({
|
|
@@ -85,6 +99,8 @@ export function ProductSetControl({
|
|
|
85
99
|
isCreateAction,
|
|
86
100
|
showEmailTemplate,
|
|
87
101
|
showSmsTemplate,
|
|
102
|
+
workHours,
|
|
103
|
+
providerHasBookingManagement = false,
|
|
88
104
|
}: ProductSetControlProps) {
|
|
89
105
|
const { t } = useTranslation(["Design", "Validation", "Notification"]);
|
|
90
106
|
const {
|
|
@@ -100,6 +116,7 @@ export function ProductSetControl({
|
|
|
100
116
|
|
|
101
117
|
const nameId = useId();
|
|
102
118
|
const termsAndConditionsId = useId();
|
|
119
|
+
const relyOnPeopleTypeId = useId();
|
|
103
120
|
|
|
104
121
|
return (
|
|
105
122
|
<Row
|
|
@@ -145,6 +162,9 @@ export function ProductSetControl({
|
|
|
145
162
|
{isCreateAction && (
|
|
146
163
|
<DateAndRecurrenceInput
|
|
147
164
|
isEventEditProductSet={isEventEditProductSet}
|
|
165
|
+
workHours={workHours}
|
|
166
|
+
isLoading={isLoading}
|
|
167
|
+
providerHasBookingManagement={providerHasBookingManagement}
|
|
148
168
|
/>
|
|
149
169
|
)}
|
|
150
170
|
|
|
@@ -176,15 +196,6 @@ export function ProductSetControl({
|
|
|
176
196
|
</Form.Group>
|
|
177
197
|
)}
|
|
178
198
|
/> */}
|
|
179
|
-
{/* <Form.Check
|
|
180
|
-
{...register("isDefault")}
|
|
181
|
-
id="isDefaultId"
|
|
182
|
-
name="isDefault"
|
|
183
|
-
label={t("Design:setAsDraft")}
|
|
184
|
-
custom
|
|
185
|
-
className="is-default-checkbox"
|
|
186
|
-
disabled={isLoading}
|
|
187
|
-
/> */}
|
|
188
199
|
|
|
189
200
|
<Form.Group>
|
|
190
201
|
<Form.Label className="mb-0">
|
|
@@ -220,6 +231,29 @@ export function ProductSetControl({
|
|
|
220
231
|
</Form.Control>
|
|
221
232
|
</Form.Group>
|
|
222
233
|
|
|
234
|
+
<Form.Group controlId={relyOnPeopleTypeId}>
|
|
235
|
+
<Form.Label>{t("peopleQuantityType")}</Form.Label>
|
|
236
|
+
<Form.Control
|
|
237
|
+
{...register("relyOnPeopleType")}
|
|
238
|
+
as="select"
|
|
239
|
+
defaultValue={null}
|
|
240
|
+
>
|
|
241
|
+
<option value="">{t("notRequired")}</option>
|
|
242
|
+
{Object.keys(RELY_ON_PEOPLE_TYPES).map((relyOnPeopleType) => (
|
|
243
|
+
<option
|
|
244
|
+
value={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
|
|
245
|
+
key={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
|
|
246
|
+
>
|
|
247
|
+
{t(
|
|
248
|
+
RELY_ON_PEOPLE_TYPE_TITLES[
|
|
249
|
+
RELY_ON_PEOPLE_TYPES[relyOnPeopleType]
|
|
250
|
+
]
|
|
251
|
+
)}
|
|
252
|
+
</option>
|
|
253
|
+
))}
|
|
254
|
+
</Form.Control>
|
|
255
|
+
</Form.Group>
|
|
256
|
+
|
|
223
257
|
<Form.Group controlId={termsAndConditionsId}>
|
|
224
258
|
<Form.Label>{t("Design:termsAndConditions")}</Form.Label>
|
|
225
259
|
<Form.Control
|