@licklist/design 0.70.5 → 0.70.6-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/assets/iframe/available.svg +4 -4
- package/dist/assets/iframe/available.svg.js +16 -18
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/availability-indicator/AvailabilityIndicator.d.ts +4 -2
- package/dist/availability-indicator/AvailabilityIndicator.d.ts.map +1 -1
- package/dist/availability-indicator/AvailabilityIndicator.js +112 -18
- package/dist/calendar/Calendar.d.ts +2 -0
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +3 -2
- package/dist/calendar/utils/index.d.ts +8 -2
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +9 -21
- package/dist/date-time-button/DateContent.d.ts.map +1 -1
- package/dist/date-time-button/DateContent.js +3 -3
- package/dist/date-time-button/DateTimeButton.d.ts +3 -1
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +5 -3
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +3 -2
- 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-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/activity-card/ActivityCard.d.ts +3 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +5 -3
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts.map +1 -1
- package/dist/iframe/event/ticket-description/TicketDescription.js +43 -32
- 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/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +25 -12
- 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/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +48 -2
- package/dist/product-set/form/ProductSetForm.d.ts +4 -1
- 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.js +1 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts +12 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -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/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/advanced-options/AdvancedOptions.js +1 -1
- 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-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
- 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/admin/PaymentFeeForm.d.ts.map +1 -1
- package/dist/setting/admin/PaymentFeeForm.js +16 -1
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +11 -3
- package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +10 -4
- 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/availability-indicator/AvailabilityIndicator.scss +9 -0
- package/dist/styles/date-time-button/DateTimeButton.scss +2 -1
- package/dist/styles/iframe-events/TicketDescription.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +22 -0
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/dist/styles/sales/BookingFilter.scss +2 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +26 -29
- package/dist/tiptap-editor/TipTapEditor.d.ts +2 -1
- package/dist/tiptap-editor/TipTapEditor.d.ts.map +1 -1
- package/dist/tiptap-editor/TipTapEditor.js +32 -2
- 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/assets/iframe/available.svg +4 -4
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/availability-indicator/AvailabilityIndicator.tsx +92 -17
- package/src/calendar/Calendar.tsx +2 -0
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +3 -0
- package/src/calendar/utils/index.ts +17 -26
- package/src/date-time-button/DateContent.tsx +3 -3
- package/src/date-time-button/DateTimeButton.tsx +7 -3
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
- package/src/iframe/activity-card/ActivityCard.tsx +15 -2
- package/src/iframe/event/ticket-description/TicketDescription.tsx +35 -22
- 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/RyftPaymentForm.tsx +14 -3
- 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/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/ProductSetForm.tsx +6 -2
- package/src/product-set/form/ProductZonesControl.tsx +1 -4
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +0 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/product/ProductControl.tsx +0 -1
- 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-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/admin/PaymentFeeForm.tsx +5 -0
- package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
- package/src/snippet/snippet-template/preview/Preview.tsx +13 -5
- package/src/sortable-tree/SortableTreeItem.tsx +6 -0
- 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/availability-indicator/AvailabilityIndicator.scss +9 -0
- package/src/styles/date-time-button/DateTimeButton.scss +2 -1
- package/src/styles/iframe-events/TicketDescription.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +22 -0
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/src/styles/sales/BookingFilter.scss +2 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +26 -29
- package/src/tiptap-editor/TipTapEditor.tsx +8 -1
- package/src/zone/form/components/GameDurationControl.tsx +1 -0
- package/src/zone/form/components/SortControl.tsx +1 -0
- package/yarn.lock +176 -167
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useFormContext,
|
|
9
9
|
useWatch,
|
|
10
10
|
} from 'react-hook-form'
|
|
11
|
+
import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from 'react-icons/fa'
|
|
11
12
|
import { useTranslation } from 'react-i18next'
|
|
12
13
|
import { useSensor, MouseSensor } from '@dnd-kit/core'
|
|
13
14
|
import {
|
|
@@ -25,7 +26,11 @@ import { ProductCategoryControl } from '../product-category'
|
|
|
25
26
|
import { ProductCategory } from '../types'
|
|
26
27
|
import { ProductsControl } from './ProductsControl'
|
|
27
28
|
import { ProductSetFormValues, WithIsLoading } from './ProductSetForm'
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
SelectCategoryModal,
|
|
31
|
+
CATEGORY_TYPES_NAMES,
|
|
32
|
+
CategoryConfig,
|
|
33
|
+
} from './SelectCategoryModal'
|
|
29
34
|
import { ProductSetLoadingContext } from './context'
|
|
30
35
|
import { VenueMapSetModal } from './VenueMapSetModal'
|
|
31
36
|
import { moveArrayElements, sortArrayByIndex } from '../utils'
|
|
@@ -33,6 +38,29 @@ import { useSortableTreeFunctions } from '../hooks/useSortableTreeFunctions'
|
|
|
33
38
|
// @TODO not for first release
|
|
34
39
|
// import Popover from "./ProductSetFormPopover";
|
|
35
40
|
|
|
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
|
+
|
|
36
64
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
37
65
|
stepIndex: number
|
|
38
66
|
isOverrides?: boolean
|
|
@@ -228,6 +256,8 @@ export function ProductCategoriesControl({
|
|
|
228
256
|
setIsExpanded(productCategoryId)
|
|
229
257
|
}
|
|
230
258
|
|
|
259
|
+
const categoryType = CATEGORIES_TYPE[productCategory.type]
|
|
260
|
+
|
|
231
261
|
return (
|
|
232
262
|
<Controller
|
|
233
263
|
key={`product-category-${productCategory._id}`}
|
|
@@ -272,6 +302,12 @@ export function ProductCategoriesControl({
|
|
|
272
302
|
)}
|
|
273
303
|
modalClass={ProductSetModalClasses.category}
|
|
274
304
|
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
|
+
}
|
|
275
311
|
body={
|
|
276
312
|
<ProductCategoryControl
|
|
277
313
|
isLoading={isLoading}
|
|
@@ -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'
|
|
15
|
+
import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
|
|
16
16
|
import { Dialog, useDialogContext } from '../../modals/dialog'
|
|
17
17
|
import {
|
|
18
18
|
ProductSetControl,
|
|
@@ -28,12 +28,16 @@ import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
|
|
|
28
28
|
export interface WithIsLoading {
|
|
29
29
|
isLoading: boolean
|
|
30
30
|
}
|
|
31
|
+
export interface WithIdOptional {
|
|
32
|
+
id?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
export interface WithId {
|
|
32
36
|
id: number
|
|
33
37
|
}
|
|
34
38
|
export interface ProductSetFormValues
|
|
35
39
|
extends FormValues,
|
|
36
|
-
|
|
40
|
+
WithIdOptional,
|
|
37
41
|
ProductSetControlValues {
|
|
38
42
|
steps: Step[]
|
|
39
43
|
isOverrides?: boolean
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from 'react-icons/fa'
|
|
26
26
|
import { ProductSetLoadingContext } from './context'
|
|
27
27
|
|
|
28
|
-
const CATEGORY_TYPES_NAMES = {
|
|
28
|
+
export 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 @@ const CATEGORY_TYPES_NAMES = {
|
|
|
33
33
|
fixedDuration: CATEGORY_TYPE_FIXED_DURATION,
|
|
34
34
|
} as const
|
|
35
35
|
|
|
36
|
-
type CategoryConfig = { label: string; icon: ReactElement }
|
|
36
|
+
export type CategoryConfig = { label: string; icon: ReactElement }
|
|
37
37
|
|
|
38
38
|
const MAIN_CATEGORIES: Partial<Record<CategoryType, CategoryConfig>> = {
|
|
39
39
|
[CATEGORY_TYPES_NAMES.tickets]: {
|
|
@@ -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}
|
|
@@ -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
|
|
@@ -216,6 +216,7 @@ export function ProductCategoryControl({
|
|
|
216
216
|
step={1}
|
|
217
217
|
value={value === null ? '' : value}
|
|
218
218
|
onChange={onChange}
|
|
219
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
219
220
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
220
221
|
`${fieldNamePrefix}.minSubItems` as const,
|
|
221
222
|
errors,
|
|
@@ -288,6 +289,7 @@ export function ProductCategoryControl({
|
|
|
288
289
|
name={name}
|
|
289
290
|
value={value === null ? '' : value}
|
|
290
291
|
onChange={onChange}
|
|
292
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
291
293
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
292
294
|
`${fieldNamePrefix}.maxSubItems` as const,
|
|
293
295
|
errors,
|
|
@@ -348,6 +350,7 @@ export function ProductCategoryControl({
|
|
|
348
350
|
min={0}
|
|
349
351
|
step={1}
|
|
350
352
|
type='number'
|
|
353
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
351
354
|
disabled={isOverride}
|
|
352
355
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
353
356
|
`${fieldNamePrefix}.overallQuantity`,
|
|
@@ -530,6 +533,7 @@ export function ProductCategoryControl({
|
|
|
530
533
|
step={1}
|
|
531
534
|
value={value}
|
|
532
535
|
onChange={onChange}
|
|
536
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
533
537
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
534
538
|
`${fieldNamePrefix}.remainderExpireAfter` as const,
|
|
535
539
|
errors,
|
|
@@ -109,6 +109,7 @@ function RecurrenceEndInput({
|
|
|
109
109
|
type='number'
|
|
110
110
|
min={1}
|
|
111
111
|
max={500}
|
|
112
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
112
113
|
disabled={disabled || !count || count === 500}
|
|
113
114
|
aria-label='Occurrence count'
|
|
114
115
|
value={count ?? defaultOccurrences[frequency]}
|
|
@@ -27,6 +27,7 @@ export const CapacityControl = ({ isLoading }: CapacityControlProps) => {
|
|
|
27
27
|
required: true,
|
|
28
28
|
min: 1,
|
|
29
29
|
})}
|
|
30
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
30
31
|
placeholder={t('Design:capacity')}
|
|
31
32
|
isInvalid={Boolean(errors.capacity)}
|
|
32
33
|
disabled={isLoading}
|
|
@@ -179,6 +179,7 @@ export const CouponFormControl = ({
|
|
|
179
179
|
<Form.Label>{t('Design:discount')}</Form.Label>
|
|
180
180
|
<Form.Control
|
|
181
181
|
type='number'
|
|
182
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
182
183
|
isInvalid={errors.discount !== undefined}
|
|
183
184
|
{...register('discount', {
|
|
184
185
|
required: t('Validation:fieldRequired', {
|
|
@@ -316,6 +317,7 @@ export const CouponFormControl = ({
|
|
|
316
317
|
<Form.Control
|
|
317
318
|
{...register('totalCoupons')}
|
|
318
319
|
type='number'
|
|
320
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
319
321
|
isInvalid={errors.totalCoupons !== undefined}
|
|
320
322
|
disabled={isLoading}
|
|
321
323
|
/>
|
|
@@ -330,6 +332,7 @@ export const CouponFormControl = ({
|
|
|
330
332
|
<Form.Control
|
|
331
333
|
type='number'
|
|
332
334
|
{...register('usesPerUser')}
|
|
335
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
333
336
|
disabled={isLoading}
|
|
334
337
|
/>
|
|
335
338
|
</Form.Group>
|
|
@@ -342,6 +345,7 @@ export const CouponFormControl = ({
|
|
|
342
345
|
<Form.Control
|
|
343
346
|
type='number'
|
|
344
347
|
{...register('useAgain')}
|
|
348
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
345
349
|
disabled={isLoading}
|
|
346
350
|
/>
|
|
347
351
|
<Form.Text className='text-muted'>
|
|
@@ -355,6 +359,7 @@ export const CouponFormControl = ({
|
|
|
355
359
|
<Form.Control
|
|
356
360
|
type='number'
|
|
357
361
|
{...register('usesPerUserDay')}
|
|
362
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
358
363
|
disabled={isLoading}
|
|
359
364
|
/>
|
|
360
365
|
<Form.Text className='text-muted'>
|
|
@@ -370,6 +375,7 @@ export const CouponFormControl = ({
|
|
|
370
375
|
<Form.Control
|
|
371
376
|
type='number'
|
|
372
377
|
{...register('minAmount')}
|
|
378
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
373
379
|
disabled={isLoading}
|
|
374
380
|
/>
|
|
375
381
|
<Form.Text className='text-muted'>
|
|
@@ -383,6 +389,7 @@ export const CouponFormControl = ({
|
|
|
383
389
|
<Form.Control
|
|
384
390
|
type='number'
|
|
385
391
|
{...register('maxAmount')}
|
|
392
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
386
393
|
disabled={isLoading}
|
|
387
394
|
/>
|
|
388
395
|
<Form.Text className='text-muted'>
|
|
@@ -74,6 +74,7 @@ export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
|
74
74
|
max={100}
|
|
75
75
|
step='1'
|
|
76
76
|
placeholder='0'
|
|
77
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
77
78
|
{...register('feeInPercent', {
|
|
78
79
|
validate: {
|
|
79
80
|
moreThan: (v) => (v ? v >= 0 : true),
|
|
@@ -129,6 +130,7 @@ export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
|
129
130
|
max={999999.99}
|
|
130
131
|
step='0.01'
|
|
131
132
|
placeholder='0,00'
|
|
133
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
132
134
|
isInvalid={Boolean(errors.minFeeInPounds)}
|
|
133
135
|
disabled={isLoading}
|
|
134
136
|
/>
|
|
@@ -174,6 +176,7 @@ export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
|
174
176
|
max={999999.99}
|
|
175
177
|
step='0.01'
|
|
176
178
|
placeholder='0,00'
|
|
179
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
177
180
|
isInvalid={Boolean(errors.maxFeeInPounds)}
|
|
178
181
|
disabled={isLoading}
|
|
179
182
|
/>
|
|
@@ -231,6 +234,7 @@ export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
|
231
234
|
max={100}
|
|
232
235
|
step='1'
|
|
233
236
|
placeholder='0'
|
|
237
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
234
238
|
isInvalid={Boolean(errors.vatInPercent)}
|
|
235
239
|
disabled={isLoading}
|
|
236
240
|
/>
|
|
@@ -276,6 +280,7 @@ export function PaymentFeeForm({ isLoading = false }: PaymentFeeFormProps) {
|
|
|
276
280
|
max={999999.99}
|
|
277
281
|
step='0.01'
|
|
278
282
|
placeholder='0,00'
|
|
283
|
+
onWheel={(event) => event.currentTarget.blur()}
|
|
279
284
|
isInvalid={Boolean(errors.fixedFee)}
|
|
280
285
|
disabled={isLoading}
|
|
281
286
|
/>
|
|
@@ -3,9 +3,10 @@ import { useTranslation } from 'react-i18next'
|
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom'
|
|
4
4
|
import { Button } from 'react-bootstrap'
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '@licklist/core/dist/DataMapper/Provider/
|
|
6
|
+
SNIPPET_TEMPLATE_TYPE_VENUE_MAP,
|
|
7
|
+
SNIPPET_TEMPLATE_TYPE_EVENT_LIST,
|
|
8
|
+
} from '@licklist/core/dist/DataMapper/Provider/SnippetTemplateDataMapper'
|
|
9
|
+
|
|
9
10
|
import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
|
|
10
11
|
import { DateTime } from 'luxon'
|
|
11
12
|
import { Calendar, CalendarProps, defaultStartDay } from '../../../calendar'
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
import { NumberInput } from '../../../iframe/order-process/components/CategoryProduct/components/NumberInput'
|
|
29
30
|
import { SnippetTemplateContext } from '../context/snippetTemplate'
|
|
30
31
|
|
|
32
|
+
|
|
31
33
|
const DEFAULT_IMAGE =
|
|
32
34
|
'https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&auto=format&fit=crop&w=687&q=80'
|
|
33
35
|
|
|
@@ -46,7 +48,7 @@ export function Preview({
|
|
|
46
48
|
|
|
47
49
|
const { setView } = useContext(SnippetTemplateViewContext)
|
|
48
50
|
const {
|
|
49
|
-
template: { type =
|
|
51
|
+
template: { type = SNIPPET_TEMPLATE_TYPE_EVENT_LIST },
|
|
50
52
|
} = useContext(SnippetTemplateContext)
|
|
51
53
|
|
|
52
54
|
const handleOnClick = (nextView: keyof typeof snippetTemplateViews) => {
|
|
@@ -192,7 +194,7 @@ export function Preview({
|
|
|
192
194
|
</div>
|
|
193
195
|
</SettingButton>
|
|
194
196
|
|
|
195
|
-
{providerHasMap && type ===
|
|
197
|
+
{providerHasMap && type === SNIPPET_TEMPLATE_TYPE_VENUE_MAP && (
|
|
196
198
|
<>
|
|
197
199
|
<div className='pt-4'>
|
|
198
200
|
<h4>{t('Calendar')}</h4>
|
|
@@ -307,6 +309,7 @@ export function Preview({
|
|
|
307
309
|
productCategoryId: 57,
|
|
308
310
|
productGroupId: null,
|
|
309
311
|
availableQuantity: 980,
|
|
312
|
+
zoneId: null,
|
|
310
313
|
name: 'Cofee',
|
|
311
314
|
description: '',
|
|
312
315
|
price: 15,
|
|
@@ -315,6 +318,8 @@ export function Preview({
|
|
|
315
318
|
maxQuantity: 15,
|
|
316
319
|
totalQuantity: 980,
|
|
317
320
|
type: 'sale' as const,
|
|
321
|
+
capacity: 0,
|
|
322
|
+
duration: 0,
|
|
318
323
|
weight: 0,
|
|
319
324
|
isAvailable: true,
|
|
320
325
|
isSoldOut: false,
|
|
@@ -333,6 +338,7 @@ export function Preview({
|
|
|
333
338
|
productCategoryId: 57,
|
|
334
339
|
productGroupId: null,
|
|
335
340
|
availableQuantity: 980,
|
|
341
|
+
zoneId: null,
|
|
336
342
|
name: 'Cofee 2',
|
|
337
343
|
description: '',
|
|
338
344
|
price: 15,
|
|
@@ -341,6 +347,8 @@ export function Preview({
|
|
|
341
347
|
maxQuantity: 15,
|
|
342
348
|
totalQuantity: 980,
|
|
343
349
|
type: 'sale' as const,
|
|
350
|
+
capacity: 0,
|
|
351
|
+
duration: 0,
|
|
344
352
|
weight: 0,
|
|
345
353
|
isAvailable: true,
|
|
346
354
|
isSoldOut: false,
|
|
@@ -33,6 +33,7 @@ export interface SortableTreeItemProps {
|
|
|
33
33
|
body: ReactNode
|
|
34
34
|
children?: ReactNode
|
|
35
35
|
preItem?: ReactNode
|
|
36
|
+
itemButton?: ReactNode
|
|
36
37
|
postItem?: ReactNode
|
|
37
38
|
sortableItems?: string[]
|
|
38
39
|
isExpanded?: boolean
|
|
@@ -82,6 +83,7 @@ export function SortableTreeItem({
|
|
|
82
83
|
secondaryBadge,
|
|
83
84
|
setIsExpanded,
|
|
84
85
|
isOverride,
|
|
86
|
+
itemButton,
|
|
85
87
|
}: SortableTreeItemProps) {
|
|
86
88
|
const [expanded, setExpanded] = useState(isExpanded)
|
|
87
89
|
const [isModalVisible, setIsModalVisible] = useState(isNewAdded)
|
|
@@ -287,9 +289,13 @@ export function SortableTreeItem({
|
|
|
287
289
|
className={clsx(
|
|
288
290
|
'sortable-tree-item-title',
|
|
289
291
|
modalLabel && 'sortable-tree-product-set-element-title',
|
|
292
|
+
'd-flex justify-content-between',
|
|
290
293
|
)}
|
|
291
294
|
>
|
|
292
295
|
{title}
|
|
296
|
+
<div className='sortable-tree-item-subtitle'>
|
|
297
|
+
{itemButton}
|
|
298
|
+
</div>
|
|
293
299
|
</span>
|
|
294
300
|
{!expanded && (
|
|
295
301
|
<span className='sortable-tree-item-subtitle'>
|
|
@@ -15,7 +15,7 @@ body[bkdt-scrollable='false'] .bkdt-mask {
|
|
|
15
15
|
left: 0;
|
|
16
16
|
width: 100%;
|
|
17
17
|
height: 100%;
|
|
18
|
-
z-index:
|
|
18
|
+
z-index: 2147483646;
|
|
19
19
|
background-color: rgba(0, 0, 0, 0.5);
|
|
20
20
|
display: none;
|
|
21
21
|
}
|
|
@@ -24,7 +24,7 @@ body[bkdt-scrollable='false'] .bkdt-mask {
|
|
|
24
24
|
position: fixed;
|
|
25
25
|
top: 0;
|
|
26
26
|
left: 0;
|
|
27
|
-
z-index:
|
|
27
|
+
z-index: 2147483647;
|
|
28
28
|
display: none;
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 100%;
|