@loczer/storefront-sdk 0.194.0 → 0.195.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/chunks/pkg/ui/dist/{Button-CxG2fSpA.js → Button-Cr_u8vnh.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Dialog-4leTWiev.js → Dialog-CczmPDwY.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Drawer/{index-DA5V7R_q.js → index-CSvSVP_J.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-BmKjdWmq.js → MapContent-CDeWtwKa.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Map-CsOTdTtL.js → Map-Cs7wgtH9.js} +2 -2
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js} +4 -3
- package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js} +3 -3
- package/dist/chunks/pkg/ui/dist/{ScrollArea-Bjwo84cv.js → ScrollArea-BqLd0xZj.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Spinner/{index-DzMEU0iA.js → index-Cgi70z_E.js} +1 -1
- package/dist/chunks/pkg/ui/dist/lib/utils-DXB19bzk.js +8 -0
- package/dist/components/BikeProductCard/index.js +6 -6
- package/dist/components/BookingBikeVariantDialog/index.js +7 -7
- package/dist/components/BookingFlowSteps/index.js +11 -11
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +16 -18
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +36 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +830 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts +2 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.js +21 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +35 -35
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +4 -4
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.js +1 -1
- package/dist/components/DeliveryAddressSelector/index.js +5 -5
- package/dist/components/Footer/index.js +11 -11
- package/dist/components/FulfillmentSection/index.js +9 -9
- package/dist/components/Header/index.js +61 -61
- package/dist/components/Map/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +5 -5
- package/dist/components/ProductPriceBadge/index.js +73 -73
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +6 -6
- package/dist/components/StorefrontCartPanel/index.js +8 -8
- package/dist/components/StorefrontInsuranceNotice/index.js +6 -6
- package/dist/components/StorefrontPopupMessages/index.js +8 -8
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/lib/utils.d.ts +3 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +9 -5
- package/dist/pages/BookingPage.js +8 -8
- package/dist/pages/CheckoutPaymentPage.js +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +15 -15
- package/dist/pages/HomePage.js +19 -19
- package/dist/pages/PaymentLinkPage.js +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +1 -1
- package/dist/pages/ProductPage.js +143 -143
- package/dist/pages/checkout/components/CheckoutCouponCard.js +5 -5
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/package.json +5 -1
- package/dist/chunks/node_modules/clsx/dist/clsx-CdyIqUTr.js +0 -16
- package/dist/chunks/node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js +0 -1608
- package/dist/chunks/pkg/ui/dist/lib/utils-BN5KOMSm.js +0 -8
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +0 -22
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +0 -1
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +0 -342
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { clsx as e } from "../../../../node_modules/clsx/dist/clsx-CdyIqUTr.js";
|
|
2
|
-
import { twMerge as t } from "../../../../node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js";
|
|
3
|
-
//#region ../ui/dist/lib/utils.js
|
|
4
|
-
function n(...n) {
|
|
5
|
-
return t(e(n));
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { n as cn };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HourPickerOption } from '@rpcbase/ui';
|
|
2
|
-
type ModalHourPickerFieldProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
value: string | null;
|
|
5
|
-
onChange: (value: string | null) => void;
|
|
6
|
-
onValueUpdate?: (value: string | null) => void;
|
|
7
|
-
options: HourPickerOption[];
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
inputClassName?: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
readOnly?: boolean;
|
|
13
|
-
open?: boolean;
|
|
14
|
-
onOpenChange?: (open: boolean) => void;
|
|
15
|
-
triggerTestId?: string;
|
|
16
|
-
contentTestId?: string;
|
|
17
|
-
isHydrated?: boolean;
|
|
18
|
-
portalContainer: HTMLElement | null;
|
|
19
|
-
};
|
|
20
|
-
export declare function ModalHourPickerField({ id, value, onChange, onValueUpdate, options, placeholder, className, inputClassName, disabled, readOnly, open: openProp, onOpenChange, triggerTestId, contentTestId, isHydrated, portalContainer, }: ModalHourPickerFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=ModalHourPickerField.d.ts.map
|
package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/ModalHourPickerField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAM,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGvD,KAAK,yBAAyB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,WAAW,GAAG,IAAI,CAAA;CACpC,CAAA;AAmKD,wBAAgB,oBAAoB,CAAC,EACnC,EAAE,EACF,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,WAA2B,EAC3B,SAAS,EACT,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,GAChB,EAAE,yBAAyB,2CA6d3B"}
|
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import { useEffect as e, useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
3
|
-
import { cn as o } from "@rpcbase/ui";
|
|
4
|
-
import { Check as s, ChevronDown as c } from "lucide-react";
|
|
5
|
-
import { createPortal as l } from "react-dom";
|
|
6
|
-
//#region src/components/BookingPeriodSelector/components/internal/ModalHourPickerField.tsx
|
|
7
|
-
function u(e) {
|
|
8
|
-
return e != null && !e.disabled;
|
|
9
|
-
}
|
|
10
|
-
function d(e) {
|
|
11
|
-
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
12
|
-
if (!t) return null;
|
|
13
|
-
let n = Number(t[1]), r = Number(t[2]);
|
|
14
|
-
return !Number.isFinite(n) || !Number.isFinite(r) || n < 0 || n > 23 || r < 0 || r > 59 ? null : n * 60 + r;
|
|
15
|
-
}
|
|
16
|
-
function f(e) {
|
|
17
|
-
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
18
|
-
if (!t) return null;
|
|
19
|
-
let n = Number(t[1]), r = Number(t[2]);
|
|
20
|
-
return !Number.isFinite(n) || !Number.isFinite(r) || n < 0 || n > 23 || r < 0 || r > 59 ? null : `${String(n).padStart(2, "0")}:${String(r).padStart(2, "0")}`;
|
|
21
|
-
}
|
|
22
|
-
function p(e) {
|
|
23
|
-
let t = e.replace(/\D/g, "").slice(0, 4);
|
|
24
|
-
return t.length <= 2 ? t : `${t.slice(0, t.length - 2)}:${t.slice(-2)}`;
|
|
25
|
-
}
|
|
26
|
-
function m(e, t) {
|
|
27
|
-
if (!e) return null;
|
|
28
|
-
let n = f(e);
|
|
29
|
-
return n && u(t.find((e) => e.value === n)) ? n : null;
|
|
30
|
-
}
|
|
31
|
-
function h(e) {
|
|
32
|
-
return e.find((e) => u(e)) ?? null;
|
|
33
|
-
}
|
|
34
|
-
function g(e, t) {
|
|
35
|
-
let n = d(e);
|
|
36
|
-
if (n == null) return null;
|
|
37
|
-
let r = null, i = Infinity, a = -Infinity;
|
|
38
|
-
for (let e of t) {
|
|
39
|
-
if (!u(e)) continue;
|
|
40
|
-
let t = d(e.value);
|
|
41
|
-
if (t == null) continue;
|
|
42
|
-
let o = Math.abs(t - n);
|
|
43
|
-
(o < i || o === i && t > a) && (r = e, i = o, a = t);
|
|
44
|
-
}
|
|
45
|
-
return r;
|
|
46
|
-
}
|
|
47
|
-
function _(e, t, n) {
|
|
48
|
-
let r = e ? n.findIndex((t) => t.value === e) : -1;
|
|
49
|
-
r === -1 && (r = t === 1 ? -1 : n.length);
|
|
50
|
-
for (let e = r + t; e >= 0 && e < n.length; e += t) {
|
|
51
|
-
let t = n[e];
|
|
52
|
-
if (u(t)) return t.value;
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
function v(e, t, n) {
|
|
57
|
-
let r = e.getBoundingClientRect(), i = t.offsetHeight, a = n.getBoundingClientRect(), o = window.innerWidth, s = window.innerHeight, c = r.width, l = r.left;
|
|
58
|
-
l + c > o - 8 && (l = Math.max(8, o - c - 8)), l < 8 && (l = 8);
|
|
59
|
-
let u = r.bottom + 8, d = u + i > s - 8, f = r.top - i - 8;
|
|
60
|
-
return d && f >= 8 && (u = f), u < 8 && (u = 8), u + i > s - 8 && (u = Math.max(8, s - i - 8)), {
|
|
61
|
-
left: l - a.left,
|
|
62
|
-
top: u - a.top,
|
|
63
|
-
width: c,
|
|
64
|
-
strategy: "absolute"
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function y({ id: u, value: d, onChange: y, onValueUpdate: b, options: x, placeholder: S = "Select time", className: C, inputClassName: w, disabled: T, readOnly: E, open: D, onOpenChange: O, triggerTestId: k, contentTestId: A, isHydrated: j, portalContainer: M }) {
|
|
68
|
-
let N = n(null), P = n(null), F = n(null), I = n(null), [L, R] = r(!1), [z, B] = r(() => d ?? ""), [V, H] = r(d ?? h(x)?.value ?? null), [U, W] = r({
|
|
69
|
-
left: 0,
|
|
70
|
-
top: 0,
|
|
71
|
-
width: 0,
|
|
72
|
-
strategy: "absolute"
|
|
73
|
-
}), G = n(!1), K = n(!1), q = D ?? L;
|
|
74
|
-
e(() => {
|
|
75
|
-
G.current || B(d ?? "");
|
|
76
|
-
}, [d]), e(() => {
|
|
77
|
-
if (!q) {
|
|
78
|
-
H(d ?? h(x)?.value ?? null);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
let e = m(d, x);
|
|
82
|
-
H(e ?? h(x)?.value ?? null);
|
|
83
|
-
}, [
|
|
84
|
-
q,
|
|
85
|
-
x,
|
|
86
|
-
d
|
|
87
|
-
]), e(() => {
|
|
88
|
-
if (!q || T || E) return;
|
|
89
|
-
let e = P.current;
|
|
90
|
-
e instanceof HTMLInputElement && document.activeElement !== e && e.focus({ preventScroll: !0 });
|
|
91
|
-
}, [
|
|
92
|
-
T,
|
|
93
|
-
q,
|
|
94
|
-
E
|
|
95
|
-
]), e(() => {
|
|
96
|
-
if (!q) return;
|
|
97
|
-
let e = (e) => {
|
|
98
|
-
let t = e.target;
|
|
99
|
-
t instanceof Node && (N.current?.contains(t) || F.current?.contains(t) || (O?.(!1), R(!1)));
|
|
100
|
-
}, t = (e) => {
|
|
101
|
-
if (e.key !== "Escape") return;
|
|
102
|
-
let t = e.target;
|
|
103
|
-
t instanceof Node && (!N.current?.contains(t) && !F.current?.contains(t) || (e.preventDefault(), e.stopPropagation(), O?.(!1), R(!1)));
|
|
104
|
-
};
|
|
105
|
-
return document.addEventListener("pointerdown", e, !0), window.addEventListener("keydown", t, !0), () => {
|
|
106
|
-
document.removeEventListener("pointerdown", e, !0), window.removeEventListener("keydown", t, !0);
|
|
107
|
-
};
|
|
108
|
-
}, [q, O]), e(() => {
|
|
109
|
-
if (!q || typeof window > "u" || !("IntersectionObserver" in window)) return;
|
|
110
|
-
let e = N.current;
|
|
111
|
-
if (!e) return;
|
|
112
|
-
let t = !0, n = new IntersectionObserver((e) => {
|
|
113
|
-
if (!t) return;
|
|
114
|
-
let n = e[0];
|
|
115
|
-
n && !n.isIntersecting && J(!1);
|
|
116
|
-
});
|
|
117
|
-
return n.observe(e), () => {
|
|
118
|
-
t = !1, n.disconnect();
|
|
119
|
-
};
|
|
120
|
-
}, [q]), t(() => {
|
|
121
|
-
if (!q || T || !M) return;
|
|
122
|
-
let e = () => {
|
|
123
|
-
!P.current || !F.current || W(v(P.current, F.current, M));
|
|
124
|
-
};
|
|
125
|
-
e();
|
|
126
|
-
let t = window.requestAnimationFrame(e);
|
|
127
|
-
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
128
|
-
window.cancelAnimationFrame(t), window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
129
|
-
};
|
|
130
|
-
}, [
|
|
131
|
-
T,
|
|
132
|
-
q,
|
|
133
|
-
M
|
|
134
|
-
]), e(() => {
|
|
135
|
-
if (!q || !I.current || !V) return;
|
|
136
|
-
let e = I.current.querySelector(`[role="option"][data-value="${V}"]`);
|
|
137
|
-
if (!e) return;
|
|
138
|
-
let t = e.offsetTop - 8, n = e.offsetTop + e.offsetHeight + 8;
|
|
139
|
-
if (t < I.current.scrollTop) {
|
|
140
|
-
I.current.scrollTop = Math.max(0, t);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
n > I.current.scrollTop + I.current.clientHeight && (I.current.scrollTop = Math.max(0, n - I.current.clientHeight));
|
|
144
|
-
}, [V, q]);
|
|
145
|
-
let J = (e) => {
|
|
146
|
-
O?.(e), R(e);
|
|
147
|
-
}, Y = (e) => {
|
|
148
|
-
b?.(e), y(e);
|
|
149
|
-
}, X = x.find((e) => e.value === d)?.selectedLabel;
|
|
150
|
-
return /* @__PURE__ */ i("div", {
|
|
151
|
-
"data-slot": "hours-picker-input",
|
|
152
|
-
className: o("w-[150px]", C),
|
|
153
|
-
ref: N,
|
|
154
|
-
children: /* @__PURE__ */ a("div", {
|
|
155
|
-
className: "relative group",
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ i("input", {
|
|
158
|
-
ref: P,
|
|
159
|
-
id: u,
|
|
160
|
-
type: "text",
|
|
161
|
-
"data-testid": k,
|
|
162
|
-
"data-hydrated": j ? "true" : void 0,
|
|
163
|
-
autoComplete: "off",
|
|
164
|
-
disabled: T,
|
|
165
|
-
readOnly: E,
|
|
166
|
-
placeholder: S,
|
|
167
|
-
value: z,
|
|
168
|
-
className: o("peer flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "transition-colors group-hover:bg-accent group-hover:text-accent-foreground", !z && "text-muted-foreground", q && "ring-2 ring-primary ring-offset-2", w, d && X != null && "text-transparent focus:text-foreground"),
|
|
169
|
-
onChange: (e) => {
|
|
170
|
-
let t = p(e.currentTarget.value);
|
|
171
|
-
if (B(t), !t) {
|
|
172
|
-
b?.(null);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
let n = m(t, x);
|
|
176
|
-
if (n) {
|
|
177
|
-
H(n), b?.(n);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
let r = f(t);
|
|
181
|
-
if (!r) return;
|
|
182
|
-
let i = g(r, x);
|
|
183
|
-
i && H(i.value);
|
|
184
|
-
},
|
|
185
|
-
onFocus: (e) => {
|
|
186
|
-
G.current = !0;
|
|
187
|
-
let t = e.currentTarget;
|
|
188
|
-
requestAnimationFrame(() => {
|
|
189
|
-
t.select();
|
|
190
|
-
}), T || J(!0);
|
|
191
|
-
},
|
|
192
|
-
onClick: () => {
|
|
193
|
-
T || J(!0);
|
|
194
|
-
},
|
|
195
|
-
onKeyDown: (e) => {
|
|
196
|
-
if (!T) {
|
|
197
|
-
if (e.key === "Tab") {
|
|
198
|
-
J(!1);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
if (e.key === "Escape") {
|
|
202
|
-
if (!q) return;
|
|
203
|
-
e.preventDefault(), J(!1);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
207
|
-
if (e.preventDefault(), !q) {
|
|
208
|
-
J(!0);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
let t = _(V ?? d, e.key === "ArrowDown" ? 1 : -1, x);
|
|
212
|
-
if (!t) return;
|
|
213
|
-
H(t), B(t), b?.(t);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (e.key === "Enter") {
|
|
217
|
-
let t = V ?? m(z, x) ?? g(z, x)?.value ?? h(x)?.value ?? null;
|
|
218
|
-
if (!t) return;
|
|
219
|
-
e.preventDefault(), B(t), H(t), Y(t), J(!1);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
!q && (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete") && !e.ctrlKey && !e.metaKey && !e.altKey && J(!0);
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
onBlur: (e) => {
|
|
226
|
-
if (G.current = !1, K.current) {
|
|
227
|
-
K.current = !1;
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
let t = e.relatedTarget;
|
|
231
|
-
if (t instanceof Node && (N.current?.contains(t) || F.current?.contains(t))) return;
|
|
232
|
-
if (requestAnimationFrame(() => {
|
|
233
|
-
let e = document.activeElement;
|
|
234
|
-
e instanceof Node && (N.current?.contains(e) || F.current?.contains(e)) || J(!1);
|
|
235
|
-
}), !z.trim()) {
|
|
236
|
-
B(d ?? "");
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
let n = m(z, x);
|
|
240
|
-
if (n) {
|
|
241
|
-
B(n), H(n), d !== n && Y(n);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
B(d ?? "");
|
|
245
|
-
}
|
|
246
|
-
}),
|
|
247
|
-
d && X != null ? /* @__PURE__ */ i("span", {
|
|
248
|
-
"aria-hidden": "true",
|
|
249
|
-
"data-slot": "hours-picker-input-selected-label",
|
|
250
|
-
className: o("pointer-events-none absolute inset-y-0 left-3 right-10 flex min-w-0 items-center text-base peer-focus:hidden md:text-sm", T && "opacity-50"),
|
|
251
|
-
children: /* @__PURE__ */ i("span", {
|
|
252
|
-
className: "min-w-0 truncate",
|
|
253
|
-
children: X
|
|
254
|
-
})
|
|
255
|
-
}) : null,
|
|
256
|
-
/* @__PURE__ */ i("button", {
|
|
257
|
-
type: "button",
|
|
258
|
-
tabIndex: -1,
|
|
259
|
-
disabled: T,
|
|
260
|
-
"data-slot": "hours-picker-input-toggle",
|
|
261
|
-
className: "absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
262
|
-
"aria-label": q ? "Close time picker" : "Open time picker",
|
|
263
|
-
onPointerDown: (e) => {
|
|
264
|
-
e.preventDefault();
|
|
265
|
-
},
|
|
266
|
-
onMouseDown: (e) => {
|
|
267
|
-
e.preventDefault();
|
|
268
|
-
},
|
|
269
|
-
onClick: () => {
|
|
270
|
-
T || (J(!q), P.current?.focus({ preventScroll: !0 }));
|
|
271
|
-
},
|
|
272
|
-
children: /* @__PURE__ */ i(c, {
|
|
273
|
-
"aria-hidden": !0,
|
|
274
|
-
className: "size-4"
|
|
275
|
-
})
|
|
276
|
-
}),
|
|
277
|
-
q ? l(/* @__PURE__ */ i("div", {
|
|
278
|
-
ref: F,
|
|
279
|
-
"data-testid": A,
|
|
280
|
-
"data-state": "open",
|
|
281
|
-
className: "pointer-events-auto overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
282
|
-
style: {
|
|
283
|
-
position: U.strategy,
|
|
284
|
-
left: U.left,
|
|
285
|
-
top: U.top,
|
|
286
|
-
width: U.width
|
|
287
|
-
},
|
|
288
|
-
onPointerDownCapture: () => {
|
|
289
|
-
K.current = !0;
|
|
290
|
-
},
|
|
291
|
-
onMouseDownCapture: () => {
|
|
292
|
-
K.current = !0;
|
|
293
|
-
},
|
|
294
|
-
children: /* @__PURE__ */ i("div", {
|
|
295
|
-
ref: I,
|
|
296
|
-
role: "listbox",
|
|
297
|
-
className: "max-h-64 overflow-y-auto p-1",
|
|
298
|
-
children: x.map((e) => {
|
|
299
|
-
let t = e.value === d, n = e.value === V;
|
|
300
|
-
return /* @__PURE__ */ a("div", {
|
|
301
|
-
role: "option",
|
|
302
|
-
"aria-selected": t,
|
|
303
|
-
"data-value": e.value,
|
|
304
|
-
"data-state": t ? "checked" : "unchecked",
|
|
305
|
-
"data-disabled": e.disabled ? "" : void 0,
|
|
306
|
-
className: o("relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none", e.disabled ? "pointer-events-none opacity-50" : "cursor-pointer", n && "bg-accent text-accent-foreground"),
|
|
307
|
-
onMouseDown: (e) => {
|
|
308
|
-
e.preventDefault();
|
|
309
|
-
},
|
|
310
|
-
onClick: () => {
|
|
311
|
-
e.disabled || (B(e.value), H(e.value), Y(e.value), J(!1), P.current?.focus({ preventScroll: !0 }));
|
|
312
|
-
},
|
|
313
|
-
onPointerEnter: () => {
|
|
314
|
-
e.disabled || H(e.value);
|
|
315
|
-
},
|
|
316
|
-
onPointerMove: () => {
|
|
317
|
-
e.disabled || H(e.value);
|
|
318
|
-
},
|
|
319
|
-
children: [/* @__PURE__ */ i("span", {
|
|
320
|
-
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
321
|
-
children: t ? /* @__PURE__ */ i(s, {
|
|
322
|
-
"aria-hidden": !0,
|
|
323
|
-
className: "h-4 w-4"
|
|
324
|
-
}) : null
|
|
325
|
-
}), /* @__PURE__ */ a("div", {
|
|
326
|
-
className: "flex flex-col",
|
|
327
|
-
children: [/* @__PURE__ */ i("span", { children: e.label }), e.description == null ? null : /* @__PURE__ */ i("span", {
|
|
328
|
-
"data-slot": "description",
|
|
329
|
-
className: "text-xs text-muted-foreground",
|
|
330
|
-
children: e.description
|
|
331
|
-
})]
|
|
332
|
-
})]
|
|
333
|
-
}, e.value);
|
|
334
|
-
})
|
|
335
|
-
})
|
|
336
|
-
}), M) : null
|
|
337
|
-
]
|
|
338
|
-
})
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
//#endregion
|
|
342
|
-
export { y as ModalHourPickerField };
|