@licklist/design 0.78.5-dev.19 → 0.78.5-dev.21

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 (148) hide show
  1. package/dist/auth/ChangePassword/ChangePasswordComponent.d.ts.map +1 -1
  2. package/dist/auth/ChangePassword/ChangePasswordComponent.js +5 -4
  3. package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
  4. package/dist/auth/Login/LoginComponent.js +12 -7
  5. package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
  6. package/dist/auth/Register/RegisterComponent.js +5 -4
  7. package/dist/auth/ResetPassword/ResetPasswordComponent.d.ts.map +1 -1
  8. package/dist/auth/ResetPassword/ResetPasswordComponent.js +5 -4
  9. package/dist/auth/Social/SocialCallbackComponent.d.ts.map +1 -1
  10. package/dist/auth/Social/SocialCallbackComponent.js +5 -2
  11. package/dist/auth/Social/SocialFormComponent.d.ts.map +1 -1
  12. package/dist/auth/Social/SocialFormComponent.js +4 -4
  13. package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.d.ts.map +1 -1
  14. package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.js +5 -4
  15. package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
  16. package/dist/events/edit-event-modal/IntervalInput.js +5 -1
  17. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts +2 -1
  18. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
  19. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.js +3 -2
  20. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +3 -2
  21. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  22. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
  23. package/dist/events/event-card/EventCard.d.ts +1 -1
  24. package/dist/events/event-card/EventCard.d.ts.map +1 -1
  25. package/dist/events/event-card/EventCard.js +1 -1
  26. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
  27. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
  28. package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
  29. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
  30. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
  31. package/dist/events/event-statistic-modal/hooks/useTableData.js +2 -1
  32. package/dist/events/event-statistic-modal/utils/index.js +3 -3
  33. package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
  34. package/dist/events/event-venue-map/EventVenueMap.js +1 -0
  35. package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
  36. package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
  37. package/dist/file-upload/FileUpload.d.ts.map +1 -1
  38. package/dist/file-upload/FileUpload.js +4 -4
  39. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
  40. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +4 -11
  41. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  42. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  43. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +13 -0
  44. package/dist/iframe/payment/payment-page/PaymentPage.js +8 -4
  45. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  46. package/dist/iframe/ryft/RyftPaymentForm.js +19 -45
  47. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  48. package/dist/iframe/ryft/utils/ryft-form.js +4 -5
  49. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  50. package/dist/notification/email-template/control/EmailTemplateControl.js +6 -3
  51. package/dist/product-set/control/ProductSetControl.js +2 -1
  52. package/dist/product-set/form/ProductSetForm.d.ts +4 -1
  53. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  54. package/dist/product-set/form/ProductSetForm.js +1 -1
  55. package/dist/product-set/form/ProductsControl.js +1 -0
  56. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  57. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
  58. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  59. package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
  60. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  61. package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
  62. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  63. package/dist/product-set/product/price/ProductPriceControl.js +3 -0
  64. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  65. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
  66. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  67. package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
  68. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  69. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
  70. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  71. package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
  72. package/dist/product-set/utils/index.d.ts +1 -1
  73. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  74. package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
  75. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  76. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  77. package/dist/resource/form/components/CapacityControl.js +3 -0
  78. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  79. package/dist/resource/form/components/SortControl.js +3 -0
  80. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  81. package/dist/sales/coupon/control/CouponFormControl.js +21 -0
  82. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  83. package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
  84. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  85. package/dist/static/CurrencyNumberInput.js +3 -0
  86. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  87. package/dist/static/form-number-input/FormNumberInput.js +3 -0
  88. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  89. package/dist/static/number-input/NumberInput.js +3 -0
  90. package/dist/styles/iframe-events/Calendar.scss +1 -1
  91. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  92. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
  93. package/dist/styles/sales/BookingResults.scss +1 -1
  94. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  95. package/dist/zone/form/components/GameDurationControl.js +3 -0
  96. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  97. package/dist/zone/form/components/SortControl.js +3 -0
  98. package/package.json +7 -7
  99. package/src/auth/ChangePassword/ChangePasswordComponent.tsx +3 -4
  100. package/src/auth/Login/LoginComponent.tsx +8 -6
  101. package/src/auth/Register/RegisterComponent.tsx +3 -4
  102. package/src/auth/ResetPassword/ResetPasswordComponent.tsx +3 -4
  103. package/src/auth/Social/SocialCallbackComponent.tsx +3 -2
  104. package/src/auth/Social/SocialFormComponent.tsx +2 -3
  105. package/src/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.tsx +3 -4
  106. package/src/events/edit-event-modal/IntervalInput.tsx +4 -0
  107. package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +12 -4
  108. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
  109. package/src/events/event-card/EventCard.tsx +10 -8
  110. package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
  111. package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
  112. package/src/events/event-statistic-modal/utils/index.ts +4 -4
  113. package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
  114. package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
  115. package/src/file-upload/FileUpload.tsx +2 -3
  116. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +1 -5
  117. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -2
  118. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
  119. package/src/iframe/payment/payment-page/PaymentPage.tsx +6 -6
  120. package/src/iframe/ryft/RyftPaymentForm.tsx +25 -58
  121. package/src/iframe/ryft/utils/ryft-form.ts +6 -5
  122. package/src/notification/email-template/control/EmailTemplateControl.tsx +7 -6
  123. package/src/product-set/control/ProductSetControl.tsx +1 -1
  124. package/src/product-set/form/ProductSetForm.tsx +6 -2
  125. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
  126. package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
  127. package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
  128. package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
  129. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
  130. package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
  131. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
  132. package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
  133. package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
  134. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
  135. package/src/resource/form/components/CapacityControl.tsx +1 -0
  136. package/src/resource/form/components/SortControl.tsx +1 -0
  137. package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
  138. package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
  139. package/src/static/CurrencyNumberInput.tsx +1 -0
  140. package/src/static/form-number-input/FormNumberInput.tsx +1 -0
  141. package/src/static/number-input/NumberInput.tsx +1 -0
  142. package/src/styles/iframe-events/Calendar.scss +1 -1
  143. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  144. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
  145. package/src/styles/sales/BookingResults.scss +1 -1
  146. package/src/zone/form/components/GameDurationControl.tsx +1 -0
  147. package/src/zone/form/components/SortControl.tsx +1 -0
  148. package/yarn.lock +69 -70
