@licklist/design 0.67.2-dev.5 → 0.67.2

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.
Files changed (248) hide show
  1. package/.storybook/main.cjs +12 -15
  2. package/dist/assets/iframe/selectArrow.svg.js +17 -0
  3. package/dist/auth/Login/LoginComponent.js +1 -2
  4. package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
  5. package/dist/calendar/components/CalendarButtons/CalendarButtons.js +40 -35
  6. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -2
  7. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
  8. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.js +3 -5
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  10. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +6 -3
  11. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  12. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
  13. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -1
  14. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  15. package/dist/iframe/event/event-card/IframeEventCard.js +3 -9
  16. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  17. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
  18. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  19. package/dist/layout/DropDown.d.ts +1 -2
  20. package/dist/layout/DropDown.d.ts.map +1 -1
  21. package/dist/layout/DropDownToggle.d.ts.map +1 -1
  22. package/dist/layout/DropDownToggle.js +0 -1
  23. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  24. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  25. package/dist/product-set/control/DateAndRecurrenceInput.js +0 -1
  26. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  27. package/dist/product-set/control/DateInput.js +2 -2
  28. package/dist/product-set/control/ProductSetControl.d.ts +1 -1
  29. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  31. package/dist/product-set/form/ProductCategoriesControl.js +2 -48
  32. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  33. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  34. package/dist/product-set/form/ProductSetForm.js +2 -60
  35. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  36. package/dist/product-set/form/ProductZonesControl.js +2 -0
  37. package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
  38. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  39. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  40. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  41. package/dist/product-set/form/SubProductsControl.js +3 -0
  42. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  43. package/dist/product-set/form/VenueMapsControl.js +3 -0
  44. package/dist/provider/location-input/LocationInput.d.ts +1 -4
  45. package/dist/provider/location-input/LocationInput.d.ts.map +1 -1
  46. package/dist/provider/location-input/LocationInput.js +2 -41
  47. package/dist/provider/location-input/index.d.ts +0 -1
  48. package/dist/provider/location-input/index.d.ts.map +1 -1
  49. package/dist/provider/provider-form/ProviderForm.d.ts +1 -3
  50. package/dist/provider/provider-form/ProviderForm.d.ts.map +1 -1
  51. package/dist/provider/provider-form/ProviderForm.js +2 -4
  52. package/dist/provider/venue-form/VenueForm.d.ts +1 -3
  53. package/dist/provider/venue-form/VenueForm.d.ts.map +1 -1
  54. package/dist/provider/venue-form/VenueForm.js +2 -4
  55. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  56. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +8 -4
  57. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
  58. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  59. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +3 -6
  60. package/dist/recurring-date-picker-input/utils.d.ts +0 -5
  61. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  62. package/dist/recurring-date-picker-input/utils.js +3 -75
  63. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  64. package/dist/sales/booking/results/components/ResultCard.js +2 -0
  65. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  66. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  67. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  68. package/dist/snippet/snippet-template/preview/Preview.js +0 -6
  69. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  70. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  71. package/dist/sortable-tree/SortableTreeItem.js +4 -10
  72. package/dist/styles/auth/AccessDenied.scss +1 -1
  73. package/dist/styles/back-button/BackButton.scss +24 -25
  74. package/dist/styles/back-button/_index.scss +1 -1
  75. package/dist/styles/company-user-form/UserForm.scss +7 -4
  76. package/dist/styles/company-user-form/_index.scss +1 -1
  77. package/dist/styles/custom-fields/CreateSortableListItem.scss +1 -2
  78. package/dist/styles/custom-fields/_index.scss +1 -1
  79. package/dist/styles/customers/Filter.scss +5 -5
  80. package/dist/styles/events/EditEventModal.scss +3 -1
  81. package/dist/styles/events/EventVenueMap.scss +7 -7
  82. package/dist/styles/form/Input.scss +1 -1
  83. package/dist/styles/header/Header.scss +1 -1
  84. package/dist/styles/header/elements/CompanySelector.scss +2 -2
  85. package/dist/styles/iframe-events/Calendar.scss +1 -0
  86. package/dist/styles/iframe-events/CalendarSelect.scss +1 -1
  87. package/dist/styles/iframe-events/CategoryStepsForm.scss +7 -6
  88. package/dist/styles/iframe-events/Event.scss +4 -2
  89. package/dist/styles/iframe-events/EventForm.scss +54 -54
  90. package/dist/styles/iframe-events/EventNavigationFooter.scss +0 -1
  91. package/dist/styles/iframe-events/TicketDescription.scss +1 -1
  92. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  93. package/dist/styles/iframe-payments/PaymentForm.scss +1 -1
  94. package/dist/styles/layout/BackgroundVideoContainer.scss +2 -2
  95. package/dist/styles/notification/Notification.scss +1 -1
  96. package/dist/styles/order-items-table/OrderItemsTable.scss +2 -1
  97. package/dist/styles/product-set/CreateProductSetItem.scss +13 -15
  98. package/dist/styles/product-set/DateAndRecurrenceInput.scss +8 -6
  99. package/dist/styles/product-set/EditCategoryModal.scss +4 -4
  100. package/dist/styles/product-set/EditProductModal.scss +3 -3
  101. package/dist/styles/product-set/EditStepModal.scss +4 -4
  102. package/dist/styles/product-set/EditVenueMapSetModal.scss +6 -6
  103. package/dist/styles/product-set/ProductSetForm.scss +2 -25
  104. package/dist/styles/product-set/TutorialGifCard.scss +1 -1
  105. package/dist/styles/product-set/_index.scss +2 -2
  106. package/dist/styles/report/ReportCard.scss +0 -1
  107. package/dist/styles/report/_index.scss +1 -1
  108. package/dist/styles/resources-blocking/_index.scss +0 -4
  109. package/dist/styles/sales/BookingFilter.scss +2 -2
  110. package/dist/styles/sales/BookingResults.scss +1 -1
  111. package/dist/styles/sales/BookingTabs.scss +5 -7
  112. package/dist/styles/sales/Filters.scss +4 -5
  113. package/dist/styles/sales/GuestProfile.scss +175 -170
  114. package/dist/styles/sales/LifeTimeSales.scss +1 -1
  115. package/dist/styles/sales/ManualBooking.scss +2 -4
  116. package/dist/styles/snippet-templates/_snippetVariables.scss +244 -63
  117. package/dist/styles/sortable-field/SortableField.scss +16 -16
  118. package/dist/styles/sortable-field/_index.scss +1 -1
  119. package/dist/styles/sortable-tree/Item.scss +4 -4
  120. package/dist/styles/table/Table.scss +1 -1
  121. package/dist/styles/themes/bookedit/_variables.scss +32 -10
  122. package/dist/styles/themes/licklist/_variables.scss +1 -1
  123. package/dist/styles/tiptap-editor/TiptapEditor.scss +10 -9
  124. package/dist/styles/tiptap-editor/_index.scss +1 -1
  125. package/dist/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
  126. package/dist/styles/virtualized/_index.scss +1 -1
  127. package/dist/styles/zones/ZoneForm.scss +0 -1
  128. package/dist/styles/zones/ZoneRecurrencesControl.scss +8 -6
  129. package/dist/zone/form/ZoneForm.d.ts +2 -2
  130. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  131. package/dist/zone/form/ZoneForm.js +2 -3
  132. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  133. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  134. package/dist/zone/form/components/ZoneControl.js +2 -4
  135. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  136. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  137. package/dist/zone/form/components/ZoneRecurrencesControl.js +2 -4
  138. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  139. package/package.json +8 -8
  140. package/src/auth/ChangePassword/ChangePassword.stories.tsx +1 -1
  141. package/src/auth/Login/LoginComponent.tsx +1 -1
  142. package/src/auth/ResetPassword/ResetPassword.stories.tsx +1 -1
  143. package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +28 -31
  144. package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +5 -3
  145. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +4 -0
  146. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
  147. package/src/header/elements/Elements.stories.tsx +1 -1
  148. package/src/help/popover/Popover.stories.tsx +1 -1
  149. package/src/iframe/event/event-card/IframeEventCard.tsx +2 -16
  150. package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -3
  151. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
  152. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  153. package/src/layout/DropDown.tsx +1 -2
  154. package/src/layout/DropDownToggle.tsx +0 -2
  155. package/src/product-set/card/ProductSetCard.stories.tsx +1 -3
  156. package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -3
  157. package/src/product-set/control/DateInput.tsx +1 -2
  158. package/src/product-set/control/ProductSetControl.tsx +1 -1
  159. package/src/product-set/control/ProductSetRecurrenceControl.stories.tsx +2 -2
  160. package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
  161. package/src/product-set/form/ProductSetForm.tsx +3 -22
  162. package/src/product-set/form/ProductZonesControl.tsx +7 -4
  163. package/src/product-set/form/SelectCategoryModal.stories.tsx +1 -1
  164. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  165. package/src/product-set/form/SubProductsControl.tsx +3 -0
  166. package/src/product-set/form/VenueMapsControl.tsx +3 -0
  167. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +5 -5
  168. package/src/product-set/product/booking-management/ProductBookingManagement.stories.tsx +1 -1
  169. package/src/product-set/product/quantity/ProductQuantity.stories.tsx +1 -1
  170. package/src/product-set/product-zone/ProductZoneControl.tsx +9 -9
  171. package/src/provider/location-input/LocationInput.tsx +1 -36
  172. package/src/provider/location-input/index.ts +0 -1
  173. package/src/provider/provider-form/ProviderForm.tsx +1 -6
  174. package/src/provider/venue-form/VenueForm.tsx +1 -4
  175. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  176. package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +4 -11
  177. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -12
  178. package/src/recurring-date-picker-input/utils.ts +1 -91
  179. package/src/sales/booking/results/components/ResultCard.tsx +2 -0
  180. package/src/setting/admin/AdminSetting.stories.tsx +0 -1
  181. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  182. package/src/setting/system/SystemSetting.stories.tsx +1 -1
  183. package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
  184. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  185. package/src/styles/auth/AccessDenied.scss +1 -1
  186. package/src/styles/back-button/BackButton.scss +24 -25
  187. package/src/styles/back-button/_index.scss +1 -1
  188. package/src/styles/company-user-form/UserForm.scss +7 -4
  189. package/src/styles/company-user-form/_index.scss +1 -1
  190. package/src/styles/custom-fields/CreateSortableListItem.scss +1 -2
  191. package/src/styles/custom-fields/_index.scss +1 -1
  192. package/src/styles/customers/Filter.scss +5 -5
  193. package/src/styles/events/EditEventModal.scss +3 -1
  194. package/src/styles/events/EventVenueMap.scss +7 -7
  195. package/src/styles/form/Input.scss +1 -1
  196. package/src/styles/header/Header.scss +1 -1
  197. package/src/styles/header/elements/CompanySelector.scss +2 -2
  198. package/src/styles/iframe-events/Calendar.scss +1 -0
  199. package/src/styles/iframe-events/CalendarSelect.scss +1 -1
  200. package/src/styles/iframe-events/CategoryStepsForm.scss +7 -6
  201. package/src/styles/iframe-events/Event.scss +4 -2
  202. package/src/styles/iframe-events/EventForm.scss +54 -54
  203. package/src/styles/iframe-events/EventNavigationFooter.scss +0 -1
  204. package/src/styles/iframe-events/TicketDescription.scss +1 -1
  205. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  206. package/src/styles/iframe-payments/PaymentForm.scss +1 -1
  207. package/src/styles/layout/BackgroundVideoContainer.scss +2 -2
  208. package/src/styles/notification/Notification.scss +1 -1
  209. package/src/styles/order-items-table/OrderItemsTable.scss +2 -1
  210. package/src/styles/product-set/CreateProductSetItem.scss +13 -15
  211. package/src/styles/product-set/DateAndRecurrenceInput.scss +8 -6
  212. package/src/styles/product-set/EditCategoryModal.scss +4 -4
  213. package/src/styles/product-set/EditProductModal.scss +3 -3
  214. package/src/styles/product-set/EditStepModal.scss +4 -4
  215. package/src/styles/product-set/EditVenueMapSetModal.scss +6 -6
  216. package/src/styles/product-set/ProductSetForm.scss +2 -25
  217. package/src/styles/product-set/TutorialGifCard.scss +1 -1
  218. package/src/styles/product-set/_index.scss +2 -2
  219. package/src/styles/report/ReportCard.scss +0 -1
  220. package/src/styles/report/_index.scss +1 -1
  221. package/src/styles/resources-blocking/_index.scss +0 -4
  222. package/src/styles/sales/BookingFilter.scss +2 -2
  223. package/src/styles/sales/BookingResults.scss +1 -1
  224. package/src/styles/sales/BookingTabs.scss +5 -7
  225. package/src/styles/sales/Filters.scss +4 -5
  226. package/src/styles/sales/GuestProfile.scss +175 -170
  227. package/src/styles/sales/LifeTimeSales.scss +1 -1
  228. package/src/styles/sales/ManualBooking.scss +2 -4
  229. package/src/styles/snippet-templates/_snippetVariables.scss +244 -63
  230. package/src/styles/sortable-field/SortableField.scss +16 -16
  231. package/src/styles/sortable-field/_index.scss +1 -1
  232. package/src/styles/sortable-tree/Item.scss +4 -4
  233. package/src/styles/table/Table.scss +1 -1
  234. package/src/styles/themes/bookedit/_variables.scss +32 -10
  235. package/src/styles/themes/licklist/_variables.scss +1 -1
  236. package/src/styles/tiptap-editor/TiptapEditor.scss +10 -9
  237. package/src/styles/tiptap-editor/_index.scss +1 -1
  238. package/src/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
  239. package/src/styles/virtualized/_index.scss +1 -1
  240. package/src/styles/zones/ZoneForm.scss +0 -1
  241. package/src/styles/zones/ZoneRecurrencesControl.scss +8 -6
  242. package/src/tiptap-editor/TipTapEditor.stories.tsx +4 -6
  243. package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +2 -5
  244. package/src/zone/form/ZoneForm.tsx +2 -3
  245. package/src/zone/form/components/ZoneControl.tsx +3 -3
  246. package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
  247. package/src/zone/form/utils/dates.ts +10 -9
  248. package/yarn.lock +141 -128
