@licklist/design 0.44.486-dev.8 → 0.44.486-dev.81
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 +66 -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
package/src/{iframe/event/event-calendar → calendar}/components/CalendarDates/CalendarDates.tsx
RENAMED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
|
-
import {
|
|
3
|
+
import { DAY_NUMBER } from "@licklist/core/dist/Config";
|
|
4
|
+
import { DateTimeButton } from "../../../date-time-button";
|
|
4
5
|
import { CalendarWeekdays } from "../CalendarWeekdays";
|
|
5
|
-
import { CalendarDate } from "../CalendarDate";
|
|
6
|
-
import { CalendarBaseProps } from "../../types";
|
|
7
6
|
import { isSelectedDateDisabled } from "../../utils";
|
|
7
|
+
import { CalendarProps } from "../../Calendar";
|
|
8
8
|
|
|
9
|
-
export type CalendarDatesProps =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export type CalendarDatesProps = Omit<
|
|
10
|
+
CalendarProps,
|
|
11
|
+
"currentDate" | "setCurrentDate" | "initialDate"
|
|
12
|
+
>;
|
|
12
13
|
|
|
13
14
|
export const CalendarDates = ({
|
|
14
15
|
disabledDates = [],
|
|
15
16
|
isLoading = false,
|
|
17
|
+
calendarDates,
|
|
18
|
+
selectedDate,
|
|
19
|
+
setSelectedDate,
|
|
16
20
|
fromPrice,
|
|
21
|
+
getAvailability,
|
|
22
|
+
includeAvailability,
|
|
17
23
|
}: CalendarDatesProps) => {
|
|
18
|
-
const { calendarDates, initialDate, selectedDate, setSelectedDate } =
|
|
19
|
-
useContext(EventCalendarContext);
|
|
20
|
-
|
|
21
24
|
const fillCalendarDates = useMemo(() => {
|
|
22
25
|
let firstDayOfWeek = calendarDates[0]?.weekday ?? 0;
|
|
23
26
|
|
|
@@ -40,22 +43,24 @@ export const CalendarDates = ({
|
|
|
40
43
|
<CalendarWeekdays />
|
|
41
44
|
<div className="calendar-dates">
|
|
42
45
|
{fillCalendarDates.map((date: DateTime | null) => {
|
|
43
|
-
if (date === null)
|
|
44
|
-
return <div />;
|
|
45
|
-
}
|
|
46
|
+
if (date === null) return <div />;
|
|
46
47
|
|
|
47
48
|
const isDisabled =
|
|
48
49
|
isLoading || isSelectedDateDisabled(date, disabledDates);
|
|
49
50
|
|
|
50
51
|
return (
|
|
51
|
-
<
|
|
52
|
+
<DateTimeButton
|
|
52
53
|
key={+date}
|
|
53
|
-
currentDate={date}
|
|
54
|
-
initialDate={initialDate}
|
|
55
|
-
selectedDate={selectedDate}
|
|
56
|
-
setSelectedDate={setSelectedDate}
|
|
57
54
|
isDisabled={isDisabled}
|
|
58
|
-
|
|
55
|
+
isSelected={
|
|
56
|
+
selectedDate ? date.hasSame(selectedDate, "day") : undefined
|
|
57
|
+
}
|
|
58
|
+
date={date.toFormat(DAY_NUMBER)}
|
|
59
|
+
onSelect={() => setSelectedDate(date)}
|
|
60
|
+
price={fromPrice}
|
|
61
|
+
resources={getAvailability?.(date)}
|
|
62
|
+
showResources={includeAvailability}
|
|
63
|
+
calendarView
|
|
59
64
|
/>
|
|
60
65
|
);
|
|
61
66
|
})}
|
package/src/{iframe/event/event-calendar → calendar}/components/CalendarSelect/CalendarSelect.tsx
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
2
|
import { Form } from "react-bootstrap";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { PAGE_CALENDAR_SELECT_WRAPPER } from "
|
|
4
|
+
import { PAGE_CALENDAR_SELECT_WRAPPER } from "../../../iframe/page/components/PageBody/constants";
|
|
5
5
|
|
|
6
6
|
export type CalendarSelectOption = {
|
|
7
7
|
label: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DateTime, Interval } from "luxon";
|
|
2
|
+
import isEqual from "lodash/isEqual";
|
|
3
|
+
|
|
4
|
+
export const isSelectedDateDisabled = (
|
|
5
|
+
selectedDate: DateTime,
|
|
6
|
+
disabledDates: DateTime[] = []
|
|
7
|
+
) => {
|
|
8
|
+
return !!disabledDates.find((disabledDate) =>
|
|
9
|
+
isEqual(disabledDate.toObject(), selectedDate.toObject())
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const getMonthCalendarDates = (initialDate: DateTime): DateTime[] => {
|
|
14
|
+
const startOfMonth = initialDate.startOf("month");
|
|
15
|
+
const endOfMonth = initialDate.endOf("month");
|
|
16
|
+
|
|
17
|
+
return Interval.fromDateTimes(startOfMonth, endOfMonth)
|
|
18
|
+
.splitBy({ day: 1 })
|
|
19
|
+
.map((d) => d.start);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const getWeekCalendarDates = (initialDate: DateTime): DateTime[] => {
|
|
23
|
+
const lastDay = initialDate.plus({ days: 7 });
|
|
24
|
+
|
|
25
|
+
return Interval.fromDateTimes(initialDate, lastDay)
|
|
26
|
+
.splitBy({ day: 1 })
|
|
27
|
+
.map((d) => d.start);
|
|
28
|
+
};
|
|
@@ -78,3 +78,20 @@ WithPrice.args = {
|
|
|
78
78
|
isOnlyTimeContainer: false,
|
|
79
79
|
price: "from $8000",
|
|
80
80
|
};
|
|
81
|
+
|
|
82
|
+
export const WithAvailability: Story<DateTimeButtonProps> = (args) => {
|
|
83
|
+
return <DateTimeButton {...args} />;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
WithAvailability.args = {
|
|
87
|
+
date,
|
|
88
|
+
isSelected: false,
|
|
89
|
+
isDisabled: false,
|
|
90
|
+
onSelect: () => null,
|
|
91
|
+
isOnlyTimeContainer: false,
|
|
92
|
+
price: "from $8000",
|
|
93
|
+
resources: {
|
|
94
|
+
booked: 1,
|
|
95
|
+
total: 3,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
|
+
import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper";
|
|
5
|
+
import { AvailabilityIndicator } from "../availability-indicator";
|
|
4
6
|
import { DateContent } from "./DateContent";
|
|
5
7
|
|
|
6
8
|
export type DateTimeButtonProps<T = DateTime | string> = {
|
|
7
9
|
date: T;
|
|
8
10
|
isSelected?: boolean;
|
|
9
11
|
isDisabled?: boolean;
|
|
12
|
+
isSoldOut?: boolean;
|
|
10
13
|
onSelect: (date: T) => void;
|
|
11
14
|
isOnlyTimeContainer?: boolean;
|
|
12
15
|
price?: string | number | ReactElement | null;
|
|
16
|
+
resources?: ZoneResourcesAvailability | null;
|
|
17
|
+
calendarView?: boolean;
|
|
18
|
+
showResources?: boolean;
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
export const DateTimeButton = <T extends DateTime | string>({
|
|
16
22
|
date,
|
|
17
|
-
isDisabled,
|
|
23
|
+
isDisabled: _isDisabled,
|
|
18
24
|
isSelected,
|
|
25
|
+
isSoldOut,
|
|
19
26
|
onSelect,
|
|
20
27
|
isOnlyTimeContainer,
|
|
21
28
|
price,
|
|
29
|
+
resources,
|
|
30
|
+
calendarView,
|
|
31
|
+
showResources,
|
|
22
32
|
}: DateTimeButtonProps<T>) => {
|
|
23
|
-
// const infoLogo = useMemo(() => {
|
|
24
|
-
// if (info?.logo === infoLogoType.LIMIT) {
|
|
25
|
-
// return <LimitedSvg />;
|
|
26
|
-
// }
|
|
27
|
-
// if (info?.logo === infoLogoType.AVAILABLE) {
|
|
28
|
-
// return <AvailableSvg />;
|
|
29
|
-
// }
|
|
30
|
-
// if (info?.logo === infoLogoType.SOLD_OUT) {
|
|
31
|
-
// return <SoldOutSvg />;
|
|
32
|
-
// }
|
|
33
|
-
// return null;
|
|
34
|
-
// }, [info]);
|
|
35
|
-
|
|
36
33
|
const isTimeVariant = typeof date === "string";
|
|
37
34
|
|
|
35
|
+
const isDisabled =
|
|
36
|
+
_isDisabled ||
|
|
37
|
+
(resources && resources.bookedResources === resources.totalResources);
|
|
38
|
+
|
|
38
39
|
return (
|
|
39
40
|
<button
|
|
40
41
|
type="button"
|
|
@@ -46,7 +47,8 @@ export const DateTimeButton = <T extends DateTime | string>({
|
|
|
46
47
|
isSelected && "selected",
|
|
47
48
|
isTimeVariant && "time-button",
|
|
48
49
|
isOnlyTimeContainer && "only-time-container",
|
|
49
|
-
!isTimeVariant && "today"
|
|
50
|
+
!isTimeVariant && "today",
|
|
51
|
+
calendarView && "calendar-view"
|
|
50
52
|
)}
|
|
51
53
|
>
|
|
52
54
|
{isTimeVariant ? (
|
|
@@ -61,13 +63,13 @@ export const DateTimeButton = <T extends DateTime | string>({
|
|
|
61
63
|
|
|
62
64
|
{price && !isDisabled && <div className="price">{price}</div>}
|
|
63
65
|
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)}
|
|
66
|
+
{showResources && resources && (
|
|
67
|
+
<AvailabilityIndicator
|
|
68
|
+
resources={resources}
|
|
69
|
+
isUnavailable={_isDisabled}
|
|
70
|
+
isSoldOut={isSoldOut}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
71
73
|
</button>
|
|
72
74
|
);
|
|
73
75
|
};
|
|
@@ -47,7 +47,6 @@ const contextValue = {
|
|
|
47
47
|
name: "Example",
|
|
48
48
|
type: "sale",
|
|
49
49
|
termsAndConditions: "",
|
|
50
|
-
isDefault: true,
|
|
51
50
|
operationalCost: OPERATIONAL_COST_CUSTOMER,
|
|
52
51
|
steps: [
|
|
53
52
|
{
|
|
@@ -60,7 +59,6 @@ const contextValue = {
|
|
|
60
59
|
minSubItems: 1,
|
|
61
60
|
maxSubItems: 10,
|
|
62
61
|
quantityType: "constant",
|
|
63
|
-
isRelyOnPeople: false,
|
|
64
62
|
isTimeRelated: false,
|
|
65
63
|
hasTicket: false,
|
|
66
64
|
allowDeposits: false,
|
|
@@ -126,7 +124,6 @@ const contextValue = {
|
|
|
126
124
|
minSubItems: 0,
|
|
127
125
|
maxSubItems: 0,
|
|
128
126
|
quantityType: "recharging",
|
|
129
|
-
isRelyOnPeople: false,
|
|
130
127
|
isTimeRelated: false,
|
|
131
128
|
hasTicket: false,
|
|
132
129
|
allowDeposits: false,
|
|
@@ -144,7 +141,6 @@ const contextValue = {
|
|
|
144
141
|
minSubItems: 0,
|
|
145
142
|
maxSubItems: 0,
|
|
146
143
|
quantityType: "recharging",
|
|
147
|
-
isRelyOnPeople: false,
|
|
148
144
|
isTimeRelated: false,
|
|
149
145
|
hasTicket: false,
|
|
150
146
|
allowDeposits: false,
|
|
@@ -690,7 +686,6 @@ const defaultProductSets = [
|
|
|
690
686
|
name: "Example",
|
|
691
687
|
type: PRODUCT_SET_TYPES[0],
|
|
692
688
|
termsAndConditions: "",
|
|
693
|
-
isDefault: true,
|
|
694
689
|
operationalCost: OPERATIONAL_COST_TYPES[0],
|
|
695
690
|
fieldSet: {
|
|
696
691
|
id: 1,
|
|
@@ -713,7 +708,6 @@ const defaultProductSets = [
|
|
|
713
708
|
minSubItems: 1,
|
|
714
709
|
maxSubItems: 10,
|
|
715
710
|
quantityType: "constant",
|
|
716
|
-
isRelyOnPeople: false,
|
|
717
711
|
isTimeRelated: false,
|
|
718
712
|
hasTicket: false,
|
|
719
713
|
allowDeposits: false,
|
|
@@ -779,7 +773,6 @@ const defaultProductSets = [
|
|
|
779
773
|
minSubItems: 0,
|
|
780
774
|
maxSubItems: 0,
|
|
781
775
|
quantityType: "recharging",
|
|
782
|
-
isRelyOnPeople: false,
|
|
783
776
|
isTimeRelated: false,
|
|
784
777
|
hasTicket: false,
|
|
785
778
|
allowDeposits: false,
|
|
@@ -797,7 +790,6 @@ const defaultProductSets = [
|
|
|
797
790
|
minSubItems: 0,
|
|
798
791
|
maxSubItems: 0,
|
|
799
792
|
quantityType: "recharging",
|
|
800
|
-
isRelyOnPeople: false,
|
|
801
793
|
isTimeRelated: false,
|
|
802
794
|
hasTicket: false,
|
|
803
795
|
allowDeposits: false,
|
|
@@ -883,7 +875,6 @@ const defaultProductSets = [
|
|
|
883
875
|
name: "Example 2",
|
|
884
876
|
type: PRODUCT_SET_TYPES[1],
|
|
885
877
|
termsAndConditions: "",
|
|
886
|
-
isDefault: true,
|
|
887
878
|
operationalCost: OPERATIONAL_COST_TYPES[1],
|
|
888
879
|
fieldSet: {
|
|
889
880
|
id: 2,
|
|
@@ -906,7 +897,6 @@ const defaultProductSets = [
|
|
|
906
897
|
minSubItems: 1,
|
|
907
898
|
maxSubItems: 10,
|
|
908
899
|
quantityType: "constant",
|
|
909
|
-
isRelyOnPeople: false,
|
|
910
900
|
isTimeRelated: false,
|
|
911
901
|
hasTicket: false,
|
|
912
902
|
allowDeposits: false,
|
|
@@ -972,7 +962,6 @@ const defaultProductSets = [
|
|
|
972
962
|
minSubItems: 0,
|
|
973
963
|
maxSubItems: 0,
|
|
974
964
|
quantityType: "recharging",
|
|
975
|
-
isRelyOnPeople: false,
|
|
976
965
|
isTimeRelated: false,
|
|
977
966
|
hasTicket: false,
|
|
978
967
|
allowDeposits: false,
|
|
@@ -990,7 +979,6 @@ const defaultProductSets = [
|
|
|
990
979
|
minSubItems: 0,
|
|
991
980
|
maxSubItems: 0,
|
|
992
981
|
quantityType: "recharging",
|
|
993
|
-
isRelyOnPeople: false,
|
|
994
982
|
isTimeRelated: false,
|
|
995
983
|
hasTicket: false,
|
|
996
984
|
allowDeposits: false,
|
|
@@ -266,7 +266,7 @@ export const EditEventForm = ({
|
|
|
266
266
|
</Form.Group>
|
|
267
267
|
{/* key is used as a hack to make sure rrule is rendered correctly */}
|
|
268
268
|
<IntervalInput
|
|
269
|
-
key={watch("
|
|
269
|
+
key={watch("name")}
|
|
270
270
|
disabled={disabled}
|
|
271
271
|
productSetId={productSetId}
|
|
272
272
|
productSets={productSets}
|
|
@@ -15,8 +15,8 @@ export const getDefaultValues = (
|
|
|
15
15
|
type: productSet?.type ?? DEFAULT_PRODUCT_SET_TYPE,
|
|
16
16
|
termsAndConditions: productSet?.termsAndConditions ?? "",
|
|
17
17
|
operationalCost: productSet?.operationalCost ?? DEFAULT_OPERATIONAL_COST_TYPE,
|
|
18
|
+
relyOnPeopleType: productSet?.relyOnPeopleType ?? null,
|
|
18
19
|
thankYouPageUrl: productSet?.thankYouPageUrl ?? "",
|
|
19
|
-
isDefault: productSet?.isDefault ?? false,
|
|
20
20
|
fieldSetId: productSet?.fieldSetId,
|
|
21
21
|
emailTemplates:
|
|
22
22
|
productSet?.mailTemplates && productSet?.mailTemplates?.length > 0
|
|
@@ -24,7 +24,7 @@ export const getDefaultValues = (
|
|
|
24
24
|
: undefined,
|
|
25
25
|
smsTemplates:
|
|
26
26
|
productSet?.smsTemplates && productSet?.smsTemplates?.length > 0
|
|
27
|
-
? getFilteredTemplates(productSet?.
|
|
27
|
+
? getFilteredTemplates(productSet?.smsTemplates)
|
|
28
28
|
: undefined,
|
|
29
29
|
steps:
|
|
30
30
|
productSet?.steps?.map(({ productCategories, ...step }) => ({
|
|
@@ -9,7 +9,11 @@ import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventSta
|
|
|
9
9
|
import Icon from "../../static/Icon";
|
|
10
10
|
import { Sale } from "../../types/bookings";
|
|
11
11
|
import { TipTapEditor } from "../../tiptap-editor/TipTapEditor";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
EVENT_DESCRIPTION_SIZE,
|
|
14
|
+
formatContentWithoutTags,
|
|
15
|
+
getStatisticInfo,
|
|
16
|
+
} from "./utils";
|
|
13
17
|
import { ReactComponent as ChartBarIcon } from "../../assets/dashboard/chartBar.svg";
|
|
14
18
|
|
|
15
19
|
export interface EventCardProps extends HasPermissionProp {
|
|
@@ -48,7 +52,7 @@ export function EventCard({
|
|
|
48
52
|
const { formatNumber, formatDate } = useIntl();
|
|
49
53
|
const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date);
|
|
50
54
|
const memoedContent = useMemo(
|
|
51
|
-
() =>
|
|
55
|
+
() => formatContentWithoutTags(description, EVENT_DESCRIPTION_SIZE),
|
|
52
56
|
[description]
|
|
53
57
|
);
|
|
54
58
|
|
|
@@ -8,34 +8,107 @@ export function formatContent(content, maxSymbols) {
|
|
|
8
8
|
return content;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export const formatContentWithoutTags = (
|
|
12
|
+
content,
|
|
13
|
+
maxLength = EVENT_DESCRIPTION_SIZE
|
|
14
14
|
) => {
|
|
15
|
-
|
|
15
|
+
if (!content) return "";
|
|
16
|
+
if (content < maxLength) return content;
|
|
17
|
+
const text = content.replace(/<[^>]*>/g, "");
|
|
18
|
+
const trimmedText = text
|
|
19
|
+
.trim()
|
|
20
|
+
.replace(/ |[^a-zA-Z0-9\s]/g, "")
|
|
21
|
+
.replace(/\s\s+/g, " ");
|
|
22
|
+
|
|
23
|
+
const words = trimmedText.slice(0, maxLength).split(" ");
|
|
24
|
+
const index = String(content).indexOf(words[words.length - 2]);
|
|
25
|
+
return content.slice(0, index).concat("...");
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const EVENT_DESCRIPTION_SIZE = 300;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Calculate the total number of views from the given dates and event statistic.
|
|
32
|
+
*
|
|
33
|
+
* @param {string[]} dates - An array of dates.
|
|
34
|
+
* @param {EventStatistic} eventStatistic - The event statistic object.
|
|
35
|
+
* @returns {number} - The total number of views.
|
|
36
|
+
*/
|
|
37
|
+
export const calculateTotalViews = (
|
|
38
|
+
dates: string[],
|
|
39
|
+
eventStatistic: EventStatistic
|
|
40
|
+
): number => {
|
|
41
|
+
return dates.reduce(
|
|
42
|
+
(rootAcc, date) =>
|
|
43
|
+
rootAcc +
|
|
44
|
+
Object.values(eventStatistic.views[date] ?? {}).reduce(
|
|
45
|
+
(acc, view) => acc + (view.pageViews || 0),
|
|
46
|
+
0
|
|
47
|
+
),
|
|
48
|
+
0
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Calculates the total number of products sold and the total amount sold
|
|
54
|
+
* based on the provided dates and event statistics.
|
|
55
|
+
*
|
|
56
|
+
* @param {string[]} dates - An array of dates.
|
|
57
|
+
* @param {EventStatistic} eventStatistic - Object containing event statistics.
|
|
58
|
+
* @returns {number[]} An array representing the total number of products sold and total amount sold.
|
|
59
|
+
*/
|
|
60
|
+
export const calculateTotalSoldAndAmount = (
|
|
61
|
+
dates: string[],
|
|
62
|
+
eventStatistic: EventStatistic
|
|
63
|
+
): [number, number] => {
|
|
16
64
|
let totalSold = 0;
|
|
17
65
|
let totalAmount = 0;
|
|
66
|
+
dates.forEach((date) =>
|
|
67
|
+
Object.values(eventStatistic.productCategorySummary[date] ?? {}).forEach(
|
|
68
|
+
({ totalPerCategory, productsSummary }) => {
|
|
69
|
+
totalAmount += totalPerCategory || 0;
|
|
70
|
+
totalSold +=
|
|
71
|
+
productsSummary?.reduce((acc, curr) => acc + curr.productsSold, 0) ??
|
|
72
|
+
0;
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
);
|
|
18
76
|
|
|
19
|
-
|
|
77
|
+
return [totalSold, totalAmount];
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get statistic information for a given event and date.
|
|
82
|
+
* @param {EventStatistic | null} eventStatistic - The event statistic object.
|
|
83
|
+
* @param {string} date - The date in ISO format.
|
|
84
|
+
* @returns {{
|
|
85
|
+
* totalViews: number;
|
|
86
|
+
* totalSold: number;
|
|
87
|
+
* totalAmount: number;
|
|
88
|
+
* }} The statistic information object.
|
|
89
|
+
*/
|
|
90
|
+
export const getStatisticInfo = (
|
|
91
|
+
eventStatistic: EventStatistic | null,
|
|
92
|
+
date: string
|
|
93
|
+
): {
|
|
94
|
+
totalViews: number;
|
|
95
|
+
totalSold: number;
|
|
96
|
+
totalAmount: number;
|
|
97
|
+
} => {
|
|
98
|
+
const defaultValues = { totalViews: 0, totalSold: 0, totalAmount: 0 };
|
|
99
|
+
if (!eventStatistic) return defaultValues;
|
|
20
100
|
|
|
21
101
|
const viewsFormattedDate = DateTime.fromISO(date)
|
|
22
102
|
.toUTC()
|
|
23
103
|
.toFormat(DATE_FORMAT);
|
|
24
|
-
|
|
25
|
-
totalViews = eventStatistic.views[viewsFormattedDate]?.pageViews || 0;
|
|
26
|
-
|
|
27
104
|
const summaryFormattedDate = DateTime.fromISO(date)
|
|
28
105
|
.toUTC()
|
|
29
106
|
.toFormat(DATE_TIME_FULL_FORMAT);
|
|
30
107
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
productsSummary?.forEach(({ productsSold }) => {
|
|
36
|
-
totalSold += productsSold;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
108
|
+
const totalViews = calculateTotalViews([viewsFormattedDate], eventStatistic);
|
|
109
|
+
const [totalSold, totalAmount] = calculateTotalSoldAndAmount(
|
|
110
|
+
[summaryFormattedDate],
|
|
111
|
+
eventStatistic
|
|
39
112
|
);
|
|
40
113
|
|
|
41
114
|
return { totalViews, totalSold, totalAmount };
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Modal, Button } from "react-bootstrap";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
|
|
5
|
+
import { Event } from "@licklist/core/dist/DataMapper/Provider/EventDataMapper";
|
|
5
6
|
import Icon from "../../static/Icon";
|
|
6
7
|
import { StaticTable } from "../../table";
|
|
7
8
|
import { useTableData } from "./hooks/useTableData";
|
|
@@ -9,6 +10,7 @@ import { useTableData } from "./hooks/useTableData";
|
|
|
9
10
|
export type EventStatisticModalProps = {
|
|
10
11
|
isOpen: boolean;
|
|
11
12
|
setIsOpen: (value: boolean) => void;
|
|
13
|
+
date?: Event["startAt"] | null;
|
|
12
14
|
eventStatistic?: EventStatistic | null;
|
|
13
15
|
title?: string;
|
|
14
16
|
};
|
|
@@ -16,11 +18,13 @@ export type EventStatisticModalProps = {
|
|
|
16
18
|
export const EventStatisticModal = ({
|
|
17
19
|
isOpen,
|
|
18
20
|
setIsOpen,
|
|
21
|
+
date,
|
|
19
22
|
eventStatistic,
|
|
20
23
|
title,
|
|
21
24
|
}: EventStatisticModalProps) => {
|
|
22
25
|
const { t } = useTranslation("Design");
|
|
23
|
-
|
|
26
|
+
|
|
27
|
+
const data = useTableData(date, eventStatistic);
|
|
24
28
|
const handleClose = () => {
|
|
25
29
|
setIsOpen(false);
|
|
26
30
|
};
|
|
@@ -4,10 +4,14 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import * as Config from "@licklist/core/dist/Config";
|
|
6
6
|
import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
|
|
7
|
+
import { Event } from "@licklist/core/dist/DataMapper/Provider/EventDataMapper";
|
|
7
8
|
import { convertEventStatisticToTableData, TRANSLATION_KEYS } from "../utils";
|
|
8
9
|
import { StaticTableData } from "../../../table";
|
|
9
10
|
|
|
10
|
-
export const useTableData = (
|
|
11
|
+
export const useTableData = (
|
|
12
|
+
date: Event["startAt"] | null,
|
|
13
|
+
eventStatistic: EventStatistic | null
|
|
14
|
+
) => {
|
|
11
15
|
const { t } = useTranslation("Design");
|
|
12
16
|
const { formatNumber } = useIntl();
|
|
13
17
|
const [tableRows, setTableRows] = useState<StaticTableData[]>([]);
|
|
@@ -28,14 +32,17 @@ export const useTableData = (eventStatistic: EventStatistic | null) => {
|
|
|
28
32
|
return t(key);
|
|
29
33
|
};
|
|
30
34
|
|
|
31
|
-
const transformStatisticToTableRows = (
|
|
35
|
+
const transformStatisticToTableRows = (
|
|
36
|
+
date: Event["startAt"],
|
|
37
|
+
statistic: EventStatistic | null
|
|
38
|
+
) => {
|
|
32
39
|
if (!statistic) {
|
|
33
40
|
return [];
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
const tableDataRows: StaticTableData[] = [];
|
|
37
44
|
|
|
38
|
-
convertEventStatisticToTableData(statistic).forEach(
|
|
45
|
+
convertEventStatisticToTableData(date, statistic).forEach(
|
|
39
46
|
({ name, quantity, total, isBold, isHeader, key }) => {
|
|
40
47
|
const formattedTotal = !Object.keys(TRANSLATION_KEYS).includes(
|
|
41
48
|
String(total)
|
|
@@ -77,9 +84,9 @@ export const useTableData = (eventStatistic: EventStatistic | null) => {
|
|
|
77
84
|
};
|
|
78
85
|
|
|
79
86
|
useEffect(() => {
|
|
80
|
-
setTableRows(transformStatisticToTableRows(eventStatistic));
|
|
87
|
+
setTableRows(transformStatisticToTableRows(date, eventStatistic));
|
|
81
88
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
82
|
-
}, [eventStatistic]);
|
|
89
|
+
}, [date, eventStatistic]);
|
|
83
90
|
|
|
84
91
|
return tableRows;
|
|
85
92
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
import { DATE_TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
|
|
2
4
|
|
|
3
5
|
export const TRANSLATION_KEYS = {
|
|
4
6
|
shortQuantity: "shortQuantity",
|
|
@@ -7,6 +9,7 @@ export const TRANSLATION_KEYS = {
|
|
|
7
9
|
};
|
|
8
10
|
|
|
9
11
|
export const convertEventStatisticToTableData = (
|
|
12
|
+
date: string,
|
|
10
13
|
eventStatistic: EventStatistic
|
|
11
14
|
) => {
|
|
12
15
|
let totalAmount = 0;
|
|
@@ -25,49 +28,51 @@ export const convertEventStatisticToTableData = (
|
|
|
25
28
|
total: string | number;
|
|
26
29
|
}[] = [];
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
|
|
32
|
-
let quantity = 0;
|
|
31
|
+
const summaryFormattedDate = DateTime.fromISO(date)
|
|
32
|
+
.toUTC()
|
|
33
|
+
.toFormat(DATE_TIME_FULL_FORMAT);
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
Object.values(
|
|
36
|
+
eventStatistic?.productCategorySummary[summaryFormattedDate] ?? {}
|
|
37
|
+
)?.forEach(
|
|
38
|
+
({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
|
|
39
|
+
let quantity = 0;
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
name: categoryName,
|
|
38
|
-
key: `${eventId}.${categoryName}`,
|
|
39
|
-
isBold: true,
|
|
40
|
-
isHeader: true,
|
|
41
|
-
quantity: TRANSLATION_KEYS.shortQuantity,
|
|
42
|
-
total: TRANSLATION_KEYS.total,
|
|
43
|
-
});
|
|
41
|
+
totalAmount += totalPerCategory || 0;
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
tableDataArray.push({
|
|
44
|
+
name: categoryName,
|
|
45
|
+
key: `${eventId}.${categoryName}`,
|
|
46
|
+
isBold: true,
|
|
47
|
+
isHeader: true,
|
|
48
|
+
quantity: TRANSLATION_KEYS.shortQuantity,
|
|
49
|
+
total: TRANSLATION_KEYS.total,
|
|
50
|
+
});
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
quantity: totalQuantity
|
|
53
|
-
? `${productsSold} / ${totalQuantity}`
|
|
54
|
-
: String(productsSold),
|
|
55
|
-
total: String(total),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
);
|
|
52
|
+
productsSummary?.forEach(
|
|
53
|
+
({ productsSold, name, totalQuantity, total }) => {
|
|
54
|
+
quantity += productsSold;
|
|
59
55
|
|
|
60
56
|
tableDataArray.push({
|
|
61
|
-
name
|
|
62
|
-
key: `${eventId}.${categoryName}.${
|
|
63
|
-
quantity
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
name,
|
|
58
|
+
key: `${eventId}.${categoryName}.${name}`,
|
|
59
|
+
quantity: totalQuantity
|
|
60
|
+
? `${productsSold} / ${totalQuantity}`
|
|
61
|
+
: String(productsSold),
|
|
62
|
+
total: String(total),
|
|
66
63
|
});
|
|
67
|
-
|
|
68
|
-
totalQuantity += quantity;
|
|
69
64
|
}
|
|
70
65
|
);
|
|
66
|
+
|
|
67
|
+
tableDataArray.push({
|
|
68
|
+
name: TRANSLATION_KEYS.totalPerCategory,
|
|
69
|
+
key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
|
|
70
|
+
quantity,
|
|
71
|
+
total: totalPerCategory,
|
|
72
|
+
isBold: true,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
totalQuantity += quantity;
|
|
71
76
|
}
|
|
72
77
|
);
|
|
73
78
|
|