@licklist/design 0.70.8-dev.0 → 0.70.9
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 +18 -16
- package/dist/auth/Login/LoginComponent.js +1 -2
- package/dist/availability-indicator/AvailabilityIndicator.d.ts +2 -4
- package/dist/availability-indicator/AvailabilityIndicator.d.ts.map +1 -1
- package/dist/availability-indicator/AvailabilityIndicator.js +18 -112
- package/dist/calendar/Calendar.d.ts +0 -2
- 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 +2 -3
- package/dist/calendar/utils/index.d.ts +2 -8
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +21 -9
- 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 +1 -3
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +3 -5
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -3
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +0 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +4 -11
- package/dist/iframe/activity-card/ActivityCard.d.ts +1 -3
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +3 -5
- 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 +0 -13
- 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 +5 -4
- package/dist/layout/DropDown.d.ts +1 -2
- 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 +0 -3
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +2 -48
- package/dist/product-set/form/ProductSetForm.d.ts +1 -4
- 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 +2 -0
- package/dist/product-set/form/ProductsControl.js +0 -1
- package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
- 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 +3 -0
- package/dist/product-set/form/VenueMapSetModal.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapSetModal.js +7 -7
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +3 -0
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/advanced-options/AdvancedOptions.js +0 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +0 -3
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
- 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 +0 -3
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +0 -3
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +2 -0
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +0 -21
- package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
- package/dist/setting/admin/PaymentFeeForm.js +1 -16
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +0 -8
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +4 -10
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +0 -3
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +0 -3
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +0 -3
- package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
- package/dist/styles/date-time-button/DateTimeButton.scss +1 -2
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +0 -22
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
- 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 +0 -3
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +0 -3
- package/package.json +6 -8
- package/src/affiliate/form/AffiliateForm.tsx +0 -1
- package/src/assets/iframe/available.svg +4 -4
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/availability-indicator/AvailabilityIndicator.tsx +17 -92
- package/src/calendar/Calendar.tsx +0 -2
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +0 -3
- package/src/calendar/utils/index.ts +26 -17
- package/src/date-time-button/DateContent.tsx +3 -3
- package/src/date-time-button/DateTimeButton.tsx +3 -7
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/events/event-venue-map/EventVenueMap.tsx +0 -1
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +1 -5
- package/src/iframe/activity-card/ActivityCard.tsx +2 -15
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
- package/src/iframe/ryft/utils/ryft-form.ts +5 -6
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
- package/src/product-set/form/ProductSetForm.tsx +2 -6
- package/src/product-set/form/ProductZonesControl.tsx +4 -1
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/form/VenueMapSetModal.tsx +9 -8
- package/src/product-set/form/VenueMapsControl.tsx +3 -0
- package/src/product-set/product/ProductControl.tsx +1 -0
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
- package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
- package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
- package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
- package/src/resource/form/components/CapacityControl.tsx +0 -1
- package/src/resource/form/components/SortControl.tsx +0 -1
- package/src/sales/booking/results/components/ResultCard.tsx +2 -0
- package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
- package/src/setting/admin/PaymentFeeForm.tsx +0 -5
- package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
- package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
- package/src/sortable-tree/SortableTreeItem.tsx +0 -6
- package/src/static/CurrencyNumberInput.tsx +0 -1
- package/src/static/form-number-input/FormNumberInput.tsx +0 -1
- package/src/static/number-input/NumberInput.tsx +0 -1
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
- package/src/styles/date-time-button/DateTimeButton.scss +1 -2
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +0 -22
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/components/GameDurationControl.tsx +0 -1
- package/src/zone/form/components/SortControl.tsx +0 -1
- package/yarn.lock +18 -20
|
@@ -77,9 +77,6 @@ var GameDurationControl = function(param) {
|
|
|
77
77
|
required: false,
|
|
78
78
|
min: 1
|
|
79
79
|
})), {
|
|
80
|
-
onWheel: function(event) {
|
|
81
|
-
return event.currentTarget.blur();
|
|
82
|
-
},
|
|
83
80
|
placeholder: t('Design:duration'),
|
|
84
81
|
isInvalid: Boolean(errors.defaultDuration),
|
|
85
82
|
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,4CAmC1D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.9",
|
|
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.
|
|
45
|
+
"@licklist/core": "0.30.3",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
|
-
"@licklist/plugins": "0.
|
|
47
|
+
"@licklist/plugins": "0.33.6",
|
|
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.31.
|
|
64
|
+
"@licklist/core": "0.31.3",
|
|
65
65
|
"@licklist/eslint-config": "0.5.6",
|
|
66
|
-
"@licklist/plugins": "0.
|
|
66
|
+
"@licklist/plugins": "0.33.6",
|
|
67
67
|
"@mantine/core": "6.0.22",
|
|
68
68
|
"@mantine/hooks": "6.0.22",
|
|
69
69
|
"@mdx-js/react": "1.6.22",
|
|
@@ -202,10 +202,8 @@
|
|
|
202
202
|
"yarn tsc"
|
|
203
203
|
]
|
|
204
204
|
},
|
|
205
|
-
"packageManager": "yarn@4.4.0",
|
|
206
205
|
"volta": {
|
|
207
206
|
"node": "20.9.0",
|
|
208
207
|
"yarn": "4.4.0"
|
|
209
|
-
}
|
|
210
|
-
"stableVersion": "0.69.1-dev.3"
|
|
208
|
+
}
|
|
211
209
|
}
|
|
@@ -76,7 +76,6 @@ export const AffiliateForm = ({
|
|
|
76
76
|
const copyToClipboard = () =>
|
|
77
77
|
// eslint-disable-next-line consistent-return
|
|
78
78
|
window.navigator.clipboard.writeText(formValues.link)
|
|
79
|
-
|
|
80
79
|
return (
|
|
81
80
|
<FormProvider {...form}>
|
|
82
81
|
<Form onSubmit={form.handleSubmit(handleSubmit)}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
<rect x="
|
|
3
|
-
<rect x="
|
|
4
|
-
<rect x="
|
|
1
|
+
<svg width="7" height="11" viewBox="0 0 7 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="0.943939" y="1.03658" width="5.25188" height="3.04878" rx="1.5" fill="#4CF973" stroke="white"/>
|
|
3
|
+
<rect x="0.943939" y="4.10976" width="5.25188" height="3.04878" rx="1.5" fill="#4CF973" stroke="white"/>
|
|
4
|
+
<rect x="0.943939" y="7.18292" width="5.25188" height="3.04878" rx="1.5" fill="#4CF973" stroke="white"/>
|
|
5
5
|
</svg>
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { FunctionComponent, SVGProps } from 'react'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
|
|
4
|
-
import {
|
|
5
|
-
AVAILABILITY_FORMAT_NUMBER,
|
|
6
|
-
AvailabilityFormat,
|
|
7
|
-
} from '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper'
|
|
8
|
-
import { useWindowDimensions } from '@licklist/plugins'
|
|
9
4
|
import { ReactComponent as AvailableIcon } from '../assets/iframe/available.svg'
|
|
10
5
|
import { ReactComponent as LimitedIcon } from '../assets/iframe/limited.svg'
|
|
11
6
|
import { ReactComponent as SoldOutIcon } from '../assets/iframe/soldOut.svg'
|
|
12
|
-
import { TAB_WIDTH } from '../iframe/page/components/PageBody/constants'
|
|
13
7
|
|
|
14
8
|
const LOTS_OF_SPACE_LIMIT = 0.2
|
|
15
9
|
const LIMITED_LIMIT = 0.8
|
|
@@ -19,94 +13,38 @@ type Config = {
|
|
|
19
13
|
Icon: FunctionComponent<SVGProps<SVGSVGElement>>
|
|
20
14
|
}
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
argument?: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface GetIconsAndLabels extends ZoneResourcesAvailability {
|
|
27
|
-
availabilityFormat?: AvailabilityFormat | null
|
|
28
|
-
}
|
|
29
|
-
interface GetAppropreateLabelFormat extends GetIconsAndLabels {
|
|
30
|
-
label?: string
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const getLabelsWithArgument = ({
|
|
16
|
+
const getIconsAndLabels = ({
|
|
34
17
|
bookedResources,
|
|
35
18
|
totalResources,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
label: string
|
|
40
|
-
argument?: number
|
|
41
|
-
} => {
|
|
42
|
-
const availableResources = totalResources - bookedResources
|
|
43
|
-
|
|
44
|
-
if (availabilityFormat !== AVAILABILITY_FORMAT_NUMBER) {
|
|
45
|
-
return { label }
|
|
19
|
+
}: ZoneResourcesAvailability): Config => {
|
|
20
|
+
if (bookedResources === totalResources) {
|
|
21
|
+
return { label: 'soldOut', Icon: SoldOutIcon }
|
|
46
22
|
}
|
|
47
23
|
|
|
48
|
-
return availableResources === 1
|
|
49
|
-
? { label: 'availableSingleSpace' }
|
|
50
|
-
: { label: 'availableMultipleSpaces', argument: availableResources }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const getIconsAndLabelsWithArgument = ({
|
|
54
|
-
bookedResources,
|
|
55
|
-
totalResources,
|
|
56
|
-
availabilityFormat,
|
|
57
|
-
}: GetIconsAndLabels): GetIconsAndLabelsWithArgumentResult => {
|
|
58
24
|
// lots of space if less than 80% booked
|
|
59
25
|
if (bookedResources / totalResources <= LOTS_OF_SPACE_LIMIT) {
|
|
60
|
-
return {
|
|
61
|
-
...getLabelsWithArgument({
|
|
62
|
-
bookedResources,
|
|
63
|
-
totalResources,
|
|
64
|
-
availabilityFormat,
|
|
65
|
-
label: 'lotsOfSpace',
|
|
66
|
-
}),
|
|
67
|
-
Icon: AvailableIcon,
|
|
68
|
-
}
|
|
26
|
+
return { label: 'lotsOfSpace', Icon: AvailableIcon }
|
|
69
27
|
}
|
|
70
28
|
|
|
71
29
|
if (bookedResources / totalResources >= LIMITED_LIMIT) {
|
|
72
|
-
return {
|
|
73
|
-
...getLabelsWithArgument({
|
|
74
|
-
bookedResources,
|
|
75
|
-
totalResources,
|
|
76
|
-
availabilityFormat,
|
|
77
|
-
label: 'limited',
|
|
78
|
-
}),
|
|
79
|
-
Icon: LimitedIcon,
|
|
80
|
-
}
|
|
30
|
+
return { label: 'limited', Icon: LimitedIcon }
|
|
81
31
|
}
|
|
82
32
|
|
|
83
|
-
return {
|
|
84
|
-
...getLabelsWithArgument({
|
|
85
|
-
bookedResources,
|
|
86
|
-
totalResources,
|
|
87
|
-
availabilityFormat,
|
|
88
|
-
label: 'available',
|
|
89
|
-
}),
|
|
90
|
-
Icon: AvailableIcon,
|
|
91
|
-
}
|
|
33
|
+
return { label: 'available', Icon: AvailableIcon }
|
|
92
34
|
}
|
|
93
35
|
|
|
94
36
|
type AvailabilityIndicatorProps = {
|
|
95
|
-
resources
|
|
37
|
+
resources: ZoneResourcesAvailability
|
|
96
38
|
isUnavailable?: boolean
|
|
97
39
|
isSoldOut?: boolean
|
|
98
|
-
availabilityFormat?: AvailabilityFormat | null
|
|
99
40
|
}
|
|
100
41
|
|
|
101
42
|
export const AvailabilityIndicator = ({
|
|
102
43
|
resources,
|
|
103
44
|
isUnavailable,
|
|
104
|
-
isSoldOut
|
|
105
|
-
availabilityFormat,
|
|
45
|
+
isSoldOut,
|
|
106
46
|
}: AvailabilityIndicatorProps) => {
|
|
107
47
|
const { t } = useTranslation('Design')
|
|
108
|
-
const isSoldOut =
|
|
109
|
-
_isSoldOut || resources?.bookedResources === resources?.totalResources
|
|
110
48
|
|
|
111
49
|
if (isUnavailable) {
|
|
112
50
|
return <Indicator Icon={SoldOutIcon} label={t('notAvailable')} />
|
|
@@ -116,27 +54,14 @@ export const AvailabilityIndicator = ({
|
|
|
116
54
|
return <Indicator Icon={SoldOutIcon} label={t('soldOut')} />
|
|
117
55
|
}
|
|
118
56
|
|
|
119
|
-
const { Icon, label
|
|
120
|
-
...resources,
|
|
121
|
-
availabilityFormat,
|
|
122
|
-
})
|
|
57
|
+
const { Icon, label } = getIconsAndLabels(resources)
|
|
123
58
|
|
|
124
|
-
return (
|
|
125
|
-
<Indicator
|
|
126
|
-
Icon={Icon}
|
|
127
|
-
label={t(label, argument ? { argument } : undefined)}
|
|
128
|
-
/>
|
|
129
|
-
)
|
|
59
|
+
return <Indicator Icon={Icon} label={t(label)} />
|
|
130
60
|
}
|
|
131
61
|
|
|
132
|
-
const Indicator = ({ Icon, label }: Config) =>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<Icon height={iconSizes.height} width={iconSizes.width} viewBox='auto' />
|
|
139
|
-
<div className='indicator-label'>{label}</div>
|
|
140
|
-
</div>
|
|
141
|
-
)
|
|
142
|
-
}
|
|
62
|
+
const Indicator = ({ Icon, label }: Config) => (
|
|
63
|
+
<div className='availability-indicator'>
|
|
64
|
+
<Icon />
|
|
65
|
+
<div>{label}</div>
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Dispatch, ReactElement, SetStateAction } from 'react'
|
|
2
2
|
import { DateTime } from 'luxon'
|
|
3
|
-
import { AvailabilityFormat } from '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper'
|
|
4
3
|
import { DateTimeButtonProps } from 'src/date-time-button'
|
|
5
4
|
import { CalendarButtons } from './components/CalendarButtons'
|
|
6
5
|
import { CalendarDates } from './components/CalendarDates'
|
|
@@ -22,7 +21,6 @@ export type CalendarProps = {
|
|
|
22
21
|
fromPrice?: string | ReactElement | null
|
|
23
22
|
isLoading?: boolean
|
|
24
23
|
initialDate?: DateTime
|
|
25
|
-
availabilityFormat?: AvailabilityFormat | null
|
|
26
24
|
getDateTimeButtonProps: (
|
|
27
25
|
date: DateTime,
|
|
28
26
|
) => Pick<DateTimeButtonProps, 'resources' | 'showResources' | 'isDisabled'>
|
|
@@ -11,7 +11,6 @@ export type CalendarDatesProps = Pick<
|
|
|
11
11
|
| 'setSelectedDate'
|
|
12
12
|
| 'fromPrice'
|
|
13
13
|
| 'getDateTimeButtonProps'
|
|
14
|
-
| 'availabilityFormat'
|
|
15
14
|
>
|
|
16
15
|
|
|
17
16
|
export const CalendarDates = ({
|
|
@@ -19,7 +18,6 @@ export const CalendarDates = ({
|
|
|
19
18
|
selectedDate,
|
|
20
19
|
setSelectedDate,
|
|
21
20
|
fromPrice,
|
|
22
|
-
availabilityFormat,
|
|
23
21
|
getDateTimeButtonProps,
|
|
24
22
|
}: CalendarDatesProps) => {
|
|
25
23
|
const fillCalendarDates = useMemo(() => {
|
|
@@ -58,7 +56,6 @@ export const CalendarDates = ({
|
|
|
58
56
|
onSelect={() => setSelectedDate(date)}
|
|
59
57
|
price={fromPrice}
|
|
60
58
|
variant={Variant.month}
|
|
61
|
-
availabilityFormat={availabilityFormat}
|
|
62
59
|
{...props}
|
|
63
60
|
/>
|
|
64
61
|
)
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import { TimeZone } from '@licklist/core/dist/DataMapper/Common/TimeZoneDataMapper'
|
|
2
1
|
import { DateTime, Interval } from 'luxon'
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
initialDate
|
|
6
|
-
timeZone
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const getMonthCalendarDates: Builder = ({
|
|
10
|
-
initialDate: _initialDate,
|
|
11
|
-
timeZone,
|
|
12
|
-
}): DateTime[] => {
|
|
13
|
-
const initialDate = _initialDate || DateTime.now().setZone(timeZone)
|
|
14
|
-
|
|
3
|
+
export const getMonthCalendarDates = (
|
|
4
|
+
initialDate: DateTime,
|
|
5
|
+
timeZone?: string,
|
|
6
|
+
): DateTime[] => {
|
|
15
7
|
const startOfMonth = initialDate.startOf('month')
|
|
16
8
|
const endOfMonth = initialDate.endOf('month')
|
|
17
9
|
|
|
18
|
-
|
|
10
|
+
const dateTimes = Interval.fromDateTimes(startOfMonth, endOfMonth)
|
|
19
11
|
.splitBy({ day: 1 })
|
|
20
12
|
.map((d) => d.start)
|
|
21
|
-
}
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
if (timeZone) {
|
|
15
|
+
return dateTimes.map((date) =>
|
|
16
|
+
date.setZone(timeZone, { keepLocalTime: true }),
|
|
17
|
+
)
|
|
18
|
+
}
|
|
25
19
|
|
|
20
|
+
return dateTimes
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const getWeekCalendarDates = (
|
|
24
|
+
initialDate: DateTime,
|
|
25
|
+
timeZone?: string,
|
|
26
|
+
): DateTime[] => {
|
|
26
27
|
const lastDay = initialDate.plus({ days: 7 })
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
const dateTimes = Interval.fromDateTimes(initialDate, lastDay)
|
|
29
30
|
.splitBy({ day: 1 })
|
|
30
31
|
.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
|
|
31
40
|
}
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from '@licklist/core/dist/Config'
|
|
7
7
|
import { getDayWithOrdinal } from '@licklist/plugins/dist/utils/formatDate'
|
|
8
8
|
import clsx from 'clsx'
|
|
9
|
+
import { isToday, isTomorrow } from 'date-fns'
|
|
9
10
|
import { DateTime } from 'luxon'
|
|
10
11
|
import { useTranslation } from 'react-i18next'
|
|
11
|
-
import { isToday, isTomorrow } from '@licklist/plugins/dist'
|
|
12
12
|
import { DateTimeButtonProps, Variant } from './DateTimeButton'
|
|
13
13
|
|
|
14
14
|
type DateContentProps = Pick<
|
|
@@ -55,9 +55,9 @@ export const DateContent = ({
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const getDate = (date: DateTime): string => {
|
|
58
|
-
if (isToday(date)) return 'today'
|
|
58
|
+
if (isToday(date.toJSDate())) return 'today'
|
|
59
59
|
|
|
60
|
-
if (isTomorrow(date)) return 'tomorrow'
|
|
60
|
+
if (isTomorrow(date.toJSDate())) return 'tomorrow'
|
|
61
61
|
|
|
62
62
|
return date.toFormat(DAY_OF_WEEK)
|
|
63
63
|
}
|
|
@@ -2,7 +2,6 @@ import { ReactElement } from 'react'
|
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import { DateTime } from 'luxon'
|
|
4
4
|
import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
|
|
5
|
-
import { AvailabilityFormat } from '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper'
|
|
6
5
|
import { AvailabilityIndicator } from '../availability-indicator'
|
|
7
6
|
import { DateContent } from './DateContent'
|
|
8
7
|
|
|
@@ -22,7 +21,6 @@ export type DateTimeButtonProps = {
|
|
|
22
21
|
resources?: ZoneResourcesAvailability | null
|
|
23
22
|
showResources?: boolean
|
|
24
23
|
variant: Variant
|
|
25
|
-
availabilityFormat?: AvailabilityFormat | null
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
export const DateTimeButton = ({
|
|
@@ -35,7 +33,6 @@ export const DateTimeButton = ({
|
|
|
35
33
|
resources,
|
|
36
34
|
showResources,
|
|
37
35
|
variant = Variant.week,
|
|
38
|
-
availabilityFormat,
|
|
39
36
|
}: DateTimeButtonProps) => {
|
|
40
37
|
const isSoldOut =
|
|
41
38
|
_isSoldOut ||
|
|
@@ -46,7 +43,7 @@ export const DateTimeButton = ({
|
|
|
46
43
|
const isPast = variant === Variant.time ? isPastTime(date) : isPastDate(date)
|
|
47
44
|
|
|
48
45
|
const isDisabled = _isDisabled || isSoldOut || isPast
|
|
49
|
-
|
|
46
|
+
|
|
50
47
|
return (
|
|
51
48
|
<button
|
|
52
49
|
type='button'
|
|
@@ -70,11 +67,10 @@ export const DateTimeButton = ({
|
|
|
70
67
|
variant={variant}
|
|
71
68
|
/>
|
|
72
69
|
{price && !isDisabled && <div className='price'>{price}</div>}
|
|
73
|
-
{showResources &&
|
|
70
|
+
{showResources && resources && (
|
|
74
71
|
<AvailabilityIndicator
|
|
75
|
-
availabilityFormat={availabilityFormat}
|
|
76
72
|
resources={resources}
|
|
77
|
-
isUnavailable={
|
|
73
|
+
isUnavailable={_isDisabled || isPast}
|
|
78
74
|
isSoldOut={isSoldOut}
|
|
79
75
|
/>
|
|
80
76
|
)}
|
|
@@ -10,17 +10,13 @@ export const useCanvasSize = ({
|
|
|
10
10
|
width: componentWidth,
|
|
11
11
|
height: componentHeight,
|
|
12
12
|
}: CanvasSizeProps) => {
|
|
13
|
-
// TODO Fix often updating of width and height
|
|
14
13
|
const { width, height } = useWindowDimensions()
|
|
15
14
|
|
|
16
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
|
-
const memoizedDimensions = useMemo(() => ({ width, height }), [width])
|
|
18
|
-
|
|
19
15
|
const memoedComponentParameters = useMemo(() => {
|
|
20
16
|
if (!componentWidth && !componentHeight) return null
|
|
21
17
|
|
|
22
18
|
return { width: componentWidth, height: componentHeight }
|
|
23
19
|
}, [componentWidth, componentHeight])
|
|
24
20
|
|
|
25
|
-
return memoedComponentParameters ||
|
|
21
|
+
return memoedComponentParameters || { width, height }
|
|
26
22
|
}
|
|
@@ -2,7 +2,6 @@ import { ReactNode } from 'react'
|
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
4
4
|
import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
|
|
5
|
-
import { AvailabilityFormat } from '@licklist/core/dist/DataMapper/Provider/SnippetDataMapper'
|
|
6
5
|
import { AvailabilityIndicator } from '../../availability-indicator'
|
|
7
6
|
|
|
8
7
|
export const LAYOUT_GRID = 'grid'
|
|
@@ -19,7 +18,6 @@ export type ActivityCardProps = {
|
|
|
19
18
|
availableTimes?: string | null
|
|
20
19
|
image?: Image | null
|
|
21
20
|
resources?: ZoneResourcesAvailability
|
|
22
|
-
availabilityFormat?: AvailabilityFormat | null
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
export const ActivityCard = ({
|
|
@@ -32,7 +30,6 @@ export const ActivityCard = ({
|
|
|
32
30
|
onSelect,
|
|
33
31
|
isSelected,
|
|
34
32
|
layout = LAYOUT_GRID,
|
|
35
|
-
availabilityFormat,
|
|
36
33
|
resources,
|
|
37
34
|
}: ActivityCardProps) => {
|
|
38
35
|
if (layout === LAYOUT_GRID) {
|
|
@@ -53,12 +50,7 @@ export const ActivityCard = ({
|
|
|
53
50
|
{description && (
|
|
54
51
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
55
52
|
)}
|
|
56
|
-
{resources &&
|
|
57
|
-
<AvailabilityIndicator
|
|
58
|
-
resources={resources}
|
|
59
|
-
availabilityFormat={availabilityFormat}
|
|
60
|
-
/>
|
|
61
|
-
)}
|
|
53
|
+
{resources && <AvailabilityIndicator resources={resources} />}
|
|
62
54
|
</div>
|
|
63
55
|
</button>
|
|
64
56
|
)
|
|
@@ -84,12 +76,7 @@ export const ActivityCard = ({
|
|
|
84
76
|
{description && (
|
|
85
77
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
86
78
|
)}
|
|
87
|
-
{resources &&
|
|
88
|
-
<AvailabilityIndicator
|
|
89
|
-
resources={resources}
|
|
90
|
-
availabilityFormat={availabilityFormat}
|
|
91
|
-
/>
|
|
92
|
-
)}
|
|
79
|
+
{resources && <AvailabilityIndicator resources={resources} />}
|
|
93
80
|
</div>
|
|
94
81
|
|
|
95
82
|
<hr className='list-activity-card-hr' />
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -89,7 +89,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
89
89
|
<FormControl
|
|
90
90
|
type='number'
|
|
91
91
|
onChange={(e) => handleChangeValue(Number(e.target.value))}
|
|
92
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
93
92
|
value={value}
|
|
94
93
|
min={0}
|
|
95
94
|
max={max}
|
|
@@ -102,14 +101,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
102
101
|
<button
|
|
103
102
|
type='button'
|
|
104
103
|
onClick={handleArrowUpClick}
|
|
105
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
106
|
-
onFocus={(event) =>
|
|
107
|
-
event.target.addEventListener(
|
|
108
|
-
'wheel',
|
|
109
|
-
(event) => event.preventDefault(),
|
|
110
|
-
{ passive: false },
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
104
|
className={`payment-number-input__btn-up ${
|
|
114
105
|
plusButtonGreyedOut && 'disabled-number-input-button'
|
|
115
106
|
}`}
|
|
@@ -61,22 +61,20 @@ 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 =
|
|
75
|
-
'ryft-pay-apple-pay-button',
|
|
76
|
-
) as HTMLButtonElement
|
|
74
|
+
const appleButton =document.getElementById("ryft-pay-apple-pay-button") as HTMLButtonElement
|
|
77
75
|
if (googleButton) {
|
|
78
76
|
googleButton.disabled = isDisableButton
|
|
79
|
-
googleButton.style.opacity =
|
|
77
|
+
googleButton.style.opacity = isDisableButton ? '1' : '0.6'
|
|
80
78
|
}
|
|
81
79
|
if (appleButton) {
|
|
82
80
|
appleButton.disabled = isDisableButton
|
|
@@ -88,6 +86,7 @@ export const injectComponentsInRyftForm = ({
|
|
|
88
86
|
const applePayButton = document.createElement('button')
|
|
89
87
|
applePayButton.id = 'apple-pay'
|
|
90
88
|
applePayButton.type = 'button'
|
|
89
|
+
applePayButton.style.opacity = !isDisableButton ? '1' : '0.6'
|
|
91
90
|
applePayButton.className = 'bg-dark btn btn-primary apple-pay-button'
|
|
92
91
|
applePayButton.textContent = t('Events:payWithApple')
|
|
93
92
|
applePayButton.onclick = onApplePayButtonClick
|
package/src/layout/DropDown.tsx
CHANGED
|
@@ -434,7 +434,6 @@ export const EmailTemplateControl = forwardRef(
|
|
|
434
434
|
`templateOptionValues.${option?.id}.value`,
|
|
435
435
|
)}
|
|
436
436
|
type='number'
|
|
437
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
438
437
|
placeholder={t(`Design:${option.name}`)}
|
|
439
438
|
id={option.name + option.id}
|
|
440
439
|
defaultValue={option.selectedValue || ''}
|