@@ -1,3 +1,4 @@
1
+ import { showAlert } from '@licklist/plugins/dist/context/app/AlertContext'
1
2
  import { createElement, useState, useEffect, useContext } from 'react'
2
3
  import { useTranslation } from 'react-i18next'
3
4
  import { Button, Form } from 'react-bootstrap'
@@ -17,7 +18,6 @@ import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permi
17
18
  import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
18
19
  import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
19
20
  import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService'
20
- import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
21
21
 
22
22
  import {
23
23
  CreateSortableListItem,
@@ -85,7 +85,6 @@ export const CustomFieldSet = ({
85
85
  useEffect(() => {
86
86
  FormErrorService.handleServerErrors(serverErrors, setError)
87
87
  }, [serverErrors, setError])
88
- const notification = useNotification()
89
88
  const { fields, append, remove } = useFieldArray({
90
89
  control,
91
90
  name: CUSTOM_FIELDS,
@@ -98,7 +97,7 @@ export const CustomFieldSet = ({
98
97
 
99
98
  if (!response) return
100
99
 
101
- notification.success({
100
+ showAlert({ type: 'success',
102
101
  title: t('App:success'),
103
102
  message: t('Notification:createSuccessfully', {
104
103
  argument: t('customField'),
@@ -124,7 +123,7 @@ export const CustomFieldSet = ({
124
123
  if (fieldSet.id !== null) {
125
124
  await onFieldSetDelete(fieldSet)
126
125
 
127
- notification.success({
126
+ showAlert({ type: 'success',
128
127
  title: t('App:success'),
129
128
  message: t('Notification:theRemovedSuccessfully', {
130
129
  argument: t('customField'),
@@ -159,6 +159,10 @@ export function IntervalInput({
159
159
  {formattedDuration && `lasts ${formattedDuration}`}
160
160
  </Form.Text>
161
161
  </Form.Group>
162
+
163
+ <Form.Control.Feedback type='invalid'>
164
+ {errors.end?.message}
165
+ </Form.Control.Feedback>
162
166
  </Form.Row>
163
167
  {start && (
164
168
  <Form.Group controlId={recurrentId}>
@@ -39,10 +39,12 @@ type SaleDeadlineType =
39
39
  export const SaleDeadline = ({
40
40
  disabled = false,
41
41
  onlyBefore = false,
42
+ isProductSet = false,
42
43
  deadLineCategory,
43
44
  }: {
44
45
  disabled?: boolean
45
46
  onlyBefore?: boolean
47
+ isProductSet?: boolean
46
48
  deadLineCategory?: string
47
49
  }) => {
48
50
  const { t } = useTranslation(['Design'])
@@ -140,10 +142,16 @@ export const SaleDeadline = ({
140
142
  <Switch
141
143
  name='sale-deadline'
142
144
  options={SALE_DEADLINES_EVENT_START_TYPES.map(
143
- ({ type }) => ({
144
- id: type,
145
- value: t(`Design:${type}`),
146
- }),
145
+ ({ type }) => {
146
+ const salesDeadlineTitle =
147
+ type === SALE_DEADLINE_BEFORE_TYPE && isProductSet
148
+ ? 'beforeProductSet'
149
+ : type
150
+ return {
151
+ id: type,
152
+ value: t(`Design:${salesDeadlineTitle}`),
153
+ }
154
+ },
147
155
  )}
148
156
  value={deadlineType}
149
157
  onChange={changeValueByType}
@@ -41,7 +41,6 @@ export const getDefaultValues = (
41
41
  ...product,
42
42
  subProducts: subProducts?.map(({ ...subProducts }) => ({
43
43
  ...subProducts,
44
- originalProductId: null,
45
44
  productCategoryId: undefined,
46
45
  })),
47
46
  productCategoryId: undefined,
@@ -33,7 +33,7 @@ export interface EventCardProps extends HasPermissionProp {
33
33
  onPreview: () => void
34
34
  onEdit: () => void
35
35
  onCopy: () => void
36
- onRemove: () => void
36
+ onRemove?: () => void
37
37
  onOpenQrCode: () => void
38
38
  eventStatistic?: EventStatistic | null
39
39
  eventMetadata?: EventMetadata | null
@@ -212,13 +212,15 @@ export function EventCard({
212
212
  >
213
213
  <FaCopy />
214
214
  </button>
215
- <button
216
- type='button'
217
- className='event-card-link-button'
218
- onClick={onRemove}
219
- >
220
- <FaTrashAlt />
221
- </button>
215
+ {onRemove && (
216
+ <button
217
+ type='button'
218
+ className='event-card-link-button'
219
+ onClick={onRemove}
220
+ >
221
+ <FaTrashAlt />
222
+ </button>
223
+ )}
222
224
  </>
223
225
  )}
224
226
  </div>
@@ -12,6 +12,7 @@ export type EventStatisticModalProps = {
12
12
  date?: Event['startAt'] | null
13
13
  eventStatistic?: EventStatistic | null
14
14
  title?: string
15
+ eventId?: string
15
16
  }
16
17
 
17
18
  export const EventStatisticModal = ({
@@ -20,10 +21,11 @@ export const EventStatisticModal = ({
20
21
  date,
21
22
  eventStatistic,
22
23
  title,
24
+ eventId,
23
25
  }: EventStatisticModalProps) => {
24
26
  const { t } = useTranslation('Design')
25
27
 
26
- const data = useTableData(date, eventStatistic)
28
+ const data = useTableData(date, eventStatistic, eventId)
27
29
  const handleClose = () => {
28
30
  setIsOpen(false)
29
31
  }
@@ -11,6 +11,7 @@ import { StaticTableData } from '../../../table'
11
11
  export const useTableData = (
12
12
  date: Event['startAt'] | null,
13
13
  eventStatistic: EventStatistic | null,
14
+ eventId: string,
14
15
  ) => {
15
16
  const { t } = useTranslation('Design')
16
17
  const { formatNumber } = useIntl()
@@ -84,7 +85,7 @@ export const useTableData = (
84
85
  useEffect(() => {
85
86
  setTableRows(transformStatisticToTableRows(date, eventStatistic))
86
87
  // eslint-disable-next-line react-hooks/exhaustive-deps
87
- }, [date, eventStatistic])
88
+ }, [date, eventId, eventStatistic])
88
89
 
89
90
  return tableRows
90
91
  }
@@ -33,15 +33,15 @@ export const convertEventStatisticToTableData = (
33
33
  return []
34
34
  }
35
35
 
36
- const summaryFormattedDate = DateTime.fromISO(date)
37
- .toUTC()
38
- .toFormat(DATE_FORMAT)
36
+ const summaryFormattedDate = DateTime.fromISO(date).toFormat(
37
+ DATE_TIME_FULL_FORMAT,
38
+ )
39
39
 
40
40
  const summaryDays =
41
41
  Object.keys(eventStatistic?.productCategorySummary)?.filter(
42
42
  (date) =>
43
43
  DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
44
- DATE_FORMAT,
44
+ DATE_TIME_FULL_FORMAT,
45
45
  ) === summaryFormattedDate,
46
46
  ) ?? []
47
47
 
@@ -49,6 +49,7 @@ export const EventVenueMap = forwardRef<VenueMapRef, EventVenueMapProps>(
49
49
  },
50
50
  ref,
51
51
  ) => {
52
+ // TODO fix often updating of canvasSizes, which leads to flashing poingts
52
53
  const canvasSizes = useCanvasSize({ width, height })
53
54
 
54
55
  return (
@@ -10,13 +10,17 @@ export const useCanvasSize = ({
10
10
  width: componentWidth,
11
11
  height: componentHeight,
12
12
  }: CanvasSizeProps) => {
13
+ // TODO Fix often updating of width and height
13
14
  const { width, height } = useWindowDimensions()
14
15
 
16
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17
+ const memoizedDimensions = useMemo(() => ({ width, height }), [width])
18
+
15
19
  const memoedComponentParameters = useMemo(() => {
16
20
  if (!componentWidth && !componentHeight) return null
17
21
 
18
22
  return { width: componentWidth, height: componentHeight }
19
23
  }, [componentWidth, componentHeight])
20
24
 
21
- return memoedComponentParameters || { width, height }
25
+ return memoedComponentParameters || memoizedDimensions
22
26
  }
@@ -1,8 +1,8 @@
1
+ import { showAlert } from '@licklist/plugins/dist/context/app/AlertContext'
1
2
  /* eslint-disable no-return-assign */
2
3
  /* eslint-disable react-hooks/exhaustive-deps */
3
4
  import { useEffect, useState } from 'react'
4
5
  import clsx from 'clsx'
5
- import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
6
6
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
7
7
  import { Attachment } from '@licklist/core/dist/DataMapper/Notification/AttachmentDataMapper'
8
8
  import { AttachmentMetadata } from '@licklist/core/dist/DataMapper/Notification/AttachmentMetadataDataMapper'
@@ -153,7 +153,6 @@ export const useFileUpload = ({
153
153
  const [files, setFiles] = useState<File[] | null>(null)
154
154
  const [isDragged, setIsDragged] = useState(false)
155
155
 
156
- const notification = useNotification()
157
156
  const { t } = useTranslation('Design')
158
157
 
159
158
  const uploadFile = (file: File) => {
@@ -183,7 +182,7 @@ export const useFileUpload = ({
183
182
  if (isExtensionValid) {
184
183
  uploadFile(file)
185
184
  } else {
186
- notification.danger({
185
+ showAlert({ type: 'error',
187
186
  title: t('fileNotUploaded', { fileName: file.name }),
188
187
  message: t('invalidExtension', { extension: fileExtension }),
189
188
  })
@@ -35,9 +35,6 @@ export const ModifiersSetControl = ({
35
35
  const { t } = useTranslation('App')
36
36
 
37
37
  const orderModifiersSets = watch(`${productId}.orderProductModifiers`)
38
- const filteredOrderModifiersSets = orderModifiersSets
39
- ?.flat(Infinity)
40
- ?.filter((item) => item && typeof item === 'object')
41
38
 
42
39
  const { formatNumber } = useIntl()
43
40
  const formatToCurrency = (value: number) =>
@@ -61,9 +58,8 @@ export const ModifiersSetControl = ({
61
58
  const selectedModifier = modifiers?.find(
62
59
  (item) => item.id === Number(e.target.defaultValue || e.target.id),
63
60
  )
64
-
65
61
  const checkSelectedModifier =
66
- filteredOrderModifiersSets?.find(
62
+ orderModifiersSets?.find(
67
63
  (modifier) => modifier?.modifierId === selectedModifier?.id,
68
64
  )?.quantity === 1
69
65
 
@@ -19,8 +19,8 @@ export const cartSumByOrderProducts = ({
19
19
  if (!product) return 0
20
20
  const modifiersPrice = calculateTotalModifiersPrice(
21
21
  product?.orderModifiersSets,
22
- ) || 0
23
-
22
+ )
23
+
24
24
  const price = isTotalSum
25
25
  ? product?.price
26
26
  : product.hasDeposit
@@ -89,6 +89,7 @@ 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()}
92
93
  value={value}
93
94
  min={0}
94
95
  max={max}
@@ -101,6 +102,14 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
101
102
  <button
102
103
  type='button'
103
104
  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
+ }
104
113
  className={`payment-number-input__btn-up ${
105
114
  plusButtonGreyedOut && 'disabled-number-input-button'
106
115
  }`}
@@ -166,12 +166,12 @@ export const PaymentPage = ({
166
166
  headerComponent={<SummaryTotalBlock amount={totalBooked} />}
167
167
  footer={
168
168
  <div className='d-flex flex-column justify-content-between'>
169
- {paymentMetadata?.total ? (
169
+ {paymentMetadata ? (
170
170
  <>
171
- {/* <SummaryTotalBlock
171
+ <SummaryTotalBlock
172
172
  label={t('total')}
173
173
  amount={paymentMetadata.total || 0}
174
- /> */}
174
+ />
175
175
  <SummaryTotalBlock
176
176
  label={t('paidSum')}
177
177
  amount={paymentMetadata.paid || 0}
@@ -185,7 +185,7 @@ export const PaymentPage = ({
185
185
  </>
186
186
  ) : (
187
187
  <>
188
- {!!isCalculatedAmountGreaterThanOrderAmount && (
188
+ {isCalculatedAmountGreaterThanOrderAmount && (
189
189
  <SummaryTotalBlock
190
190
  label={t(hasRemaingToPay ? 'payNow' : 'total')}
191
191
  amount={
@@ -195,7 +195,7 @@ export const PaymentPage = ({
195
195
  />
196
196
  )}
197
197
 
198
- {!!hasRemaingToPay && (
198
+ {hasRemaingToPay && (
199
199
  <SummaryTotalBlock
200
200
  label={t('remaining')}
201
201
  amount={
@@ -205,7 +205,7 @@ export const PaymentPage = ({
205
205
  />
206
206
  )}
207
207
 
208
- {!!isPaymentLinkWithRemainingToPay && (
208
+ {isPaymentLinkWithRemainingToPay && (
209
209
  <SummaryTotalBlock
210
210
  label={t('remaningToPay')}
211
211
  amount={Number(data?.remaining_to_pay)}
@@ -134,42 +134,32 @@ export const RyftPaymentForm = ({
134
134
  setIsBtnDisabled(false)
135
135
  }
136
136
  }
137
- console.log(
138
- formRef.current?.childNodes?.length,
139
- 'formRef.current?.childNodes?.length ',
140
- )
141
-
142
- // useEffect(() => {
143
- // const formBox = document.getElementById('form-disable-box')
144
- // const cardContainer = document.getElementById('ryft-pay-iframe')
145
-
146
- // const googleButton = document.getElementById(
147
- // 'gpay-button-online-api-id',
148
- // ) as HTMLButtonElement | null
149
-
150
- // const appleButton = document.getElementById(
151
- // 'ryft-pay-apple-pay-button',
152
- // ) as HTMLButtonElement | null
153
-
154
- // if (cardContainer) {
155
- // cardContainer.style.opacity = payButtonDisabled ? '0.6' : '1'
156
- // cardContainer.setAttribute('aria-disabled', payButtonDisabled.toString())
157
- // }
158
-
159
- // if (googleButton) {
160
- // googleButton.disabled = payButtonDisabled
161
- // googleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
162
- // }
163
137
 
164
- // if (appleButton) {
165
- // appleButton.disabled = payButtonDisabled
166
- // appleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
167
- // }
168
-
169
- // if (formBox) {
170
- // formBox.style.display = payButtonDisabled ? 'block' : 'none'
171
- // }
172
- // }, [payButtonDisabled])
138
+ useEffect(
139
+ () => {
140
+ if (
141
+ !formRef.current?.childNodes?.length ||
142
+ formRef.current?.childNodes?.length < 3 ||
143
+ !accountId.data?.account_id
144
+ ) {
145
+ return
146
+ }
147
+ injectComponentsInRyftForm({
148
+ t,
149
+ isAppUsingInIframe,
150
+ onApplePayButtonClick,
151
+ isDisableButton: !payButtonDisabled,
152
+ additionalPaymentMethodsEnabled:
153
+ providerPaymentSettings?.additionalPaymentMethodsEnabled,
154
+ })
155
+ },
156
+ // eslint-disable-next-line react-hooks/exhaustive-deps
157
+ [
158
+ formRef.current?.childNodes?.length,
159
+ showApplePayButton,
160
+ payButtonDisabled,
161
+ ],
162
+ )
173
163
 
174
164
  useEffect(() => {
175
165
  if (!accountId.data?.account_id || accountId.isError) return
@@ -193,29 +183,6 @@ export const RyftPaymentForm = ({
193
183
  // eslint-disable-next-line react-hooks/exhaustive-deps
194
184
  }, [accountId.data?.account_id])
195
185
 
196
-
197
- useEffect(
198
- () => {
199
- if (
200
- !formRef.current?.childNodes?.length ||
201
- formRef.current?.childNodes?.length < 3 ||
202
- !accountId.data?.account_id
203
- ) {
204
- return
205
- }
206
- injectComponentsInRyftForm({
207
- t,
208
- isAppUsingInIframe,
209
- onApplePayButtonClick,
210
- isDisableButton: !payButtonDisabled,
211
- additionalPaymentMethodsEnabled:
212
- providerPaymentSettings?.additionalPaymentMethodsEnabled,
213
- })
214
- },
215
- // eslint-disable-next-line react-hooks/exhaustive-deps
216
- [formRef.current?.childNodes?.length, showApplePayButton, payButtonDisabled],
217
- )
218
-
219
186
  if (accountId.isLoading || accountId.isFetching || isCreateLoading)
220
187
  return (
221
188
  <div className='mt-5 pt-5'>
@@ -61,20 +61,22 @@ 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("ryft-pay-apple-pay-button") as HTMLButtonElement
74
+ const appleButton = document.getElementById(
75
+ 'ryft-pay-apple-pay-button',
76
+ ) as HTMLButtonElement
75
77
  if (googleButton) {
76
78
  googleButton.disabled = isDisableButton
77
- googleButton.style.opacity = isDisableButton ? '1' : '0.6'
79
+ googleButton.style.opacity = !isDisableButton ? '1' : '0.6'
78
80
  }
79
81
  if (appleButton) {
80
82
  appleButton.disabled = isDisableButton
@@ -86,7 +88,6 @@ export const injectComponentsInRyftForm = ({
86
88
  const applePayButton = document.createElement('button')
87
89
  applePayButton.id = 'apple-pay'
88
90
  applePayButton.type = 'button'
89
- applePayButton.style.opacity = !isDisableButton ? '1' : '0.6'
90
91
  applePayButton.className = 'bg-dark btn btn-primary apple-pay-button'
91
92
  applePayButton.textContent = t('Events:payWithApple')
92
93
  applePayButton.onclick = onApplePayButtonClick
@@ -286,15 +286,15 @@ export const EmailTemplateControl = forwardRef(
286
286
  </Form.Group>
287
287
  </Row>
288
288
 
289
- <Row>
289
+ { !waiverType && (<Row>
290
290
  <Form.Group as={Col}>
291
- {!waiverType && (<Form.Check
291
+ <Form.Check
292
292
  {...register('isActive')}
293
293
  name='isActive'
294
294
  label={t('Design:active')}
295
295
  id='formGroupIsActive'
296
296
  custom
297
- />)}
297
+ />
298
298
  <Form.Check
299
299
  {...register('isDefault')}
300
300
  name='isDefault'
@@ -303,7 +303,7 @@ export const EmailTemplateControl = forwardRef(
303
303
  custom
304
304
  />
305
305
  </Form.Group>
306
- </Row>
306
+ </Row>)}
307
307
  <Row className='mb-4'>
308
308
  <Form.Group as={Col}>
309
309
  <Form.Label>{t('Design:emailBody')}</Form.Label>
@@ -375,9 +375,9 @@ export const EmailTemplateControl = forwardRef(
375
375
  )
376
376
  }
377
377
  // should show dropdown only if user want to include PDF file
378
- if (option.type === OPTION_TYPE.files_selector && !waiverType) {
378
+ if (option.type === OPTION_TYPE.files_selector) {
379
379
  const fileSelectors = option?.defaultValue ? JSON.parse(option.defaultValue) : ''
380
- const fileNames = Object.values(fileSelectors) : []
380
+ const fileNames = Object.values(fileSelectors)
381
381
  const fileKeys = Object.keys(fileSelectors)
382
382
 
383
383
  return (
@@ -436,6 +436,7 @@ export const EmailTemplateControl = forwardRef(
436
436
  `templateOptionValues.${option?.id}.value`,
437
437
  )}
438
438
  type='number'
439
+ onWheel={(event) => event.currentTarget.blur()}
439
440
  placeholder={t(`Design:${option.name}`)}
440
441
  id={option.name + option.id}
441
442
  defaultValue={option.selectedValue || ''}
@@ -227,7 +227,7 @@ export function ProductSetControl({
227
227
  </>
228
228
  )}
229
229
 
230
- <SaleDeadline disabled={false} />
230
+ <SaleDeadline disabled={false} isProductSet />
231
231
 
232
232
  <div className='divider' />
233
233
 
@@ -11,7 +11,7 @@ import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetD
11
11
  import { isEqual } from 'lodash'
12
12
  import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
13
13
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
14
- import { transformErrorToMessage } from '@licklist/plugins'
14
+ import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
15
15
  import { Dialog, useDialogContext } from '../../modals/dialog'
16
16
  import {
17
17
  ProductSetControl,
@@ -31,12 +31,16 @@ import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
31
31
  export interface WithIsLoading {
32
32
  isLoading: boolean
33
33
  }
34
+ export interface WithIdOptional {
35
+ id?: number
36
+ }
37
+
34
38
  export interface WithId {
35
39
  id: number
36
40
  }
37
41
  export interface ProductSetFormValues
38
42
  extends FormValues,
39
- WithId,
43
+ WithIdOptional,
40
44
  ProductSetControlValues {
41
45
  steps: Step[]
42
46
  isOverrides?: boolean
@@ -86,6 +86,7 @@ export function ProductBookingManagementControl<T extends FormValues>(
86
86
  <Form.Control
87
87
  ref={ref}
88
88
  type='number'
89
+ onWheel={(event) => event.currentTarget.blur()}
89
90
  min={0}
90
91
  step={1}
91
92
  value={value as string}
@@ -129,6 +130,7 @@ export function ProductBookingManagementControl<T extends FormValues>(
129
130
  <Form.Control
130
131
  ref={ref}
131
132
  type='number'
133
+ onWheel={(event) => event.currentTarget.blur()}
132
134
  min='0'
133
135
  step='1'
134
136
  value={value as string}
@@ -50,6 +50,7 @@ export function ProductDepositControl<T extends FormValues>(
50
50
  <Form.Control
51
51
  ref={ref}
52
52
  type='number'
53
+ onWheel={(event) => event.currentTarget.blur()}
53
54
  min={0}
54
55
  max={Number(totalPrice)}
55
56
  step='0.01'
@@ -91,6 +91,7 @@ export const ProductDurationControl = <T,>({
91
91
  <Form.Control
92
92
  type='number'
93
93
  min={0}
94
+ onWheel={(event) => event.currentTarget.blur()}
94
95
  step={1}
95
96
  value={durationHours}
96
97
  disabled={disabled}
@@ -127,6 +128,7 @@ export const ProductDurationControl = <T,>({
127
128
  type='number'
128
129
  min={0}
129
130
  step={1}
131
+ onWheel={(event) => event.currentTarget.blur()}
130
132
  disabled={disabled}
131
133
  value={durationMinutes}
132
134
  isInvalid={isInvalid}
@@ -59,6 +59,7 @@ export function ProductPriceControl<T extends FormValues>({
59
59
  ref={ref}
60
60
  type='number'
61
61
  min={0}
62
+ onWheel={(event) => event.currentTarget.blur()}
62
63
  max={999999.99}
63
64
  step='0.01'
64
65
  value={value as string}
@@ -111,6 +111,7 @@ export function ProductQuantityConstantControl<T extends FormValues>(
111
111
  type='number'
112
112
  min={0}
113
113
  step={1}
114
+ onWheel={(event) => event.currentTarget.blur()}
114
115
  value={value as string}
115
116
  isInvalid={HookFormService.isInvalid<T>(
116
117
  `${fieldNamePrefix}.totalQuantity` as Path<T>,
@@ -165,6 +166,7 @@ export function ProductQuantityConstantControl<T extends FormValues>(
165
166
  type='number'
166
167
  min={0}
167
168
  step={1}
169
+ onWheel={(event) => event.currentTarget.blur()}
168
170
  value={value as string}
169
171
  onChange={onChange}
170
172
  onFocus={onFocus}
@@ -85,6 +85,7 @@ export function ProductQuantityControl<T extends FormValues>(
85
85
  type='number'
86
86
  min={0}
87
87
  step={1}
88
+ onWheel={(event) => event.currentTarget.blur()}
88
89
  value={value as string}
89
90
  onChange={onChange}
90
91
  onFocus={onFocus}
@@ -143,6 +144,7 @@ export function ProductQuantityControl<T extends FormValues>(
143
144
  type='number'
144
145
  min={0}
145
146
  step={1}
147
+ onWheel={(event) => event.currentTarget.blur()}
146
148
  value={value && (value as string)}
147
149
  onFocus={onFocus}
148
150
  onChange={onChange}
@@ -69,6 +69,7 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
69
69
  type='number'
70
70
  min={0}
71
71
  step={1}
72
+ onWheel={(event) => event.currentTarget.blur()}
72
73
  {...register(`${fieldNamePrefix}.totalQuantity` as Path<T>, {
73
74
  validate: (value) => {
74
75
  if (unlimited) return true