@licklist/design 0.44.486-dev.3 → 0.44.486-dev.31

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 (276) hide show
  1. package/dist/assets/iframe/available.svg.js +1 -0
  2. package/dist/assets/iframe/limited.svg.js +1 -0
  3. package/dist/assets/iframe/soldOut.svg.js +1 -0
  4. package/dist/assets/logo/bookedit.svg +9 -11
  5. package/dist/assets/logo/bookedit.svg.js +1 -1
  6. package/dist/assets/logo/favicon.svg +12 -0
  7. package/dist/assets/logo/licklist.svg +0 -2
  8. package/dist/assets/logo/licklist.svg.js +1 -1
  9. package/dist/calendar/Calendar.d.ts +16 -0
  10. package/dist/calendar/Calendar.d.ts.map +1 -0
  11. package/dist/calendar/Calendar.js +1 -0
  12. package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts +6 -0
  13. package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -0
  14. package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -0
  15. package/dist/calendar/components/CalendarButtons/index.d.ts.map +1 -0
  16. package/dist/{iframe/event/event-calendar → calendar}/components/CalendarDate/CalendarDate.d.ts +3 -2
  17. package/dist/calendar/components/CalendarDate/CalendarDate.d.ts.map +1 -0
  18. package/dist/calendar/components/CalendarDate/CalendarDate.js +1 -0
  19. package/dist/calendar/components/CalendarDate/index.d.ts.map +1 -0
  20. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +8 -0
  21. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -0
  22. package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -0
  23. package/dist/calendar/components/CalendarDates/index.d.ts.map +1 -0
  24. package/dist/calendar/components/CalendarSelect/CalendarSelect.d.ts.map +1 -0
  25. package/dist/calendar/components/CalendarSelect/CalendarSelect.js +1 -0
  26. package/dist/calendar/components/CalendarSelect/index.d.ts.map +1 -0
  27. package/dist/calendar/components/CalendarWeekdays/CalendarWeekdays.d.ts.map +1 -0
  28. package/dist/calendar/components/CalendarWeekdays/index.d.ts.map +1 -0
  29. package/dist/calendar/index.d.ts +4 -0
  30. package/dist/calendar/index.d.ts.map +1 -0
  31. package/dist/calendar/utils/index.d.ts +5 -0
  32. package/dist/calendar/utils/index.d.ts.map +1 -0
  33. package/dist/calendar/utils/index.js +1 -0
  34. package/dist/date-time-button/DateTimeButton.d.ts +5 -1
  35. package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
  36. package/dist/date-time-button/DateTimeButton.js +1 -1
  37. package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
  38. package/dist/events/edit-event-modal/IntervalInput.js +1 -1
  39. package/dist/events/event-venue-map/hooks/useImage.d.ts.map +1 -1
  40. package/dist/events/event-venue-map/hooks/useImage.js +1 -1
  41. package/dist/file-upload/FileUpload.d.ts.map +1 -1
  42. package/dist/file-upload/FileUpload.js +1 -1
  43. package/dist/iframe/activity-card/ActivityCard.d.ts +17 -0
  44. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -0
  45. package/dist/iframe/activity-card/ActivityCard.js +1 -0
  46. package/dist/iframe/activity-card/index.d.ts +2 -0
  47. package/dist/iframe/activity-card/index.d.ts.map +1 -0
  48. package/dist/iframe/event/index.d.ts +0 -1
  49. package/dist/iframe/event/index.d.ts.map +1 -1
  50. package/dist/iframe/index.d.ts +2 -2
  51. package/dist/iframe/index.d.ts.map +1 -1
  52. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
  53. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  54. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  55. package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
  56. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +1 -0
  57. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  58. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  59. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  60. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts +1 -1
  61. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts.map +1 -1
  62. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
  63. package/dist/iframe/order-process/components/Timer/utils/index.d.ts +1 -1
  64. package/dist/iframe/order-process/components/Timer/utils/index.d.ts.map +1 -1
  65. package/dist/iframe/order-process/components/Timer/utils/index.js +1 -1
  66. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +3 -2
  67. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  68. package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -1
  69. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  70. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  71. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  72. package/dist/iframe/payment/order-items-table/hooks/useTableData.js +1 -1
  73. package/dist/iframe/payment/order-items-table/types/index.d.ts +7 -1
  74. package/dist/iframe/payment/order-items-table/types/index.d.ts.map +1 -1
  75. package/dist/iframe/payment/order-items-table/types/index.js +1 -0
  76. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts +3 -0
  77. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -0
  78. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -0
  79. package/dist/index.d.ts +1 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  83. package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
  84. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  85. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  86. package/dist/product-set/form/ProductsControl.d.ts +3 -1
  87. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  88. package/dist/product-set/form/ProductsControl.js +1 -1
  89. package/dist/product-set/product/ProductControl.d.ts +2 -1
  90. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  91. package/dist/product-set/product/ProductControl.js +1 -1
  92. package/dist/product-set/product/duration/ProductDurationControl.js +1 -1
  93. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  94. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  95. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  96. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  97. package/dist/recurrence-input/RecurrenceEndInput.d.ts +8 -1
  98. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  99. package/dist/recurrence-input/RecurrenceEndInput.js +1 -1
  100. package/dist/recurrence-input/RecurrenceInput.d.ts +2 -1
  101. package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
  102. package/dist/recurrence-input/RecurrenceInput.js +1 -1
  103. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts +4 -1
  104. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
  105. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
  106. package/dist/report/form/ReportForm.d.ts.map +1 -1
  107. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  108. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  109. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  110. package/dist/snippet/snippet-template/preview/Preview.js +1 -1
  111. package/dist/static/RestrictedAccess.d.ts.map +1 -1
  112. package/dist/static/form-number-input/FormNumberInput.d.ts +2 -1
  113. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  114. package/dist/static/form-number-input/FormNumberInput.js +1 -1
  115. package/dist/styles/{iframe-customers-journey/ActivitiesCard.scss → activity-card/GridActivitiesCard.scss} +1 -1
  116. package/dist/styles/{iframe-customers-journey/ActivitiesSelectedCard.scss → activity-card/ListActivitiesCard.scss} +2 -1
  117. package/dist/styles/activity-card/_index.scss +2 -0
  118. package/{src/styles/iframe-customers-journey → dist/styles/date-time-button}/DateTimeButton.scss +3 -6
  119. package/dist/styles/date-time-button/_index.scss +1 -0
  120. package/dist/styles/header/Header.scss +0 -4
  121. package/dist/styles/iframe-events/Calendar.scss +14 -14
  122. package/dist/styles/iframe-events/Card.scss +1 -0
  123. package/dist/styles/iframe-page/PageBody.scss +3 -2
  124. package/dist/styles/notification/Notification.scss +4 -0
  125. package/dist/styles/packages.scss +2 -1
  126. package/dist/styles/resources-blocking/_index.scss +5 -0
  127. package/dist/styles/themes/bookedit/_index.scss +1 -0
  128. package/dist/zone/form/components/AvailableTimesControl.d.ts.map +1 -1
  129. package/dist/zone/form/components/AvailableTimesControl.js +1 -1
  130. package/dist/zone/form/components/GameDurationControl.d.ts +7 -0
  131. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -0
  132. package/dist/zone/form/components/GameDurationControl.js +1 -0
  133. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  134. package/dist/zone/form/components/ZoneControl.js +1 -1
  135. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  136. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  137. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  138. package/dist/zone/form/utils/dates.js +1 -1
  139. package/package.json +2 -2
  140. package/src/assets/logo/bookedit.svg +9 -11
  141. package/src/assets/logo/favicon.svg +12 -0
  142. package/src/assets/logo/licklist.svg +0 -2
  143. package/src/calendar/Calendar.stories.tsx +33 -0
  144. package/src/calendar/Calendar.tsx +59 -0
  145. package/src/{iframe/event/event-calendar → calendar}/components/CalendarButtons/CalendarButtons.tsx +31 -14
  146. package/src/{iframe/event/event-calendar → calendar}/components/CalendarDate/CalendarDate.tsx +10 -2
  147. package/src/{iframe/event/event-calendar → calendar}/components/CalendarDates/CalendarDates.tsx +17 -13
  148. package/src/{iframe/event/event-calendar → calendar}/components/CalendarSelect/CalendarSelect.tsx +1 -1
  149. package/src/calendar/index.ts +3 -0
  150. package/src/calendar/utils/index.ts +28 -0
  151. package/src/date-time-button/DateTimeButton.stories.tsx +17 -0
  152. package/src/date-time-button/DateTimeButton.tsx +42 -20
  153. package/src/events/edit-event-modal/IntervalInput.tsx +3 -0
  154. package/src/events/event-venue-map/hooks/useImage.tsx +17 -8
  155. package/src/file-upload/FileUpload.tsx +3 -1
  156. package/src/iframe/{activity-cards/activity-card → activity-card}/ActivityCard.stories.tsx +24 -1
  157. package/src/iframe/activity-card/ActivityCard.tsx +77 -0
  158. package/src/iframe/activity-card/index.ts +1 -0
  159. package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +1 -1
  160. package/src/iframe/event/index.ts +0 -6
  161. package/src/iframe/index.ts +1 -2
  162. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +2 -0
  163. package/src/iframe/order-process/components/BookingSummary/types/index.ts +1 -0
  164. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -0
  165. package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.tsx +5 -3
  166. package/src/iframe/order-process/components/Timer/utils/index.ts +6 -9
  167. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +28 -29
  168. package/src/iframe/page/Page.stories.tsx +2 -2
  169. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +6 -1
  170. package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +11 -99
  171. package/src/iframe/payment/order-items-table/types/index.ts +18 -1
  172. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +118 -0
  173. package/src/iframe/payment/payment-page/PaymentPage.tsx +4 -4
  174. package/src/index.ts +1 -0
  175. package/src/notification/email-template/control/EmailTemplateControl.tsx +26 -1
  176. package/src/product-set/form/ProductCategoriesControl.tsx +2 -0
  177. package/src/product-set/form/ProductSetForm.stories.tsx +1 -0
  178. package/src/product-set/form/ProductsControl.tsx +10 -0
  179. package/src/product-set/product/ProductControl.tsx +28 -1
  180. package/src/product-set/product/duration/ProductDurationControl.tsx +1 -1
  181. package/src/product-set/product-category/ProductCategoryControl.tsx +1 -7
  182. package/src/provider/location-input/LocationInputDescription.tsx +2 -2
  183. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +10 -8
  184. package/src/recurrence-input/RecurrenceEndInput.tsx +28 -10
  185. package/src/recurrence-input/RecurrenceInput.tsx +12 -2
  186. package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +24 -21
  187. package/src/report/form/ReportForm.tsx +1 -1
  188. package/src/sales/booking/results/components/ResultCard.tsx +3 -2
  189. package/src/snippet/snippet-template/preview/Preview.tsx +14 -2
  190. package/src/static/CountryCodeSelect.tsx +3 -3
  191. package/src/static/RestrictedAccess.tsx +1 -1
  192. package/src/static/form-number-input/FormNumberInput.tsx +8 -1
  193. package/src/styles/{iframe-customers-journey/ActivitiesCard.scss → activity-card/GridActivitiesCard.scss} +1 -1
  194. package/src/styles/{iframe-customers-journey/ActivitiesSelectedCard.scss → activity-card/ListActivitiesCard.scss} +2 -1
  195. package/src/styles/activity-card/_index.scss +2 -0
  196. package/{dist/styles/iframe-customers-journey → src/styles/date-time-button}/DateTimeButton.scss +3 -6
  197. package/src/styles/date-time-button/_index.scss +1 -0
  198. package/src/styles/header/Header.scss +0 -4
  199. package/src/styles/iframe-events/Calendar.scss +14 -14
  200. package/src/styles/iframe-events/Card.scss +1 -0
  201. package/src/styles/iframe-page/PageBody.scss +3 -2
  202. package/src/styles/notification/Notification.scss +4 -0
  203. package/src/styles/packages.scss +2 -1
  204. package/src/styles/resources-blocking/_index.scss +5 -0
  205. package/src/styles/themes/bookedit/_index.scss +1 -0
  206. package/src/typings.d.ts +11 -0
  207. package/src/zone/form/components/AvailableTimesControl.tsx +4 -9
  208. package/src/zone/form/components/GameDurationControl.tsx +46 -0
  209. package/src/zone/form/components/ZoneControl.tsx +2 -0
  210. package/src/zone/form/components/ZoneRecurrencesControl.tsx +27 -35
  211. package/src/zone/form/utils/dates.ts +29 -36
  212. package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts +0 -12
  213. package/dist/iframe/activity-cards/activity-card/ActivityCard.d.ts.map +0 -1
  214. package/dist/iframe/activity-cards/activity-card/ActivityCard.js +0 -1
  215. package/dist/iframe/activity-cards/index.d.ts +0 -3
  216. package/dist/iframe/activity-cards/index.d.ts.map +0 -1
  217. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts +0 -12
  218. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.d.ts.map +0 -1
  219. package/dist/iframe/activity-cards/list-activity-card/ListActivityCard.js +0 -1
  220. package/dist/iframe/event/event-calendar/EventCalendar.d.ts +0 -5
  221. package/dist/iframe/event/event-calendar/EventCalendar.d.ts.map +0 -1
  222. package/dist/iframe/event/event-calendar/EventCalendar.js +0 -1
  223. package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.d.ts +0 -6
  224. package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.d.ts.map +0 -1
  225. package/dist/iframe/event/event-calendar/components/CalendarButtons/CalendarButtons.js +0 -1
  226. package/dist/iframe/event/event-calendar/components/CalendarButtons/index.d.ts.map +0 -1
  227. package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.d.ts.map +0 -1
  228. package/dist/iframe/event/event-calendar/components/CalendarDate/CalendarDate.js +0 -1
  229. package/dist/iframe/event/event-calendar/components/CalendarDate/index.d.ts.map +0 -1
  230. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts +0 -5
  231. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.d.ts.map +0 -1
  232. package/dist/iframe/event/event-calendar/components/CalendarDates/CalendarDates.js +0 -1
  233. package/dist/iframe/event/event-calendar/components/CalendarDates/index.d.ts.map +0 -1
  234. package/dist/iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.d.ts.map +0 -1
  235. package/dist/iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.js +0 -1
  236. package/dist/iframe/event/event-calendar/components/CalendarSelect/index.d.ts.map +0 -1
  237. package/dist/iframe/event/event-calendar/components/CalendarWeekdays/CalendarWeekdays.d.ts.map +0 -1
  238. package/dist/iframe/event/event-calendar/components/CalendarWeekdays/index.d.ts.map +0 -1
  239. package/dist/iframe/event/event-calendar/index.d.ts +0 -4
  240. package/dist/iframe/event/event-calendar/index.d.ts.map +0 -1
  241. package/dist/iframe/event/event-calendar/types/index.d.ts +0 -6
  242. package/dist/iframe/event/event-calendar/types/index.d.ts.map +0 -1
  243. package/dist/iframe/event/event-calendar/utils/index.d.ts +0 -3
  244. package/dist/iframe/event/event-calendar/utils/index.d.ts.map +0 -1
  245. package/dist/iframe/event/event-calendar/utils/index.js +0 -1
  246. package/dist/styles/iframe-customers-journey/_index.scss +0 -3
  247. package/src/iframe/activity-cards/activity-card/ActivityCard.tsx +0 -38
  248. package/src/iframe/activity-cards/index.ts +0 -2
  249. package/src/iframe/activity-cards/list-activity-card/ListActivityCard.stories.tsx +0 -52
  250. package/src/iframe/activity-cards/list-activity-card/ListActivityCard.tsx +0 -49
  251. package/src/iframe/event/event-calendar/EventCalendar.stories.tsx +0 -37
  252. package/src/iframe/event/event-calendar/EventCalendar.tsx +0 -20
  253. package/src/iframe/event/event-calendar/index.ts +0 -6
  254. package/src/iframe/event/event-calendar/types/index.ts +0 -6
  255. package/src/iframe/event/event-calendar/utils/index.ts +0 -11
  256. package/src/styles/iframe-customers-journey/_index.scss +0 -3
  257. /package/dist/assets/iframe/{dateInfo/available.svg → available.svg} +0 -0
  258. /package/dist/assets/iframe/{dateInfo/limited.svg → limited.svg} +0 -0
  259. /package/dist/assets/iframe/{dateInfo/soldOut.svg → soldOut.svg} +0 -0
  260. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarButtons/index.d.ts +0 -0
  261. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarDate/index.d.ts +0 -0
  262. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarDates/index.d.ts +0 -0
  263. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarSelect/CalendarSelect.d.ts +0 -0
  264. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarSelect/index.d.ts +0 -0
  265. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.d.ts +0 -0
  266. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.js +0 -0
  267. /package/dist/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/index.d.ts +0 -0
  268. /package/src/assets/iframe/{dateInfo/available.svg → available.svg} +0 -0
  269. /package/src/assets/iframe/{dateInfo/limited.svg → limited.svg} +0 -0
  270. /package/src/assets/iframe/{dateInfo/soldOut.svg → soldOut.svg} +0 -0
  271. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarButtons/index.ts +0 -0
  272. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarDate/index.ts +0 -0
  273. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarDates/index.ts +0 -0
  274. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarSelect/index.ts +0 -0
  275. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/CalendarWeekdays.tsx +0 -0
  276. /package/src/{iframe/event/event-calendar → calendar}/components/CalendarWeekdays/index.ts +0 -0
