@licklist/design 0.69.5 → 0.69.6-dev.1
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/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/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +6 -6
- 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.js +2 -2
- package/dist/events/event-card/utils.d.ts +3 -2
- package/dist/events/event-card/utils.d.ts.map +1 -1
- package/dist/events/event-card/utils.js +14 -14
- 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 +8 -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/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +2 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts +2 -2
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +8 -2
- package/dist/iframe/ryft/utils/ryft-form.d.ts +2 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +20 -1
- 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/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +4 -3
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +6 -5
- 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 +57 -2
- 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/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 +6 -0
- 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/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +22 -0
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +25 -0
- 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 +9 -8
- package/src/affiliate/form/AffiliateForm.tsx +1 -0
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/calendar/utils/index.ts +17 -26
- package/src/date-time-button/DateContent.tsx +3 -3
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +12 -10
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/events/event-card/EventCard.tsx +2 -2
- package/src/events/event-card/utils.ts +16 -21
- package/src/iframe/activity-card/ActivityCard.tsx +6 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/iframe/ryft/RyftPaymentForm.tsx +9 -4
- package/src/iframe/ryft/utils/ryft-form.ts +28 -2
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -1
- package/src/product-set/control/DateInput.tsx +5 -2
- package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/ProductSetForm.tsx +15 -3
- 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 +6 -0
- 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/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +22 -0
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +25 -0
- 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 +31 -58
|
@@ -77,6 +77,9 @@ var GameDurationControl = function(param) {
|
|
|
77
77
|
required: false,
|
|
78
78
|
min: 1
|
|
79
79
|
})), {
|
|
80
|
+
onWheel: function(event) {
|
|
81
|
+
return event.currentTarget.blur();
|
|
82
|
+
},
|
|
80
83
|
placeholder: t('Design:duration'),
|
|
81
84
|
isInvalid: Boolean(errors.defaultDuration),
|
|
82
85
|
disabled: isLoading
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/SortControl.tsx"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SortControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/SortControl.tsx"],"names":[],"mappings":"AAOA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,4CAoC1D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.6-dev.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.30.
|
|
45
|
+
"@licklist/core": "0.30.5-dev.0",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
|
-
"@licklist/plugins": "0.33.4",
|
|
47
|
+
"@licklist/plugins": "0.33.4-dev.0",
|
|
48
48
|
"lodash": "4.17.21",
|
|
49
49
|
"luxon": "3.5.0",
|
|
50
50
|
"react": "17.0.2",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@dnd-kit/utilities": "2.0.0",
|
|
62
62
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
63
63
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
64
|
-
"@licklist/core": "0.30.
|
|
64
|
+
"@licklist/core": "0.30.5-dev.0",
|
|
65
65
|
"@licklist/eslint-config": "0.5.6",
|
|
66
|
-
"@licklist/plugins": "0.33.4",
|
|
66
|
+
"@licklist/plugins": "0.33.4-dev.0",
|
|
67
67
|
"@mantine/core": "6.0.22",
|
|
68
68
|
"@mantine/hooks": "6.0.22",
|
|
69
69
|
"@mdx-js/react": "1.6.22",
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
"bootstrap": "4.6.0",
|
|
96
96
|
"bootstrap-social": "5.1.1",
|
|
97
97
|
"clsx": "1.1.1",
|
|
98
|
-
"date-fns": "2.29.3",
|
|
99
98
|
"emojibase": "6.1.0",
|
|
100
99
|
"emojibase-data": "7.0.1",
|
|
101
100
|
"emojibase-regex": "6.0.1",
|
|
@@ -202,8 +201,10 @@
|
|
|
202
201
|
"yarn tsc"
|
|
203
202
|
]
|
|
204
203
|
},
|
|
204
|
+
"packageManager": "yarn@4.4.0",
|
|
205
205
|
"volta": {
|
|
206
206
|
"node": "20.9.0",
|
|
207
207
|
"yarn": "4.4.0"
|
|
208
|
-
}
|
|
209
|
-
|
|
208
|
+
},
|
|
209
|
+
"stableVersion": "0.69.1-dev.3"
|
|
210
|
+
}
|
|
@@ -76,6 +76,7 @@ export const AffiliateForm = ({
|
|
|
76
76
|
const copyToClipboard = () =>
|
|
77
77
|
// eslint-disable-next-line consistent-return
|
|
78
78
|
window.navigator.clipboard.writeText(formValues.link)
|
|
79
|
+
|
|
79
80
|
return (
|
|
80
81
|
<FormProvider {...form}>
|
|
81
82
|
<Form onSubmit={form.handleSubmit(handleSubmit)}>
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
+
import { TimeZone } from '@licklist/core/dist/DataMapper/Common/TimeZoneDataMapper'
|
|
1
2
|
import { DateTime, Interval } from 'luxon'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
initialDate
|
|
5
|
-
timeZone
|
|
6
|
-
)
|
|
4
|
+
type Builder = (args: {
|
|
5
|
+
initialDate?: DateTime
|
|
6
|
+
timeZone: TimeZone['name']
|
|
7
|
+
}) => DateTime[]
|
|
8
|
+
|
|
9
|
+
export const getMonthCalendarDates: Builder = ({
|
|
10
|
+
initialDate: _initialDate,
|
|
11
|
+
timeZone,
|
|
12
|
+
}): DateTime[] => {
|
|
13
|
+
const initialDate = _initialDate || DateTime.now().setZone(timeZone)
|
|
14
|
+
|
|
7
15
|
const startOfMonth = initialDate.startOf('month')
|
|
8
16
|
const endOfMonth = initialDate.endOf('month')
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
return Interval.fromDateTimes(startOfMonth, endOfMonth)
|
|
11
19
|
.splitBy({ day: 1 })
|
|
12
20
|
.map((d) => d.start)
|
|
13
|
-
|
|
14
|
-
if (timeZone) {
|
|
15
|
-
return dateTimes.map((date) =>
|
|
16
|
-
date.setZone(timeZone, { keepLocalTime: true }),
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return dateTimes
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const getWeekCalendarDates = (
|
|
24
|
-
initialDate
|
|
25
|
-
|
|
26
|
-
): DateTime[] => {
|
|
23
|
+
export const getWeekCalendarDates: Builder = ({ timeZone }): DateTime[] => {
|
|
24
|
+
const initialDate = DateTime.now().setZone(timeZone)
|
|
25
|
+
|
|
27
26
|
const lastDay = initialDate.plus({ days: 7 })
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
return Interval.fromDateTimes(initialDate, lastDay)
|
|
30
29
|
.splitBy({ day: 1 })
|
|
31
30
|
.map((d) => d.start)
|
|
32
|
-
|
|
33
|
-
if (timeZone) {
|
|
34
|
-
return dateTimes.map((date) =>
|
|
35
|
-
date.setZone(timeZone, { keepLocalTime: true }),
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return dateTimes
|
|
40
31
|
}
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from '@licklist/core/dist/Config'
|
|
7
7
|
import { getDayWithOrdinal } from '@licklist/plugins/dist/utils/formatDate'
|
|
8
8
|
import clsx from 'clsx'
|
|
9
|
-
import { isToday, isTomorrow } from 'date-fns'
|
|
10
9
|
import { DateTime } from 'luxon'
|
|
11
10
|
import { useTranslation } from 'react-i18next'
|
|
11
|
+
import { isToday, isTomorrow } from '@licklist/plugins/dist'
|
|
12
12
|
import { DateTimeButtonProps, Variant } from './DateTimeButton'
|
|
13
13
|
|
|
14
14
|
type DateContentProps = Pick<
|
|
@@ -55,9 +55,9 @@ export const DateContent = ({
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const getDate = (date: DateTime): string => {
|
|
58
|
-
if (isToday(date
|
|
58
|
+
if (isToday(date)) return 'today'
|
|
59
59
|
|
|
60
|
-
if (isTomorrow(date
|
|
60
|
+
if (isTomorrow(date)) return 'tomorrow'
|
|
61
61
|
|
|
62
62
|
return date.toFormat(DAY_OF_WEEK)
|
|
63
63
|
}
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { useId } from '@react-aria/utils'
|
|
|
5
5
|
import { Controller, useFormContext } from 'react-hook-form'
|
|
6
6
|
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
|
|
7
7
|
import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
|
|
8
|
+
import { uniqBy } from 'lodash'
|
|
8
9
|
import { getTypeHeadItemsFromMenus } from '../../../../product-set/utils'
|
|
9
10
|
import { ConfirmModal } from '../../../../modals/confirmation/ConfirmModal'
|
|
10
11
|
import { EditEventFormValues } from '../EditEventForm/EditEventForm'
|
|
@@ -52,16 +53,17 @@ export const SelectEventProductSet = ({
|
|
|
52
53
|
const productSetId = watch('productSetId')
|
|
53
54
|
const editedProductSet = watch('editedProductSet')
|
|
54
55
|
|
|
55
|
-
const typeheadValues =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
const typeheadValues = uniqBy(
|
|
57
|
+
getTypeHeadItemsFromMenus(
|
|
58
|
+
editedProductSet
|
|
59
|
+
? productSets.map((productSet) =>
|
|
60
|
+
productSet.id === editedProductSet.id
|
|
61
|
+
? editedProductSet
|
|
62
|
+
: productSet,
|
|
63
|
+
)
|
|
64
|
+
: productSets,
|
|
65
|
+
),
|
|
66
|
+
(item) => item.id,
|
|
65
67
|
)
|
|
66
68
|
const selectedProductSetTypeheadValue = productSetId
|
|
67
69
|
? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
|
|
@@ -23,7 +23,7 @@ import { Sale } from '../../types/bookings'
|
|
|
23
23
|
import { TipTapEditor } from '../../tiptap-editor/TipTapEditor'
|
|
24
24
|
import {
|
|
25
25
|
EVENT_DESCRIPTION_SIZE,
|
|
26
|
-
|
|
26
|
+
formatContent,
|
|
27
27
|
getStatisticInfo,
|
|
28
28
|
} from './utils'
|
|
29
29
|
import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
|
|
@@ -66,7 +66,7 @@ export function EventCard({
|
|
|
66
66
|
const { formatNumber, formatDate } = useIntl()
|
|
67
67
|
const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
|
|
68
68
|
const memoedContent = useMemo(
|
|
69
|
-
() =>
|
|
69
|
+
() => formatContent(description, EVENT_DESCRIPTION_SIZE),
|
|
70
70
|
[description],
|
|
71
71
|
)
|
|
72
72
|
|
|
@@ -2,30 +2,25 @@ import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config'
|
|
|
2
2
|
import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
|
|
3
3
|
import { DateTime } from 'luxon'
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return content
|
|
9
|
-
}
|
|
5
|
+
export const MIN_EVENT_DESCRIPTION_SIZE = 150;
|
|
6
|
+
export const EVENT_DESCRIPTION_SIZE = 350;
|
|
7
|
+
export const EMOJI_REGEX = /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g;
|
|
10
8
|
|
|
11
|
-
export const
|
|
12
|
-
content
|
|
13
|
-
maxLength = EVENT_DESCRIPTION_SIZE,
|
|
14
|
-
) => {
|
|
15
|
-
if (!content) return ''
|
|
16
|
-
if (content < maxLength) return content
|
|
17
|
-
const text = content.replace(/<[^>]*>/g, '')
|
|
18
|
-
const trimmedText = text
|
|
19
|
-
.trim()
|
|
20
|
-
.replace(/ |[^a-zA-Z0-9\s]/g, '')
|
|
21
|
-
.replace(/\s\s+/g, ' ')
|
|
9
|
+
export const formatContent = (content, maxLength = EVENT_DESCRIPTION_SIZE) => {
|
|
10
|
+
if (!content) return '';
|
|
22
11
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const replacedContent = replaceEmojiImagesWithText(content);
|
|
13
|
+
|
|
14
|
+
if (replacedContent.length <= maxLength) {
|
|
15
|
+
return replacedContent;
|
|
16
|
+
}
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
return replacedContent.slice(0, maxLength).concat('...');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function replaceEmojiImagesWithText(text) {
|
|
22
|
+
return text.replace(EMOJI_REGEX, (_, emojiText) => emojiText);
|
|
23
|
+
}
|
|
29
24
|
|
|
30
25
|
/**
|
|
31
26
|
* Calculate the total number of views from the given dates and event statistic.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
4
|
+
import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
|
|
5
|
+
import { AvailabilityIndicator } from '../../availability-indicator'
|
|
4
6
|
|
|
5
7
|
export const LAYOUT_GRID = 'grid'
|
|
6
8
|
export const LAYOUT_LIST = 'list'
|
|
@@ -15,6 +17,7 @@ export type ActivityCardProps = {
|
|
|
15
17
|
layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST
|
|
16
18
|
availableTimes?: string | null
|
|
17
19
|
image?: Image | null
|
|
20
|
+
resources?: ZoneResourcesAvailability
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
export const ActivityCard = ({
|
|
@@ -27,6 +30,7 @@ export const ActivityCard = ({
|
|
|
27
30
|
onSelect,
|
|
28
31
|
isSelected,
|
|
29
32
|
layout = LAYOUT_GRID,
|
|
33
|
+
resources,
|
|
30
34
|
}: ActivityCardProps) => {
|
|
31
35
|
if (layout === LAYOUT_GRID) {
|
|
32
36
|
return (
|
|
@@ -46,6 +50,7 @@ export const ActivityCard = ({
|
|
|
46
50
|
{description && (
|
|
47
51
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
48
52
|
)}
|
|
53
|
+
{resources && <AvailabilityIndicator resources={resources} />}
|
|
49
54
|
</div>
|
|
50
55
|
</button>
|
|
51
56
|
)
|
|
@@ -71,6 +76,7 @@ export const ActivityCard = ({
|
|
|
71
76
|
{description && (
|
|
72
77
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
73
78
|
)}
|
|
79
|
+
{resources && <AvailabilityIndicator resources={resources} />}
|
|
74
80
|
</div>
|
|
75
81
|
|
|
76
82
|
<hr className='list-activity-card-hr' />
|
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
|
}`}
|
|
@@ -38,7 +38,7 @@ export interface RyftPaymentFormProps {
|
|
|
38
38
|
isCreateLoading: boolean
|
|
39
39
|
isAppUsingInIframe?: boolean
|
|
40
40
|
onApplePayButtonClick?: () => void
|
|
41
|
-
|
|
41
|
+
payButtonDisabled?: boolean
|
|
42
42
|
initRyft: (
|
|
43
43
|
onSuccess: () => void,
|
|
44
44
|
onFailure: (error?: string) => void,
|
|
@@ -57,6 +57,7 @@ export const RyftPaymentForm = ({
|
|
|
57
57
|
initRyft,
|
|
58
58
|
resetReferrer,
|
|
59
59
|
onSubmit,
|
|
60
|
+
payButtonDisabled,
|
|
60
61
|
}: RyftPaymentFormProps) => {
|
|
61
62
|
const { t } = useTranslation(['Design', 'Validation', 'Ryft'])
|
|
62
63
|
const formRef = useRef<HTMLFormElement | null>(null)
|
|
@@ -89,7 +90,6 @@ export const RyftPaymentForm = ({
|
|
|
89
90
|
|
|
90
91
|
const handleSubmit = async () => {
|
|
91
92
|
setIsBtnDisabled(true)
|
|
92
|
-
|
|
93
93
|
try {
|
|
94
94
|
const paymentSession = await onSubmit()
|
|
95
95
|
|
|
@@ -142,17 +142,21 @@ export const RyftPaymentForm = ({
|
|
|
142
142
|
t,
|
|
143
143
|
isAppUsingInIframe,
|
|
144
144
|
onApplePayButtonClick,
|
|
145
|
+
isDisableButton: !payButtonDisabled,
|
|
145
146
|
additionalPaymentMethodsEnabled:
|
|
146
147
|
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
147
148
|
})
|
|
148
149
|
},
|
|
149
150
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
150
|
-
[
|
|
151
|
+
[
|
|
152
|
+
formRef.current?.childNodes?.length,
|
|
153
|
+
showApplePayButton,
|
|
154
|
+
payButtonDisabled,
|
|
155
|
+
],
|
|
151
156
|
)
|
|
152
157
|
|
|
153
158
|
useEffect(() => {
|
|
154
159
|
if (!accountId.data?.account_id || accountId.isError) return
|
|
155
|
-
|
|
156
160
|
initRyft(
|
|
157
161
|
() => {
|
|
158
162
|
addEventHandler('cardValidationChanged', (e: MessageEvent['data']) => {
|
|
@@ -215,6 +219,7 @@ export const RyftPaymentForm = ({
|
|
|
215
219
|
onSubmit={methods.handleSubmit(handleSubmit)}
|
|
216
220
|
className='ryft-payment-form'
|
|
217
221
|
>
|
|
222
|
+
<div className='form-disable-box' id='form-disable-box' />
|
|
218
223
|
<div className='submit-button-wrapper mt-4 p-1'>
|
|
219
224
|
<Button type='submit' disabled={isBtnDisabled || !isValid}>
|
|
220
225
|
{isBtnDisabled && <ButtonLoader />}
|
|
@@ -7,6 +7,7 @@ interface InjectComponentsInRyftForm
|
|
|
7
7
|
'onApplePayButtonClick' | 'isAppUsingInIframe'
|
|
8
8
|
> {
|
|
9
9
|
t: TFunction<string[]>
|
|
10
|
+
isDisableButton?: boolean
|
|
10
11
|
additionalPaymentMethodsEnabled?: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -14,16 +15,19 @@ export const injectComponentsInRyftForm = ({
|
|
|
14
15
|
t,
|
|
15
16
|
additionalPaymentMethodsEnabled,
|
|
16
17
|
isAppUsingInIframe,
|
|
18
|
+
isDisableButton,
|
|
17
19
|
onApplePayButtonClick,
|
|
18
20
|
}: InjectComponentsInRyftForm) => {
|
|
19
21
|
const cardContainer = document.getElementById('ryft-pay-iframe')
|
|
20
|
-
|
|
21
22
|
if (!cardContainer) {
|
|
22
23
|
return
|
|
23
24
|
}
|
|
24
25
|
// Removing of the old title container
|
|
25
26
|
document.getElementById('card-title-container')?.remove()
|
|
26
27
|
|
|
28
|
+
cardContainer.style.opacity = isDisableButton ? '0.6' : '1'
|
|
29
|
+
cardContainer.ariaDisabled = isDisableButton?.toString()
|
|
30
|
+
|
|
27
31
|
const cardTitle = document.createElement('div')
|
|
28
32
|
const cardText = document.createElement('div')
|
|
29
33
|
const cardTitleContainer = document.createElement('div')
|
|
@@ -35,7 +39,6 @@ export const injectComponentsInRyftForm = ({
|
|
|
35
39
|
cardContainer?.before(cardTitleContainer)
|
|
36
40
|
|
|
37
41
|
const payGrid = document.getElementById('ryft-pay-grid')
|
|
38
|
-
|
|
39
42
|
if (!payGrid || !additionalPaymentMethodsEnabled) {
|
|
40
43
|
return
|
|
41
44
|
}
|
|
@@ -58,6 +61,29 @@ export const injectComponentsInRyftForm = ({
|
|
|
58
61
|
divider.id = 'mobile-pay-divider'
|
|
59
62
|
container.id = 'mobile-pay-divider-container'
|
|
60
63
|
container.append(dividerText, divider)
|
|
64
|
+
const payIframe = document.getElementById('ryft-pay-iframe')
|
|
65
|
+
if (payIframe) {
|
|
66
|
+
const formBox = document.getElementById('form-disable-box')
|
|
67
|
+
if (formBox) {
|
|
68
|
+
formBox.style.display = isDisableButton ? 'block' : 'none'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const googleButton = document.getElementById(
|
|
72
|
+
'gpay-button-online-api-id',
|
|
73
|
+
) as HTMLButtonElement
|
|
74
|
+
const appleButton = document.getElementById(
|
|
75
|
+
'ryft-pay-apple-pay-button',
|
|
76
|
+
) as HTMLButtonElement
|
|
77
|
+
if (googleButton) {
|
|
78
|
+
googleButton.disabled = isDisableButton
|
|
79
|
+
googleButton.style.opacity = isDisableButton ? '1' : '0.6'
|
|
80
|
+
}
|
|
81
|
+
if (appleButton) {
|
|
82
|
+
appleButton.disabled = isDisableButton
|
|
83
|
+
appleButton.style.opacity = isDisableButton ? '1' : '0.6'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
61
87
|
if (isAppUsingInIframe) {
|
|
62
88
|
const applePayButton = document.createElement('button')
|
|
63
89
|
applePayButton.id = 'apple-pay'
|
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 || ''}
|
|
@@ -198,6 +198,8 @@ export const DateAndRecurrenceInput = ({
|
|
|
198
198
|
move(prevIndex, nextIndex)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
|
|
202
|
+
|
|
201
203
|
useEffect(() => {
|
|
202
204
|
if (fields.length) {
|
|
203
205
|
clearErrors('menuRecurrences')
|
|
@@ -307,7 +309,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
307
309
|
/>
|
|
308
310
|
|
|
309
311
|
<div className='manual-form-error'>
|
|
310
|
-
{
|
|
312
|
+
{errorMessage}
|
|
311
313
|
</div>
|
|
312
314
|
</div>
|
|
313
315
|
</OverlayTrigger>
|
|
@@ -195,6 +195,8 @@ export const DateInput = ({
|
|
|
195
195
|
}, 100)
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
|
|
199
|
+
|
|
198
200
|
return (
|
|
199
201
|
<Form.Group>
|
|
200
202
|
<Form.Label>
|
|
@@ -247,7 +249,8 @@ export const DateInput = ({
|
|
|
247
249
|
menuRecurrence={menuRecurrence}
|
|
248
250
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
249
251
|
errorMessage={
|
|
250
|
-
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
252
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
253
|
+
?.message || errors?.menuRecurrences?.[`${index}`]?.message
|
|
251
254
|
}
|
|
252
255
|
/>
|
|
253
256
|
))}
|
|
@@ -282,7 +285,7 @@ export const DateInput = ({
|
|
|
282
285
|
/>
|
|
283
286
|
|
|
284
287
|
<div className='manual-form-error'>
|
|
285
|
-
{
|
|
288
|
+
{errorMessage}
|
|
286
289
|
</div>
|
|
287
290
|
</div>
|
|
288
291
|
</OverlayTrigger>
|
|
@@ -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}
|