@licklist/design 0.69.7-dev.0 → 0.69.7

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 (156) hide show
  1. package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
  2. package/dist/auth/Login/LoginComponent.js +1 -2
  3. package/dist/calendar/utils/index.d.ts +2 -8
  4. package/dist/calendar/utils/index.d.ts.map +1 -1
  5. package/dist/calendar/utils/index.js +21 -9
  6. package/dist/date-time-button/DateContent.d.ts.map +1 -1
  7. package/dist/date-time-button/DateContent.js +3 -3
  8. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +6 -6
  10. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -2
  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/events/event-card/EventCard.js +2 -2
  14. package/dist/events/event-card/utils.d.ts +2 -2
  15. package/dist/events/event-card/utils.d.ts.map +1 -1
  16. package/dist/events/event-card/utils.js +18 -14
  17. package/dist/iframe/activity-card/ActivityCard.d.ts +1 -3
  18. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  19. package/dist/iframe/activity-card/ActivityCard.js +1 -8
  20. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  21. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
  22. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  23. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
  24. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  25. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  26. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  27. package/dist/iframe/ryft/utils/ryft-form.js +3 -3
  28. package/dist/layout/DropDown.d.ts +1 -2
  29. package/dist/layout/DropDown.d.ts.map +1 -1
  30. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  31. package/dist/notification/email-template/control/EmailTemplateControl.js +0 -3
  32. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  33. package/dist/product-set/control/DateInput.js +5 -6
  34. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  35. package/dist/product-set/form/ProductCategoriesControl.js +2 -48
  36. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  37. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  38. package/dist/product-set/form/ProductSetForm.js +2 -57
  39. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  40. package/dist/product-set/form/ProductZonesControl.js +2 -0
  41. package/dist/product-set/form/ProductsControl.js +0 -1
  42. package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
  43. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  44. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  45. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  46. package/dist/product-set/form/SubProductsControl.js +3 -0
  47. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  48. package/dist/product-set/form/VenueMapsControl.js +3 -0
  49. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  50. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  51. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
  52. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  53. package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
  54. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  55. package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
  56. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  57. package/dist/product-set/product/price/ProductPriceControl.js +0 -3
  58. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  59. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
  60. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  61. package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
  62. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  63. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
  64. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  65. package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
  66. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  67. package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
  68. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  69. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  70. package/dist/resource/form/components/CapacityControl.js +0 -3
  71. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  72. package/dist/resource/form/components/SortControl.js +0 -3
  73. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  74. package/dist/sales/booking/results/components/ResultCard.js +2 -0
  75. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  76. package/dist/sales/coupon/control/CouponFormControl.js +0 -21
  77. package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
  78. package/dist/setting/admin/PaymentFeeForm.js +1 -16
  79. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  80. package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
  81. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  82. package/dist/snippet/snippet-template/preview/Preview.js +0 -6
  83. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  84. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  85. package/dist/sortable-tree/SortableTreeItem.js +4 -10
  86. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  87. package/dist/static/CurrencyNumberInput.js +0 -3
  88. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  89. package/dist/static/form-number-input/FormNumberInput.js +0 -3
  90. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  91. package/dist/static/number-input/NumberInput.js +0 -3
  92. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
  93. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  94. package/dist/styles/product-set/ProductSetForm.scss +0 -22
  95. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
  96. package/dist/styles/sales/BookingResults.scss +1 -1
  97. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  98. package/dist/zone/form/components/GameDurationControl.js +0 -3
  99. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  100. package/dist/zone/form/components/SortControl.js +0 -3
  101. package/package.json +6 -8
  102. package/src/affiliate/form/AffiliateForm.tsx +0 -1
  103. package/src/auth/Login/LoginComponent.tsx +1 -1
  104. package/src/calendar/utils/index.ts +26 -17
  105. package/src/date-time-button/DateContent.tsx +3 -3
  106. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +10 -12
  107. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
  108. package/src/events/event-card/EventCard.tsx +2 -2
  109. package/src/events/event-card/utils.ts +25 -16
  110. package/src/iframe/activity-card/ActivityCard.tsx +0 -6
  111. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
  112. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
  113. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  114. package/src/iframe/ryft/RyftPaymentForm.tsx +5 -2
  115. package/src/iframe/ryft/utils/ryft-form.ts +3 -5
  116. package/src/layout/DropDown.tsx +1 -1
  117. package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
  118. package/src/product-set/control/DateInput.tsx +2 -5
  119. package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
  120. package/src/product-set/form/ProductSetForm.tsx +3 -15
  121. package/src/product-set/form/ProductZonesControl.tsx +4 -1
  122. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  123. package/src/product-set/form/SubProductsControl.tsx +3 -0
  124. package/src/product-set/form/VenueMapsControl.tsx +3 -0
  125. package/src/product-set/product/ProductControl.tsx +1 -0
  126. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
  127. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
  128. package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
  129. package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
  130. package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
  131. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
  132. package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
  133. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
  134. package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
  135. package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
  136. package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
  137. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
  138. package/src/resource/form/components/CapacityControl.tsx +0 -1
  139. package/src/resource/form/components/SortControl.tsx +0 -1
  140. package/src/sales/booking/results/components/ResultCard.tsx +2 -0
  141. package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
  142. package/src/setting/admin/PaymentFeeForm.tsx +0 -5
  143. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
  144. package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
  145. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  146. package/src/static/CurrencyNumberInput.tsx +0 -1
  147. package/src/static/form-number-input/FormNumberInput.tsx +0 -1
  148. package/src/static/number-input/NumberInput.tsx +0 -1
  149. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
  150. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  151. package/src/styles/product-set/ProductSetForm.scss +0 -22
  152. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
  153. package/src/styles/sales/BookingResults.scss +1 -1
  154. package/src/zone/form/components/GameDurationControl.tsx +0 -1
  155. package/src/zone/form/components/SortControl.tsx +0 -1
  156. package/yarn.lock +44 -25