@@ -1,4 +1,7 @@
1
- import { useContext, useState } from "react";
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
3
+ import React, { useContext, useState } from "react";
4
+
2
5
  import {
3
6
  ArrayPath,
4
7
  Controller,
@@ -79,14 +82,14 @@ export const ProductZonesControl = <T extends FormValues>({
79
82
 
80
83
  const productZonesError = HookFormService.getErrors<T>(
81
84
  `${productZonesFieldName}.root` as Path<T>,
82
- errors,
85
+ errors
83
86
  );
84
87
 
85
88
  const zoneCapacity = useWatch({
86
89
  control,
87
90
  name: [
88
91
  ...fields.map(
89
- (_, index) => `${productZonesFieldName}.${index}.capacity` as const,
92
+ (_, index) => `${productZonesFieldName}.${index}.capacity` as const
90
93
  ),
91
94
  ],
92
95
  });
@@ -95,7 +98,7 @@ export const ProductZonesControl = <T extends FormValues>({
95
98
  control,
96
99
  name: [
97
100
  ...fields.map(
98
- (_, index) => `${productZonesFieldName}.${index}.duration` as const,
101
+ (_, index) => `${productZonesFieldName}.${index}.duration` as const
99
102
  ),
100
103
  ],
101
104
  });
@@ -29,7 +29,7 @@ Default.args = {
29
29
  };
30
30
 
31
31
  export const WithBookingManagement: Story<SelectCategoryModalProps> = (
32
- args
32
+ args,
33
33
  ) => (
34
34
  <ProductSetLoadingContext.Provider value={contextValue}>
35
35
  <SelectCategoryModal {...args} />
@@ -25,7 +25,7 @@ import {
25
25
  } from "react-icons/fa";
26
26
  import { ProductSetLoadingContext } from "./context";
27
27
 
28
- export const CATEGORY_TYPES_NAMES = {
28
+ const CATEGORY_TYPES_NAMES = {
29
29
  menuItems: CATEGORY_TYPE_MENU_ITEMS,
30
30
  tickets: CATEGORY_TYPE_TICKETS,
31
31
  bookings: CATEGORY_TYPE_BOOKINGS,
@@ -33,7 +33,7 @@ export const CATEGORY_TYPES_NAMES = {
33
33
  fixedDuration: CATEGORY_TYPE_FIXED_DURATION,
34
34
  } as const;
35
35
 
36
- export type CategoryConfig = { label: string; icon: ReactElement };
36
+ type CategoryConfig = { label: string; icon: ReactElement };
37
37
 
38
38
  const MAIN_CATEGORIES: Partial<Record<CategoryType, CategoryConfig>> = {
39
39
  [CATEGORY_TYPES_NAMES.tickets]: {
@@ -71,6 +71,9 @@ export function SubProductsControl({
71
71
  images: subProducts[index]?.images as Image[],
72
72
  };
73
73
  // @ts-expect-error TS2345
74
+ // @TODO fix prod type error
75
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
76
+ // @ts-ignore
74
77
  append(subProductCopy);
75
78
  }}
76
79
  />
@@ -47,6 +47,9 @@ export const VenueMapsControl = ({
47
47
  url={image.url}
48
48
  name={name}
49
49
  points={points}
50
+ // @TODO fix prod type error
51
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
52
+ // @ts-ignore
50
53
  products={products}
51
54
  pointProducts={pointProducts}
52
55
  onPointProductsChange={onPointProductsChange}
@@ -1,4 +1,4 @@
1
- import { useContext } from "react";
1
+ import React, { useContext } from "react";
2
2
  import { Col, Form } from "react-bootstrap";
3
3
  import { Controller, Path, useFormContext } from "react-hook-form";
4
4
  import { HookFormService } from "@licklist/plugins";
@@ -98,7 +98,7 @@ export const AdvancedOptions = <T extends FormValues>({
98
98
  {...register(`${fieldNamePrefix}.productGroupId` as Path<T>)}
99
99
  isInvalid={HookFormService.isInvalid<T>(
100
100
  `${fieldNamePrefix}.productGroupId` as Path<T>,
101
- errors,
101
+ errors
102
102
  )}
103
103
  disabled={isLoading || isOverrides}
104
104
  defaultValue=""
@@ -115,7 +115,7 @@ export const AdvancedOptions = <T extends FormValues>({
115
115
  <Form.Control.Feedback type="invalid">
116
116
  {HookFormService.getErrors<T>(
117
117
  `${fieldNamePrefix}.productGroupId` as Path<T>,
118
- errors,
118
+ errors
119
119
  )}
120
120
  </Form.Control.Feedback>
121
121
  </Form.Group>
@@ -134,7 +134,7 @@ export const AdvancedOptions = <T extends FormValues>({
134
134
  onChange={onChange}
135
135
  isInvalid={HookFormService.isInvalid<T>(
136
136
  `${fieldNamePrefix}.termsAndConditions` as Path<T>,
137
- errors,
137
+ errors
138
138
  )}
139
139
  disabled={isLoading || isOverrides}
140
140
  name={name}
@@ -147,7 +147,7 @@ export const AdvancedOptions = <T extends FormValues>({
147
147
  <Form.Control.Feedback type="invalid">
148
148
  {HookFormService.getErrors<T>(
149
149
  `${fieldNamePrefix}.termsAndConditions` as Path<T>,
150
- errors,
150
+ errors
151
151
  )}
152
152
  </Form.Control.Feedback>
153
153
  </Form.Group>
@@ -12,7 +12,7 @@ export default {
12
12
  } as Meta;
13
13
 
14
14
  export const Default: Story<ProductBookingManagementControlProps<{}>> = (
15
- args
15
+ args,
16
16
  ) => {
17
17
  const form = useForm<ProductBookingManagementControlValues>({
18
18
  mode: "onChange",
@@ -42,7 +42,7 @@ export const Default: Story<ProductQuantityControlProps<{}>> = (args) => {
42
42
  };
43
43
 
44
44
  export const ConstantForm: Story<ProductQuantityConstantControlProps<{}>> = (
45
- args
45
+ args,
46
46
  ) => {
47
47
  const form = useForm<ProductQuantityConstantControlValues>({
48
48
  mode: "onChange",
@@ -1,4 +1,4 @@
1
- import { useContext, useEffect, useMemo } from "react";
1
+ import React, { useContext, useEffect, useMemo } from "react";
2
2
  import { Col, Form, Row } from "react-bootstrap";
3
3
  import {
4
4
  ArrayPath,
@@ -63,7 +63,7 @@ export const ProductZoneControl = <T extends FormValues>({
63
63
  const disabledDuration = capacity === "0" || !capacity;
64
64
 
65
65
  const { providerHasBookingManagement, zones = [] } = useContext(
66
- ProductSetLoadingContext,
66
+ ProductSetLoadingContext
67
67
  );
68
68
 
69
69
  const currentZoneData = zones.find((zone) => zone.id === Number(zoneId));
@@ -75,10 +75,10 @@ export const ProductZoneControl = <T extends FormValues>({
75
75
  !productZones.find(
76
76
  (productZone) =>
77
77
  Number(productZone.zoneId) === zone.id &&
78
- productZone.zoneId !== zoneId,
79
- ),
78
+ productZone.zoneId !== zoneId
79
+ )
80
80
  ),
81
- [zones, productZones, zoneId],
81
+ [zones, productZones, zoneId]
82
82
  );
83
83
 
84
84
  useEffect(() => {
@@ -89,7 +89,7 @@ export const ProductZoneControl = <T extends FormValues>({
89
89
  setValue(
90
90
  `${fieldNamePrefix}.duration` as Path<T>,
91
91
  /* @ts-expect-error 6385 */
92
- 0 as UnpackNestedValue<PathValue<T, Path<T>>>,
92
+ 0 as UnpackNestedValue<PathValue<T, Path<T>>>
93
93
  );
94
94
  clearErrors(`${fieldNamePrefix}.duration` as Path<T>);
95
95
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -104,7 +104,7 @@ export const ProductZoneControl = <T extends FormValues>({
104
104
  /* @ts-expect-error 6385 */
105
105
  (value * currentZoneData?.defaultDuration) as UnpackNestedValue<
106
106
  PathValue<T, Path<T>>
107
- >,
107
+ >
108
108
  );
109
109
  };
110
110
  return (
@@ -123,7 +123,7 @@ export const ProductZoneControl = <T extends FormValues>({
123
123
  disabled={isOverrides}
124
124
  isInvalid={HookFormService.isInvalid(
125
125
  `${fieldNamePrefix}.zoneId`,
126
- errors,
126
+ errors
127
127
  )}
128
128
  {...field}
129
129
  >
@@ -147,7 +147,7 @@ export const ProductZoneControl = <T extends FormValues>({
147
147
  <Form.Control.Feedback type="invalid">
148
148
  {HookFormService.getErrors(
149
149
  `${fieldNamePrefix}.zoneId` as Path<T>,
150
- errors,
150
+ errors
151
151
  )}
152
152
  </Form.Control.Feedback>
153
153
  </Form.Group>
@@ -2,21 +2,17 @@ import { useId } from "@react-aria/utils";
2
2
  import { Form } from "react-bootstrap";
3
3
  import { useFormContext } from "react-hook-form";
4
4
  import { useTranslation } from "react-i18next";
5
- import { TimeZonePath, useTimeZoneApi } from "@licklist/plugins";
6
- import { BlockLoader } from "src/static";
7
5
  import CountryCodeSelect from "../../static/CountryCodeSelect";
8
6
  import { LocationInputValues } from ".";
9
7
  import { FormGroupControll } from "./components";
10
8
 
11
- export function LocationInput({ path }: { path: TimeZonePath }) {
9
+ export function LocationInput() {
12
10
  const {
13
11
  register,
14
12
  formState: { errors },
15
13
  } = useFormContext<LocationInputValues>();
16
14
  const { t } = useTranslation("Design");
17
15
 
18
- const { data, isLoading } = useTimeZoneApi(path).useAll();
19
-
20
16
  const countryId = useId();
21
17
 
22
18
  return (
@@ -43,7 +39,6 @@ export function LocationInput({ path }: { path: TimeZonePath }) {
43
39
  name="location.postcode"
44
40
  label={t("locationPostcode")}
45
41
  />
46
-
47
42
  <Form.Group controlId={countryId}>
48
43
  <Form.Label>{t("locationCountry")}</Form.Label>
49
44
  <CountryCodeSelect
@@ -52,36 +47,6 @@ export function LocationInput({ path }: { path: TimeZonePath }) {
52
47
  error={errors?.location?.country?.message}
53
48
  />
54
49
  </Form.Group>
55
-
56
- {isLoading ? (
57
- <BlockLoader />
58
- ) : (
59
- <Form.Group controlId="timeZoneId">
60
- <Form.Label>{t("locationTimeZone")}</Form.Label>
61
- <Form.Control
62
- {...register("timeZoneId", {
63
- required: t("Validation:fieldRequired", {
64
- attribute: t("locationTimeZone"),
65
- }) as string,
66
- })}
67
- as="select"
68
- custom
69
- isInvalid={Boolean(errors?.timeZoneId?.message)}
70
- >
71
- <option key="" value="" disabled>
72
- {t("chooseTimeZone")}
73
- </option>
74
- {data.map((zone) => (
75
- <option key={zone.id} value={zone.id.toString()}>
76
- {zone.name}
77
- </option>
78
- ))}
79
- </Form.Control>
80
- <Form.Control.Feedback type="invalid">
81
- {errors?.timeZoneId?.message}
82
- </Form.Control.Feedback>
83
- </Form.Group>
84
- )}
85
50
  </>
86
51
  );
87
52
  }
@@ -11,5 +11,4 @@ export type LocationInputValues = {
11
11
  latitude: string;
12
12
  longitude: string;
13
13
  };
14
- timeZoneId: string;
15
14
  };
@@ -10,7 +10,6 @@ import {
10
10
  } from "@licklist/core/dist/DataMapper/Media/ImageDataMapper";
11
11
  import { useMultipleImages } from "@licklist/plugins/dist/hooks/Media/useMultipleImages";
12
12
  import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
13
- import { TimeZonePath } from "@licklist/plugins";
14
13
  import { CollapsibleInputGroup } from "../../collapsible-input-group";
15
14
  import {
16
15
  CategoriesInput,
@@ -42,7 +41,6 @@ export interface ProviderFormProps extends HasPermissionProp {
42
41
  companiesOptions?: TypeaheadOptions[];
43
42
  onSubmit: (values: ProviderFormValues) => void;
44
43
  intent?: "create" | "update";
45
- path: TimeZonePath;
46
44
  }
47
45
 
48
46
  const providerImageTypes = {
@@ -58,17 +56,14 @@ export function ProviderForm({
58
56
  onSubmit,
59
57
  intent = "update",
60
58
  hasPermission = true,
61
- path,
62
59
  }: ProviderFormProps) {
63
60
  const form = useForm<ProviderFormValues>({ defaultValues });
64
-
65
61
  const {
66
62
  setValue,
67
63
  handleSubmit,
68
64
  formState: { isSubmitting, errors },
69
65
  getValues,
70
66
  } = form;
71
-
72
67
  const { t } = useTranslation("Design");
73
68
  const [initialImages, setInitialImages] = useState<Image[] | null>(null);
74
69
 
@@ -109,7 +104,7 @@ export function ProviderForm({
109
104
  description={<LocationInputDescription />}
110
105
  error={errors?.location?.country?.message}
111
106
  >
112
- <LocationInput path={path} />
107
+ <LocationInput />
113
108
  </CollapsibleInputGroup>
114
109
  {categories && categories.length > 0 && (
115
110
  <CollapsibleInputGroup
@@ -11,7 +11,6 @@ import {
11
11
  import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
12
12
  import { useMultipleImages } from "@licklist/plugins/dist/hooks/Media/useMultipleImages";
13
13
  import { parseServerErrorForFormValidation } from "@licklist/plugins/dist/utils/parseError";
14
- import { TimeZonePath } from "@licklist/plugins";
15
14
  import { CollapsibleInputGroup } from "../../collapsible-input-group";
16
15
  import {
17
16
  CategoriesInput,
@@ -51,7 +50,6 @@ export interface VenueFormProps extends HasPermissionProp {
51
50
  intent?: "create" | "update";
52
51
  isLoading?: boolean;
53
52
  errorResponse?: unknown;
54
- path: TimeZonePath;
55
53
  }
56
54
 
57
55
  const providerImageTypes = {
@@ -69,7 +67,6 @@ export function VenueForm({
69
67
  hasPermission = true,
70
68
  isLoading,
71
69
  errorResponse,
72
- path,
73
70
  }: VenueFormProps) {
74
71
  const form = useForm<VenueFormValues>({ defaultValues, mode: "onChange" });
75
72
  const {
@@ -146,7 +143,7 @@ export function VenueForm({
146
143
  }))
147
144
  }
148
145
  >
149
- <LocationInput path={path} />
146
+ <LocationInput />
150
147
  </CollapsibleInputGroup>
151
148
  <CollapsibleInputGroup
152
149
  eventKey="workingHours"
@@ -1,6 +1,8 @@
1
+ import { DateTime } from "luxon";
1
2
  import { Col, Row } from "react-bootstrap";
2
3
  import { useFormContext } from "react-hook-form";
3
4
  import { useTranslation } from "react-i18next";
5
+ import { TIME_FORMAT } from "@licklist/core/dist/Config";
4
6
  import { WorkingHoursInputValues } from ".";
5
7
  import { useWeekdays } from "./utils";
6
8
 
@@ -22,10 +24,22 @@ export function WorkingHoursInputDescription() {
22
24
  <Row key={i}>
23
25
  <Col xs="auto">{weekdays[i]}:</Col>
24
26
  <Col>
25
- {t("timeInterval", {
26
- start: weekday.start,
27
- end: weekday.end,
28
- })}
27
+ {weekday?.end
28
+ ? weekday.start
29
+ ? t("timeInterval", {
30
+ start: DateTime.fromISO(weekday.start).toFormat(
31
+ TIME_FORMAT,
32
+ ),
33
+ end: DateTime.fromISO(weekday.start).toFormat(
34
+ TIME_FORMAT,
35
+ ),
36
+ })
37
+ : t("timeFrom", {
38
+ start: DateTime.fromISO(weekday.start).toFormat(
39
+ TIME_FORMAT,
40
+ ),
41
+ })
42
+ : null}
29
43
  </Col>
30
44
  </Row>
31
45
  );
@@ -12,7 +12,9 @@ export default {
12
12
  component: RecurringDatePickerInput,
13
13
  } as Meta;
14
14
 
15
- export const Default: Story<RecurringDatePickerInputProps> = (args) => {
15
+ type DefaultRecurringDatePickerInputProps = RecurringDatePickerInputProps;
16
+
17
+ export const Default: Story<DefaultRecurringDatePickerInputProps> = (args) => {
16
18
  return (
17
19
  <Card style={{ maxWidth: "max-content" }}>
18
20
  <Card.Body>
@@ -21,7 +23,7 @@ export const Default: Story<RecurringDatePickerInputProps> = (args) => {
21
23
  </Card>
22
24
  );
23
25
  };
24
- export const Valid: Story<RecurringDatePickerInputProps> = (args) => {
26
+ export const Valid: Story<DefaultRecurringDatePickerInputProps> = (args) => {
25
27
  return (
26
28
  <Card style={{ maxWidth: "max-content" }}>
27
29
  <Card.Body>
@@ -32,15 +34,6 @@ export const Valid: Story<RecurringDatePickerInputProps> = (args) => {
32
34
  };
33
35
  Default.args = {
34
36
  onChange: (data) => console.log("onSubmit", data),
35
- workHours: [
36
- { start: "20:00", end: "04:00", day: 0, description: "" },
37
- { start: "20:00", end: "04:00", day: 1, description: "" },
38
- { start: "20:00", end: "04:00", day: 2, description: "" },
39
- { start: "20:00", end: "12:00", day: 3, description: "" },
40
- { start: "20:00", end: "23:00", day: 4, description: "" },
41
- { start: "08:00", end: "12:00", day: 5, description: "" },
42
- { start: "10:00", end: "16:00", day: 6, description: "" },
43
- ],
44
37
  };
45
38
  Valid.args = {
46
39
  onChange: (data) => console.log("onSubmit", data),
@@ -12,14 +12,9 @@ import {
12
12
  import { usePreviousValue } from "@licklist/plugins/dist/hooks/Value/usePreviousValue";
13
13
  import { FormProvider, useForm } from "react-hook-form";
14
14
  import { Form } from "react-bootstrap";
15
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
16
15
  import RecurrenceIntervalAndFrequencyInput from "./RecurrenceIntervalAndFrequencyInput";
17
16
  import RecurrenceWeekdaysInput from "./RecurrenceWeekdaysInput";
18
- import {
19
- parseAndValidateRRule,
20
- SupportedFrequency,
21
- useWorkHoursValidation,
22
- } from "./utils";
17
+ import { parseAndValidateRRule, SupportedFrequency } from "./utils";
23
18
  import { ConfirmModal } from "../modals";
24
19
  import { DeleteFieldButton } from "../product-set/elements";
25
20
 
@@ -31,7 +26,6 @@ export interface RecurringDatePickerInputProps {
31
26
  initialFrequency?: Frequency;
32
27
  setInitialStartDateAfterSelect?: boolean;
33
28
  minDate?: string;
34
- workHours: WorkHour[] | undefined;
35
29
  }
36
30
 
37
31
  export interface RecurringDatePickerInputValues {
@@ -57,7 +51,6 @@ export function RecurringDatePickerInput({
57
51
  setInitialStartDateAfterSelect = false,
58
52
  children,
59
53
  minDate,
60
- workHours,
61
54
  }: PropsWithChildren<RecurringDatePickerInputProps>) {
62
55
  const { t } = useTranslation(["Design"]);
63
56
 
@@ -91,8 +84,6 @@ export function RecurringDatePickerInput({
91
84
  byWeekDay,
92
85
  });
93
86
 
94
- const validator = useWorkHoursValidation(byWeekDay, workHours);
95
-
96
87
  const onSubmit = (nextState: RecurringDatePickerInputValues) => {
97
88
  const end = getDateTimeObject(endDate, endTime || "23:59:59");
98
89
 
@@ -197,8 +188,6 @@ export function RecurringDatePickerInput({
197
188
  <RecurrenceIntervalAndFrequencyInput
198
189
  disabled={disabled}
199
190
  minDate={minDate}
200
- startTimeRules={validator}
201
- endTimeRules={validator}
202
191
  />
203
192
 
204
193
  {children}
@@ -1,9 +1,4 @@
1
- import { TIME_FORMAT, TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
2
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
3
- import { fromFormat } from "@licklist/plugins/dist/utils/dateTime";
4
- import { DateTime, Interval } from "luxon";
5
- import { Validate } from "react-hook-form";
6
- import { useTranslation } from "react-i18next";
1
+ import { DateTime } from "luxon";
7
2
  import RRule, { Frequency, Weekday } from "rrule";
8
3
 
9
4
  export const getWeekdayForFrequency = ({
@@ -16,7 +11,6 @@ export const getWeekdayForFrequency = ({
16
11
  const parsedDate = DateTime.fromISO(date);
17
12
  return new Weekday(
18
13
  parsedDate.weekday - 1,
19
- // eslint-disable-next-line no-nested-ternary
20
14
  frequency !== Frequency.MONTHLY
21
15
  ? undefined
22
16
  : parsedDate.day + 7 > parsedDate.daysInMonth
@@ -115,87 +109,3 @@ export const parseAndValidateRRule = ({
115
109
  until: options.until,
116
110
  } as ParsedRRuleOptions;
117
111
  };
118
-
119
- export const useWorkHoursValidation = (
120
- byWeekDay: Weekday[] = [],
121
- workHours: WorkHour[] | undefined,
122
- ): {
123
- /* @ts-expect-error 2314 */
124
- validate?: Validate<string>;
125
- } => {
126
- const { t } = useTranslation("Validation");
127
- if (!workHours) return {};
128
-
129
- const fromTimeFormat = fromFormat(TIME_FORMAT);
130
- const fromTimeFullFormat = fromFormat(TIME_FULL_FORMAT);
131
-
132
- // map every day to array of intervals describing workhours for that day
133
- let intervalsByDay = workHours.map((workhour, index, self) => {
134
- const res: Interval[] = [];
135
-
136
- const startTime = fromTimeFormat(workhour.start);
137
- const endTime = fromTimeFormat(workhour.end);
138
-
139
- if (endTime > startTime) {
140
- res.push(Interval.fromDateTimes(startTime, endTime));
141
- } else {
142
- // if end is before start, then it means that end is on the next day
143
- // so count only to the end of current day
144
- res.push(Interval.fromDateTimes(startTime, startTime.endOf("day")));
145
- }
146
-
147
- const prevIndex = index === 0 ? self.length - 1 : index - 1;
148
-
149
- const prevStartTime = fromTimeFormat(self[prevIndex].start);
150
- const prevEndTime = fromTimeFormat(self[prevIndex].end);
151
-
152
- // if prevStartTime > prevEndTime then it means that prevEndTime is on the current day
153
- // so we need to add interval from start of current day to prevEndTime
154
- if (prevStartTime > prevEndTime) {
155
- res.push(Interval.fromDateTimes(prevEndTime.startOf("day"), prevEndTime));
156
- }
157
-
158
- return res;
159
- });
160
-
161
- // if length === 0 or length === 7 then all workhours are selected, no need to filter
162
- if (![0, 7].includes(byWeekDay.length)) {
163
- intervalsByDay = intervalsByDay.filter((_, index) =>
164
- byWeekDay.find(({ weekday }) => weekday === index),
165
- );
166
- }
167
-
168
- return {
169
- validate: (_time: string) => {
170
- // workaround for issue with form values
171
- // default values and entered values have different formats
172
- const time = fromTimeFormat(_time).isValid
173
- ? fromTimeFormat(_time)
174
- : fromTimeFullFormat(_time);
175
-
176
- const notFittingIntervalsByDay = intervalsByDay.reduce<Interval[][]>(
177
- (acc, intervalsByDay) => {
178
- if (!intervalsByDay.some((interval) => interval.contains(time))) {
179
- acc.push(intervalsByDay);
180
- }
181
- return acc;
182
- },
183
- [],
184
- );
185
-
186
- const notFittingIntervals = notFittingIntervalsByDay
187
- .flat()
188
- .filter((interval) => !interval.contains(time));
189
-
190
- const attribute = notFittingIntervals
191
- .map((interval) => interval.toFormat("HH:mm"))
192
- .join(", ");
193
-
194
- if (notFittingIntervalsByDay.length !== 0) {
195
- return t("outsideWorkingHours", { attribute }) as string;
196
- }
197
-
198
- return true;
199
- },
200
- };
201
- };
@@ -20,6 +20,8 @@ export type ResultCardProps = {
20
20
  onCardClick?: (id: number) => void;
21
21
  };
22
22
 
23
+ // @TODO integrate when API will be available
24
+ // activity and staff keys
23
25
  export const ResultCard = ({
24
26
  order,
25
27
  className,
@@ -19,7 +19,6 @@ export const SettingFormComponent: Story<AdminSettingFormProps> = (args) => (
19
19
  </Container>
20
20
  );
21
21
 
22
-
23
22
  export const PaymentFeeFormComponent: Story<PaymentFeeFormProps> = (args) => {
24
23
  const form = useForm<PaymentFeeFormFieldValues>({
25
24
  defaultValues: args.defaultValues,
@@ -10,7 +10,7 @@ import Row from "react-bootstrap/Row";
10
10
  import Col from "react-bootstrap/Col";
11
11
  import { Link } from "react-router-dom";
12
12
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
13
- import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
13
+ import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
14
14
  import { FaCommentAlt } from "react-icons/fa";
15
15
  import { PaymentFeeForm, PaymentFeeFormFieldValues } from "./PaymentFeeForm";
16
16
  import { Currency } from "../../types/currency";
@@ -32,7 +32,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
32
32
  providerMetadata: {
33
33
  country?: string;
34
34
  providableId?: number;
35
- providerType?: ProvidableType;
35
+ providerType?: ProviderType;
36
36
  };
37
37
  }
38
38
 
@@ -23,4 +23,4 @@ export function Default() {
23
23
  />
24
24
  </Container>
25
25
  );
26
- }
26
+ }
@@ -307,7 +307,6 @@ export function Preview({
307
307
  productCategoryId: 57,
308
308
  productGroupId: null,
309
309
  availableQuantity: 980,
310
- zoneId: null,
311
310
  name: "Cofee",
312
311
  description: "",
313
312
  price: 15,
@@ -316,8 +315,6 @@ export function Preview({
316
315
  maxQuantity: 15,
317
316
  totalQuantity: 980,
318
317
  type: "sale" as const,
319
- capacity: 0,
320
- duration: 0,
321
318
  weight: 0,
322
319
  isAvailable: true,
323
320
  isSoldOut: false,
@@ -336,7 +333,6 @@ export function Preview({
336
333
  productCategoryId: 57,
337
334
  productGroupId: null,
338
335
  availableQuantity: 980,
339
- zoneId: null,
340
336
  name: "Cofee 2",
341
337
  description: "",
342
338
  price: 15,
@@ -345,8 +341,6 @@ export function Preview({
345
341
  maxQuantity: 15,
346
342
  totalQuantity: 980,
347
343
  type: "sale" as const,
348
- capacity: 0,
349
- duration: 0,
350
344
  weight: 0,
351
345
  isAvailable: true,
352
346
  isSoldOut: false,