@licklist/design 0.58.4-dev.1 → 0.58.4
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/iframe/event/event-card/IframeEventCard.d.ts +1 -2
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- 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 +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/card/ProductSetCard.d.ts +1 -2
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -2
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/control/TutorialGifCard.d.ts +1 -2
- package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
- package/dist/product-set/control/TutorialGifCard.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -2
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +2 -7
- 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/ProductsControl.d.ts +1 -2
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/dist/product-set/form/StepsControl.d.ts +1 -2
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts +1 -2
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +1 -2
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
- package/dist/product-set/item/CreateProductSetItem.d.ts +1 -2
- package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
- package/dist/product-set/item/CreateProductSetItem.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts +1 -2
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +2 -4
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +0 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -2
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +0 -2
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sortable-list/SortableList.d.ts +1 -2
- package/dist/sortable-list/SortableList.d.ts.map +1 -1
- package/dist/sortable-list/SortableList.js +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -3
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
- package/dist/styles/iframe-events/Card.scss +8 -24
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
- package/dist/styles/iframe-page/Page.scss +0 -1
- package/dist/styles/iframe-page/PageBody.scss +11 -32
- package/dist/styles/iframe-page/PageHeader.scss +39 -41
- package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/package.json +3 -3
- package/src/calendar/Calendar.stories.tsx +2 -9
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
- package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -30
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +12 -8
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -6
- package/src/product-set/card/ProductSetCard.tsx +1 -10
- package/src/product-set/control/ProductSetControl.tsx +24 -46
- package/src/product-set/control/TutorialGifCard.tsx +3 -11
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -12
- package/src/product-set/form/ProductSetForm.tsx +1 -10
- package/src/product-set/form/ProductsControl.tsx +0 -10
- package/src/product-set/form/StepsControl.tsx +2 -8
- package/src/product-set/form/SubProductsControl.tsx +0 -3
- package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -4
- package/src/product-set/item/CreateProductSetItem.tsx +0 -3
- package/src/product-set/product/ProductControl.tsx +12 -23
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -10
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +3 -4
- package/src/product-set/product-category/ProductCategoryControl.tsx +8 -12
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -4
- package/src/sales/booking/results/components/ResultCard.tsx +3 -0
- package/src/sortable-list/SortableList.tsx +0 -3
- package/src/sortable-tree/SortableTreeItem.tsx +1 -7
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +2 -6
- package/src/static/manual-date-picker/utils/index.ts +0 -11
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
- package/src/styles/iframe-events/Card.scss +8 -24
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
- package/src/styles/iframe-page/Page.scss +0 -1
- package/src/styles/iframe-page/PageBody.scss +11 -32
- package/src/styles/iframe-page/PageHeader.scss +39 -41
- package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/dist/product-set/control/DateInput.d.ts +0 -17
- package/dist/product-set/control/DateInput.d.ts.map +0 -1
- package/dist/product-set/control/DateInput.js +0 -1
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +0 -11
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +0 -1
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +0 -1
- package/dist/recurring-date-picker-input/DatePickerInput.d.ts +0 -19
- package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +0 -1
- package/dist/recurring-date-picker-input/DatePickerInput.js +0 -1
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +0 -15
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +0 -1
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +0 -1
- package/src/product-set/control/DateInput.tsx +0 -311
- package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +0 -63
- package/src/recurring-date-picker-input/DatePickerInput.tsx +0 -93
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -137
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { DateTime } from "luxon";
|
|
3
|
-
import { Col, Form, Row } from "react-bootstrap";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { RegisterOptions, useFormContext } from "react-hook-form";
|
|
6
|
-
import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
|
|
7
|
-
|
|
8
|
-
interface RecurrenceIntervalAndFrequencyInputProps {
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
minDate?: string;
|
|
11
|
-
startDateLabel?: string;
|
|
12
|
-
startTimeLabel?: string;
|
|
13
|
-
endDateLabel?: string;
|
|
14
|
-
endTimeLabel?: string;
|
|
15
|
-
startTimeRules?: Pick<
|
|
16
|
-
RegisterOptions,
|
|
17
|
-
"max" | "min" | "validate" | "required" | "pattern"
|
|
18
|
-
>;
|
|
19
|
-
endTimeRules?: Pick<
|
|
20
|
-
RegisterOptions,
|
|
21
|
-
"max" | "min" | "validate" | "required" | "pattern"
|
|
22
|
-
>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function RecurrenceAndFrequencyInput({
|
|
26
|
-
disabled = false,
|
|
27
|
-
minDate,
|
|
28
|
-
startDateLabel,
|
|
29
|
-
startTimeLabel,
|
|
30
|
-
endTimeLabel,
|
|
31
|
-
startTimeRules,
|
|
32
|
-
endTimeRules,
|
|
33
|
-
}: RecurrenceIntervalAndFrequencyInputProps) {
|
|
34
|
-
const { t } = useTranslation(["Design", "Notification", "App"]);
|
|
35
|
-
|
|
36
|
-
const {
|
|
37
|
-
getValues,
|
|
38
|
-
formState: { errors },
|
|
39
|
-
register,
|
|
40
|
-
trigger,
|
|
41
|
-
} = useFormContext<RecurringDatePickerInputValues>();
|
|
42
|
-
|
|
43
|
-
const startDate = getValues("startDate");
|
|
44
|
-
const startTime = getValues("startTime");
|
|
45
|
-
const endTime = getValues("endTime");
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (!startTime || !endTime) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
trigger("endTime");
|
|
52
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
-
}, [startTime]);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<>
|
|
57
|
-
<Row>
|
|
58
|
-
<Col xs={12} sm={6}>
|
|
59
|
-
<Form.Group>
|
|
60
|
-
<Form.Label>{startDateLabel ?? t("Design:fromDate")}</Form.Label>
|
|
61
|
-
<Form.Control
|
|
62
|
-
type="date"
|
|
63
|
-
{...register("startDate", { required: true })}
|
|
64
|
-
defaultValue={startDate}
|
|
65
|
-
className={startDate && "date-input-with-value"}
|
|
66
|
-
disabled={disabled}
|
|
67
|
-
min={minDate}
|
|
68
|
-
isInvalid={Boolean(errors.startDate)}
|
|
69
|
-
/>
|
|
70
|
-
<Form.Control.Feedback type="invalid">
|
|
71
|
-
{errors.startDate?.message}
|
|
72
|
-
</Form.Control.Feedback>
|
|
73
|
-
</Form.Group>
|
|
74
|
-
</Col>
|
|
75
|
-
|
|
76
|
-
</Row>
|
|
77
|
-
|
|
78
|
-
<Row>
|
|
79
|
-
<Col xs={12} sm={6}>
|
|
80
|
-
<Form.Group>
|
|
81
|
-
<Form.Label>
|
|
82
|
-
{startTimeLabel ?? t("Design:availableFrom")}
|
|
83
|
-
</Form.Label>
|
|
84
|
-
<Form.Control
|
|
85
|
-
type="time"
|
|
86
|
-
{...register("startTime", { required: false, ...startTimeRules })}
|
|
87
|
-
placeholder="hh:mm"
|
|
88
|
-
defaultValue={startTime}
|
|
89
|
-
disabled={disabled}
|
|
90
|
-
isInvalid={Boolean(errors.startTime)}
|
|
91
|
-
/>
|
|
92
|
-
<Form.Control.Feedback type="invalid">
|
|
93
|
-
{errors.startTime?.message}
|
|
94
|
-
</Form.Control.Feedback>
|
|
95
|
-
</Form.Group>
|
|
96
|
-
</Col>
|
|
97
|
-
|
|
98
|
-
<Col xs={12} sm={6}>
|
|
99
|
-
<Form.Group>
|
|
100
|
-
<Form.Label>{endTimeLabel ?? t("Design:availableTo")}</Form.Label>
|
|
101
|
-
<Form.Control
|
|
102
|
-
type="time"
|
|
103
|
-
{...register("endTime", {
|
|
104
|
-
required: false,
|
|
105
|
-
validate: (time) => {
|
|
106
|
-
if (!startTime || !time) {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
const currentStartTime = DateTime.fromISO(startTime);
|
|
110
|
-
const currentEndTime = DateTime.fromISO(time);
|
|
111
|
-
|
|
112
|
-
return currentEndTime?.diff(currentStartTime, ["minutes"])
|
|
113
|
-
?.minutes >= 0
|
|
114
|
-
? true
|
|
115
|
-
: `${t(`Validation:fieldLaterDate`, {
|
|
116
|
-
attribute: t("Design:endTimeSmall"),
|
|
117
|
-
min: t("Design:startTimeSmall"),
|
|
118
|
-
})}`;
|
|
119
|
-
},
|
|
120
|
-
...endTimeRules,
|
|
121
|
-
})}
|
|
122
|
-
placeholder="hh:mm"
|
|
123
|
-
defaultValue={endTime}
|
|
124
|
-
disabled={disabled}
|
|
125
|
-
isInvalid={Boolean(errors.endTime)}
|
|
126
|
-
/>
|
|
127
|
-
<Form.Control.Feedback type="invalid">
|
|
128
|
-
{errors.endTime?.message}
|
|
129
|
-
</Form.Control.Feedback>
|
|
130
|
-
</Form.Group>
|
|
131
|
-
</Col>
|
|
132
|
-
</Row>
|
|
133
|
-
</>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export default RecurrenceAndFrequencyInput;
|