@licklist/design 0.74.1 → 0.75.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +2 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
- package/dist/events/event-card/EventCard.d.ts +2 -1
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +8 -2
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +2 -1
- package/dist/events/event-statistic-modal/utils/index.js +3 -3
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +1 -0
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +2 -3
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +4 -11
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +13 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +4 -5
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +5 -3
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +0 -2
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +4 -3
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +2 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +0 -3
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +0 -3
- package/dist/product-set/form/context.d.ts +1 -2
- package/dist/product-set/form/context.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts +2 -0
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +7 -0
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +3 -0
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts +12 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts.map +1 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.js +153 -0
- package/dist/product-set/product/scanRange/index.d.ts +2 -0
- package/dist/product-set/product/scanRange/index.d.ts.map +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
- package/dist/product-set/utils/index.d.ts +3 -1
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
- package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.js +3 -0
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +3 -0
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +0 -2
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +21 -0
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +3 -0
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +3 -0
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +3 -0
- package/dist/styles/iframe-events/Calendar.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +2 -3
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +3 -0
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +3 -0
- package/package.json +8 -6
- package/src/affiliate/form/AffiliateForm.tsx +1 -0
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +12 -7
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/events/event-card/EventCard.tsx +15 -5
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -13
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/iframe/ryft/utils/ryft-form.ts +6 -5
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/product-set/control/ProductSetControl.tsx +11 -8
- package/src/product-set/form/ProductSetForm.tsx +7 -6
- package/src/product-set/form/ProductZonesControl.tsx +1 -4
- package/src/product-set/form/ProductsControl.tsx +3 -9
- package/src/product-set/form/StepsControl.tsx +1 -3
- package/src/product-set/form/SubProductsControl.tsx +0 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/form/context.tsx +2 -5
- package/src/product-set/product/ProductControl.tsx +19 -17
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
- package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
- package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
- package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.stories.ts +45 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.tsx +163 -0
- package/src/product-set/product/scanRange/index.ts +1 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
- package/src/resource/form/components/CapacityControl.tsx +1 -0
- package/src/resource/form/components/SortControl.tsx +1 -0
- package/src/sales/booking/results/components/ResultCard.tsx +0 -2
- package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
- package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
- package/src/sortable-tree/SortableTreeItem.tsx +1 -6
- package/src/static/CurrencyNumberInput.tsx +1 -0
- package/src/static/form-number-input/FormNumberInput.tsx +1 -0
- package/src/static/number-input/NumberInput.tsx +1 -0
- package/src/styles/iframe-events/Calendar.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +2 -3
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/components/GameDurationControl.tsx +1 -0
- package/src/zone/form/components/SortControl.tsx +1 -0
- package/yarn.lock +421 -420
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -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
|
}`}
|
|
@@ -61,6 +61,7 @@ const processedPaymentSummary = ({
|
|
|
61
61
|
const total = order.fullAmount || calculateTotalPrice(order, externalPaymentDetail)
|
|
62
62
|
|
|
63
63
|
const totalDiscount = calculateTotalDiscount(order.payments)
|
|
64
|
+
|
|
64
65
|
let summaryItems: SummaryItem[] = [
|
|
65
66
|
{
|
|
66
67
|
translateKey: AMOUNT_TOTAL,
|
|
@@ -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(
|
|
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 ?
|
|
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(
|
|
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
|
package/src/layout/DropDown.tsx
CHANGED
|
@@ -434,6 +434,7 @@ export const EmailTemplateControl = forwardRef(
|
|
|
434
434
|
`templateOptionValues.${option?.id}.value`,
|
|
435
435
|
)}
|
|
436
436
|
type='number'
|
|
437
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
437
438
|
placeholder={t(`Design:${option.name}`)}
|
|
438
439
|
id={option.name + option.id}
|
|
439
440
|
defaultValue={option.selectedValue || ''}
|
|
@@ -309,14 +309,17 @@ export function ProductSetControl({
|
|
|
309
309
|
</Form.Control.Feedback>
|
|
310
310
|
</Form.Group>
|
|
311
311
|
|
|
312
|
-
<Form.Group
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
312
|
+
<Form.Group
|
|
313
|
+
controlId='hasGeneralTicket'
|
|
314
|
+
className='checkbox-second-column mt-4'
|
|
315
|
+
>
|
|
316
|
+
<Form.Check
|
|
317
|
+
data-testid='save-as-template-checkbox'
|
|
318
|
+
label={t('Design:hasGeneralTicket')}
|
|
319
|
+
{...register('hasGeneralTicket')}
|
|
320
|
+
custom
|
|
321
|
+
/>
|
|
322
|
+
</Form.Group>
|
|
320
323
|
|
|
321
324
|
<Form.Group controlId={termsAndConditionsId}>
|
|
322
325
|
<Form.Label>{t('Design:termsAndConditions')}</Form.Label>
|
|
@@ -7,13 +7,10 @@ import { VenueMapSet } from '@licklist/core/dist/DataMapper/Product/VenueMapSetD
|
|
|
7
7
|
import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
|
|
8
8
|
import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
|
|
9
9
|
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
10
|
-
|
|
11
10
|
import { isEqual } from 'lodash'
|
|
12
|
-
// eslint-disable-next-line max-len
|
|
13
|
-
import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
|
|
14
11
|
import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
|
|
15
12
|
import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
|
|
16
|
-
import { transformErrorToMessage } from '@licklist/plugins'
|
|
13
|
+
import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
|
|
17
14
|
import { Dialog, useDialogContext } from '../../modals/dialog'
|
|
18
15
|
import {
|
|
19
16
|
ProductSetControl,
|
|
@@ -33,12 +30,16 @@ import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
|
|
|
33
30
|
export interface WithIsLoading {
|
|
34
31
|
isLoading: boolean
|
|
35
32
|
}
|
|
33
|
+
export interface WithIdOptional {
|
|
34
|
+
id?: number
|
|
35
|
+
}
|
|
36
|
+
|
|
36
37
|
export interface WithId {
|
|
37
38
|
id: number
|
|
38
39
|
}
|
|
39
40
|
export interface ProductSetFormValues
|
|
40
41
|
extends FormValues,
|
|
41
|
-
|
|
42
|
+
WithIdOptional,
|
|
42
43
|
ProductSetControlValues {
|
|
43
44
|
steps: Step[]
|
|
44
45
|
isOverrides?: boolean
|
|
@@ -55,7 +56,7 @@ export interface ProductSetFormProps
|
|
|
55
56
|
serverErrors?: ServerError
|
|
56
57
|
providerHasMap?: boolean
|
|
57
58
|
venueMapSets?: VenueMapSet[]
|
|
58
|
-
providerHasBookingManagement?:
|
|
59
|
+
providerHasBookingManagement?: boolean
|
|
59
60
|
zones?: Zone[] | null
|
|
60
61
|
isCreateAction?: boolean
|
|
61
62
|
isOverrides?: boolean
|
|
@@ -9,18 +9,14 @@ import {
|
|
|
9
9
|
} from 'react-hook-form'
|
|
10
10
|
import { useSensor, MouseSensor } from '@dnd-kit/core'
|
|
11
11
|
import { useTranslation } from 'react-i18next'
|
|
12
|
-
import { DEFAULT_PRODUCT_TYPE } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
|
|
13
12
|
import { generateUuid } from '@licklist/core/dist/Services'
|
|
14
13
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService'
|
|
15
|
-
|
|
16
14
|
import { CategoryType } from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper'
|
|
17
15
|
import { ProductControl, ProductControlProps, ProductSetFormValues } from '..'
|
|
18
16
|
import { SortableTree } from '../../sortable-tree'
|
|
19
17
|
import { CreateProductSetItem } from '../item/CreateProductSetItem'
|
|
20
18
|
import { Product } from '../types'
|
|
21
19
|
import { WithIsLoading } from './ProductSetForm'
|
|
22
|
-
// @TODO not for first release
|
|
23
|
-
// import Popover from "./ProductSetFormPopover";
|
|
24
20
|
import { useSortableTreeFunctions } from '../hooks/useSortableTreeFunctions'
|
|
25
21
|
import { SubProductsControl } from './SubProductsControl'
|
|
26
22
|
import { ProductSetModalClasses } from '../../sortable-tree/SortableTreeItem'
|
|
@@ -47,6 +43,8 @@ const getDefaultProductValue = (sort: number): Product => ({
|
|
|
47
43
|
deposit: 0,
|
|
48
44
|
minQuantity: null,
|
|
49
45
|
maxQuantity: null,
|
|
46
|
+
scanRangeStart: null,
|
|
47
|
+
scanRangeEnd: null,
|
|
50
48
|
totalQuantity: 0,
|
|
51
49
|
isAvailable: true,
|
|
52
50
|
modifiersSet: [],
|
|
@@ -58,7 +56,6 @@ const getDefaultProductValue = (sort: number): Product => ({
|
|
|
58
56
|
hasSpecialNotes: false,
|
|
59
57
|
weight: 0,
|
|
60
58
|
originalProductId: null,
|
|
61
|
-
type: DEFAULT_PRODUCT_TYPE,
|
|
62
59
|
tierId: Number(uniqueId()),
|
|
63
60
|
subProducts: [],
|
|
64
61
|
images: [],
|
|
@@ -287,7 +284,6 @@ export function ProductsControl({
|
|
|
287
284
|
trigger(`${productControlFieldName}.${index}`)
|
|
288
285
|
}
|
|
289
286
|
saveValidField={saveValidField}
|
|
290
|
-
// preItem={<Popover className="d-none d-sm-block" />}
|
|
291
287
|
>
|
|
292
288
|
<SubProductsControl
|
|
293
289
|
isLoading={isLoading}
|
|
@@ -313,9 +309,7 @@ export function ProductsControl({
|
|
|
313
309
|
}
|
|
314
310
|
}}
|
|
315
311
|
/>
|
|
316
|
-
<div className='manual-form-error'>
|
|
317
|
-
{categoryProductErrors && categoryProductErrors.message}
|
|
318
|
-
</div>
|
|
312
|
+
<div className='manual-form-error'>{categoryProductErrors?.message}</div>
|
|
319
313
|
</>
|
|
320
314
|
)
|
|
321
315
|
}
|
|
@@ -70,9 +70,6 @@ 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
|
|
76
73
|
append(subProductCopy)
|
|
77
74
|
}}
|
|
78
75
|
/>
|
|
@@ -46,9 +46,6 @@ 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
|
|
52
49
|
products={products}
|
|
53
50
|
pointProducts={pointProducts}
|
|
54
51
|
onPointProductsChange={onPointProductsChange}
|
|
@@ -8,12 +8,9 @@ import {
|
|
|
8
8
|
} from 'react'
|
|
9
9
|
import { VenueMapSet } from '@licklist/core/dist/DataMapper/Product/VenueMapSetDataMapper'
|
|
10
10
|
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
11
|
-
// eslint-disable-next-line max-len
|
|
12
|
-
import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
|
|
13
11
|
import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
|
|
14
12
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
15
13
|
|
|
16
|
-
|
|
17
14
|
interface LoadingContext {
|
|
18
15
|
isLoading: boolean
|
|
19
16
|
setLoading: (loading: boolean) => void
|
|
@@ -21,7 +18,7 @@ interface LoadingContext {
|
|
|
21
18
|
modifiersSetList?: ModifierSet[] | null
|
|
22
19
|
providerHasMap?: boolean | null
|
|
23
20
|
venueMapSets?: VenueMapSet[]
|
|
24
|
-
providerHasBookingManagement?:
|
|
21
|
+
providerHasBookingManagement?: boolean
|
|
25
22
|
zones?: Zone[] | null
|
|
26
23
|
expandedProductCategories: Record<string, boolean>
|
|
27
24
|
setExpandedProductCategories: Dispatch<
|
|
@@ -46,7 +43,7 @@ type ProductSetContextProviderProps = PropsWithChildren<
|
|
|
46
43
|
export function ProductSetContextProvider({
|
|
47
44
|
children,
|
|
48
45
|
productGroupList = [],
|
|
49
|
-
modifiersSetList =[],
|
|
46
|
+
modifiersSetList = [],
|
|
50
47
|
providerHasMap = false,
|
|
51
48
|
venueMapSets = [],
|
|
52
49
|
providerHasBookingManagement,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CategoryType,
|
|
3
3
|
QuantityType,
|
|
4
|
-
QUANTITY_TYPE_CONSTANT,
|
|
5
|
-
QUANTITY_TYPE_LIST_DTO,
|
|
6
|
-
QUANTITY_TYPE_RECHARGING,
|
|
7
4
|
} from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper'
|
|
8
5
|
import { ProductType } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
|
|
9
6
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService'
|
|
@@ -28,13 +25,11 @@ import {
|
|
|
28
25
|
Controller,
|
|
29
26
|
Path,
|
|
30
27
|
useFormContext,
|
|
31
|
-
useWatch,
|
|
32
28
|
UnpackNestedValue,
|
|
33
29
|
PathValue,
|
|
34
30
|
} from 'react-hook-form'
|
|
35
31
|
import { useTranslation } from 'react-i18next'
|
|
36
32
|
import { useImages } from '@licklist/plugins/dist/hooks/Media/useImages'
|
|
37
|
-
|
|
38
33
|
import {
|
|
39
34
|
Image,
|
|
40
35
|
IMAGE_TYPE_IMAGE,
|
|
@@ -65,7 +60,7 @@ import { MAX_PRODUCT_DESCRIPTION_CHARACTERS_LENGTH } from './constants'
|
|
|
65
60
|
import { ProductZoneControlValues } from '../product-zone'
|
|
66
61
|
import { AdvancedOptions } from './advanced-options'
|
|
67
62
|
import { ProductZonesControl } from '../form/ProductZonesControl'
|
|
68
|
-
|
|
63
|
+
import { ProductScanRangeControl } from './scanRange'
|
|
69
64
|
|
|
70
65
|
export interface ModifiersSet {
|
|
71
66
|
id: number
|
|
@@ -87,6 +82,8 @@ export interface ProductControlValues
|
|
|
87
82
|
deposit: number
|
|
88
83
|
minQuantity: number
|
|
89
84
|
maxQuantity: number
|
|
85
|
+
scanRangeStart?: number
|
|
86
|
+
scanRangeEnd?: number
|
|
90
87
|
totalQuantity: number
|
|
91
88
|
isAvailable: boolean
|
|
92
89
|
isSoldOut: boolean
|
|
@@ -122,7 +119,6 @@ export interface ProductControlProps<T>
|
|
|
122
119
|
hasTicket?: boolean
|
|
123
120
|
categoryType?: CategoryType
|
|
124
121
|
isOverrides?: boolean
|
|
125
|
-
|
|
126
122
|
}
|
|
127
123
|
|
|
128
124
|
export function ProductControl<T extends FormValues>({
|
|
@@ -137,7 +133,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
137
133
|
categoryType,
|
|
138
134
|
isOverrides = false,
|
|
139
135
|
}: ProductControlProps<T>) {
|
|
140
|
-
|
|
141
136
|
const {
|
|
142
137
|
register,
|
|
143
138
|
control,
|
|
@@ -203,7 +198,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
203
198
|
setInitialImages(formImages as Image[])
|
|
204
199
|
}, [getValues, setInitialImages, fieldNamePrefix])
|
|
205
200
|
|
|
206
|
-
|
|
207
201
|
useEffect(() => {
|
|
208
202
|
if (Array.isArray(images)) {
|
|
209
203
|
setValue(
|
|
@@ -299,14 +293,14 @@ export function ProductControl<T extends FormValues>({
|
|
|
299
293
|
isOverrides={isOverrides}
|
|
300
294
|
onFocus={onFocus}
|
|
301
295
|
/>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
296
|
+
|
|
297
|
+
<ProductQuantityRechargingControl<T>
|
|
298
|
+
isLoading={isLoading}
|
|
299
|
+
fieldNamePrefix={fieldNamePrefix}
|
|
300
|
+
onFocus={onFocus}
|
|
301
|
+
disabled={isUnlimited}
|
|
302
|
+
/>
|
|
303
|
+
|
|
310
304
|
<Form.Group
|
|
311
305
|
controlId={unlimitedQuantityId}
|
|
312
306
|
className='custom-checkbox'
|
|
@@ -320,6 +314,13 @@ export function ProductControl<T extends FormValues>({
|
|
|
320
314
|
/>
|
|
321
315
|
<Form.Check.Label>{t('isUnlimited')}</Form.Check.Label>
|
|
322
316
|
</Form.Group>
|
|
317
|
+
|
|
318
|
+
<ProductScanRangeControl<T>
|
|
319
|
+
isLoading={isLoading}
|
|
320
|
+
fieldNamePrefix={fieldNamePrefix}
|
|
321
|
+
isOverrides={isOverrides}
|
|
322
|
+
onFocus={onFocus}
|
|
323
|
+
/>
|
|
323
324
|
</div>
|
|
324
325
|
</Col>
|
|
325
326
|
</Row>
|
|
@@ -411,6 +412,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
411
412
|
name={`${fieldNamePrefix}.isSoldOut` as Path<T>}
|
|
412
413
|
/>
|
|
413
414
|
</Form.Group>
|
|
415
|
+
|
|
414
416
|
<Form.Group controlId={advancedId} className='custom-checkbox'>
|
|
415
417
|
<Form.Check
|
|
416
418
|
custom
|
|
@@ -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}
|
|
@@ -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}
|
|
@@ -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
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// ProductScanRangeControl.stories.tsx
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
4
|
+
import Form from 'react-bootstrap/Form';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ProductScanRangeControl,
|
|
8
|
+
ProductScanRangeControlProps,
|
|
9
|
+
ProductScanRangeControlValues,
|
|
10
|
+
} from './ProductScanRangeControl';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof ProductScanRangeControl> = {
|
|
14
|
+
title: 'Product Set/Product/Scan Range',
|
|
15
|
+
component: ProductScanRangeControl,
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof ProductScanRangeControl>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
isLoading: false,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
render: (args: ProductScanRangeControlProps<{}>) => {
|
|
28
|
+
const methods = useForm<ProductScanRangeControlValues>({ mode: 'onChange' });
|
|
29
|
+
const onSubmit = (data: ProductScanRangeControlValues) =>
|
|
30
|
+
console.log('onSubmit', data);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<FormProvider {...methods}>
|
|
34
|
+
<Form
|
|
35
|
+
className="d-flex flex-column"
|
|
36
|
+
noValidate
|
|
37
|
+
onSubmit={methods.handleSubmit(onSubmit)}
|
|
38
|
+
>
|
|
39
|
+
<ProductScanRangeControl {...args} />
|
|
40
|
+
</Form>
|
|
41
|
+
</FormProvider>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|