@rpcbase/ui 0.263.0 → 0.265.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/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/HourPickerField/index.d.ts +1 -0
- package/dist/components/HourPickerField/index.d.ts.map +1 -1
- package/dist/index299.js +366 -365
- package/dist/index299.js.map +1 -1
- package/dist/index302.js +203 -186
- package/dist/index302.js.map +1 -1
- package/package.json +1 -1
package/dist/index302.js
CHANGED
|
@@ -140,47 +140,47 @@ function b({ direction: e, viewportRef: n, speed: i = 400, className: s }) {
|
|
|
140
140
|
function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeholder: f = "Select time", className: p, inputClassName: m, disabled: h, readOnly: g, open: _, onOpenChange: v, triggerTestId: ee, contentTestId: te, isHydrated: x }) {
|
|
141
141
|
let S = r.useId(), C = e ?? `hours-picker-${S}`, T = r.useRef(null), E = r.useRef(null), D = r.useCallback((e) => {
|
|
142
142
|
E.current = e;
|
|
143
|
-
}, []), O = r.useRef(null), k = r.useRef(!1), [A, j] = r.useState(null), M = r.useRef(null), N = r.useRef(null), P = r.useRef(null), [F,
|
|
143
|
+
}, []), O = r.useRef(null), k = r.useRef(!1), [A, j] = r.useState(null), M = r.useRef(null), N = r.useRef(null), P = r.useRef(null), [F, I] = r.useState(() => ({
|
|
144
144
|
left: 0,
|
|
145
145
|
top: 0,
|
|
146
146
|
width: 0
|
|
147
|
-
})), [
|
|
148
|
-
|
|
149
|
-
if (!
|
|
147
|
+
})), [L, R] = r.useState(!1), z = _ ?? L, B = v ?? R, V = r.useRef(!1);
|
|
148
|
+
V.current = z, r.useEffect(() => {
|
|
149
|
+
if (!z || h || g) return;
|
|
150
150
|
let e = T.current;
|
|
151
151
|
e instanceof HTMLInputElement && (typeof document < "u" && document.activeElement === e || e.focus({ preventScroll: !0 }));
|
|
152
152
|
}, [
|
|
153
153
|
h,
|
|
154
|
-
|
|
154
|
+
z,
|
|
155
155
|
g
|
|
156
156
|
]);
|
|
157
|
-
let
|
|
157
|
+
let H = r.useCallback((e) => {
|
|
158
158
|
O.current = e, j(e);
|
|
159
|
-
}, []),
|
|
159
|
+
}, []), U = r.useCallback(() => {
|
|
160
160
|
k.current = !0;
|
|
161
161
|
}, []);
|
|
162
162
|
r.useEffect(() => {
|
|
163
|
-
if (!
|
|
163
|
+
if (!z) return;
|
|
164
164
|
let e = d.find((e) => e.value === n);
|
|
165
165
|
if (e && y(e)) {
|
|
166
|
-
|
|
166
|
+
H(e.value);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
let t = d.find((e) => y(e));
|
|
170
|
-
|
|
170
|
+
H(t?.value ?? null);
|
|
171
171
|
}, [
|
|
172
|
-
|
|
172
|
+
z,
|
|
173
173
|
d,
|
|
174
|
-
|
|
174
|
+
H,
|
|
175
175
|
n
|
|
176
176
|
]);
|
|
177
|
-
let
|
|
177
|
+
let ne = r.useCallback((e) => {
|
|
178
178
|
if (e === null) {
|
|
179
179
|
o && o(null);
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
y(d.find((t) => t.value === e)) && o && o(e);
|
|
183
|
-
}, [o, d]),
|
|
183
|
+
}, [o, d]), W = r.useCallback((e) => {
|
|
184
184
|
if (e === null) {
|
|
185
185
|
o && o(null), a(null);
|
|
186
186
|
return;
|
|
@@ -192,24 +192,24 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
192
192
|
d
|
|
193
193
|
]);
|
|
194
194
|
r.useEffect(() => {
|
|
195
|
-
if (!
|
|
195
|
+
if (!z) return;
|
|
196
196
|
let e = M.current?.ownerDocument ?? document, t = e.defaultView ?? window, n = (e) => {
|
|
197
197
|
let t = e.target;
|
|
198
198
|
if (!(t instanceof Node)) return;
|
|
199
199
|
let n = M.current;
|
|
200
|
-
n && (n.contains(t) || N.current?.contains(t) ||
|
|
200
|
+
n && (n.contains(t) || N.current?.contains(t) || B(!1));
|
|
201
201
|
}, r = (e) => {
|
|
202
|
-
if (e.key !== "Escape" || !
|
|
202
|
+
if (e.key !== "Escape" || !V.current) return;
|
|
203
203
|
let t = e.target;
|
|
204
204
|
if (!(t instanceof Node)) return;
|
|
205
205
|
let n = M.current, r = N.current;
|
|
206
|
-
!n?.contains(t) && !r?.contains(t) || (e.preventDefault(), e.stopPropagation(),
|
|
206
|
+
!n?.contains(t) && !r?.contains(t) || (e.preventDefault(), e.stopPropagation(), B(!1));
|
|
207
207
|
};
|
|
208
208
|
return e.addEventListener("pointerdown", n, !0), t.addEventListener("keydown", r, !0), () => {
|
|
209
209
|
e.removeEventListener("pointerdown", n, !0), t.removeEventListener("keydown", r, !0);
|
|
210
210
|
};
|
|
211
|
-
}, [
|
|
212
|
-
if (!
|
|
211
|
+
}, [z, B]), r.useEffect(() => {
|
|
212
|
+
if (!z) return;
|
|
213
213
|
let e = N.current;
|
|
214
214
|
if (!e) return;
|
|
215
215
|
let t = (e) => {
|
|
@@ -227,50 +227,50 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
227
227
|
return e.addEventListener("wheel", t, { passive: !1 }), () => {
|
|
228
228
|
e.removeEventListener("wheel", t);
|
|
229
229
|
};
|
|
230
|
-
}, [
|
|
231
|
-
if (!
|
|
230
|
+
}, [z]), r.useEffect(() => {
|
|
231
|
+
if (!z || _ !== void 0 && !v || typeof window > "u" || !("IntersectionObserver" in window)) return;
|
|
232
232
|
let e = T.current;
|
|
233
233
|
if (!(e instanceof HTMLElement)) return;
|
|
234
234
|
let t = !0, n = new IntersectionObserver((e) => {
|
|
235
235
|
if (!t) return;
|
|
236
236
|
let n = e[0];
|
|
237
|
-
n && !n.isIntersecting &&
|
|
237
|
+
n && !n.isIntersecting && B(!1);
|
|
238
238
|
});
|
|
239
239
|
return n.observe(e), () => {
|
|
240
240
|
t = !1, n.disconnect();
|
|
241
241
|
};
|
|
242
242
|
}, [
|
|
243
243
|
v,
|
|
244
|
-
|
|
244
|
+
z,
|
|
245
245
|
_,
|
|
246
|
-
|
|
246
|
+
B
|
|
247
247
|
]);
|
|
248
|
-
let
|
|
248
|
+
let G = r.useCallback(() => {
|
|
249
249
|
if (typeof window > "u") return;
|
|
250
250
|
let e = T.current, t = N.current;
|
|
251
251
|
if (!(e instanceof HTMLElement) || !t) return;
|
|
252
252
|
let n = e.getBoundingClientRect(), r = t.offsetHeight, i = window.innerWidth ?? 0, a = window.innerHeight ?? 0, o = n.width, s = n.left;
|
|
253
253
|
s + o > i - 8 && (s = Math.max(8, i - o - 8)), s < 8 && (s = 8);
|
|
254
254
|
let c = n.bottom + 8, l = c + r > a - 8, u = n.top - r - 8;
|
|
255
|
-
l && u >= 8 && (c = u), c < 8 && (c = 8), c + r > a - 8 && (c = Math.max(8, a - r - 8)),
|
|
255
|
+
l && u >= 8 && (c = u), c < 8 && (c = 8), c + r > a - 8 && (c = Math.max(8, a - r - 8)), I({
|
|
256
256
|
left: s,
|
|
257
257
|
top: c,
|
|
258
258
|
width: o
|
|
259
259
|
});
|
|
260
260
|
}, []);
|
|
261
|
-
|
|
262
|
-
if (!
|
|
263
|
-
|
|
264
|
-
let e = window.requestAnimationFrame(
|
|
265
|
-
return window.addEventListener("scroll",
|
|
266
|
-
window.cancelAnimationFrame(e), window.removeEventListener("scroll",
|
|
261
|
+
r.useLayoutEffect(() => {
|
|
262
|
+
if (!z || h || typeof window > "u") return;
|
|
263
|
+
G();
|
|
264
|
+
let e = window.requestAnimationFrame(G);
|
|
265
|
+
return window.addEventListener("scroll", G, !0), window.addEventListener("resize", G), () => {
|
|
266
|
+
window.cancelAnimationFrame(e), window.removeEventListener("scroll", G, !0), window.removeEventListener("resize", G);
|
|
267
267
|
};
|
|
268
268
|
}, [
|
|
269
269
|
h,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
z,
|
|
271
|
+
G
|
|
272
272
|
]), r.useEffect(() => {
|
|
273
|
-
if (!
|
|
273
|
+
if (!z) return;
|
|
274
274
|
let e = P.current;
|
|
275
275
|
if (!e) return;
|
|
276
276
|
let t = requestAnimationFrame(() => {
|
|
@@ -299,8 +299,8 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
299
299
|
e.scrollTop = a;
|
|
300
300
|
});
|
|
301
301
|
return () => cancelAnimationFrame(t);
|
|
302
|
-
}, [
|
|
303
|
-
if (!
|
|
302
|
+
}, [z, d]), r.useEffect(() => {
|
|
303
|
+
if (!z || !A || !k.current) return;
|
|
304
304
|
let e = P.current;
|
|
305
305
|
if (!e) return;
|
|
306
306
|
let t = e.querySelector(`[role="option"][data-value="${A}"]`);
|
|
@@ -311,7 +311,9 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
313
|
r > e.scrollTop + e.clientHeight && (e.scrollTop = Math.max(0, r - e.clientHeight));
|
|
314
|
-
}, [A,
|
|
314
|
+
}, [A, z]);
|
|
315
|
+
let re = d.find((e) => e.value === n);
|
|
316
|
+
return /* @__PURE__ */ c("div", {
|
|
315
317
|
"data-slot": "hours-picker-input",
|
|
316
318
|
className: t("w-[150px]", p),
|
|
317
319
|
ref: M,
|
|
@@ -321,24 +323,25 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
321
323
|
id: C,
|
|
322
324
|
placeholder: f,
|
|
323
325
|
value: n,
|
|
324
|
-
onValueUpdate:
|
|
325
|
-
onCommit:
|
|
326
|
+
onValueUpdate: ne,
|
|
327
|
+
onCommit: W,
|
|
326
328
|
options: d,
|
|
329
|
+
selectedLabel: re?.selectedLabel,
|
|
327
330
|
disabled: h,
|
|
328
331
|
readOnly: g,
|
|
329
|
-
open:
|
|
330
|
-
setOpen:
|
|
332
|
+
open: z,
|
|
333
|
+
setOpen: B,
|
|
331
334
|
inputClassName: m,
|
|
332
335
|
triggerTestId: ee,
|
|
333
336
|
isHydrated: x,
|
|
334
337
|
highlightedValueRef: O,
|
|
335
|
-
setHighlightedValue:
|
|
336
|
-
markKeyboardNavigation:
|
|
338
|
+
setHighlightedValue: H,
|
|
339
|
+
markKeyboardNavigation: U,
|
|
337
340
|
inputRef: (e) => {
|
|
338
341
|
T.current = e;
|
|
339
342
|
},
|
|
340
343
|
onDraftValueHandlerChange: D
|
|
341
|
-
}),
|
|
344
|
+
}), z ? (() => {
|
|
342
345
|
let e = /* @__PURE__ */ c(s, { children: /* @__PURE__ */ l("div", {
|
|
343
346
|
ref: N,
|
|
344
347
|
"data-testid": te,
|
|
@@ -371,13 +374,13 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
|
|
|
371
374
|
e.preventDefault();
|
|
372
375
|
},
|
|
373
376
|
onClick: () => {
|
|
374
|
-
e.disabled || (E.current?.(e.value),
|
|
377
|
+
e.disabled || (E.current?.(e.value), H(e.value), T.current?.focus({ preventScroll: !0 }), W(e.value), B(!1));
|
|
375
378
|
},
|
|
376
379
|
onPointerEnter: () => {
|
|
377
|
-
k.current || (k.current = !1,
|
|
380
|
+
k.current || (k.current = !1, H(e.value));
|
|
378
381
|
},
|
|
379
382
|
onPointerMove: (t) => {
|
|
380
|
-
k.current && t.movementX === 0 && t.movementY === 0 || (k.current = !1,
|
|
383
|
+
k.current && t.movementX === 0 && t.movementY === 0 || (k.current = !1, H(e.value));
|
|
381
384
|
},
|
|
382
385
|
children: [/* @__PURE__ */ c("span", {
|
|
383
386
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -415,13 +418,13 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
|
|
|
415
418
|
width: 0
|
|
416
419
|
})), [j, M] = r.useState(!1), N = v ?? j, P = ee ?? M, F = r.useRef(!1);
|
|
417
420
|
F.current = N;
|
|
418
|
-
let
|
|
421
|
+
let I = r.useCallback((e) => {
|
|
419
422
|
y(f.find((t) => t.value === e)) && (d && d(e), o(e));
|
|
420
423
|
}, [
|
|
421
424
|
o,
|
|
422
425
|
d,
|
|
423
426
|
f
|
|
424
|
-
]),
|
|
427
|
+
]), L = r.useCallback(() => {
|
|
425
428
|
if (typeof window > "u") return;
|
|
426
429
|
let e = T.current, t = D.current;
|
|
427
430
|
if (!(e instanceof HTMLElement) || !t) return;
|
|
@@ -436,15 +439,15 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
|
|
|
436
439
|
}, []);
|
|
437
440
|
r.useLayoutEffect(() => {
|
|
438
441
|
if (!N || g || typeof window > "u") return;
|
|
439
|
-
|
|
440
|
-
let e = window.requestAnimationFrame(
|
|
441
|
-
return window.addEventListener("scroll",
|
|
442
|
-
window.cancelAnimationFrame(e), window.removeEventListener("scroll",
|
|
442
|
+
L();
|
|
443
|
+
let e = window.requestAnimationFrame(L);
|
|
444
|
+
return window.addEventListener("scroll", L, !0), window.addEventListener("resize", L), () => {
|
|
445
|
+
window.cancelAnimationFrame(e), window.removeEventListener("scroll", L, !0), window.removeEventListener("resize", L);
|
|
443
446
|
};
|
|
444
447
|
}, [
|
|
445
448
|
g,
|
|
446
449
|
N,
|
|
447
|
-
|
|
450
|
+
L
|
|
448
451
|
]), r.useEffect(() => {
|
|
449
452
|
if (!N) return;
|
|
450
453
|
let e = E.current?.ownerDocument ?? document, t = e.defaultView ?? window, n = (e) => {
|
|
@@ -461,7 +464,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
|
|
|
461
464
|
e.removeEventListener("pointerdown", n, !0), t.removeEventListener("keydown", r, !0);
|
|
462
465
|
};
|
|
463
466
|
}, [N, P]);
|
|
464
|
-
let
|
|
467
|
+
let R = f.find((e) => e.value === n), z = R?.selectedLabel ?? R?.label;
|
|
465
468
|
return /* @__PURE__ */ l("div", {
|
|
466
469
|
"data-slot": "hours-picker-field",
|
|
467
470
|
className: t("w-[150px]", m),
|
|
@@ -482,7 +485,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
|
|
|
482
485
|
},
|
|
483
486
|
children: [/* @__PURE__ */ c("span", {
|
|
484
487
|
className: "line-clamp-1 text-left",
|
|
485
|
-
children:
|
|
488
|
+
children: R ? z : p
|
|
486
489
|
}), /* @__PURE__ */ c(a, {
|
|
487
490
|
"aria-hidden": !0,
|
|
488
491
|
className: "h-4 w-4 shrink-0 opacity-50"
|
|
@@ -521,7 +524,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
|
|
|
521
524
|
e.preventDefault();
|
|
522
525
|
},
|
|
523
526
|
onClick: () => {
|
|
524
|
-
e.disabled || _ || (
|
|
527
|
+
e.disabled || _ || (I(e.value), P(!1), T.current?.focus({ preventScroll: !0 }));
|
|
525
528
|
},
|
|
526
529
|
children: [/* @__PURE__ */ c("span", {
|
|
527
530
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -561,219 +564,233 @@ function C(t) {
|
|
|
561
564
|
}
|
|
562
565
|
C.displayName = "HourPickerField";
|
|
563
566
|
function w(e) {
|
|
564
|
-
let i = n(
|
|
565
|
-
i[0] === u ?
|
|
566
|
-
let [
|
|
567
|
-
i[2] ===
|
|
568
|
-
|
|
567
|
+
let i = n(99), { id: o, placeholder: s, value: u, onValueUpdate: f, onCommit: p, options: m, selectedLabel: g, disabled: b, readOnly: x, open: S, setOpen: C, inputClassName: w, triggerTestId: O, isHydrated: k, highlightedValueRef: A, setHighlightedValue: j, markKeyboardNavigation: M, inputRef: N, onDraftValueHandlerChange: P } = e, F = r.useRef(!1), I = r.useRef(!1), L = r.useRef(!1), R = r.useRef(null), z = r.useRef(null), B = r.useRef(!1), V;
|
|
568
|
+
i[0] === u ? V = i[1] : (V = () => u || "", i[0] = u, i[1] = V);
|
|
569
|
+
let [H, U] = r.useState(V), ne, W;
|
|
570
|
+
i[2] === P ? (ne = i[3], W = i[4]) : (ne = () => (P((e) => {
|
|
571
|
+
U(e);
|
|
569
572
|
}), () => {
|
|
570
|
-
|
|
571
|
-
}),
|
|
572
|
-
let
|
|
573
|
-
i[5] !==
|
|
574
|
-
let t =
|
|
573
|
+
P(null);
|
|
574
|
+
}), W = [P], i[2] = P, i[3] = ne, i[4] = W), r.useEffect(ne, W);
|
|
575
|
+
let G;
|
|
576
|
+
i[5] !== A || i[6] !== f || i[7] !== m || i[8] !== j || i[9] !== u ? (G = (e) => {
|
|
577
|
+
let t = A.current ?? u ?? "", n = m.findIndex((e) => e.value === t);
|
|
575
578
|
n === -1 && (n = e === 1 ? -1 : m.length);
|
|
576
579
|
for (let t = n + e; t >= 0 && t < m.length; t += e) {
|
|
577
580
|
let e = m[t];
|
|
578
581
|
if (y(e)) {
|
|
579
|
-
|
|
582
|
+
j(e.value), R.current = e.value, U(e.value), f(e.value);
|
|
580
583
|
return;
|
|
581
584
|
}
|
|
582
585
|
}
|
|
583
|
-
}, i[5] =
|
|
584
|
-
let
|
|
585
|
-
i[11] === u ? (
|
|
586
|
-
|
|
587
|
-
},
|
|
586
|
+
}, i[5] = A, i[6] = f, i[7] = m, i[8] = j, i[9] = u, i[10] = G) : G = i[10];
|
|
587
|
+
let re = G, ie, ae;
|
|
588
|
+
i[11] === u ? (ie = i[12], ae = i[13]) : (ie = () => {
|
|
589
|
+
F.current || U(u || "");
|
|
590
|
+
}, ae = [u], i[11] = u, i[12] = ie, i[13] = ae), r.useEffect(ie, ae);
|
|
591
|
+
let oe, se;
|
|
592
|
+
i[14] === H ? (oe = i[15], se = i[16]) : (oe = () => {
|
|
593
|
+
z.current = _(H);
|
|
594
|
+
}, se = [H], i[14] = H, i[15] = oe, i[16] = se), r.useEffect(oe, se);
|
|
588
595
|
let ce, le;
|
|
589
|
-
i[
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
let ue, de;
|
|
593
|
-
i[
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
let fe = !z && "text-muted-foreground", pe = x && "ring-2 ring-primary ring-offset-2", me;
|
|
597
|
-
i[20] !== C || i[21] !== fe || i[22] !== pe ? (me = t("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", fe, pe, "[&_[data-slot='description']]:hidden", C), i[20] = C, i[21] = fe, i[22] = pe, i[23] = me) : me = i[23];
|
|
598
|
-
let he = me, ge = O ? "true" : void 0, _e;
|
|
599
|
-
i[24] === Symbol.for("react.memo_cache_sentinel") ? (_e = [{
|
|
596
|
+
i[17] === u ? (ce = i[18], le = i[19]) : (le = () => {
|
|
597
|
+
u === null && (B.current = !1);
|
|
598
|
+
}, ce = [u], i[17] = u, i[18] = ce, i[19] = le), r.useEffect(le, ce);
|
|
599
|
+
let ue = !H && "text-muted-foreground", de = S && "ring-2 ring-primary ring-offset-2", fe = u && g != null && "text-transparent focus:text-foreground", pe;
|
|
600
|
+
i[20] !== w || i[21] !== ue || i[22] !== de || i[23] !== fe ? (pe = t("peer 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", ue, de, "[&_[data-slot='description']]:hidden", w, fe), i[20] = w, i[21] = ue, i[22] = de, i[23] = fe, i[24] = pe) : pe = i[24];
|
|
601
|
+
let me = pe, he = k ? "true" : void 0, ge;
|
|
602
|
+
i[25] === Symbol.for("react.memo_cache_sentinel") ? (ge = [{
|
|
600
603
|
mask: "00:00",
|
|
601
604
|
lazy: !0
|
|
602
605
|
}, {
|
|
603
606
|
mask: "0:00",
|
|
604
607
|
lazy: !0
|
|
605
|
-
}], i[
|
|
606
|
-
let
|
|
607
|
-
i[
|
|
608
|
+
}], i[25] = ge) : ge = i[25];
|
|
609
|
+
let K;
|
|
610
|
+
i[26] === m ? K = i[27] : (K = (e, t) => {
|
|
608
611
|
let n = (t.value + e).replace(/\D/g, "");
|
|
609
612
|
if (n.length <= 2 || n.length >= 4) return t.compiledMasks[0];
|
|
610
613
|
let r = h(Number(n.slice(0, 2)));
|
|
611
614
|
return m.some((e) => e.value.startsWith(`${r}:`)) ? t.compiledMasks[0] : t.compiledMasks[1];
|
|
612
|
-
}, i[
|
|
613
|
-
let
|
|
614
|
-
i[
|
|
615
|
+
}, i[26] = m, i[27] = K);
|
|
616
|
+
let q;
|
|
617
|
+
i[28] !== p || i[29] !== u ? (q = (e, t, n) => {
|
|
615
618
|
if (!n) return;
|
|
616
619
|
let r = typeof e == "string" ? e : String(e ?? ""), i = r.replace(/\D/g, ""), a = _(r);
|
|
617
|
-
if (
|
|
618
|
-
if (
|
|
619
|
-
|
|
620
|
+
if (z.current !== a) {
|
|
621
|
+
if (z.current = a, U(r), i.length !== 0) {
|
|
622
|
+
B.current = !1;
|
|
620
623
|
return;
|
|
621
624
|
}
|
|
622
|
-
u && !
|
|
625
|
+
u && !B.current && (B.current = !0, p(null));
|
|
623
626
|
}
|
|
624
|
-
}, i[
|
|
625
|
-
let
|
|
626
|
-
i[
|
|
627
|
+
}, i[28] = p, i[29] = u, i[30] = q) : q = i[30];
|
|
628
|
+
let J;
|
|
629
|
+
i[31] !== p || i[32] !== m || i[33] !== j || i[34] !== u ? (J = (e, t, n) => {
|
|
627
630
|
if (!n) return;
|
|
628
631
|
let r = typeof e == "string" ? e : String(e ?? "");
|
|
629
|
-
if (
|
|
630
|
-
|
|
632
|
+
if (R.current === r) {
|
|
633
|
+
R.current = null;
|
|
631
634
|
return;
|
|
632
635
|
}
|
|
633
636
|
let i = v(r, m);
|
|
634
637
|
if (!i) return;
|
|
635
638
|
if (i.selectableValue) {
|
|
636
|
-
if (
|
|
639
|
+
if (j(i.selectableValue), U(i.selectableValue), u === i.selectableValue) return;
|
|
637
640
|
p(i.selectableValue);
|
|
638
641
|
return;
|
|
639
642
|
}
|
|
640
643
|
let a = ee(i.parsed);
|
|
641
644
|
if (a == null) return;
|
|
642
645
|
let o = te(a, m);
|
|
643
|
-
o &&
|
|
644
|
-
}, i[
|
|
645
|
-
let
|
|
646
|
-
i[
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
|
|
650
|
-
},
|
|
651
|
-
|
|
652
|
-
}, i[
|
|
653
|
-
let
|
|
654
|
-
i[
|
|
655
|
-
if (!
|
|
656
|
-
if (e.key === "Tab" &&
|
|
657
|
-
|
|
646
|
+
o && j(o.value);
|
|
647
|
+
}, i[31] = p, i[32] = m, i[33] = j, i[34] = u, i[35] = J) : J = i[35];
|
|
648
|
+
let Y, X, Z;
|
|
649
|
+
i[36] !== b || i[37] !== S || i[38] !== C ? (Y = () => {
|
|
650
|
+
I.current = !0, !b && (S || C(!0));
|
|
651
|
+
}, X = (e) => {
|
|
652
|
+
I.current = !0, L.current = typeof document < "u" && document.activeElement === e.currentTarget, !b && (S || C(!0));
|
|
653
|
+
}, Z = () => {
|
|
654
|
+
b || S || C(!0);
|
|
655
|
+
}, i[36] = b, i[37] = S, i[38] = C, i[39] = Y, i[40] = X, i[41] = Z) : (Y = i[39], X = i[40], Z = i[41]);
|
|
656
|
+
let Q;
|
|
657
|
+
i[42] !== b || i[43] !== H || i[44] !== A || i[45] !== M || i[46] !== re || i[47] !== p || i[48] !== S || i[49] !== m || i[50] !== j || i[51] !== C ? (Q = (e) => {
|
|
658
|
+
if (!b) {
|
|
659
|
+
if (e.key === "Tab" && S && !e.defaultPrevented) {
|
|
660
|
+
C(!1);
|
|
658
661
|
return;
|
|
659
662
|
}
|
|
660
663
|
if (e.key === "Escape") {
|
|
661
|
-
if (!
|
|
662
|
-
e.preventDefault(),
|
|
664
|
+
if (!S) return;
|
|
665
|
+
e.preventDefault(), C(!1);
|
|
663
666
|
return;
|
|
664
667
|
}
|
|
665
|
-
if (!
|
|
666
|
-
if (
|
|
667
|
-
|
|
668
|
+
if (!S && !e.defaultPrevented && (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete") && !e.ctrlKey && !e.metaKey && !e.altKey && C(!0), e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
669
|
+
if (M(), e.preventDefault(), !S) {
|
|
670
|
+
C(!0);
|
|
668
671
|
return;
|
|
669
672
|
}
|
|
670
|
-
|
|
673
|
+
re(e.key === "ArrowDown" ? 1 : -1);
|
|
671
674
|
return;
|
|
672
675
|
}
|
|
673
676
|
if (e.key === "Enter") {
|
|
674
|
-
|
|
675
|
-
let t = v(
|
|
677
|
+
M();
|
|
678
|
+
let t = v(H, m);
|
|
676
679
|
if (!t) {
|
|
677
|
-
if (!
|
|
678
|
-
let t = m.find((e) => e.value ===
|
|
680
|
+
if (!S || H.trim() !== "") return;
|
|
681
|
+
let t = m.find((e) => e.value === A.current), n = (y(t) ? t?.value : void 0) ?? m.find(D)?.value;
|
|
679
682
|
if (!n) return;
|
|
680
|
-
e.preventDefault(),
|
|
683
|
+
e.preventDefault(), j(n), U(n), p(n), C(!1);
|
|
681
684
|
return;
|
|
682
685
|
}
|
|
683
686
|
if (t.selectableValue) {
|
|
684
|
-
e.preventDefault(),
|
|
687
|
+
e.preventDefault(), j(t.selectableValue), U(t.selectableValue), p(t.selectableValue), C(!1);
|
|
685
688
|
return;
|
|
686
689
|
}
|
|
687
690
|
let n = ee(t.parsed);
|
|
688
691
|
if (n == null) return;
|
|
689
692
|
let r = te(n, m);
|
|
690
693
|
if (!r) return;
|
|
691
|
-
e.preventDefault(),
|
|
694
|
+
e.preventDefault(), j(r.value), U(r.value), p(r.value), C(!1);
|
|
692
695
|
return;
|
|
693
696
|
}
|
|
694
697
|
}
|
|
695
|
-
}, i[
|
|
696
|
-
let
|
|
697
|
-
i[
|
|
698
|
-
let t = !
|
|
699
|
-
if (
|
|
698
|
+
}, i[42] = b, i[43] = H, i[44] = A, i[45] = M, i[46] = re, i[47] = p, i[48] = S, i[49] = m, i[50] = j, i[51] = C, i[52] = Q) : Q = i[52];
|
|
699
|
+
let $;
|
|
700
|
+
i[53] !== b || i[54] !== S || i[55] !== C ? ($ = (e) => {
|
|
701
|
+
let t = !I.current || !L.current;
|
|
702
|
+
if (I.current = !1, L.current = !1, F.current = !0, t) {
|
|
700
703
|
let t = e.currentTarget;
|
|
701
704
|
requestAnimationFrame(() => t.select());
|
|
702
705
|
}
|
|
703
|
-
|
|
704
|
-
}, i[
|
|
705
|
-
let
|
|
706
|
-
i[
|
|
707
|
-
|
|
708
|
-
let e =
|
|
706
|
+
b || S || C(!0);
|
|
707
|
+
}, i[53] = b, i[54] = S, i[55] = C, i[56] = $) : $ = i[56];
|
|
708
|
+
let _e;
|
|
709
|
+
i[57] !== H || i[58] !== p || i[59] !== m || i[60] !== u ? (_e = () => {
|
|
710
|
+
F.current = !1;
|
|
711
|
+
let e = H.trim();
|
|
709
712
|
if (!e) {
|
|
710
|
-
|
|
713
|
+
U(u || "");
|
|
711
714
|
return;
|
|
712
715
|
}
|
|
713
716
|
let t = v(e, m);
|
|
714
717
|
if (!t) {
|
|
715
|
-
|
|
718
|
+
U(u || "");
|
|
716
719
|
return;
|
|
717
720
|
}
|
|
718
721
|
if (!t.selectableValue) {
|
|
719
|
-
|
|
722
|
+
U(u || "");
|
|
720
723
|
return;
|
|
721
724
|
}
|
|
722
|
-
|
|
723
|
-
}, i[
|
|
724
|
-
let
|
|
725
|
-
i[
|
|
725
|
+
U(t.selectableValue), u !== t.selectableValue && p(t.selectableValue);
|
|
726
|
+
}, i[57] = H, i[58] = p, i[59] = m, i[60] = u, i[61] = _e) : _e = i[61];
|
|
727
|
+
let ve;
|
|
728
|
+
i[62] !== b || i[63] !== H || i[64] !== o || i[65] !== N || i[66] !== s || i[67] !== x || i[68] !== he || i[69] !== K || i[70] !== q || i[71] !== J || i[72] !== Y || i[73] !== X || i[74] !== Z || i[75] !== Q || i[76] !== $ || i[77] !== _e || i[78] !== me || i[79] !== O ? (ve = /* @__PURE__ */ c(d, {
|
|
726
729
|
id: o,
|
|
727
|
-
"data-testid":
|
|
728
|
-
"data-hydrated":
|
|
730
|
+
"data-testid": O,
|
|
731
|
+
"data-hydrated": he,
|
|
729
732
|
type: "text",
|
|
730
|
-
disabled:
|
|
731
|
-
readOnly:
|
|
732
|
-
inputRef:
|
|
733
|
+
disabled: b,
|
|
734
|
+
readOnly: x,
|
|
735
|
+
inputRef: N,
|
|
733
736
|
autoComplete: "off",
|
|
734
|
-
mask:
|
|
735
|
-
dispatch:
|
|
737
|
+
mask: ge,
|
|
738
|
+
dispatch: K,
|
|
736
739
|
placeholder: s,
|
|
737
|
-
value:
|
|
738
|
-
className:
|
|
739
|
-
onAccept:
|
|
740
|
-
onComplete:
|
|
741
|
-
onPointerDown:
|
|
742
|
-
onMouseDown:
|
|
743
|
-
onClick:
|
|
744
|
-
onKeyDown:
|
|
745
|
-
onFocus:
|
|
746
|
-
onBlur:
|
|
747
|
-
}), i[
|
|
748
|
-
let
|
|
749
|
-
i[
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
740
|
+
value: H,
|
|
741
|
+
className: me,
|
|
742
|
+
onAccept: q,
|
|
743
|
+
onComplete: J,
|
|
744
|
+
onPointerDown: Y,
|
|
745
|
+
onMouseDown: X,
|
|
746
|
+
onClick: Z,
|
|
747
|
+
onKeyDown: Q,
|
|
748
|
+
onFocus: $,
|
|
749
|
+
onBlur: _e
|
|
750
|
+
}), i[62] = b, i[63] = H, i[64] = o, i[65] = N, i[66] = s, i[67] = x, i[68] = he, i[69] = K, i[70] = q, i[71] = J, i[72] = Y, i[73] = X, i[74] = Z, i[75] = Q, i[76] = $, i[77] = _e, i[78] = me, i[79] = O, i[80] = ve) : ve = i[80];
|
|
751
|
+
let ye;
|
|
752
|
+
i[81] !== b || i[82] !== g || i[83] !== u ? (ye = u && g != null ? /* @__PURE__ */ c("span", {
|
|
753
|
+
"aria-hidden": "true",
|
|
754
|
+
"data-slot": "hours-picker-input-selected-label",
|
|
755
|
+
className: t("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", b && "opacity-50"),
|
|
756
|
+
children: /* @__PURE__ */ c("span", {
|
|
757
|
+
className: "min-w-0 truncate",
|
|
758
|
+
children: g
|
|
759
|
+
})
|
|
760
|
+
}) : null, i[81] = b, i[82] = g, i[83] = u, i[84] = ye) : ye = i[84];
|
|
754
761
|
let be;
|
|
755
|
-
i[85] === Symbol.for("react.memo_cache_sentinel") ? (be =
|
|
762
|
+
i[85] === Symbol.for("react.memo_cache_sentinel") ? (be = t("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"), i[85] = be) : be = i[85];
|
|
763
|
+
let xe = S ? "Close time picker" : "Open time picker", Se;
|
|
764
|
+
i[86] !== b || i[87] !== S || i[88] !== C ? (Se = () => {
|
|
765
|
+
b || C(!S);
|
|
766
|
+
}, i[86] = b, i[87] = S, i[88] = C, i[89] = Se) : Se = i[89];
|
|
767
|
+
let Ce;
|
|
768
|
+
i[90] === Symbol.for("react.memo_cache_sentinel") ? (Ce = /* @__PURE__ */ c(a, {
|
|
756
769
|
"aria-hidden": !0,
|
|
757
770
|
className: "size-4"
|
|
758
|
-
}), i[
|
|
759
|
-
let
|
|
760
|
-
i[
|
|
771
|
+
}), i[90] = Ce) : Ce = i[90];
|
|
772
|
+
let we;
|
|
773
|
+
i[91] !== b || i[92] !== xe || i[93] !== Se ? (we = /* @__PURE__ */ c("button", {
|
|
761
774
|
type: "button",
|
|
762
775
|
tabIndex: -1,
|
|
763
|
-
disabled:
|
|
776
|
+
disabled: b,
|
|
764
777
|
"data-slot": "hours-picker-input-toggle",
|
|
765
|
-
className:
|
|
766
|
-
"aria-label":
|
|
778
|
+
className: be,
|
|
779
|
+
"aria-label": xe,
|
|
767
780
|
onPointerDown: E,
|
|
768
781
|
onMouseDown: T,
|
|
769
|
-
onClick:
|
|
770
|
-
children:
|
|
771
|
-
}), i[
|
|
772
|
-
let
|
|
773
|
-
return i[
|
|
782
|
+
onClick: Se,
|
|
783
|
+
children: Ce
|
|
784
|
+
}), i[91] = b, i[92] = xe, i[93] = Se, i[94] = we) : we = i[94];
|
|
785
|
+
let Te;
|
|
786
|
+
return i[95] !== ve || i[96] !== ye || i[97] !== we ? (Te = /* @__PURE__ */ l("div", {
|
|
774
787
|
className: "relative group",
|
|
775
|
-
children: [
|
|
776
|
-
|
|
788
|
+
children: [
|
|
789
|
+
ve,
|
|
790
|
+
ye,
|
|
791
|
+
we
|
|
792
|
+
]
|
|
793
|
+
}), i[95] = ve, i[96] = ye, i[97] = we, i[98] = Te) : Te = i[98], Te;
|
|
777
794
|
}
|
|
778
795
|
function T(e) {
|
|
779
796
|
e.preventDefault();
|