@@ -0,0 +1,118 @@
1
+ import { PAYMENT_TYPE_TRANSLATE_KEYS } from "../hooks/useTableData";
2
+ import {
3
+ AMOUNT_TOTAL,
4
+ AMOUNT_WITH_DISCOUNT,
5
+ OrderItemsTableProps,
6
+ REMAINING_TO_PAY,
7
+ SummaryItem,
8
+ TOTAL_PAID,
9
+ } from "../types";
10
+ import {
11
+ calculateTotalDiscount,
12
+ calculateTotalPrice,
13
+ getExternalPaymentDetail,
14
+ getPaymentValueByType,
15
+ } from "./index";
16
+
17
+ const paymentNotProcessedSummary = ({
18
+ order,
19
+ externalDiscount,
20
+ paymentDetail,
21
+ }: OrderItemsTableProps) => {
22
+ const externalPaymentDetail = paymentDetail
23
+ ? getExternalPaymentDetail(paymentDetail)
24
+ : undefined;
25
+
26
+ const total = calculateTotalPrice(order, externalPaymentDetail);
27
+
28
+ const summaryItems: SummaryItem[] = [
29
+ {
30
+ translateKey: AMOUNT_TOTAL,
31
+ price: total,
32
+ },
33
+ ];
34
+
35
+ if (externalDiscount) {
36
+ summaryItems.push({
37
+ price: externalDiscount,
38
+ translateKey: AMOUNT_WITH_DISCOUNT,
39
+ });
40
+ }
41
+
42
+ if (externalPaymentDetail) {
43
+ return [...summaryItems, ...getExternalPaymentDetail(paymentDetail)];
44
+ }
45
+
46
+ return summaryItems;
47
+ };
48
+
49
+ const processedPaymentSummary = ({
50
+ order,
51
+ paymentDetail,
52
+ }: OrderItemsTableProps) => {
53
+ const externalPaymentDetail =
54
+ paymentDetail && !order.payments.length
55
+ ? getExternalPaymentDetail(paymentDetail)
56
+ : Object.keys(PAYMENT_TYPE_TRANSLATE_KEYS).map((key) => {
57
+ return {
58
+ translateKey: PAYMENT_TYPE_TRANSLATE_KEYS[key],
59
+ price: getPaymentValueByType(order.payments, key),
60
+ };
61
+ });
62
+
63
+ const total = calculateTotalPrice(order, externalPaymentDetail);
64
+
65
+ const totalDiscount = calculateTotalDiscount(order.payments);
66
+ const totalWithDiscount = total - Number(totalDiscount);
67
+ let summaryItems: SummaryItem[] = [
68
+ {
69
+ translateKey: AMOUNT_TOTAL,
70
+ price: total,
71
+ },
72
+ ];
73
+
74
+ if (totalDiscount) {
75
+ summaryItems.push({
76
+ translateKey: AMOUNT_WITH_DISCOUNT,
77
+ price: totalWithDiscount < 0 ? 0 : totalWithDiscount,
78
+ });
79
+ }
80
+
81
+ if (paymentDetail && !order.payments.length) {
82
+ return [...summaryItems, ...externalPaymentDetail];
83
+ }
84
+
85
+ summaryItems.push({
86
+ translateKey: TOTAL_PAID,
87
+ price: totalWithDiscount <= 0 ? 0 : order.totalAmount,
88
+ });
89
+ if (totalWithDiscount <= 0) {
90
+ return summaryItems;
91
+ }
92
+ summaryItems = [...summaryItems, ...externalPaymentDetail];
93
+
94
+ if (totalWithDiscount > order.totalAmount) {
95
+ summaryItems.push({
96
+ translateKey: REMAINING_TO_PAY,
97
+ price: totalWithDiscount - order.totalAmount,
98
+ });
99
+ }
100
+ return summaryItems;
101
+ };
102
+
103
+ export const getOrderSummaryItems = ({
104
+ order,
105
+ externalDiscount,
106
+ paymentDetail,
107
+ isPaymentProcessed,
108
+ }: OrderItemsTableProps): SummaryItem[] => {
109
+ if (!isPaymentProcessed) {
110
+ return paymentNotProcessedSummary({
111
+ order,
112
+ externalDiscount,
113
+ paymentDetail,
114
+ });
115
+ }
116
+
117
+ return processedPaymentSummary({ order, paymentDetail });
118
+ };
@@ -100,18 +100,18 @@ export const PaymentPage = ({
100
100
  );
101
101
  }