@@ -6,9 +6,9 @@ import {
6
6
  } from '@licklist/core/dist/Config'
7
7
  import { getDayWithOrdinal } from '@licklist/plugins/dist/utils/formatDate'
8
8
  import clsx from 'clsx'
9
+ import { isToday, isTomorrow } from 'date-fns'
9
10
  import { DateTime } from 'luxon'
10
11
  import { useTranslation } from 'react-i18next'
11
- import { isToday, isTomorrow } from '@licklist/plugins/dist'
12
12
  import { DateTimeButtonProps, Variant } from './DateTimeButton'
13
13
 
14
14
  type DateContentProps = Pick<
@@ -55,9 +55,9 @@ export const DateContent = ({
55
55
  }
56
56
 
57
57
  const getDate = (date: DateTime): string => {
58
- if (isToday(date)) return 'today'
58
+ if (isToday(date.toJSDate())) return 'today'
59
59
 
60
- if (isTomorrow(date)) return 'tomorrow'
60
+ if (isTomorrow(date.toJSDate())) return 'tomorrow'
61
61
 
62
62
  return date.toFormat(DAY_OF_WEEK)
63
63
  }
@@ -5,7 +5,6 @@ import { useId } from '@react-aria/utils'
5
5
  import { Controller, useFormContext } from 'react-hook-form'
6
6
  import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
7
7
  import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
8
- import { uniqBy } from 'lodash'
9
8
  import { getTypeHeadItemsFromMenus } from '../../../../product-set/utils'
10
9
  import { ConfirmModal } from '../../../../modals/confirmation/ConfirmModal'
11
10
  import { EditEventFormValues } from '../EditEventForm/EditEventForm'
@@ -53,17 +52,16 @@ export const SelectEventProductSet = ({
53
52
  const productSetId = watch('productSetId')
54
53
  const editedProductSet = watch('editedProductSet')
55
54
 
56
- const typeheadValues = uniqBy(
57
- getTypeHeadItemsFromMenus(
58
- editedProductSet
59
- ? productSets.map((productSet) =>
60
- productSet.id === editedProductSet.id
61
- ? editedProductSet
62
- : productSet,
63
- )
64
- : productSets,
65
- ),
66
- (item) => item.id,
55
+ const typeheadValues = getTypeHeadItemsFromMenus(
56
+ editedProductSet
57
+ ? productSets.map((productSet) => {
58
+ if (productSet.id === editedProductSet.id) {
59
+ return editedProductSet
60
+ }
61
+
62
+ return productSet
63
+ })
64
+ : productSets,
67
65
  )
68
66
  const selectedProductSetTypeheadValue = productSetId
69
67
  ? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
@@ -39,6 +39,7 @@ export const getDefaultValues = (
39
39
  ...product,
40
40
  subProducts: subProducts?.map(({ ...subProducts }) => ({
41
41
  ...subProducts,
42
+ originalProductId: null,
42
43
  productCategoryId: undefined,
43
44
  })),
44
45
  productCategoryId: undefined,
@@ -23,7 +23,7 @@ import { Sale } from '../../types/bookings'
23
23
  import { TipTapEditor } from '../../tiptap-editor/TipTapEditor'
24
24
  import {
25
25
  EVENT_DESCRIPTION_SIZE,
26
- formatContent,
26
+ formatContentWithoutTags,
27
27
  getStatisticInfo,
28
28
  } from './utils'
29
29
  import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
@@ -66,7 +66,7 @@ export function EventCard({
66
66
  const { formatNumber, formatDate } = useIntl()
67
67
  const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
68
68
  const memoedContent = useMemo(
69
- () => formatContent(description, EVENT_DESCRIPTION_SIZE),
69
+ () => formatContentWithoutTags(description, EVENT_DESCRIPTION_SIZE),
70
70
  [description],
71
71
  )
72
72
 
@@ -2,26 +2,35 @@ import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config'
2
2
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
3
3
  import { DateTime } from 'luxon'
4
4
 
5
- export const MIN_EVENT_DESCRIPTION_SIZE = 150;
6
- export const EVENT_DESCRIPTION_SIZE = 350;
7
- export const EMOJI_REGEX = /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g;
8
-
9
- export const formatContent = (content, maxLength = EVENT_DESCRIPTION_SIZE) => {
10
- if (!content) return '';
11
-
12
- const replacedContent = replaceEmojiImagesWithText(content);
13
-
14
- if (replacedContent.length <= maxLength) {
15
- return replacedContent;
16
- }
5
+ export function formatContent(content, maxSymbols) {
6
+ if (!content) return ''
7
+ if (content.length > maxSymbols) return `${content.slice(0, maxSymbols)}...`
8
+ return content
9
+ }
17
10
 
18
- return replacedContent.slice(0, maxLength).concat('...');
19
- };
11
+ export const formatContentWithoutTags = (
12
+ content,
13
+ maxLength = EVENT_DESCRIPTION_SIZE,
14
+ ) => {
15
+ if (!content) return ''
16
+ if (content < maxLength) return content
17
+ const text = content.replace(/<[^>]*>/g, '')
18
+ const trimmedText = text
19
+ .trim()
20
+ .replace(/&nbsp;|[^a-zA-Z0-9\s]/g, '')
21
+ .replace(/\s\s+/g, ' ')
20
22
 
21
- function replaceEmojiImagesWithText(text) {
22
- return text.replace(EMOJI_REGEX, (_, emojiText) => emojiText);
23
+ const words = trimmedText.slice(0, maxLength).split(' ')
24
+ const contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE)
25
+ const index = String(content).indexOf(words[words.length - 2])
26
+ const slicedContent = content.slice(0, index)
27
+ const minSizeContent = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent
28
+ return minSizeContent.concat('...')
23
29
  }
24
30
 
31
+ export const MIN_EVENT_DESCRIPTION_SIZE = 150
32
+ export const EVENT_DESCRIPTION_SIZE = 350
33
+
25
34
  /**
26
35
  * Calculate the total number of views from the given dates and event statistic.
27
36
  *
@@ -1,8 +1,6 @@
1
1
  import { ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
3
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
4
- import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
5
- import { AvailabilityIndicator } from '../../availability-indicator'
6
4
 
7
5
  export const LAYOUT_GRID = 'grid'
8
6
  export const LAYOUT_LIST = 'list'
@@ -17,7 +15,6 @@ export type ActivityCardProps = {
17
15
  layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST
18
16
  availableTimes?: string | null
19
17
  image?: Image | null
20
- resources?: ZoneResourcesAvailability
21
18
  }
22
19
 
23
20
  export const ActivityCard = ({
@@ -30,7 +27,6 @@ export const ActivityCard = ({
30
27
  onSelect,
31
28
  isSelected,
32
29
  layout = LAYOUT_GRID,
33
- resources,
34
30
  }: ActivityCardProps) => {
35
31
  if (layout === LAYOUT_GRID) {
36
32
  return (
@@ -50,7 +46,6 @@ export const ActivityCard = ({
50
46
  {description && (
51
47
  <div className='mt-2 activity-card-description'>{description}</div>
52
48
  )}
53
- {resources && <AvailabilityIndicator resources={resources} />}
54
49
  </div>
55
50
  </button>
56
51
  )
@@ -76,7 +71,6 @@ export const ActivityCard = ({
76
71
  {description && (
77
72
  <div className='mt-2 activity-card-description'>{description}</div>
78
73
  )}
79
- {resources && <AvailabilityIndicator resources={resources} />}
80
74
  </div>
81
75
 
82
76
  <hr className='list-activity-card-hr' />
@@ -89,7 +89,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
89
89
  <FormControl
90
90
  type='number'
91
91
  onChange={(e) => handleChangeValue(Number(e.target.value))}
92
- onWheel={(event) => event.currentTarget.blur()}
93
92
  value={value}
94
93
  min={0}
95
94
  max={max}
@@ -102,14 +101,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
102
101
  <button
103
102
  type='button'
104
103
  onClick={handleArrowUpClick}
105
- onWheel={(event) => event.currentTarget.blur()}
106
- onFocus={(event) =>
107
- event.target.addEventListener(
108
- 'wheel',
109
- (event) => event.preventDefault(),
110
- { passive: false },
111
- )
112
- }
113
104
  className={`payment-number-input__btn-up ${
114
105
  plusButtonGreyedOut && 'disabled-number-input-button'
115
106
  }`}
@@ -51,7 +51,6 @@ export const ProductQuantityInput = ({
51
51
  hasDeposit: category.allowDeposits && product?.deposit < product.price,
52
52
  price: product.price,
53
53
  productCategoryId: category.id,
54
- zoneId: category.zone?.id,
55
54
  quantity,
56
55
  capacity: product?.capacity,
57
56
  })
@@ -61,7 +61,6 @@ const processedPaymentSummary = ({
61
61
  const total = calculateTotalPrice(order, externalPaymentDetail)
62
62
 
63
63
  const totalDiscount = calculateTotalDiscount(order.payments)
64
-
65
64
  let summaryItems: SummaryItem[] = [
66
65
  {
67
66
  translateKey: AMOUNT_TOTAL,
@@ -219,9 +219,12 @@ export const RyftPaymentForm = ({
219
219
  onSubmit={methods.handleSubmit(handleSubmit)}
220
220
  className='ryft-payment-form'
221
221
  >
222
- <div className='form-disable-box' id='form-disable-box' />
222
+ <div className='form-disable-box' id="form-disable-box"/>
223
223
  <div className='submit-button-wrapper mt-4 p-1'>
224
- <Button type='submit' disabled={isBtnDisabled || !isValid}>
224
+ <Button
225
+ type='submit'
226
+ disabled={isBtnDisabled || !isValid}
227
+ >
225
228
  {isBtnDisabled && <ButtonLoader />}
226
229
  {t('Design:buyNow')}
227
230
  </Button>
@@ -61,19 +61,17 @@ export const injectComponentsInRyftForm = ({
61
61
  divider.id = 'mobile-pay-divider'
62
62
  container.id = 'mobile-pay-divider-container'
63
63
  container.append(dividerText, divider)
64
- const payIframe = document.getElementById('ryft-pay-iframe')
64
+ const payIframe = document.getElementById("ryft-pay-iframe");
65
65
  if (payIframe) {
66
66
  const formBox = document.getElementById('form-disable-box')
67
67
  if (formBox) {
68
- formBox.style.display = isDisableButton ? 'block' : 'none'
68
+ formBox.style.display = isDisableButton ? "block" : "none"
69
69
  }
70
70
 
71
71
  const googleButton = document.getElementById(
72
72
  'gpay-button-online-api-id',
73
73
  ) as HTMLButtonElement
74
- const appleButton = document.getElementById(
75
- 'ryft-pay-apple-pay-button',
76
- ) as HTMLButtonElement
74
+ const appleButton =document.getElementById("ryft-pay-apple-pay-button") as HTMLButtonElement
77
75
  if (googleButton) {
78
76
  googleButton.disabled = isDisableButton
79
77
  googleButton.style.opacity = isDisableButton ? '1' : '0.6'
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from 'react'
1
+ import { forwardRef } from 'react'
2
2
 
3
3
  interface Props {
4
4
  children?: React.ReactNode | React.ReactNode[]
@@ -434,7 +434,6 @@ export const EmailTemplateControl = forwardRef(
434
434
  `templateOptionValues.${option?.id}.value`,
435
435
  )}
436
436
  type='number'
437
- onWheel={(event) => event.currentTarget.blur()}
438
437
  placeholder={t(`Design:${option.name}`)}
439
438
  id={option.name + option.id}
440
439
  defaultValue={option.selectedValue || ''}
@@ -195,8 +195,6 @@ export const DateInput = ({
195
195
  }, 100)
196
196
  }
197
197
 
198
- const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
199
-
200
198
  return (
201
199
  <Form.Group>
202
200
  <Form.Label>
@@ -249,8 +247,7 @@ export const DateInput = ({
249
247
  menuRecurrence={menuRecurrence}
250
248
  onEdit={() => handleOnEdit(menuRecurrence, index)}
251
249
  errorMessage={
252
- errors?.menuRecurrences?.[`${index}`]?.availableTimes
253
- ?.message || errors?.menuRecurrences?.[`${index}`]?.message
250
+ errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
254
251
  }
255
252
  />
256
253
  ))}
@@ -285,7 +282,7 @@ export const DateInput = ({
285
282
  />
286
283
 
287
284
  <div className='manual-form-error'>
288
- {errorMessage}
285
+ {errors.menuRecurrences?.message}
289
286
  </div>
290
287
  </div>
291
288
  </OverlayTrigger>
@@ -8,7 +8,6 @@ import {
8
8
  useFormContext,
9
9
  useWatch,
10
10
  } from 'react-hook-form'
11
- import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from 'react-icons/fa'
12
11
  import { useTranslation } from 'react-i18next'
13
12
  import { useSensor, MouseSensor } from '@dnd-kit/core'
14
13
  import {
@@ -26,11 +25,7 @@ import { ProductCategoryControl } from '../product-category'
26
25
  import { ProductCategory } from '../types'
27
26
  import { ProductsControl } from './ProductsControl'
28
27
  import { ProductSetFormValues, WithIsLoading } from './ProductSetForm'
29
- import {
30
- SelectCategoryModal,
31
- CATEGORY_TYPES_NAMES,
32
- CategoryConfig,
33
- } from './SelectCategoryModal'
28
+ import { SelectCategoryModal } from './SelectCategoryModal'
34
29
  import { ProductSetLoadingContext } from './context'
35
30
  import { VenueMapSetModal } from './VenueMapSetModal'
36
31
  import { moveArrayElements, sortArrayByIndex } from '../utils'
@@ -38,29 +33,6 @@ import { useSortableTreeFunctions } from '../hooks/useSortableTreeFunctions'
38
33
  // @TODO not for first release
39
34
  // import Popover from "./ProductSetFormPopover";
40
35
 
41
- const CATEGORIES_TYPE: Partial<Record<CategoryType, CategoryConfig>> = {
42
- [CATEGORY_TYPES_NAMES.tickets]: {
43
- label: 'tickets',
44
- icon: <FaTicketAlt color='#0e8ce2' size={10} />,
45
- },
46
- [CATEGORY_TYPES_NAMES.bookings]: {
47
- label: 'bookings',
48
- icon: <FaCalendar color='#0e8ce2' size={10} />,
49
- },
50
- [CATEGORY_TYPES_NAMES.menuItems]: {
51
- label: 'menuItems',
52
- icon: <FaBars color='#0e8ce2' size={10} />,
53
- },
54
- [CATEGORY_TYPES_NAMES.game]: {
55
- label: 'game',
56
- icon: <FaBowlingBall color='#0e8ce2' size={10} />,
57
- },
58
- [CATEGORY_TYPES_NAMES.fixedDuration]: {
59
- label: 'fixedDuration',
60
- icon: <FaCalendar color='#0e8ce2' size={10} />,
61
- },
62
- }
63
-
64
36
  interface ProductCategoriesControlProps extends WithIsLoading {
65
37
  stepIndex: number
66
38
  isOverrides?: boolean
@@ -256,8 +228,6 @@ export function ProductCategoriesControl({
256
228
  setIsExpanded(productCategoryId)
257
229
  }
258
230
 
259
- const categoryType = CATEGORIES_TYPE[productCategory.type]
260
-
261
231
  return (
262
232
  <Controller
263
233
  key={`product-category-${productCategory._id}`}
@@ -302,12 +272,6 @@ export function ProductCategoriesControl({
302
272
  )}
303
273
  modalClass={ProductSetModalClasses.category}
304
274
  isNewAdded={showCategoryModal}
305
- itemButton={
306
- <div className='btn-outline-primary item-icon sm border border-primary rounded-sm'>
307
- {categoryType.icon}
308
- <span className='ml-2'>{t(categoryType.label)}</span>
309
- </div>
310
- }
311
275
  body={
312
276
  <ProductCategoryControl
313
277
  isLoading={isLoading}
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react'
1
+ import { useEffect } from 'react'
2
2
  import { FormValues } from '@licklist/plugins/dist/types/services/Form/hook-form-service'
3
3
  import { Button, Form, Col, Row } from 'react-bootstrap'
4
4
  import { FormProvider, useForm } from 'react-hook-form'
@@ -12,7 +12,7 @@ import { isEqual } from 'lodash'
12
12
  import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
13
13
  import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
14
14
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
15
- import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
15
+ import { transformErrorToMessage } from '@licklist/plugins'
16
16
  import { Dialog, useDialogContext } from '../../modals/dialog'
17
17
  import {
18
18
  ProductSetControl,
@@ -23,21 +23,16 @@ import { Step } from '../types'
23
23
  import { ProductSetContextProvider, ProductSetLoadingContext } from './context'
24
24
  import { SelectItem } from '../../types/generic/SelectItem'
25
25
  import { checkAvailableTimesErrors, getFilteredTemplates } from '../utils'
26
- import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
27
26
 
28
27
  export interface WithIsLoading {
29
28
  isLoading: boolean
30
29
  }
31
- export interface WithIdOptional {
32
- id?: number
33
- }
34
-
35
30
  export interface WithId {
36
31
  id: number
37
32
  }
38
33
  export interface ProductSetFormValues
39
34
  extends FormValues,
40
- WithIdOptional,
35
+ WithId,
41
36
  ProductSetControlValues {
42
37
  steps: Step[]
43
38
  isOverrides?: boolean
@@ -90,7 +85,6 @@ export function ProductSetForm({
90
85
  onApproveDialog,
91
86
  onDeclineDialog,
92
87
  } = useDialogContext()
93
- const [errorMessage, setErrorMessage] = useState('')
94
88
 
95
89
  const form = useForm<ProductSetFormValues>({
96
90
  defaultValues,
@@ -172,12 +166,6 @@ export function ProductSetForm({
172
166
  onDecline={onDeclineDialog}
173
167
  />
174
168
 
175
- <ErrorModal
176
- message={errorMessage}
177
- isOpen={!!errorMessage}
178
- onClose={() => setErrorMessage('')}
179
- />
180
-
181
169
  <FormProvider {...form}>
182
170
  <Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
183
171
  <ProductSetLoadingContext.Consumer>
@@ -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,
@@ -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]: {
@@ -70,6 +70,9 @@ export function SubProductsControl({
70
70
  images: subProducts[index]?.images as Image[],
71
71
  }
72
72
  // @ts-expect-error TS2345
73
+ // @TODO fix prod type error
74
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
75
+ // @ts-ignore
73
76
  append(subProductCopy)
74
77
  }}
75
78
  />
@@ -46,6 +46,9 @@ export const VenueMapsControl = ({
46
46
  url={image.url}
47
47
  name={name}
48
48
  points={points}
49
+ // @TODO fix prod type error
50
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
51
+ // @ts-ignore
49
52
  products={products}
50
53
  pointProducts={pointProducts}
51
54
  onPointProductsChange={onPointProductsChange}
@@ -34,6 +34,7 @@ import {
34
34
  } from 'react-hook-form'
35
35
  import { useTranslation } from 'react-i18next'
36
36
  import { useImages } from '@licklist/plugins/dist/hooks/Media/useImages'
37
+
37
38
  import {
38
39
  Image,
39
40
  IMAGE_TYPE_IMAGE,
@@ -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'
@@ -86,7 +86,6 @@ export function ProductBookingManagementControl<T extends FormValues>(
86
86
  <Form.Control
87
87
  ref={ref}
88
88
  type='number'
89
- onWheel={(event) => event.currentTarget.blur()}
90
89
  min={0}
91
90
  step={1}
92
91
  value={value as string}
@@ -130,7 +129,6 @@ export function ProductBookingManagementControl<T extends FormValues>(
130
129
  <Form.Control
131
130
  ref={ref}
132
131
  type='number'
133
- onWheel={(event) => event.currentTarget.blur()}
134
132
  min='0'
135
133
  step='1'
136
134
  value={value as string}
@@ -50,7 +50,6 @@ export function ProductDepositControl<T extends FormValues>(
50
50
  <Form.Control
51
51
  ref={ref}
52
52
  type='number'
53
- onWheel={(event) => event.currentTarget.blur()}
54
53
  min={0}
55
54
  max={Number(totalPrice)}
56
55
  step='0.01'
@@ -91,7 +91,6 @@ export const ProductDurationControl = <T,>({
91
91
  <Form.Control
92
92
  type='number'
93
93
  min={0}
94
- onWheel={(event) => event.currentTarget.blur()}
95
94
  step={1}
96
95
  value={durationHours}
97
96
  disabled={disabled}
@@ -128,7 +127,6 @@ export const ProductDurationControl = <T,>({
128
127
  type='number'
129
128
  min={0}
130
129
  step={1}
131
- onWheel={(event) => event.currentTarget.blur()}
132
130
  disabled={disabled}
133
131
  value={durationMinutes}
134
132
  isInvalid={isInvalid}
@@ -59,7 +59,6 @@ export function ProductPriceControl<T extends FormValues>({
59
59
  ref={ref}
60
60
  type='number'
61
61
  min={0}
62
- onWheel={(event) => event.currentTarget.blur()}
63
62
  max={999999.99}
64
63
  step='0.01'
65
64
  value={value as string}
@@ -111,7 +111,6 @@ export function ProductQuantityConstantControl<T extends FormValues>(
111
111
  type='number'
112
112
  min={0}
113
113
  step={1}
114
- onWheel={(event) => event.currentTarget.blur()}
115
114
  value={value as string}
116
115
  isInvalid={HookFormService.isInvalid<T>(
117
116
  `${fieldNamePrefix}.totalQuantity` as Path<T>,
@@ -166,7 +165,6 @@ export function ProductQuantityConstantControl<T extends FormValues>(
166
165
  type='number'
167
166
  min={0}
168
167
  step={1}
169
- onWheel={(event) => event.currentTarget.blur()}
170
168
  value={value as string}
171
169
  onChange={onChange}
172
170
  onFocus={onFocus}
@@ -85,7 +85,6 @@ export function ProductQuantityControl<T extends FormValues>(
85
85
  type='number'
86
86
  min={0}
87
87
  step={1}
88
- onWheel={(event) => event.currentTarget.blur()}
89
88
  value={value as string}
90
89
  onChange={onChange}
91
90
  onFocus={onFocus}
@@ -144,7 +143,6 @@ export function ProductQuantityControl<T extends FormValues>(
144
143
  type='number'
145
144
  min={0}
146
145
  step={1}
147
- onWheel={(event) => event.currentTarget.blur()}
148
146
  value={value && (value as string)}
149
147
  onFocus={onFocus}
150
148
  onChange={onChange}
@@ -69,7 +69,6 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
69
69
  type='number'
70
70
  min={0}
71
71
  step={1}
72
- onWheel={(event) => event.currentTarget.blur()}
73
72
  {...register(`${fieldNamePrefix}.totalQuantity` as Path<T>, {
74
73
  validate: (value) => {
75
74
  if (unlimited) return true
@@ -216,7 +216,6 @@ export function ProductCategoryControl({
216
216
  step={1}
217
217
  value={value === null ? '' : value}
218
218
  onChange={onChange}
219
- onWheel={(event) => event.currentTarget.blur()}
220
219
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
221
220
  `${fieldNamePrefix}.minSubItems` as const,
222
221
  errors,
@@ -289,7 +288,6 @@ export function ProductCategoryControl({
289
288
  name={name}
290
289
  value={value === null ? '' : value}
291
290
  onChange={onChange}
292
- onWheel={(event) => event.currentTarget.blur()}
293
291
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
294
292
  `${fieldNamePrefix}.maxSubItems` as const,
295
293
  errors,
@@ -350,7 +348,6 @@ export function ProductCategoryControl({
350
348
  min={0}
351
349
  step={1}
352
350
  type='number'
353
- onWheel={(event) => event.currentTarget.blur()}
354
351
  disabled={isOverride}
355
352
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
356
353
  `${fieldNamePrefix}.overallQuantity`,
@@ -533,7 +530,6 @@ export function ProductCategoryControl({
533
530
  step={1}
534
531
  value={value}
535
532
  onChange={onChange}
536
- onWheel={(event) => event.currentTarget.blur()}
537
533
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
538
534
  `${fieldNamePrefix}.remainderExpireAfter` as const,
539
535
  errors,
@@ -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,
@@ -109,7 +109,6 @@ function RecurrenceEndInput({
109
109
  type='number'
110
110
  min={1}
111
111
  max={500}
112
- onWheel={(event) => event.currentTarget.blur()}
113
112
  disabled={disabled || !count || count === 500}
114
113
  aria-label='Occurrence count'
115
114
  value={count ?? defaultOccurrences[frequency]}