@loczer/storefront-sdk 0.157.0 → 0.159.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/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +267 -227
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +51 -53
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +70 -66
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +69 -89
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +1 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +33 -32
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAqJA,eAAO,MAAM,mBAAmB,+CAkiB/B,CAAA"}
|
|
@@ -1,87 +1,128 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { differenceInCalendarDays as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useMorphingModalWizardOverlayLayer as
|
|
6
|
-
import { DayPicker as
|
|
7
|
-
import { Label as
|
|
8
|
-
import {
|
|
9
|
-
import { useBookingPeriod as
|
|
10
|
-
import { BookingPeriodFieldErrorMessage as
|
|
11
|
-
import { ModalDayPickerField as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
if (d <
|
|
15
|
-
return
|
|
16
|
-
if (d >
|
|
17
|
-
const
|
|
18
|
-
return
|
|
1
|
+
import { jsxs as ne, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { differenceInCalendarDays as me } from "date-fns";
|
|
3
|
+
import { createContext as pe, useRef as F, useState as X, useEffect as v, useContext as ye } from "react";
|
|
4
|
+
import { cn as k, DayPickerField as De } from "@rpcbase/ui";
|
|
5
|
+
import { useMorphingModalWizardOverlayLayer as Ee } from "../../../chunks/ui/dist/MorphingModalWizard-D7hc-dDP.js";
|
|
6
|
+
import { DayPicker as he } from "../../../ui/day-picker.js";
|
|
7
|
+
import { Label as ve } from "../../../ui/label.js";
|
|
8
|
+
import { Provider as be, Root as ge, TooltipTrigger as Me, Content as ke } from "../../../ui/tooltip.js";
|
|
9
|
+
import { useBookingPeriod as Te } from "../BookingPeriodContext.js";
|
|
10
|
+
import { BookingPeriodFieldErrorMessage as Pe } from "./BookingPeriodFieldErrorMessage.js";
|
|
11
|
+
import { ModalDayPickerField as we } from "./internal/ModalDayPickerField.js";
|
|
12
|
+
const Z = (t) => String(t).padStart(2, "0"), $ = (t) => `${t.getFullYear()}-${Z(t.getMonth() + 1)}-${Z(t.getDate())}`, z = (t) => t.getFullYear() * 12 + t.getMonth(), oe = (t) => new Date(Math.floor(t / 12), t % 12, 1), N = (t) => oe(z(t)), ee = (t, i, r) => {
|
|
13
|
+
const c = z(t), d = z(i), f = Math.max(0, r - 1), b = c + f;
|
|
14
|
+
if (d < c)
|
|
15
|
+
return N(i);
|
|
16
|
+
if (d > b) {
|
|
17
|
+
const m = d - f;
|
|
18
|
+
return m === c ? t : oe(m);
|
|
19
19
|
}
|
|
20
|
-
return
|
|
21
|
-
},
|
|
20
|
+
return t;
|
|
21
|
+
}, Ce = (t) => {
|
|
22
22
|
if (typeof PointerEvent == "function") {
|
|
23
|
-
|
|
23
|
+
t.dispatchEvent(new PointerEvent("pointermove", { bubbles: !0, pointerType: "mouse" }));
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
26
|
+
t.dispatchEvent(new MouseEvent("mousemove", { bubbles: !0 }));
|
|
27
|
+
}, te = (t) => {
|
|
28
28
|
if (typeof PointerEvent == "function") {
|
|
29
|
-
|
|
29
|
+
t.dispatchEvent(new PointerEvent("pointerout", { bubbles: !0, pointerType: "mouse" })), t.dispatchEvent(new PointerEvent("pointerleave", { bubbles: !0, pointerType: "mouse" }));
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
},
|
|
32
|
+
t.dispatchEvent(new MouseEvent("mouseout", { bubbles: !0 })), t.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
|
|
33
|
+
}, re = pe(null), ae = (t) => {
|
|
34
|
+
const i = ye(re), { day: r, modifiers: c, className: d, ...f } = t, b = c.disabled ? "cursor-not-allowed" : "cursor-pointer", m = F(null);
|
|
35
|
+
v(() => {
|
|
36
|
+
c.focused && m.current?.focus();
|
|
37
|
+
}, [c.focused]);
|
|
38
|
+
const p = /* @__PURE__ */ s(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
ref: m,
|
|
42
|
+
...f,
|
|
43
|
+
className: k(d, b)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
if (!i)
|
|
47
|
+
return p;
|
|
48
|
+
const { labels: y, startDate: L, hoveredEndDate: T, keyboardTooltipDay: P, numberOfMonths: g, overlayLayer: M } = i;
|
|
49
|
+
if (!L || c.disabled || g === 1)
|
|
50
|
+
return p;
|
|
51
|
+
const l = me(r.date, L);
|
|
52
|
+
if (l < 0)
|
|
53
|
+
return p;
|
|
54
|
+
const B = $(r.date), I = P === B || (!P && T ? $(T) === B : !1), O = y.selectedDaysTooltip?.({ count: l + 1 });
|
|
55
|
+
return O ? /* @__PURE__ */ ne(ge, { open: I, children: [
|
|
56
|
+
/* @__PURE__ */ s(Me, { asChild: !0, children: p }),
|
|
57
|
+
/* @__PURE__ */ s(
|
|
58
|
+
ke,
|
|
59
|
+
{
|
|
60
|
+
container: M ?? void 0,
|
|
61
|
+
side: "top",
|
|
62
|
+
align: "center",
|
|
63
|
+
disableAnimation: !0,
|
|
64
|
+
positionerClassName: M ? "z-[120]" : "z-[80]",
|
|
65
|
+
className: k(
|
|
66
|
+
"pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
|
|
67
|
+
M ? "z-[120]" : "z-[70]"
|
|
68
|
+
),
|
|
69
|
+
children: /* @__PURE__ */ s("span", { children: O })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }) : p;
|
|
73
|
+
};
|
|
74
|
+
ae.displayName = "BookingEndDateDayButton";
|
|
75
|
+
const qe = () => {
|
|
34
76
|
const {
|
|
35
|
-
labels:
|
|
77
|
+
labels: t,
|
|
36
78
|
startDate: i,
|
|
37
|
-
endDate:
|
|
38
|
-
selectEndDate:
|
|
79
|
+
endDate: r,
|
|
80
|
+
selectEndDate: c,
|
|
39
81
|
isEndDatePopoverOpen: d,
|
|
40
82
|
setIsEndDatePopoverOpen: f,
|
|
41
|
-
setIsStartTimeSelectOpen:
|
|
42
|
-
hoveredEndDate:
|
|
43
|
-
setHoveredEndDate:
|
|
44
|
-
resetHoveredEndDate:
|
|
45
|
-
labelClassName:
|
|
46
|
-
inputClassName:
|
|
47
|
-
buttonClassName:
|
|
48
|
-
errors:
|
|
49
|
-
dateLocale:
|
|
50
|
-
numberOfMonths:
|
|
51
|
-
isMobile:
|
|
52
|
-
isHydrated:
|
|
53
|
-
openDatePickerOnFocus:
|
|
83
|
+
setIsStartTimeSelectOpen: b,
|
|
84
|
+
hoveredEndDate: m,
|
|
85
|
+
setHoveredEndDate: p,
|
|
86
|
+
resetHoveredEndDate: y,
|
|
87
|
+
labelClassName: L,
|
|
88
|
+
inputClassName: T,
|
|
89
|
+
buttonClassName: P,
|
|
90
|
+
errors: g,
|
|
91
|
+
dateLocale: M,
|
|
92
|
+
numberOfMonths: l,
|
|
93
|
+
isMobile: B,
|
|
94
|
+
isHydrated: I,
|
|
95
|
+
openDatePickerOnFocus: O,
|
|
54
96
|
withMobileDateDrawer: ie,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, []), E(() => {
|
|
97
|
+
selectionFlow: x,
|
|
98
|
+
minSelectableDate: U
|
|
99
|
+
} = Te(), D = ie && B, E = F(null), h = F(!1), [V, A] = X(null), [j, K] = X(
|
|
100
|
+
() => N(i ?? r ?? /* @__PURE__ */ new Date())
|
|
101
|
+
), S = Ee(), de = !!S;
|
|
102
|
+
v(() => {
|
|
62
103
|
if (typeof document > "u")
|
|
63
104
|
return;
|
|
64
105
|
const e = document.getElementById("end-date-picker");
|
|
65
106
|
if (!(e instanceof HTMLInputElement))
|
|
66
107
|
return;
|
|
67
|
-
const
|
|
68
|
-
h.current =
|
|
108
|
+
const n = (o) => {
|
|
109
|
+
h.current = o.key === "ArrowUp" || o.key === "ArrowDown";
|
|
69
110
|
};
|
|
70
|
-
return e.addEventListener("keydown",
|
|
71
|
-
e.removeEventListener("keydown",
|
|
111
|
+
return e.addEventListener("keydown", n, !0), () => {
|
|
112
|
+
e.removeEventListener("keydown", n, !0);
|
|
72
113
|
};
|
|
73
|
-
}, []),
|
|
74
|
-
if (!d ||
|
|
114
|
+
}, []), v(() => {
|
|
115
|
+
if (!d || D)
|
|
75
116
|
return;
|
|
76
|
-
const e =
|
|
77
|
-
|
|
78
|
-
}, [
|
|
117
|
+
const e = N(i ?? r ?? /* @__PURE__ */ new Date()), n = r ?? i;
|
|
118
|
+
K(n ? ee(e, n, l) : e);
|
|
119
|
+
}, [r, d, l, i]), v(() => {
|
|
79
120
|
if (!d)
|
|
80
121
|
return;
|
|
81
|
-
const e =
|
|
82
|
-
e &&
|
|
83
|
-
}, [
|
|
84
|
-
if (!d || typeof document > "u" || (
|
|
122
|
+
const e = m ?? r;
|
|
123
|
+
e && K((n) => ee(n, e, l));
|
|
124
|
+
}, [r, m, d, l]), v(() => {
|
|
125
|
+
if (!d || typeof document > "u" || (y(), D))
|
|
85
126
|
return;
|
|
86
127
|
const e = document.getElementById("end-date-picker");
|
|
87
128
|
if (!(e instanceof HTMLElement)) {
|
|
@@ -89,268 +130,267 @@ const X = (o) => String(o).padStart(2, "0"), x = (o) => `${o.getFullYear()}-${X(
|
|
|
89
130
|
return;
|
|
90
131
|
}
|
|
91
132
|
document.activeElement !== e && requestAnimationFrame(() => {
|
|
92
|
-
e.focus({ preventScroll: !0 }), e.click();
|
|
133
|
+
e.focus({ preventScroll: !0 }), x === "chained-times" && e.click();
|
|
93
134
|
});
|
|
94
|
-
}, [d,
|
|
135
|
+
}, [d, y, x, f]), v(() => {
|
|
95
136
|
if (typeof document > "u")
|
|
96
137
|
return;
|
|
97
138
|
const e = document.getElementById("end-date-picker");
|
|
98
|
-
if (!(e instanceof HTMLInputElement))
|
|
139
|
+
if (!(e instanceof HTMLInputElement) || x !== "chained-times")
|
|
99
140
|
return;
|
|
100
|
-
const
|
|
101
|
-
|
|
141
|
+
const n = () => {
|
|
142
|
+
b(!1);
|
|
102
143
|
};
|
|
103
|
-
return e.addEventListener("focus",
|
|
104
|
-
e.removeEventListener("focus",
|
|
144
|
+
return e.addEventListener("focus", n, !0), () => {
|
|
145
|
+
e.removeEventListener("focus", n, !0);
|
|
105
146
|
};
|
|
106
|
-
}, [
|
|
147
|
+
}, [x, b]), v(() => {
|
|
107
148
|
if (d || typeof document > "u")
|
|
108
149
|
return;
|
|
109
|
-
const e =
|
|
150
|
+
const e = E.current;
|
|
110
151
|
if (!e)
|
|
111
152
|
return;
|
|
112
|
-
const
|
|
113
|
-
|
|
153
|
+
const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
|
|
154
|
+
o instanceof HTMLElement && te(o), E.current = null, A(null);
|
|
114
155
|
}, [d]);
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
156
|
+
const W = F({
|
|
157
|
+
labels: t,
|
|
158
|
+
startDate: i,
|
|
159
|
+
endDate: r,
|
|
160
|
+
hoveredEndDate: m,
|
|
161
|
+
keyboardTooltipDay: V,
|
|
162
|
+
numberOfMonths: l,
|
|
163
|
+
overlayLayer: S,
|
|
164
|
+
calendarMonth: j,
|
|
165
|
+
resetHoveredEndDate: y,
|
|
166
|
+
setHoveredEndDate: p
|
|
167
|
+
});
|
|
168
|
+
W.current = {
|
|
169
|
+
labels: t,
|
|
170
|
+
startDate: i,
|
|
171
|
+
endDate: r,
|
|
172
|
+
hoveredEndDate: m,
|
|
173
|
+
keyboardTooltipDay: V,
|
|
174
|
+
numberOfMonths: l,
|
|
175
|
+
overlayLayer: S,
|
|
176
|
+
calendarMonth: j,
|
|
177
|
+
resetHoveredEndDate: y,
|
|
178
|
+
setHoveredEndDate: p
|
|
179
|
+
};
|
|
180
|
+
const q = F(null);
|
|
181
|
+
if (!q.current) {
|
|
182
|
+
const e = (n) => {
|
|
183
|
+
const {
|
|
184
|
+
labels: o,
|
|
185
|
+
startDate: a,
|
|
186
|
+
endDate: u,
|
|
187
|
+
hoveredEndDate: w,
|
|
188
|
+
keyboardTooltipDay: H,
|
|
189
|
+
numberOfMonths: Q,
|
|
190
|
+
overlayLayer: se,
|
|
191
|
+
calendarMonth: ce,
|
|
192
|
+
resetHoveredEndDate: le,
|
|
193
|
+
setHoveredEndDate: ue
|
|
194
|
+
} = W.current, fe = {
|
|
195
|
+
labels: o,
|
|
196
|
+
startDate: a,
|
|
197
|
+
hoveredEndDate: w,
|
|
198
|
+
keyboardTooltipDay: H,
|
|
199
|
+
numberOfMonths: Q,
|
|
200
|
+
overlayLayer: se
|
|
201
|
+
};
|
|
202
|
+
return /* @__PURE__ */ s(re.Provider, { value: fe, children: /* @__PURE__ */ s(be, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: le, children: /* @__PURE__ */ s(
|
|
203
|
+
he,
|
|
123
204
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
disableAnimation: !0,
|
|
144
|
-
positionerClassName: D ? "z-[120]" : "z-[80]",
|
|
145
|
-
className: b(
|
|
146
|
-
"pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
|
|
147
|
-
D ? "z-[120]" : "z-[70]"
|
|
148
|
-
),
|
|
149
|
-
children: /* @__PURE__ */ s("span", { children: G })
|
|
205
|
+
...n,
|
|
206
|
+
mode: "range",
|
|
207
|
+
month: ce,
|
|
208
|
+
onMonthChange: (C) => {
|
|
209
|
+
K(N(C));
|
|
210
|
+
},
|
|
211
|
+
selected: {
|
|
212
|
+
from: a,
|
|
213
|
+
to: w || u
|
|
214
|
+
},
|
|
215
|
+
components: {
|
|
216
|
+
...n.components,
|
|
217
|
+
DayButton: ae
|
|
218
|
+
},
|
|
219
|
+
onSelect: (C, Y) => {
|
|
220
|
+
n.onSelect?.(Y);
|
|
221
|
+
},
|
|
222
|
+
onDayMouseEnter: (C, Y) => {
|
|
223
|
+
Q !== 1 && a && !Y.disabled && C >= a && ue(C);
|
|
150
224
|
}
|
|
151
|
-
)
|
|
152
|
-
] }) : w;
|
|
153
|
-
};
|
|
154
|
-
return e.displayName = "BookingEndDateDayButton", e;
|
|
155
|
-
}, [u, F, o, D, i]), R = Q(() => {
|
|
156
|
-
const e = (t) => /* @__PURE__ */ s(ge, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: m, children: /* @__PURE__ */ s(
|
|
157
|
-
me,
|
|
158
|
-
{
|
|
159
|
-
...t,
|
|
160
|
-
mode: "range",
|
|
161
|
-
month: $,
|
|
162
|
-
onMonthChange: (n) => {
|
|
163
|
-
B(C(n));
|
|
164
|
-
},
|
|
165
|
-
selected: {
|
|
166
|
-
from: i,
|
|
167
|
-
to: u || a
|
|
168
|
-
},
|
|
169
|
-
components: {
|
|
170
|
-
...t.components,
|
|
171
|
-
DayButton: z
|
|
172
|
-
},
|
|
173
|
-
onSelect: (n, r) => {
|
|
174
|
-
t.onSelect?.(r);
|
|
175
|
-
},
|
|
176
|
-
onDayMouseEnter: (n, r) => {
|
|
177
|
-
p !== 1 && i && !r.disabled && n >= i && M(n);
|
|
178
225
|
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
i,
|
|
185
|
-
a,
|
|
186
|
-
u,
|
|
187
|
-
$,
|
|
188
|
-
m,
|
|
189
|
-
M
|
|
190
|
-
]), L = () => {
|
|
226
|
+
) }) }) });
|
|
227
|
+
};
|
|
228
|
+
e.displayName = "BookingEndDateDayPicker", q.current = e;
|
|
229
|
+
}
|
|
230
|
+
const _ = q.current, R = () => {
|
|
191
231
|
if (typeof document > "u") {
|
|
192
|
-
|
|
232
|
+
E.current = null;
|
|
193
233
|
return;
|
|
194
234
|
}
|
|
195
|
-
const e =
|
|
235
|
+
const e = E.current;
|
|
196
236
|
if (!e)
|
|
197
237
|
return;
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
},
|
|
238
|
+
const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
|
|
239
|
+
o instanceof HTMLElement && te(o), E.current = null, A(null);
|
|
240
|
+
}, G = (e) => {
|
|
201
241
|
if (typeof document > "u")
|
|
202
242
|
return;
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
243
|
+
const n = $(e);
|
|
244
|
+
if (E.current === n)
|
|
205
245
|
return;
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
246
|
+
R(), E.current = n, A(n);
|
|
247
|
+
let o = 0;
|
|
248
|
+
const a = 6, u = () => {
|
|
249
|
+
if (E.current !== n)
|
|
210
250
|
return;
|
|
211
|
-
const
|
|
212
|
-
if (!(
|
|
213
|
-
|
|
251
|
+
const w = document.getElementById("end-date-calendar");
|
|
252
|
+
if (!(w instanceof HTMLElement)) {
|
|
253
|
+
o += 1, o <= a && requestAnimationFrame(u);
|
|
214
254
|
return;
|
|
215
255
|
}
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
|
|
256
|
+
const H = w.querySelector(`[data-day="${n}"] button:not([disabled])`);
|
|
257
|
+
if (H instanceof HTMLElement) {
|
|
258
|
+
Ce(H);
|
|
219
259
|
return;
|
|
220
260
|
}
|
|
221
|
-
|
|
261
|
+
o += 1, o <= a && requestAnimationFrame(u);
|
|
222
262
|
};
|
|
223
|
-
requestAnimationFrame(
|
|
224
|
-
},
|
|
225
|
-
|
|
263
|
+
requestAnimationFrame(u);
|
|
264
|
+
}, J = () => {
|
|
265
|
+
D && f(!0);
|
|
226
266
|
};
|
|
227
|
-
return /* @__PURE__ */
|
|
267
|
+
return /* @__PURE__ */ ne(
|
|
228
268
|
"div",
|
|
229
269
|
{
|
|
230
|
-
className:
|
|
231
|
-
onPointerDownCapture:
|
|
232
|
-
onClick:
|
|
270
|
+
className: k("group/form-item relative flex-grow", D && "cursor-pointer rounded-md"),
|
|
271
|
+
onPointerDownCapture: J,
|
|
272
|
+
onClick: J,
|
|
233
273
|
children: [
|
|
234
274
|
/* @__PURE__ */ s(
|
|
235
|
-
|
|
275
|
+
ve,
|
|
236
276
|
{
|
|
237
277
|
htmlFor: "end-date-picker",
|
|
238
|
-
className:
|
|
239
|
-
children: /* @__PURE__ */ s("span", { children:
|
|
278
|
+
className: k("mb-1 block text-sm font-medium", D && "cursor-pointer", L),
|
|
279
|
+
children: /* @__PURE__ */ s("span", { children: t.endDate })
|
|
240
280
|
}
|
|
241
281
|
),
|
|
242
|
-
|
|
243
|
-
|
|
282
|
+
de ? /* @__PURE__ */ s(
|
|
283
|
+
we,
|
|
244
284
|
{
|
|
245
285
|
id: "end-date-picker",
|
|
246
|
-
value:
|
|
247
|
-
placeholder:
|
|
286
|
+
value: r ?? null,
|
|
287
|
+
placeholder: t.pickEndDate,
|
|
248
288
|
triggerTestId: "end-date-trigger",
|
|
249
|
-
isHydrated:
|
|
250
|
-
open:
|
|
289
|
+
isHydrated: I,
|
|
290
|
+
open: D ? !1 : d,
|
|
251
291
|
onOpenChange: f,
|
|
252
|
-
readOnly:
|
|
253
|
-
openOnFocus:
|
|
292
|
+
readOnly: D,
|
|
293
|
+
openOnFocus: O,
|
|
254
294
|
onValueUpdate: (e) => {
|
|
255
|
-
const
|
|
295
|
+
const n = (() => {
|
|
256
296
|
if (!d || typeof document > "u")
|
|
257
297
|
return !1;
|
|
258
|
-
const
|
|
259
|
-
return
|
|
298
|
+
const o = document.activeElement;
|
|
299
|
+
return o instanceof HTMLElement && o.id === "end-date-picker";
|
|
260
300
|
})();
|
|
261
301
|
if (!i || !e || e < i) {
|
|
262
|
-
|
|
302
|
+
y(), n && R();
|
|
263
303
|
return;
|
|
264
304
|
}
|
|
265
|
-
|
|
305
|
+
p(e), n && G(e);
|
|
266
306
|
},
|
|
267
307
|
onChange: (e) => {
|
|
268
|
-
if (
|
|
308
|
+
if (y(), (() => {
|
|
269
309
|
if (typeof document > "u")
|
|
270
310
|
return h.current = !1, !1;
|
|
271
|
-
const
|
|
272
|
-
return h.current = !1,
|
|
273
|
-
})() || e &&
|
|
311
|
+
const a = document.activeElement, u = h.current && a instanceof HTMLElement && a.id === "end-date-picker";
|
|
312
|
+
return h.current = !1, u;
|
|
313
|
+
})() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
|
|
274
314
|
return;
|
|
275
|
-
const
|
|
315
|
+
const o = (() => {
|
|
276
316
|
if (!e || typeof document > "u")
|
|
277
317
|
return !1;
|
|
278
|
-
const
|
|
279
|
-
return
|
|
318
|
+
const a = document.activeElement;
|
|
319
|
+
return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
|
|
280
320
|
})();
|
|
281
|
-
|
|
321
|
+
c(e ?? void 0, { openTimePicker: o ? void 0 : !1 });
|
|
282
322
|
},
|
|
283
|
-
inputClassName:
|
|
284
|
-
dayPickerComponent:
|
|
323
|
+
inputClassName: k(g.endDate && "border-destructive", T, P),
|
|
324
|
+
dayPickerComponent: _,
|
|
285
325
|
dayPickerProps: {
|
|
286
326
|
id: "end-date-calendar",
|
|
287
|
-
locale:
|
|
327
|
+
locale: M,
|
|
288
328
|
showOutsideDays: !1,
|
|
289
|
-
numberOfMonths:
|
|
290
|
-
disabled: (e) => i && e < i || e <
|
|
329
|
+
numberOfMonths: l,
|
|
330
|
+
disabled: (e) => i && e < i || e < U,
|
|
291
331
|
initialFocus: !0,
|
|
292
332
|
"data-testid": "end-date-calendar"
|
|
293
333
|
},
|
|
294
|
-
portalContainer:
|
|
334
|
+
portalContainer: S
|
|
295
335
|
}
|
|
296
336
|
) : /* @__PURE__ */ s(
|
|
297
|
-
|
|
337
|
+
De,
|
|
298
338
|
{
|
|
299
339
|
id: "end-date-picker",
|
|
300
|
-
value:
|
|
301
|
-
placeholder:
|
|
340
|
+
value: r ?? null,
|
|
341
|
+
placeholder: t.pickEndDate,
|
|
302
342
|
triggerTestId: "end-date-trigger",
|
|
303
|
-
isHydrated:
|
|
304
|
-
open:
|
|
343
|
+
isHydrated: I,
|
|
344
|
+
open: D ? !1 : d,
|
|
305
345
|
onOpenChange: f,
|
|
306
|
-
readOnly:
|
|
346
|
+
readOnly: D,
|
|
307
347
|
onValueUpdate: (e) => {
|
|
308
|
-
const
|
|
348
|
+
const n = (() => {
|
|
309
349
|
if (!d || typeof document > "u")
|
|
310
350
|
return !1;
|
|
311
|
-
const
|
|
312
|
-
return
|
|
351
|
+
const o = document.activeElement;
|
|
352
|
+
return o instanceof HTMLElement && o.id === "end-date-picker";
|
|
313
353
|
})();
|
|
314
354
|
if (!i || !e || e < i) {
|
|
315
|
-
|
|
355
|
+
y(), n && R();
|
|
316
356
|
return;
|
|
317
357
|
}
|
|
318
|
-
|
|
358
|
+
p(e), n && G(e);
|
|
319
359
|
},
|
|
320
360
|
onChange: (e) => {
|
|
321
|
-
if (
|
|
361
|
+
if (y(), (() => {
|
|
322
362
|
if (typeof document > "u")
|
|
323
363
|
return h.current = !1, !1;
|
|
324
|
-
const
|
|
325
|
-
return h.current = !1,
|
|
326
|
-
})() || e &&
|
|
364
|
+
const a = document.activeElement, u = h.current && a instanceof HTMLElement && a.id === "end-date-picker";
|
|
365
|
+
return h.current = !1, u;
|
|
366
|
+
})() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
|
|
327
367
|
return;
|
|
328
|
-
const
|
|
368
|
+
const o = (() => {
|
|
329
369
|
if (!e || typeof document > "u")
|
|
330
370
|
return !1;
|
|
331
|
-
const
|
|
332
|
-
return
|
|
371
|
+
const a = document.activeElement;
|
|
372
|
+
return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
|
|
333
373
|
})();
|
|
334
|
-
|
|
374
|
+
c(e ?? void 0, { openTimePicker: o ? void 0 : !1 });
|
|
335
375
|
},
|
|
336
|
-
inputClassName:
|
|
337
|
-
dayPickerComponent:
|
|
376
|
+
inputClassName: k(g.endDate && "border-destructive", T, P),
|
|
377
|
+
dayPickerComponent: _,
|
|
338
378
|
dayPickerProps: {
|
|
339
379
|
id: "end-date-calendar",
|
|
340
|
-
locale:
|
|
380
|
+
locale: M,
|
|
341
381
|
showOutsideDays: !1,
|
|
342
|
-
numberOfMonths:
|
|
343
|
-
disabled: (e) => i && e < i || e <
|
|
382
|
+
numberOfMonths: l,
|
|
383
|
+
disabled: (e) => i && e < i || e < U,
|
|
344
384
|
initialFocus: !0,
|
|
345
385
|
"data-testid": "end-date-calendar"
|
|
346
386
|
}
|
|
347
387
|
}
|
|
348
388
|
),
|
|
349
|
-
|
|
389
|
+
g.endDate && /* @__PURE__ */ s(Pe, { children: g.endDate })
|
|
350
390
|
]
|
|
351
391
|
}
|
|
352
392
|
);
|
|
353
393
|
};
|
|
354
394
|
export {
|
|
355
|
-
|
|
395
|
+
qe as BookingEndDateField
|
|
356
396
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CA8J/B,CAAA"}
|