102
102
 
103
- const orderTotalAmounByFormValues = cartSumByOrderProducts(
103
+ const orderTotalAmountByFormValues = cartSumByOrderProducts(
104
104
  bookingSummaryProps && bookingSummaryProps?.formValues
105
105
  ? Object.values(bookingSummaryProps?.formValues)
106
106
  : undefined
107
107
  );
108
108
 
109
- // User can fill promocode only in iframe appcliation.
109
+ // User can fill promo code only in iframe application.
110
110
  // It didn't possible via payment link. This check will
111
111
  // be applied when there are no metadata and in case when
112
112
  // orderValues sum is greater than amount in order.
113
113
  const isCalculatedAmountGreaterThanOrderAmount =
114
- orderTotalAmounByFormValues > data?.amount;
114
+ orderTotalAmountByFormValues > data?.amount;
115
115
 
116
116
  return (
117
117
  <Page
@@ -164,7 +164,7 @@ export const PaymentPage = ({
164
164
  <SummaryTotalBlock
165
165
  label={t("total")}
166
166
  amount={
167
- orderTotalAmounByFormValues +
167
+ orderTotalAmountByFormValues +
168
168
  (bookingSummaryProps?.transactionFee || 0)
169
169
  }
170
170
  />
package/src/index.ts CHANGED
@@ -39,3 +39,4 @@ export * from "./radio-card";
39
39
  export * from "./image-radio-input";
40
40
  export * from "./sorting-select";
41
41
  export * from "./date-time-button";
42
+ export * from "./calendar";
@@ -314,13 +314,38 @@ export const EmailTemplateControl = React.forwardRef(
314
314
  <Row className="mb-4">
315
315
  <Form.Group as={Col}>
316
316
  <Form.Label>{t("Design:emailBody")}</Form.Label>
317
- <div className="email-editor">
317
+
318
+ <div className="alert alert-warning" role="alert">
319
+ Due to the mail services limitations on the length of the email
320
+ body that can be sent or received - maximum length is set to
321
+ 65,535 characters.
322
+ </div>
323
+
324
+ <div className={`email-editor ${errors.body && "is-invalid"}`}>
318
325
  <EmailEditor
319
326
  ref={ref}
320
327
  onReady={onReadyEditor}
321
328
  style={{ height: "50rem" }}
322
329
  />
330
+
331
+ <input
332
+ type="hidden"
333
+ name="body"
334
+ {...register("body", {
335
+ maxLength: {
336
+ value: 65535,
337
+ message: t("Validation:fieldMaxLength", {
338
+ attribute: t("body"),
339
+ max: 65535,
340
+ }) as string,
341
+ },
342
+ })}
343
+ />
323
344
  </div>
345
+
346
+ <Form.Control.Feedback type="invalid">
347
+ {errors.body?.message}
348
+ </Form.Control.Feedback>
324
349
  </Form.Group>
325
350
  </Row>
326
351
  <Row>
@@ -72,6 +72,7 @@ export function ProductCategoriesControl({
72
72
  providerHasMap,
73
73
  expandedProductCategories,
74
74
  setExpandedProductCategories,
75
+ zones,
75
76
  } = useContext(ProductSetLoadingContext);
76
77
  const form = useFormContext<ProductSetFormValues>();
77
78
  const [isSelectCategoryVisible, setIsSelectCategoryVisible] = useState(false);
@@ -287,6 +288,7 @@ export function ProductCategoriesControl({
287
288
  quantityType={productCategory.quantityType}
288
289
  hasTicket={productCategory?.hasTicket}
289
290
  stepIndex={stepIndex}
291
+ zones={zones}
290
292
  productCategoryIndex={index}
291
293
  categoryType={productCategory.type}
292
294
  />
@@ -74,6 +74,7 @@ Default.args = {
74
74
  {
75
75
  createdAt: "2023-05-08T15:55:28.000+03:00",
76
76
  deletedAt: null,
77
+ defaultDuration: 30,
77
78
  description: "Zone description 2",
78
79
  id: 2,
79
80
  image: null,
@@ -14,6 +14,7 @@ import { generateUuid } from "@licklist/core/dist/Services";
14
14
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
15
15
 
16
16
  import { CategoryType } from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
17
+ import { Zone } from "@licklist/core/dist/DataMapper/Provider/ZoneDataMapper";
17
18
  import { ProductControl, ProductControlProps, ProductSetFormValues } from "..";
18
19
  import { SortableTree } from "../../sortable-tree";
19
20
  import { CreateProductSetItem } from "../item/CreateProductSetItem";
@@ -32,6 +33,7 @@ interface ProductsControlProps extends WithIsLoading {
32
33
  productCategoryIndex: number;
33
34
  hasTicket?: boolean;
34
35
  categoryType: CategoryType;
36
+ zones?: Zone[];
35
37
  }
36
38
 
37
39
  const getDefaultProductValue = (sort: number): Product => ({
@@ -74,6 +76,7 @@ export function ProductsControl({
74
76
  productCategoryIndex,
75
77
  hasTicket,
76
78
  categoryType,
79
+ zones,
77
80
  }: ProductsControlProps) {
78
81
  const { t } = useTranslation("Design");
79
82
  const form = useFormContext<ProductSetFormValues>();
@@ -89,6 +92,12 @@ export function ProductsControl({
89
92
  getValues,
90
93
  } = form;
91
94
 
95
+ const zoneId = watch(
96
+ `steps.${stepIndex}.productCategories.${productCategoryIndex}.zoneId`
97
+ );
98
+
99
+ const catergoryZone = zones?.find((zone) => zone.id === Number(zoneId));
100
+
92
101
  const productControlFieldName =
93
102
  `steps.${stepIndex}.productCategories.${productCategoryIndex}.products` as const;
94
103
 
@@ -245,6 +254,7 @@ export function ProductsControl({
245
254
  onProductNameChange={onChange}
246
255
  hasTicket={hasTicket}
247
256
  categoryType={categoryType}
257
+ zoneDuration={catergoryZone?.defaultDuration}
248
258
  />
249
259
  }
250
260
  onDelete={() => onProductRemove(index)}
@@ -113,6 +113,7 @@ export interface ProductControlProps<T>
113
113
  productName: string;
114
114
  hasTicket?: boolean;
115
115
  categoryType?: CategoryType;
116
+ zoneDuration?: number;
116
117
  }
117
118
 
118
119
  export function ProductControl<T extends FormValues>({
@@ -126,6 +127,7 @@ export function ProductControl<T extends FormValues>({
126
127
  productName,
127
128
  hasTicket,
128
129
  categoryType,
130
+ zoneDuration,
129
131
  }: ProductControlProps<T>) {
130
132
  const {
131
133
  register,
@@ -190,6 +192,16 @@ export function ProductControl<T extends FormValues>({
190
192
  [handleImageUploading]
191
193
  );
192
194
 
195
+ const onChangeGameCapacity = (value: number) => {
196
+ if (!zoneDuration) {
197
+ return;
198
+ }
199
+ setValue(
200
+ `${fieldNamePrefix}.duration` as Path<T>,
201
+ (value * zoneDuration) as UnpackNestedValue<PathValue<T, Path<T>>>
202
+ );
203
+ };
204
+
193
205
  const onImageRemove = useCallback(
194
206
  (id, path) => {
195
207
  handleImageRemove(String(id), path);
@@ -372,6 +384,14 @@ export function ProductControl<T extends FormValues>({
372
384
  <FormNumberInput
373
385
  fieldName={`${fieldNamePrefix}.capacity`}
374
386
  label={t("capacity")}
387
+ rules={{
388
+ min: {
389
+ value: 1,
390
+ message: t("Validation:fieldRequired", {
391
+ attribute: t("capacity"),
392
+ }) as string,
393
+ },
394
+ }}
375
395
  />
376
396
  </Col>
377
397
  </Row>
@@ -383,7 +403,11 @@ export function ProductControl<T extends FormValues>({
383
403
  <FormNumberInput
384
404
  fieldName={`${fieldNamePrefix}.capacity`}
385
405
  label={t("capacity")}
406
+ onChange={onChangeGameCapacity}
386
407
  rules={{
408
+ required: t("Validation:fieldRequired", {
409
+ attribute: t("capacity"),
410
+ }) as string,
387
411
  min: {
388
412
  value: 1,
389
413
  message: t("Validation:fieldRequired", {
@@ -398,10 +422,13 @@ export function ProductControl<T extends FormValues>({
398
422
  fieldName={`${fieldNamePrefix}.duration`}
399
423
  label={t("durationMinutes")}
400
424
  rules={{
425
+ required: t("Validation:fieldRequired", {
426
+ attribute: t("capacity"),
427
+ }) as string,
401
428
  min: {
402
429
  value: 1,
403
430
  message: t("Validation:fieldRequired", {
404
- attribute: t("duration"),
431
+ attribute: t("capacity"),
405
432
  }) as string,
406
433
  },
407
434
  }}
@@ -66,7 +66,7 @@ export const ProductDurationControl = <T,>({
66
66
  },
67
67
  min: {
68
68
  value: 1,
69
- message: t("Validation:fieldMin", {
69
+ message: t("Validation:fieldMinNumber", {
70
70
  attribute: t("duration"),
71
71
  }),
72
72
  },
@@ -332,7 +332,7 @@ export function ProductCategoryControl({
332
332
  <Row>
333
333
  <Col>
334
334
  <Form.Group controlId={zoneId}>
335
- <Form.Label>Zone</Form.Label>
335
+ <Form.Label>{t("Design:zone")}</Form.Label>
336
336
  <Controller
337
337
  control={control}
338
338
  name={`${fieldNamePrefix}.zoneId`}
@@ -360,12 +360,6 @@ export function ProductCategoryControl({
360
360
  attribute: t("zone"),
361
361
  }),
362
362
  },
363
- validate: (value) => {
364
- if (value) return true;
365
- return t("Validation:fieldRequired", {
366
- attribute: t("zone"),
367
- }) as string;
368
- },
369
363
  }}
370
364
  />
371
365
  <Form.Control.Feedback type="invalid">
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ReactElement } from "react";
2
2
  import { useFormContext } from "react-hook-form";
3
3
  import en from "react-phone-number-input/locale/en.json";
4
4
  import { LocationInputValues } from ".";
@@ -13,7 +13,7 @@ export function LocationInputDescription() {
13
13
  "postcode",
14
14
  "country",
15
15
  ] as const;
16
- const fields = fieldNames.reduce<JSX.Element[]>((acc, field) => {
16
+ const fields = fieldNames.reduce<ReactElement[]>((acc, field) => {
17
17
  const value = values?.[field];
18
18
  if (!value) return acc;
19
19
 
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { Col, Row } from "react-bootstrap";
4
4
  import { useFormContext } from "react-hook-form";
5
5
  import { useTranslation } from "react-i18next";
6
- import { useIntl } from "react-intl";
6
+ import { TIME_FORMAT } from "@licklist/core/dist/Config";
7
7
  import { WorkingHoursInputValues } from ".";
8
8
  import { useWeekdays } from "./utils";
9
9
 
@@ -12,7 +12,9 @@ export function WorkingHoursInputDescription() {
12
12
  const values = watch("workingHours");
13
13
  const weekdays = useWeekdays("short");
14
14
  const { t } = useTranslation("Design");
15
- const { formatTime } = useIntl();
15
+
16
+ if (!values) return null;
17
+
16
18
  return (
17
19
  <>
18
20
  {Array.from({ length: weekdays.length }, (_, i) => i)
@@ -26,16 +28,16 @@ export function WorkingHoursInputDescription() {
26
28
  {weekday?.end
27
29
  ? weekday.start
28
30
  ? t("timeInterval", {
29
- start: formatTime(
30
- DateTime.fromISO(weekday.start).toJSDate()
31
+ start: DateTime.fromISO(weekday.start).toFormat(
32
+ TIME_FORMAT
31
33
  ),
32
- end: formatTime(
33
- DateTime.fromISO(weekday.end).toJSDate()
34
+ end: DateTime.fromISO(weekday.start).toFormat(
35
+ TIME_FORMAT
34
36
  ),
35
37
  })
36
38
  : t("timeFrom", {
37
- start: formatTime(
38
- DateTime.fromISO(weekday.start).toJSDate()
39
+ start: DateTime.fromISO(weekday.start).toFormat(
40
+ TIME_FORMAT
39
41
  ),
40
42
  })
41
43
  : null}
@@ -1,17 +1,19 @@
1
- import React, { useRef } from "react";
1
+ import React, { useEffect, useRef } from "react";
2
2
  import { useId } from "@react-aria/utils";
3
3
  import { DateTime, DurationUnit } from "luxon";
4
4
  import { Col, Form, InputGroup, Row } from "react-bootstrap";
5
5
  import RRule from "rrule";
6
-
6
+ import { DATE_FORMAT } from "@licklist/core/dist/Config";
7
+ import { useTranslation } from "react-i18next";
7
8
  import { SupportedFrequency } from "./utils";
8
9
  import HTMLInputDateElement from "../types/static/HTMLInputDateElement";
9
10
 
10
11
  interface Props {
11
12
  disabled?: boolean;
12
- date: string;
13
+ date: string; // yyyy-mm-ddThh:mm
14
+ minDate?: string; // should be in yyyy-mm-dd format
13
15
  frequency: SupportedFrequency;
14
- until?: string;
16
+ until?: string; // yyyy-mm-dd
15
17
  count?: number;
16
18
  onChange: (values: { until?: string; count?: number }) => void;
17
19
  }
@@ -23,16 +25,31 @@ function RecurrenceEndInput({
23
25
  until,
24
26
  count,
25
27
  onChange,
28
+ minDate,
26
29
  }: Props) {
30
+ const { t } = useTranslation("Design");
27
31
  // unique ids for radios
28
32
  const neverId = useId();
29
33
  const onId = useId();
30
34
  const afterId = useId();
31
35
  const dateInput = useRef<HTMLInputDateElement | null>(null);
32
36
 
37
+ useEffect(() => {
38
+ const untilDatetime = DateTime.fromFormat(
39
+ until ?? getUntil({ date, frequency }),
40
+ DATE_FORMAT
41
+ );
42
+
43
+ const minDatetime = DateTime.fromFormat(minDate, DATE_FORMAT);
44
+
45
+ if (minDatetime > untilDatetime) {
46
+ onChange({ until: minDate });
47
+ }
48
+ }, [minDate, onChange, until, date, frequency]);
49
+
33
50
  return (
34
51
  <Form.Group>
35
- <Form.Label>Ends</Form.Label>
52
+ <Form.Label>{t("ends")}</Form.Label>
36
53
 
37
54
  <Form.Check type="radio" id={neverId} custom className="mt-3">
38
55
  <Form.Check.Input
@@ -41,7 +58,7 @@ function RecurrenceEndInput({
41
58
  onChange={() => onChange({ count: 500 })}
42
59
  disabled={disabled}
43
60
  />
44
- <Form.Check.Label>Never</Form.Check.Label>
61
+ <Form.Check.Label>{t("never")}</Form.Check.Label>
45
62
  </Form.Check>
46
63
 
47
64
  <Form.Check type="radio" id={onId} custom className="mt-3">
@@ -55,11 +72,12 @@ function RecurrenceEndInput({
55
72
  }
56
73
  disabled={disabled}
57
74
  />
58
- <Form.Check.Label>On</Form.Check.Label>
75
+ <Form.Check.Label>{t("on")}</Form.Check.Label>
59
76
  </Col>
60
77
  <Col>
61
78
  <Form.Control
62
79
  type="date"
80
+ min={minDate}
63
81
  disabled={disabled || !until}
64
82
  aria-label="Date on which the recurrence ends"
65
83
  value={until ?? getUntil({ date, frequency })}
@@ -83,7 +101,7 @@ function RecurrenceEndInput({
83
101
  }
84
102
  disabled={disabled}
85
103
  />
86
- <Form.Check.Label>After</Form.Check.Label>
104
+ <Form.Check.Label>{t("after")}</Form.Check.Label>
87
105
  </Col>
88
106
  <Col>
89
107
  <InputGroup>
@@ -99,7 +117,7 @@ function RecurrenceEndInput({
99
117
  }
100
118
  />
101
119
  <InputGroup.Append>
102
- <InputGroup.Text>occurrences</InputGroup.Text>
120
+ <InputGroup.Text>{t("occurences")}</InputGroup.Text>
103
121
  </InputGroup.Append>
104
122
  </InputGroup>
105
123
  </Col>
@@ -109,7 +127,7 @@ function RecurrenceEndInput({
109
127
  );
110
128
  }
111
129
 
112
- const defaultOccurrences = {
130
+ export const defaultOccurrences = {
113
131
  [RRule.DAILY]: 30,
114
132
  [RRule.WEEKLY]: 13,
115
133
  [RRule.MONTHLY]: 12,
@@ -3,7 +3,7 @@
3
3
  import { DateTime } from "luxon";
4
4
  import React, { useEffect, useReducer } from "react";
5
5
  import RRule, { Frequency, Weekday } from "rrule";
6
- import RecurrenceEndInput from "./RecurrenceEndInput";
6
+ import RecurrenceEndInput, { defaultOccurrences } from "./RecurrenceEndInput";
7
7
  import RecurrenceIntervalAndFrequencyInput from "./RecurrenceIntervalAndFrequencyInput";
8
8
  import RecurrenceMonthlyRepeatByInput from "./RecurrenceMonthlyRepeatByInput";
9
9
  import RecurrenceWeekdaysInput from "./RecurrenceWeekdaysInput";
@@ -16,6 +16,7 @@ import {
16
16
  export interface RecurrenceInputProps {
17
17
  disabled?: boolean;
18
18
  date: string;
19
+ minDate?: string;
19
20
  value?: string;
20
21
  onChange: (value: string) => void;
21
22
  initialFrequency?: Frequency;
@@ -24,6 +25,7 @@ export interface RecurrenceInputProps {
24
25
  export function RecurrenceInput({
25
26
  disabled = false,
26
27
  date,
28
+ minDate,
27
29
  value,
28
30
  onChange,
29
31
  initialFrequency = Frequency.WEEKLY,
@@ -82,6 +84,7 @@ export function RecurrenceInput({
82
84
  )}
83
85
  <RecurrenceEndInput
84
86
  date={date}
87
+ minDate={minDate}
85
88
  frequency={state.freq}
86
89
  until={state.until && DateTime.fromJSDate(state.until).toISODate()}
87
90
  count={state.count}
@@ -130,5 +133,12 @@ const getInitialState = ({
130
133
  byweekday = options.byweekday[0];
131
134
  }
132
135
 
133
- return { ...options, byweekday };
136
+ return {
137
+ ...options,
138
+ count:
139
+ options?.count || options.until
140
+ ? options.count
141
+ : defaultOccurrences[options.freq],
142
+ byweekday,
143
+ };
134
144
  };