@rpcbase/ui 0.192.0 → 0.194.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/DayPickerField/index.d.ts.map +1 -1
- package/dist/components/HourPickerField/index.d.ts.map +1 -1
- package/dist/index12.js +421 -510
- package/dist/index12.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +599 -40
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +41 -200
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +204 -20
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +22 -25
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +23 -398
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +383 -589
- package/dist/index157.js.map +1 -1
- package/dist/index19.js +507 -545
- package/dist/index19.js.map +1 -1
- package/dist/index239.js +65 -22
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +179 -27
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +47 -5
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +22 -65
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +27 -179
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -47
- package/dist/index244.js.map +1 -1
- package/dist/index274.js +1 -1
- package/dist/index276.js +5 -5
- package/dist/index277.js +1 -1
- package/dist/index299.js +65 -69
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +68 -8
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -14
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -66
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +65 -64
- package/dist/index303.js.map +1 -1
- package/dist/index31.js +5 -5
- package/dist/index41.js +20 -20
- package/dist/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index51.js +7 -7
- package/dist/index52.js +2 -7
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +2 -34
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +5 -25
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +33 -7
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +26 -11
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +7 -3
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +11 -47
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +3 -50
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +47 -7
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +48 -12
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +7 -133
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +14 -10
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +127 -210
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +10 -12
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +214 -44
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +12 -49
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +47 -4
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +49 -5
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +4 -28
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +6 -50
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +28 -9
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +50 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +9 -2
- package/dist/index74.js.map +1 -1
- package/package.json +1 -1
package/dist/index19.js
CHANGED
|
@@ -1,688 +1,650 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Check as
|
|
4
|
-
import * as
|
|
5
|
-
import { DismissableLayerBranch as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { IMaskInput as
|
|
8
|
-
import
|
|
9
|
-
import { SelectItem as
|
|
10
|
-
import { useIsTouchDevice as
|
|
11
|
-
import { cn as
|
|
12
|
-
const
|
|
13
|
-
typeof
|
|
14
|
-
function
|
|
1
|
+
import { j as v } from "./index30.js";
|
|
2
|
+
import { c as we } from "./index28.js";
|
|
3
|
+
import { Check as Ee, ChevronUp as Re, ChevronDown as De } from "lucide-react";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { DismissableLayerBranch as He } from "./index31.js";
|
|
6
|
+
import { createPortal as Ie } from "react-dom";
|
|
7
|
+
import { IMaskInput as Ce } from "react-imask";
|
|
8
|
+
import Me, { InputMask as je } from "imask";
|
|
9
|
+
import { SelectItem as Ve, SelectValue as Pe, SelectTrigger as Oe, SelectContent as Ae, Select as Le } from "./index21.js";
|
|
10
|
+
import { useIsTouchDevice as Fe } from "./index4.js";
|
|
11
|
+
import { cn as ne } from "./index2.js";
|
|
12
|
+
const ke = Me;
|
|
13
|
+
typeof ke.InputMask != "function" && (ke.InputMask = je);
|
|
14
|
+
function be(o) {
|
|
15
15
|
return String(o).padStart(2, "0");
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Be(o) {
|
|
18
18
|
const e = o.trim();
|
|
19
19
|
if (!e) return null;
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
20
|
+
const g = /^(\d{1,2}):(\d{2})$/.exec(e);
|
|
21
|
+
if (!g)
|
|
22
22
|
return null;
|
|
23
|
-
const
|
|
24
|
-
return !Number.isFinite(
|
|
23
|
+
const l = Number(g[1]), t = Number(g[2]);
|
|
24
|
+
return !Number.isFinite(l) || !Number.isFinite(t) || l < 0 || l > 23 || t < 0 || t > 59 ? null : `${be(l)}:${be(t)}`;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
parsed:
|
|
32
|
-
selectableValue:
|
|
26
|
+
function ve(o, e) {
|
|
27
|
+
const g = Be(o);
|
|
28
|
+
if (!g) return null;
|
|
29
|
+
const l = e.find((t) => t.value === g);
|
|
30
|
+
return _(l) ? {
|
|
31
|
+
parsed: g,
|
|
32
|
+
selectableValue: g
|
|
33
33
|
} : {
|
|
34
|
-
parsed:
|
|
34
|
+
parsed: g,
|
|
35
35
|
selectableValue: null
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function xe(o) {
|
|
39
39
|
const e = /^(\d{2}):(\d{2})$/.exec(o);
|
|
40
40
|
if (!e)
|
|
41
41
|
return null;
|
|
42
|
-
const
|
|
43
|
-
return !Number.isFinite(
|
|
42
|
+
const g = Number(e[1]), l = Number(e[2]);
|
|
43
|
+
return !Number.isFinite(g) || !Number.isFinite(l) ? null : g * 60 + l;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function _(o) {
|
|
46
46
|
return o ? !o.disabled : !1;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
let
|
|
50
|
-
for (const
|
|
51
|
-
if (!
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const c = Math.abs(
|
|
55
|
-
(c <
|
|
48
|
+
function ye(o, e) {
|
|
49
|
+
let g = null, l = Number.POSITIVE_INFINITY, t = Number.NEGATIVE_INFINITY;
|
|
50
|
+
for (const M of e) {
|
|
51
|
+
if (!_(M)) continue;
|
|
52
|
+
const f = xe(M.value);
|
|
53
|
+
if (f == null) continue;
|
|
54
|
+
const c = Math.abs(f - o);
|
|
55
|
+
(c < l || c === l && f > t) && (g = M, l = c, t = f);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return g;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Te({
|
|
60
60
|
direction: o,
|
|
61
61
|
viewportRef: e,
|
|
62
|
-
speed:
|
|
63
|
-
className:
|
|
62
|
+
speed: g = 400,
|
|
63
|
+
className: l
|
|
64
64
|
}) {
|
|
65
|
-
const [
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
68
|
-
|
|
65
|
+
const [t, M] = n.useState(!0), f = n.useRef(void 0), c = n.useRef(void 0), a = n.useRef(!1), j = n.useCallback(() => {
|
|
66
|
+
const E = e.current;
|
|
67
|
+
if (!E) {
|
|
68
|
+
M(!0);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
const {
|
|
72
|
-
scrollTop:
|
|
73
|
-
scrollHeight:
|
|
74
|
-
clientHeight:
|
|
75
|
-
} =
|
|
76
|
-
if (!(
|
|
77
|
-
|
|
72
|
+
scrollTop: C,
|
|
73
|
+
scrollHeight: V,
|
|
74
|
+
clientHeight: w
|
|
75
|
+
} = E, y = 2, z = C > y, N = C < V - w - y;
|
|
76
|
+
if (!(V > w + y)) {
|
|
77
|
+
M(!0);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
M(o === "up" ? !z : !N);
|
|
81
81
|
}, [o, e]);
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
82
|
+
n.useEffect(() => {
|
|
83
|
+
const E = e.current;
|
|
84
|
+
if (!E) return;
|
|
85
|
+
j();
|
|
86
|
+
const C = () => j(), V = () => j();
|
|
87
|
+
E.addEventListener("scroll", C, {
|
|
88
88
|
passive: !0
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
return
|
|
90
|
+
const w = new ResizeObserver(V);
|
|
91
|
+
w.observe(E);
|
|
92
|
+
const y = new MutationObserver(V);
|
|
93
|
+
return y.observe(E, {
|
|
94
94
|
childList: !0,
|
|
95
95
|
subtree: !0
|
|
96
96
|
}), () => {
|
|
97
|
-
|
|
97
|
+
E.removeEventListener("scroll", C), w.disconnect(), y.disconnect();
|
|
98
98
|
};
|
|
99
|
-
}, [e,
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
}, []),
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
|
|
99
|
+
}, [e, j]);
|
|
100
|
+
const d = n.useCallback(() => {
|
|
101
|
+
f.current && (cancelAnimationFrame(f.current), f.current = void 0), a.current = !1, c.current = void 0;
|
|
102
|
+
}, []), p = n.useCallback((E) => {
|
|
103
|
+
const C = e.current;
|
|
104
|
+
if (!C || t || !a.current) {
|
|
105
|
+
d();
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
c.current || (c.current =
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
|
|
108
|
+
c.current || (c.current = E);
|
|
109
|
+
const V = E - c.current, w = g * V / 1e3;
|
|
110
|
+
if (w < 0.1) {
|
|
111
|
+
f.current = requestAnimationFrame(p);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
const
|
|
115
|
-
let
|
|
116
|
-
o === "up" ?
|
|
117
|
-
top:
|
|
118
|
-
}), c.current =
|
|
119
|
-
const
|
|
120
|
-
(o === "up" ?
|
|
121
|
-
}, [
|
|
122
|
-
|
|
123
|
-
}, [
|
|
124
|
-
return
|
|
125
|
-
|
|
114
|
+
const y = C.scrollTop, z = C.scrollHeight - C.clientHeight;
|
|
115
|
+
let N;
|
|
116
|
+
o === "up" ? N = Math.max(0, y - w) : N = Math.min(z, y + w), C.scrollTo({
|
|
117
|
+
top: N
|
|
118
|
+
}), c.current = E;
|
|
119
|
+
const W = 1;
|
|
120
|
+
(o === "up" ? N > W : N < z - W) && Math.abs(N - y) > 0.01 ? f.current = requestAnimationFrame(p) : (d(), setTimeout(j, 16));
|
|
121
|
+
}, [j, o, t, g, d, e]), G = n.useCallback(() => {
|
|
122
|
+
t || !e.current || a.current || (a.current = !0, c.current = void 0, f.current = requestAnimationFrame(p));
|
|
123
|
+
}, [t, p, e]);
|
|
124
|
+
return n.useEffect(() => d, [d]), /* @__PURE__ */ v.jsx("div", { className: ne("flex items-center justify-center py-1 select-none", t ? "cursor-default opacity-40" : "cursor-pointer opacity-100 hover:bg-accent/20", l), onPointerEnter: () => {
|
|
125
|
+
t || G();
|
|
126
126
|
}, onPointerMove: () => {
|
|
127
|
-
!
|
|
127
|
+
!t && !a.current && G();
|
|
128
128
|
}, onPointerLeave: () => {
|
|
129
|
-
|
|
130
|
-
}, children: o === "up" ? /* @__PURE__ */
|
|
129
|
+
d();
|
|
130
|
+
}, children: o === "up" ? /* @__PURE__ */ v.jsx(Re, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) : /* @__PURE__ */ v.jsx(De, { "aria-hidden": !0, className: "h-4 w-4 opacity-50" }) });
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (!
|
|
132
|
+
function Se({
|
|
133
|
+
id: o,
|
|
134
|
+
value: e,
|
|
135
|
+
onChange: g,
|
|
136
|
+
onValueUpdate: l,
|
|
137
|
+
options: t,
|
|
138
|
+
placeholder: M = "Select time",
|
|
139
|
+
className: f,
|
|
140
|
+
inputClassName: c,
|
|
141
|
+
disabled: a,
|
|
142
|
+
readOnly: j,
|
|
143
|
+
open: d,
|
|
144
|
+
onOpenChange: p,
|
|
145
|
+
triggerTestId: G,
|
|
146
|
+
contentTestId: E,
|
|
147
|
+
isHydrated: C
|
|
148
|
+
}) {
|
|
149
|
+
const V = n.useId(), w = o ?? `hours-picker-${V}`, y = n.useRef(null), z = n.useRef(null), N = n.useCallback((r) => {
|
|
150
|
+
z.current = r;
|
|
151
|
+
}, []), W = n.useRef(null), H = n.useRef(!1), [X, ee] = n.useState(null), J = n.useRef(null), A = n.useRef(null), P = n.useRef(null), [T, R] = n.useState(() => ({
|
|
152
|
+
left: 0,
|
|
153
|
+
top: 0,
|
|
154
|
+
width: 0
|
|
155
|
+
})), [K, Y] = n.useState(!1), b = d ?? K, L = p ?? Y, te = n.useRef(!1);
|
|
156
|
+
te.current = b, n.useEffect(() => {
|
|
157
|
+
if (!b || a || j)
|
|
158
158
|
return;
|
|
159
|
-
const
|
|
160
|
-
|
|
159
|
+
const r = y.current;
|
|
160
|
+
r instanceof HTMLInputElement && (typeof document < "u" && document.activeElement === r || r.focus({
|
|
161
161
|
preventScroll: !0
|
|
162
162
|
}));
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
let J, Q;
|
|
175
|
-
e[8] !== s || e[9] !== r || e[10] !== a ? (J = () => {
|
|
176
|
-
if (!s)
|
|
177
|
-
return;
|
|
178
|
-
const t = r.find((h) => h.value === a);
|
|
179
|
-
if (t && se(t)) {
|
|
180
|
-
$(t.value);
|
|
163
|
+
}, [a, b, j]);
|
|
164
|
+
const $ = n.useCallback((r) => {
|
|
165
|
+
W.current = r, ee(r);
|
|
166
|
+
}, []), se = n.useCallback(() => {
|
|
167
|
+
H.current = !0;
|
|
168
|
+
}, []);
|
|
169
|
+
n.useEffect(() => {
|
|
170
|
+
if (!b) return;
|
|
171
|
+
const r = t.find((u) => u.value === e);
|
|
172
|
+
if (r && _(r)) {
|
|
173
|
+
$(r.value);
|
|
181
174
|
return;
|
|
182
175
|
}
|
|
183
|
-
const
|
|
184
|
-
$(
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
x && x(null);
|
|
176
|
+
const s = t.find((u) => _(u));
|
|
177
|
+
$(s?.value ?? null);
|
|
178
|
+
}, [b, t, $, e]);
|
|
179
|
+
const ie = n.useCallback((r) => {
|
|
180
|
+
if (r === null) {
|
|
181
|
+
l && l(null);
|
|
190
182
|
return;
|
|
191
183
|
}
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
e[16] !== n || e[17] !== x || e[18] !== r ? (ee = (t) => {
|
|
198
|
-
if (t === null) {
|
|
199
|
-
x && x(null), n(null);
|
|
184
|
+
const s = t.find((u) => u.value === r);
|
|
185
|
+
_(s) && l && l(r);
|
|
186
|
+
}, [l, t]), oe = n.useCallback((r) => {
|
|
187
|
+
if (r === null) {
|
|
188
|
+
l && l(null), g(null);
|
|
200
189
|
return;
|
|
201
190
|
}
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const h =
|
|
212
|
-
|
|
191
|
+
const s = t.find((u) => u.value === r);
|
|
192
|
+
_(s) && (l && l(r), g(r));
|
|
193
|
+
}, [g, l, t]);
|
|
194
|
+
n.useEffect(() => {
|
|
195
|
+
if (!b) return;
|
|
196
|
+
const r = J.current?.ownerDocument ?? document, s = r.defaultView ?? window, u = (k) => {
|
|
197
|
+
const D = k.target;
|
|
198
|
+
if (!(D instanceof Node))
|
|
199
|
+
return;
|
|
200
|
+
const h = J.current;
|
|
201
|
+
!h || h.contains(D) || A.current?.contains(D) || L(!1);
|
|
202
|
+
}, m = (k) => {
|
|
203
|
+
if (k.key !== "Escape" || !te.current)
|
|
204
|
+
return;
|
|
205
|
+
const D = k.target;
|
|
206
|
+
if (!(D instanceof Node))
|
|
213
207
|
return;
|
|
214
|
-
const
|
|
215
|
-
!
|
|
208
|
+
const h = J.current, B = A.current;
|
|
209
|
+
!h?.contains(D) && !B?.contains(D) || (k.preventDefault(), k.stopPropagation(), L(!1));
|
|
216
210
|
};
|
|
217
|
-
return
|
|
218
|
-
|
|
211
|
+
return r.addEventListener("pointerdown", u, !0), s.addEventListener("keydown", m, !0), () => {
|
|
212
|
+
r.removeEventListener("pointerdown", u, !0), s.removeEventListener("keydown", m, !0);
|
|
219
213
|
};
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
e[24] !== s ? (te = () => {
|
|
223
|
-
if (!s)
|
|
214
|
+
}, [b, L]), n.useEffect(() => {
|
|
215
|
+
if (!b)
|
|
224
216
|
return;
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
217
|
+
const r = A.current;
|
|
218
|
+
if (!r)
|
|
227
219
|
return;
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
220
|
+
const s = (u) => {
|
|
221
|
+
const m = P.current;
|
|
222
|
+
if (!m)
|
|
231
223
|
return;
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
224
|
+
const k = u.deltaY;
|
|
225
|
+
if (k === 0)
|
|
234
226
|
return;
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
(
|
|
227
|
+
const D = Math.max(0, m.scrollHeight - m.clientHeight), h = m.scrollTop <= 0, B = m.scrollTop >= D, F = u.target;
|
|
228
|
+
if (F instanceof Node && m.contains(F)) {
|
|
229
|
+
(k < 0 && h || k > 0 && B) && u.preventDefault();
|
|
238
230
|
return;
|
|
239
231
|
}
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
232
|
+
u.preventDefault();
|
|
233
|
+
const q = Math.min(D, Math.max(0, m.scrollTop + k));
|
|
234
|
+
m.scrollTop = q;
|
|
243
235
|
};
|
|
244
|
-
return
|
|
236
|
+
return r.addEventListener("wheel", s, {
|
|
245
237
|
passive: !1
|
|
246
238
|
}), () => {
|
|
247
|
-
|
|
239
|
+
r.removeEventListener("wheel", s);
|
|
248
240
|
};
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
e[27] !== k || e[28] !== s || e[29] !== O || e[30] !== C ? (ne = () => {
|
|
252
|
-
if (!s || O !== void 0 && !k || typeof window > "u" || !("IntersectionObserver" in window))
|
|
241
|
+
}, [b]), n.useEffect(() => {
|
|
242
|
+
if (!b || d !== void 0 && !p || typeof window > "u" || !("IntersectionObserver" in window))
|
|
253
243
|
return;
|
|
254
|
-
const
|
|
255
|
-
if (!(
|
|
244
|
+
const r = y.current;
|
|
245
|
+
if (!(r instanceof HTMLElement))
|
|
256
246
|
return;
|
|
257
|
-
let
|
|
258
|
-
const
|
|
259
|
-
if (!
|
|
247
|
+
let s = !0;
|
|
248
|
+
const u = new IntersectionObserver((m) => {
|
|
249
|
+
if (!s)
|
|
260
250
|
return;
|
|
261
|
-
const
|
|
262
|
-
|
|
251
|
+
const k = m[0];
|
|
252
|
+
k && !k.isIntersecting && L(!1);
|
|
263
253
|
});
|
|
264
|
-
return
|
|
265
|
-
|
|
254
|
+
return u.observe(r), () => {
|
|
255
|
+
s = !1, u.disconnect();
|
|
266
256
|
};
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
left: ve,
|
|
282
|
-
top: Y,
|
|
283
|
-
width: de
|
|
257
|
+
}, [p, b, d, L]);
|
|
258
|
+
const Q = n.useCallback(() => {
|
|
259
|
+
if (typeof window > "u") return;
|
|
260
|
+
const r = y.current, s = A.current;
|
|
261
|
+
if (!(r instanceof HTMLElement) || !s) return;
|
|
262
|
+
const u = r.getBoundingClientRect(), m = s.offsetHeight, k = window.innerWidth ?? 0, D = window.innerHeight ?? 0, h = 8, B = u.width;
|
|
263
|
+
let F = u.left;
|
|
264
|
+
F + B > k - h && (F = Math.max(h, k - B - h)), F < h && (F = h);
|
|
265
|
+
let I = u.bottom + h;
|
|
266
|
+
const q = I + m > D - h, Z = u.top - m - h;
|
|
267
|
+
q && Z >= h && (I = Z), I < h && (I = h), I + m > D - h && (I = Math.max(h, D - m - h)), R({
|
|
268
|
+
left: F,
|
|
269
|
+
top: I,
|
|
270
|
+
width: B
|
|
284
271
|
});
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const t = window.requestAnimationFrame(d);
|
|
293
|
-
return window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
|
|
294
|
-
window.cancelAnimationFrame(t), window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
|
|
272
|
+
}, []);
|
|
273
|
+
return n.useLayoutEffect(() => {
|
|
274
|
+
if (!b || a || typeof window > "u") return;
|
|
275
|
+
Q();
|
|
276
|
+
const r = window.requestAnimationFrame(Q);
|
|
277
|
+
return window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), () => {
|
|
278
|
+
window.cancelAnimationFrame(r), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
295
279
|
};
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if (!
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (w instanceof HTMLElement) {
|
|
307
|
-
const pe = w.offsetTop - 8, be = w.offsetTop + w.offsetHeight + 8;
|
|
308
|
-
if (pe < t.scrollTop) {
|
|
309
|
-
t.scrollTop = Math.max(0, pe);
|
|
280
|
+
}, [a, b, Q]), n.useEffect(() => {
|
|
281
|
+
if (!b) return;
|
|
282
|
+
const r = P.current;
|
|
283
|
+
if (!r) return;
|
|
284
|
+
const u = requestAnimationFrame(() => {
|
|
285
|
+
const m = r.querySelector('[role="option"][data-state="checked"]');
|
|
286
|
+
if (m instanceof HTMLElement) {
|
|
287
|
+
const q = m.offsetTop - 8, Z = m.offsetTop + m.offsetHeight + 8;
|
|
288
|
+
if (q < r.scrollTop) {
|
|
289
|
+
r.scrollTop = Math.max(0, q);
|
|
310
290
|
return;
|
|
311
291
|
}
|
|
312
|
-
const
|
|
313
|
-
|
|
292
|
+
const re = r.scrollTop + r.clientHeight;
|
|
293
|
+
Z > re && (r.scrollTop = Math.max(0, Z - r.clientHeight));
|
|
314
294
|
return;
|
|
315
295
|
}
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
le = pe;
|
|
296
|
+
const k = Array.from(r.querySelectorAll('[role="option"]'));
|
|
297
|
+
if (!k.length) return;
|
|
298
|
+
let D, h;
|
|
299
|
+
for (const I of k) {
|
|
300
|
+
if (!I.hasAttribute("data-disabled")) {
|
|
301
|
+
D = I;
|
|
323
302
|
break;
|
|
324
303
|
}
|
|
325
|
-
|
|
304
|
+
h = I;
|
|
326
305
|
}
|
|
327
|
-
if (!
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
t.scrollTop = Y;
|
|
306
|
+
if (!D) return;
|
|
307
|
+
const F = Math.max(0, (h || D).offsetTop - 8);
|
|
308
|
+
r.scrollTop = F;
|
|
331
309
|
});
|
|
332
|
-
return () => cancelAnimationFrame(
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (!s
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return;
|
|
343
|
-
const f = t.querySelector(`[role="option"][data-value="${y}"]`);
|
|
344
|
-
if (!(f instanceof HTMLElement))
|
|
345
|
-
return;
|
|
346
|
-
const h = f.offsetTop - 8, w = f.offsetTop + f.offsetHeight + 8;
|
|
347
|
-
if (h < t.scrollTop) {
|
|
348
|
-
t.scrollTop = Math.max(0, h);
|
|
310
|
+
return () => cancelAnimationFrame(u);
|
|
311
|
+
}, [b, t]), n.useEffect(() => {
|
|
312
|
+
if (!b || !X || !H.current) return;
|
|
313
|
+
const r = P.current;
|
|
314
|
+
if (!r) return;
|
|
315
|
+
const s = r.querySelector(`[role="option"][data-value="${X}"]`);
|
|
316
|
+
if (!(s instanceof HTMLElement)) return;
|
|
317
|
+
const u = 8, m = s.offsetTop - u, k = s.offsetTop + s.offsetHeight + u;
|
|
318
|
+
if (m < r.scrollTop) {
|
|
319
|
+
r.scrollTop = Math.max(0, m);
|
|
349
320
|
return;
|
|
350
321
|
}
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
] }) });
|
|
390
|
-
return typeof document > "u" ? t : qe(t, document.body);
|
|
391
|
-
})() : null, e[64] = W, e[65] = H, e[66] = L, e[67] = y, e[68] = s, e[69] = r, e[70] = C, e[71] = a, e[72] = Ne) : Ne = e[72];
|
|
392
|
-
let De;
|
|
393
|
-
e[73] !== Se || e[74] !== Ne ? (De = /* @__PURE__ */ g.jsxs("div", { className: "relative", children: [
|
|
394
|
-
Se,
|
|
395
|
-
Ne
|
|
396
|
-
] }), e[73] = Se, e[74] = Ne, e[75] = De) : De = e[75];
|
|
397
|
-
let He;
|
|
398
|
-
return e[76] !== Te || e[77] !== De ? (He = /* @__PURE__ */ g.jsx("div", { "data-slot": "hours-picker-input", className: Te, ref: z, children: De }), e[76] = Te, e[77] = De, e[78] = He) : He = e[78], He;
|
|
399
|
-
}
|
|
400
|
-
function et(o) {
|
|
401
|
-
o.preventDefault();
|
|
402
|
-
}
|
|
403
|
-
function tt(o) {
|
|
404
|
-
return se(o);
|
|
405
|
-
}
|
|
406
|
-
function nt() {
|
|
407
|
-
return {
|
|
408
|
-
left: 0,
|
|
409
|
-
top: 0,
|
|
410
|
-
width: 0
|
|
411
|
-
};
|
|
322
|
+
const D = r.scrollTop + r.clientHeight;
|
|
323
|
+
k > D && (r.scrollTop = Math.max(0, k - r.clientHeight));
|
|
324
|
+
}, [X, b]), /* @__PURE__ */ v.jsx("div", { "data-slot": "hours-picker-input", className: ne("w-[150px]", f), ref: J, children: /* @__PURE__ */ v.jsxs("div", { className: "relative", children: [
|
|
325
|
+
/* @__PURE__ */ v.jsx(qe, { id: w, placeholder: M, value: e, onValueUpdate: ie, onCommit: oe, options: t, disabled: a, readOnly: j, open: b, setOpen: L, inputClassName: c, triggerTestId: G, isHydrated: C, highlightedValueRef: W, setHighlightedValue: $, markKeyboardNavigation: se, inputRef: (r) => {
|
|
326
|
+
y.current = r;
|
|
327
|
+
}, onDraftValueHandlerChange: N }),
|
|
328
|
+
b ? (() => {
|
|
329
|
+
const r = /* @__PURE__ */ v.jsx(He, { children: /* @__PURE__ */ v.jsxs("div", { ref: A, "data-testid": E, "data-state": "open", className: ne("pointer-events-auto fixed z-[60] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"), style: {
|
|
330
|
+
left: T.left,
|
|
331
|
+
top: T.top,
|
|
332
|
+
width: T.width
|
|
333
|
+
}, children: [
|
|
334
|
+
/* @__PURE__ */ v.jsx(Te, { direction: "up", viewportRef: P }),
|
|
335
|
+
/* @__PURE__ */ v.jsx("div", { ref: P, role: "listbox", className: "max-h-64 overflow-y-auto p-1 [overscroll-behavior:contain] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", children: t.map((s) => {
|
|
336
|
+
const u = s.value === e;
|
|
337
|
+
return /* @__PURE__ */ v.jsxs("div", { role: "option", "aria-selected": u, "data-value": s.value, "data-state": u ? "checked" : "unchecked", "data-disabled": s.disabled ? "" : void 0, className: ne("relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none cursor-pointer", s.disabled && "pointer-events-none opacity-50", X === s.value && "bg-accent text-accent-foreground"), onMouseDown: (m) => {
|
|
338
|
+
m.preventDefault();
|
|
339
|
+
}, onClick: () => {
|
|
340
|
+
s.disabled || (z.current?.(s.value), $(s.value), y.current?.focus({
|
|
341
|
+
preventScroll: !0
|
|
342
|
+
}), oe(s.value), L(!1));
|
|
343
|
+
}, onPointerEnter: () => {
|
|
344
|
+
H.current || (H.current = !1, $(s.value));
|
|
345
|
+
}, onPointerMove: (m) => {
|
|
346
|
+
H.current && m.movementX === 0 && m.movementY === 0 || (H.current = !1, $(s.value));
|
|
347
|
+
}, children: [
|
|
348
|
+
/* @__PURE__ */ v.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: u ? /* @__PURE__ */ v.jsx(Ee, { "aria-hidden": !0, className: "h-4 w-4" }) : null }),
|
|
349
|
+
/* @__PURE__ */ v.jsxs("div", { className: "flex flex-col", children: [
|
|
350
|
+
/* @__PURE__ */ v.jsx("span", { children: s.label }),
|
|
351
|
+
s.description != null ? /* @__PURE__ */ v.jsx("span", { "data-slot": "description", className: "text-xs text-muted-foreground", children: s.description }) : null
|
|
352
|
+
] })
|
|
353
|
+
] }, s.value);
|
|
354
|
+
}) }),
|
|
355
|
+
/* @__PURE__ */ v.jsx(Te, { direction: "down", viewportRef: P })
|
|
356
|
+
] }) });
|
|
357
|
+
return typeof document > "u" ? r : Ie(r, document.body);
|
|
358
|
+
})() : null
|
|
359
|
+
] }) });
|
|
412
360
|
}
|
|
413
|
-
|
|
414
|
-
function
|
|
415
|
-
const e =
|
|
416
|
-
id:
|
|
417
|
-
value:
|
|
418
|
-
onChange:
|
|
419
|
-
onValueUpdate:
|
|
420
|
-
options:
|
|
361
|
+
Se.displayName = "HourPickerInput";
|
|
362
|
+
function ze(o) {
|
|
363
|
+
const e = we.c(36), {
|
|
364
|
+
id: g,
|
|
365
|
+
value: l,
|
|
366
|
+
onChange: t,
|
|
367
|
+
onValueUpdate: M,
|
|
368
|
+
options: f,
|
|
421
369
|
placeholder: c,
|
|
422
|
-
className:
|
|
423
|
-
inputClassName:
|
|
424
|
-
disabled:
|
|
425
|
-
open:
|
|
426
|
-
onOpenChange:
|
|
427
|
-
triggerTestId:
|
|
428
|
-
contentTestId:
|
|
429
|
-
isHydrated:
|
|
430
|
-
} = o,
|
|
431
|
-
let D;
|
|
432
|
-
e[0] !== n || e[1] !== x || e[2] !== r ? (D = (K) => {
|
|
433
|
-
const we = r.find((ye) => ye.value === K);
|
|
434
|
-
se(we) && (x && x(K), n(K));
|
|
435
|
-
}, e[0] = n, e[1] = x, e[2] = r, e[3] = D) : D = e[3];
|
|
436
|
-
const B = D;
|
|
437
|
-
let T;
|
|
438
|
-
e[4] !== m ? (T = xe("w-[150px]", m), e[4] = m, e[5] = T) : T = e[5];
|
|
439
|
-
const M = a ?? "";
|
|
440
|
-
let P;
|
|
441
|
-
e[6] !== B ? (P = (K) => B(K), e[6] = B, e[7] = P) : P = e[7];
|
|
442
|
-
const U = H ? "true" : void 0, ie = !a && "text-muted-foreground", _ = u && "ring-2 ring-primary ring-offset-2";
|
|
443
|
-
let S;
|
|
444
|
-
e[8] !== I || e[9] !== ie || e[10] !== _ ? (S = xe("transition-colors hover:bg-accent hover:text-accent-foreground", ie, _, "[&_[data-slot='description']]:hidden", I), e[8] = I, e[9] = ie, e[10] = _, e[11] = S) : S = e[11];
|
|
370
|
+
className: a,
|
|
371
|
+
inputClassName: j,
|
|
372
|
+
disabled: d,
|
|
373
|
+
open: p,
|
|
374
|
+
onOpenChange: G,
|
|
375
|
+
triggerTestId: E,
|
|
376
|
+
contentTestId: C,
|
|
377
|
+
isHydrated: V
|
|
378
|
+
} = o, w = c === void 0 ? "Select time" : c;
|
|
445
379
|
let y;
|
|
446
|
-
e[
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
380
|
+
e[0] !== t || e[1] !== M || e[2] !== f ? (y = (L) => {
|
|
381
|
+
const te = f.find(($) => $.value === L);
|
|
382
|
+
_(te) && (M && M(L), t(L));
|
|
383
|
+
}, e[0] = t, e[1] = M, e[2] = f, e[3] = y) : y = e[3];
|
|
384
|
+
const z = y;
|
|
385
|
+
let N;
|
|
386
|
+
e[4] !== a ? (N = ne("w-[150px]", a), e[4] = a, e[5] = N) : N = e[5];
|
|
387
|
+
const W = l ?? "";
|
|
388
|
+
let H;
|
|
389
|
+
e[6] !== z ? (H = (L) => z(L), e[6] = z, e[7] = H) : H = e[7];
|
|
390
|
+
const X = V ? "true" : void 0, ee = !l && "text-muted-foreground", J = p && "ring-2 ring-primary ring-offset-2";
|
|
451
391
|
let A;
|
|
452
|
-
e[
|
|
453
|
-
let
|
|
454
|
-
e[
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
392
|
+
e[8] !== j || e[9] !== ee || e[10] !== J ? (A = ne("transition-colors hover:bg-accent hover:text-accent-foreground", ee, J, "[&_[data-slot='description']]:hidden", j), e[8] = j, e[9] = ee, e[10] = J, e[11] = A) : A = e[11];
|
|
393
|
+
let P;
|
|
394
|
+
e[12] !== w ? (P = /* @__PURE__ */ v.jsx(Pe, { placeholder: w }), e[12] = w, e[13] = P) : P = e[13];
|
|
395
|
+
let T;
|
|
396
|
+
e[14] !== g || e[15] !== P || e[16] !== X || e[17] !== A || e[18] !== E ? (T = /* @__PURE__ */ v.jsx(Oe, { id: g, "data-testid": E, "data-hydrated": X, className: A, children: P }), e[14] = g, e[15] = P, e[16] = X, e[17] = A, e[18] = E, e[19] = T) : T = e[19];
|
|
397
|
+
let R;
|
|
398
|
+
e[20] !== f ? (R = f.map(We), e[20] = f, e[21] = R) : R = e[21];
|
|
399
|
+
let K;
|
|
400
|
+
e[22] !== C || e[23] !== R ? (K = /* @__PURE__ */ v.jsx(Ae, { "data-testid": C, autoScroll: "firstEnabledWithContext", className: "max-h-64 overflow-y-auto", children: R }), e[22] = C, e[23] = R, e[24] = K) : K = e[24];
|
|
401
|
+
let Y;
|
|
402
|
+
e[25] !== d || e[26] !== G || e[27] !== p || e[28] !== T || e[29] !== K || e[30] !== W || e[31] !== H ? (Y = /* @__PURE__ */ v.jsxs(Le, { disabled: d, open: p, onOpenChange: G, value: W, onValueChange: H, children: [
|
|
403
|
+
T,
|
|
404
|
+
K
|
|
405
|
+
] }), e[25] = d, e[26] = G, e[27] = p, e[28] = T, e[29] = K, e[30] = W, e[31] = H, e[32] = Y) : Y = e[32];
|
|
406
|
+
let b;
|
|
407
|
+
return e[33] !== Y || e[34] !== N ? (b = /* @__PURE__ */ v.jsx("div", { "data-slot": "hours-picker-field", className: N, children: Y }), e[33] = Y, e[34] = N, e[35] = b) : b = e[35], b;
|
|
460
408
|
}
|
|
461
|
-
function
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
o.description != null ? /* @__PURE__ */
|
|
409
|
+
function We(o) {
|
|
410
|
+
return /* @__PURE__ */ v.jsxs(Ve, { value: o.value, disabled: o.disabled, children: [
|
|
411
|
+
/* @__PURE__ */ v.jsx("span", { children: o.label }),
|
|
412
|
+
o.description != null ? /* @__PURE__ */ v.jsx("span", { "data-slot": "description", className: "block text-xs text-muted-foreground", children: o.description }) : null
|
|
465
413
|
] }, o.value);
|
|
466
414
|
}
|
|
467
|
-
function
|
|
468
|
-
const e =
|
|
469
|
-
if (
|
|
470
|
-
let
|
|
471
|
-
return e[0] !== o ? (
|
|
415
|
+
function $e(o) {
|
|
416
|
+
const e = we.c(4);
|
|
417
|
+
if (Fe()) {
|
|
418
|
+
let t;
|
|
419
|
+
return e[0] !== o ? (t = /* @__PURE__ */ v.jsx(ze, { ...o }), e[0] = o, e[1] = t) : t = e[1], t;
|
|
472
420
|
}
|
|
473
|
-
let
|
|
474
|
-
return e[2] !== o ? (
|
|
421
|
+
let l;
|
|
422
|
+
return e[2] !== o ? (l = /* @__PURE__ */ v.jsx(Se, { ...o }), e[2] = o, e[3] = l) : l = e[3], l;
|
|
475
423
|
}
|
|
476
|
-
|
|
477
|
-
function
|
|
478
|
-
const e =
|
|
479
|
-
id:
|
|
480
|
-
placeholder:
|
|
481
|
-
value:
|
|
482
|
-
onValueUpdate:
|
|
483
|
-
onCommit:
|
|
424
|
+
$e.displayName = "HourPickerField";
|
|
425
|
+
function qe(o) {
|
|
426
|
+
const e = we.c(93), {
|
|
427
|
+
id: g,
|
|
428
|
+
placeholder: l,
|
|
429
|
+
value: t,
|
|
430
|
+
onValueUpdate: M,
|
|
431
|
+
onCommit: f,
|
|
484
432
|
options: c,
|
|
485
|
-
disabled:
|
|
486
|
-
readOnly:
|
|
487
|
-
open:
|
|
488
|
-
setOpen:
|
|
489
|
-
inputClassName:
|
|
490
|
-
triggerTestId:
|
|
491
|
-
isHydrated:
|
|
492
|
-
highlightedValueRef:
|
|
493
|
-
setHighlightedValue:
|
|
494
|
-
markKeyboardNavigation:
|
|
495
|
-
inputRef:
|
|
496
|
-
onDraftValueHandlerChange:
|
|
497
|
-
} = o,
|
|
498
|
-
let
|
|
499
|
-
e[0] !==
|
|
500
|
-
const [
|
|
501
|
-
let
|
|
502
|
-
e[2] !==
|
|
503
|
-
|
|
433
|
+
disabled: a,
|
|
434
|
+
readOnly: j,
|
|
435
|
+
open: d,
|
|
436
|
+
setOpen: p,
|
|
437
|
+
inputClassName: G,
|
|
438
|
+
triggerTestId: E,
|
|
439
|
+
isHydrated: C,
|
|
440
|
+
highlightedValueRef: V,
|
|
441
|
+
setHighlightedValue: w,
|
|
442
|
+
markKeyboardNavigation: y,
|
|
443
|
+
inputRef: z,
|
|
444
|
+
onDraftValueHandlerChange: N
|
|
445
|
+
} = o, W = n.useRef(!1), H = n.useRef(!1), X = n.useRef(!1), ee = n.useRef(null), J = n.useRef(null), A = n.useRef(!1);
|
|
446
|
+
let P;
|
|
447
|
+
e[0] !== t ? (P = () => t || "", e[0] = t, e[1] = P) : P = e[1];
|
|
448
|
+
const [T, R] = n.useState(P);
|
|
449
|
+
let K, Y;
|
|
450
|
+
e[2] !== N ? (K = () => (N((i) => {
|
|
451
|
+
R(i);
|
|
504
452
|
}), () => {
|
|
505
|
-
|
|
506
|
-
}),
|
|
507
|
-
let
|
|
508
|
-
e[5] !==
|
|
509
|
-
const
|
|
510
|
-
let
|
|
511
|
-
|
|
512
|
-
for (let
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
|
|
453
|
+
N(null);
|
|
454
|
+
}), Y = [N], e[2] = N, e[3] = K, e[4] = Y) : (K = e[3], Y = e[4]), n.useEffect(K, Y);
|
|
455
|
+
let b;
|
|
456
|
+
e[5] !== V || e[6] !== M || e[7] !== c || e[8] !== w || e[9] !== t ? (b = (i) => {
|
|
457
|
+
const x = V.current ?? t ?? "";
|
|
458
|
+
let S = c.findIndex((O) => O.value === x);
|
|
459
|
+
S === -1 && (S = i === 1 ? -1 : c.length);
|
|
460
|
+
for (let O = S + i; O >= 0 && O < c.length; O = O + i, O) {
|
|
461
|
+
const U = c[O];
|
|
462
|
+
if (_(U)) {
|
|
463
|
+
w(U.value), ee.current = U.value, R(U.value), M(U.value);
|
|
516
464
|
return;
|
|
517
465
|
}
|
|
518
466
|
}
|
|
519
|
-
}, e[5] =
|
|
520
|
-
const
|
|
521
|
-
let
|
|
522
|
-
e[11] !==
|
|
523
|
-
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
let
|
|
530
|
-
e[
|
|
467
|
+
}, e[5] = V, e[6] = M, e[7] = c, e[8] = w, e[9] = t, e[10] = b) : b = e[10];
|
|
468
|
+
const L = b;
|
|
469
|
+
let te, $;
|
|
470
|
+
e[11] !== t ? (te = () => {
|
|
471
|
+
W.current || R(t || "");
|
|
472
|
+
}, $ = [t], e[11] = t, e[12] = te, e[13] = $) : (te = e[12], $ = e[13]), n.useEffect(te, $);
|
|
473
|
+
let se, ie;
|
|
474
|
+
e[14] !== T ? (se = () => {
|
|
475
|
+
J.current = T.replace(/\D/g, "");
|
|
476
|
+
}, ie = [T], e[14] = T, e[15] = se, e[16] = ie) : (se = e[15], ie = e[16]), n.useEffect(se, ie);
|
|
477
|
+
let oe, Q;
|
|
478
|
+
e[17] !== t ? (Q = () => {
|
|
479
|
+
t === null && (A.current = !1);
|
|
480
|
+
}, oe = [t], e[17] = t, e[18] = oe, e[19] = Q) : (oe = e[18], Q = e[19]), n.useEffect(Q, oe);
|
|
481
|
+
const r = !T && "text-muted-foreground", s = d && "ring-2 ring-primary ring-offset-2";
|
|
482
|
+
let u;
|
|
483
|
+
e[20] !== G || e[21] !== r || e[22] !== s ? (u = ne("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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", r, s, "[&_[data-slot='description']]:hidden", G), e[20] = G, e[21] = r, e[22] = s, e[23] = u) : u = e[23];
|
|
484
|
+
const m = u, k = C ? "true" : void 0;
|
|
485
|
+
let D;
|
|
486
|
+
e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = [{
|
|
531
487
|
mask: "00:00",
|
|
532
488
|
lazy: !0
|
|
533
489
|
}, {
|
|
534
490
|
mask: "0:00",
|
|
535
491
|
lazy: !0
|
|
536
|
-
}], e[
|
|
537
|
-
let
|
|
538
|
-
e[
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
return
|
|
542
|
-
const
|
|
543
|
-
return c.some((
|
|
544
|
-
}, e[
|
|
545
|
-
let
|
|
546
|
-
e[
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
492
|
+
}], e[24] = D) : D = e[24];
|
|
493
|
+
let h;
|
|
494
|
+
e[25] !== c ? (h = (i, x) => {
|
|
495
|
+
const S = (x.value + i).replace(/\D/g, "");
|
|
496
|
+
if (S.length <= 2 || S.length >= 4)
|
|
497
|
+
return x.compiledMasks[0];
|
|
498
|
+
const O = be(Number(S.slice(0, 2)));
|
|
499
|
+
return c.some((de) => de.value.startsWith(`${O}:`)) ? x.compiledMasks[0] : x.compiledMasks[1];
|
|
500
|
+
}, e[25] = c, e[26] = h) : h = e[26];
|
|
501
|
+
let B;
|
|
502
|
+
e[27] !== f || e[28] !== t ? (B = (i) => {
|
|
503
|
+
const x = typeof i == "string" ? i : String(i ?? ""), S = x.replace(/\D/g, "");
|
|
504
|
+
if (J.current !== S) {
|
|
505
|
+
if (J.current = S, R(x), S.length !== 0) {
|
|
506
|
+
A.current = !1;
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
t && !A.current && (A.current = !0, f(null));
|
|
510
|
+
}
|
|
511
|
+
}, e[27] = f, e[28] = t, e[29] = B) : B = e[29];
|
|
512
|
+
let F;
|
|
513
|
+
e[30] !== f || e[31] !== c || e[32] !== w || e[33] !== t ? (F = (i) => {
|
|
514
|
+
const x = typeof i == "string" ? i : String(i ?? "");
|
|
515
|
+
if (ee.current === x) {
|
|
516
|
+
ee.current = null;
|
|
555
517
|
return;
|
|
556
518
|
}
|
|
557
|
-
const
|
|
558
|
-
if (!
|
|
519
|
+
const S = ve(x, c);
|
|
520
|
+
if (!S)
|
|
559
521
|
return;
|
|
560
|
-
if (
|
|
561
|
-
if (
|
|
522
|
+
if (S.selectableValue) {
|
|
523
|
+
if (w(S.selectableValue), R(S.selectableValue), t === S.selectableValue)
|
|
562
524
|
return;
|
|
563
|
-
|
|
525
|
+
f(S.selectableValue);
|
|
564
526
|
return;
|
|
565
527
|
}
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
528
|
+
const O = xe(S.parsed);
|
|
529
|
+
if (O == null)
|
|
568
530
|
return;
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
}, e[
|
|
572
|
-
let
|
|
573
|
-
e[
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
|
|
577
|
-
},
|
|
578
|
-
|
|
579
|
-
}, e[
|
|
580
|
-
let
|
|
581
|
-
e[
|
|
582
|
-
if (!
|
|
583
|
-
if (
|
|
584
|
-
|
|
531
|
+
const U = ye(O, c);
|
|
532
|
+
U && w(U.value);
|
|
533
|
+
}, e[30] = f, e[31] = c, e[32] = w, e[33] = t, e[34] = F) : F = e[34];
|
|
534
|
+
let I, q, Z;
|
|
535
|
+
e[35] !== a || e[36] !== d || e[37] !== p ? (I = () => {
|
|
536
|
+
H.current = !0, !a && (d || p(!0));
|
|
537
|
+
}, q = (i) => {
|
|
538
|
+
H.current = !0, X.current = typeof document < "u" && document.activeElement === i.currentTarget, !a && (d || p(!0));
|
|
539
|
+
}, Z = () => {
|
|
540
|
+
a || d || p(!0);
|
|
541
|
+
}, e[35] = a, e[36] = d, e[37] = p, e[38] = I, e[39] = q, e[40] = Z) : (I = e[38], q = e[39], Z = e[40]);
|
|
542
|
+
let re;
|
|
543
|
+
e[41] !== a || e[42] !== T || e[43] !== V || e[44] !== y || e[45] !== L || e[46] !== f || e[47] !== d || e[48] !== c || e[49] !== w || e[50] !== p ? (re = (i) => {
|
|
544
|
+
if (!a) {
|
|
545
|
+
if (i.key === "Tab" && d && !i.defaultPrevented) {
|
|
546
|
+
p(!1);
|
|
585
547
|
return;
|
|
586
548
|
}
|
|
587
|
-
if (
|
|
588
|
-
if (!
|
|
549
|
+
if (i.key === "Escape") {
|
|
550
|
+
if (!d)
|
|
589
551
|
return;
|
|
590
|
-
|
|
552
|
+
i.preventDefault(), p(!1);
|
|
591
553
|
return;
|
|
592
554
|
}
|
|
593
|
-
if (!
|
|
594
|
-
if (
|
|
595
|
-
|
|
555
|
+
if (!d && !i.defaultPrevented && (i.key.length === 1 || i.key === "Backspace" || i.key === "Delete") && !i.ctrlKey && !i.metaKey && !i.altKey && p(!0), i.key === "ArrowDown" || i.key === "ArrowUp") {
|
|
556
|
+
if (y(), i.preventDefault(), !d) {
|
|
557
|
+
p(!0);
|
|
596
558
|
return;
|
|
597
559
|
}
|
|
598
|
-
|
|
560
|
+
L(i.key === "ArrowDown" ? 1 : -1);
|
|
599
561
|
return;
|
|
600
562
|
}
|
|
601
|
-
if (
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
605
|
-
if (!
|
|
563
|
+
if (i.key === "Enter") {
|
|
564
|
+
y();
|
|
565
|
+
const x = ve(T, c);
|
|
566
|
+
if (!x) {
|
|
567
|
+
if (!d || T.trim() !== "")
|
|
606
568
|
return;
|
|
607
|
-
const
|
|
608
|
-
if (!
|
|
569
|
+
const U = c.find((Ne) => Ne.value === V.current), de = (_(U) ? U?.value : void 0) ?? c.find(Ge)?.value;
|
|
570
|
+
if (!de)
|
|
609
571
|
return;
|
|
610
|
-
|
|
572
|
+
i.preventDefault(), w(de), R(de), f(de), p(!1);
|
|
611
573
|
return;
|
|
612
574
|
}
|
|
613
|
-
if (
|
|
614
|
-
|
|
575
|
+
if (x.selectableValue) {
|
|
576
|
+
i.preventDefault(), w(x.selectableValue), R(x.selectableValue), f(x.selectableValue), p(!1);
|
|
615
577
|
return;
|
|
616
578
|
}
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
579
|
+
const S = xe(x.parsed);
|
|
580
|
+
if (S == null)
|
|
619
581
|
return;
|
|
620
|
-
const
|
|
621
|
-
if (!
|
|
582
|
+
const O = ye(S, c);
|
|
583
|
+
if (!O)
|
|
622
584
|
return;
|
|
623
|
-
|
|
585
|
+
i.preventDefault(), w(O.value), R(O.value), f(O.value), p(!1);
|
|
624
586
|
return;
|
|
625
587
|
}
|
|
626
588
|
}
|
|
627
|
-
}, e[
|
|
628
|
-
let
|
|
629
|
-
e[
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
const
|
|
633
|
-
requestAnimationFrame(() =>
|
|
589
|
+
}, e[41] = a, e[42] = T, e[43] = V, e[44] = y, e[45] = L, e[46] = f, e[47] = d, e[48] = c, e[49] = w, e[50] = p, e[51] = re) : re = e[51];
|
|
590
|
+
let le;
|
|
591
|
+
e[52] !== a || e[53] !== d || e[54] !== p ? (le = (i) => {
|
|
592
|
+
const x = !H.current || !X.current;
|
|
593
|
+
if (H.current = !1, X.current = !1, W.current = !0, x) {
|
|
594
|
+
const S = i.currentTarget;
|
|
595
|
+
requestAnimationFrame(() => S.select());
|
|
634
596
|
}
|
|
635
|
-
|
|
636
|
-
}, e[
|
|
637
|
-
let
|
|
638
|
-
e[
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
if (!
|
|
642
|
-
|
|
597
|
+
a || d || p(!0);
|
|
598
|
+
}, e[52] = a, e[53] = d, e[54] = p, e[55] = le) : le = e[55];
|
|
599
|
+
let ce;
|
|
600
|
+
e[56] !== T || e[57] !== f || e[58] !== c || e[59] !== t ? (ce = () => {
|
|
601
|
+
W.current = !1;
|
|
602
|
+
const i = T.trim();
|
|
603
|
+
if (!i) {
|
|
604
|
+
R(t || "");
|
|
643
605
|
return;
|
|
644
606
|
}
|
|
645
|
-
const
|
|
646
|
-
if (!
|
|
647
|
-
|
|
607
|
+
const x = ve(i, c);
|
|
608
|
+
if (!x) {
|
|
609
|
+
R(t || "");
|
|
648
610
|
return;
|
|
649
611
|
}
|
|
650
|
-
if (!
|
|
651
|
-
|
|
612
|
+
if (!x.selectableValue) {
|
|
613
|
+
R(t || "");
|
|
652
614
|
return;
|
|
653
615
|
}
|
|
654
|
-
|
|
655
|
-
}, e[
|
|
656
|
-
let W;
|
|
657
|
-
e[55] !== m || e[56] !== S || e[57] !== b || e[58] !== B || e[59] !== a || e[60] !== I || e[61] !== me || e[62] !== G || e[63] !== $ || e[64] !== X || e[65] !== he || e[66] !== J || e[67] !== Q || e[68] !== Z || e[69] !== oe || e[70] !== ee || e[71] !== C || e[72] !== k ? (W = /* @__PURE__ */ g.jsx(We, { id: b, "data-testid": k, "data-hydrated": me, type: "text", disabled: m, readOnly: I, inputRef: B, autoComplete: "off", mask: ce, dispatch: G, placeholder: a, value: S, className: C, onAccept: $, onComplete: X, onPointerDown: he, onMouseDown: J, onClick: Q, onKeyDown: Z, onFocus: oe, onBlur: ee }), e[55] = m, e[56] = S, e[57] = b, e[58] = B, e[59] = a, e[60] = I, e[61] = me, e[62] = G, e[63] = $, e[64] = X, e[65] = he, e[66] = J, e[67] = Q, e[68] = Z, e[69] = oe, e[70] = ee, e[71] = C, e[72] = k, e[73] = W) : W = e[73];
|
|
658
|
-
let ae;
|
|
659
|
-
e[74] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = xe("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"), e[74] = ae) : ae = e[74];
|
|
660
|
-
const ge = i ? "Close time picker" : "Open time picker";
|
|
661
|
-
let te;
|
|
662
|
-
e[75] !== m || e[76] !== i || e[77] !== u ? (te = () => {
|
|
663
|
-
m || u(!i);
|
|
664
|
-
}, e[75] = m, e[76] = i, e[77] = u, e[78] = te) : te = e[78];
|
|
616
|
+
R(x.selectableValue), t !== x.selectableValue && f(x.selectableValue);
|
|
617
|
+
}, e[56] = T, e[57] = f, e[58] = c, e[59] = t, e[60] = ce) : ce = e[60];
|
|
665
618
|
let ue;
|
|
666
|
-
e[
|
|
667
|
-
let
|
|
668
|
-
e[80]
|
|
619
|
+
e[61] !== a || e[62] !== T || e[63] !== g || e[64] !== z || e[65] !== l || e[66] !== j || e[67] !== k || e[68] !== h || e[69] !== B || e[70] !== F || e[71] !== I || e[72] !== q || e[73] !== Z || e[74] !== re || e[75] !== le || e[76] !== ce || e[77] !== m || e[78] !== E ? (ue = /* @__PURE__ */ v.jsx(Ce, { id: g, "data-testid": E, "data-hydrated": k, type: "text", disabled: a, readOnly: j, inputRef: z, autoComplete: "off", mask: D, dispatch: h, placeholder: l, value: T, className: m, onAccept: B, onComplete: F, onPointerDown: I, onMouseDown: q, onClick: Z, onKeyDown: re, onFocus: le, onBlur: ce }), e[61] = a, e[62] = T, e[63] = g, e[64] = z, e[65] = l, e[66] = j, e[67] = k, e[68] = h, e[69] = B, e[70] = F, e[71] = I, e[72] = q, e[73] = Z, e[74] = re, e[75] = le, e[76] = ce, e[77] = m, e[78] = E, e[79] = ue) : ue = e[79];
|
|
620
|
+
let me;
|
|
621
|
+
e[80] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (me = ne("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"), e[80] = me) : me = e[80];
|
|
622
|
+
const ge = d ? "Close time picker" : "Open time picker";
|
|
623
|
+
let ae;
|
|
624
|
+
e[81] !== a || e[82] !== d || e[83] !== p ? (ae = () => {
|
|
625
|
+
a || p(!d);
|
|
626
|
+
}, e[81] = a, e[82] = d, e[83] = p, e[84] = ae) : ae = e[84];
|
|
627
|
+
let pe;
|
|
628
|
+
e[85] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pe = /* @__PURE__ */ v.jsx(De, { "aria-hidden": !0, className: "size-4" }), e[85] = pe) : pe = e[85];
|
|
669
629
|
let fe;
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
630
|
+
e[86] !== a || e[87] !== ge || e[88] !== ae ? (fe = /* @__PURE__ */ v.jsx("button", { type: "button", tabIndex: -1, disabled: a, "data-slot": "hours-picker-input-toggle", className: me, "aria-label": ge, onPointerDown: Ye, onMouseDown: Ke, onClick: ae, children: pe }), e[86] = a, e[87] = ge, e[88] = ae, e[89] = fe) : fe = e[89];
|
|
631
|
+
let he;
|
|
632
|
+
return e[90] !== ue || e[91] !== fe ? (he = /* @__PURE__ */ v.jsxs("div", { className: "relative group", children: [
|
|
633
|
+
ue,
|
|
634
|
+
fe
|
|
635
|
+
] }), e[90] = ue, e[91] = fe, e[92] = he) : he = e[92], he;
|
|
674
636
|
}
|
|
675
|
-
function
|
|
637
|
+
function Ke(o) {
|
|
676
638
|
o.preventDefault();
|
|
677
639
|
}
|
|
678
|
-
function
|
|
640
|
+
function Ye(o) {
|
|
679
641
|
o.preventDefault();
|
|
680
642
|
}
|
|
681
|
-
function
|
|
682
|
-
return
|
|
643
|
+
function Ge(o) {
|
|
644
|
+
return _(o);
|
|
683
645
|
}
|
|
684
646
|
export {
|
|
685
|
-
|
|
686
|
-
|
|
647
|
+
$e as HourPickerField,
|
|
648
|
+
Se as HourPickerInput
|
|
687
649
|
};
|
|
688
650
|
//# sourceMappingURL=index19.js.map
|