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