@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/index12.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { DismissableLayerBranch as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { IMaskInput as
|
|
8
|
-
import
|
|
9
|
-
import { useIsTouchDevice as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { DayPicker as
|
|
12
|
-
import { dateMatchModifiers as
|
|
13
|
-
const
|
|
14
|
-
typeof
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
className:
|
|
20
|
-
classNames:
|
|
21
|
-
components:
|
|
22
|
-
showOutsideDays:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
let
|
|
29
|
-
|
|
1
|
+
import { j as h } from "./index30.js";
|
|
2
|
+
import { c as ye } from "./index28.js";
|
|
3
|
+
import { CalendarDays as we, ChevronLeft as Ee, ChevronRight as Ne } from "lucide-react";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { DismissableLayerBranch as be } from "./index31.js";
|
|
6
|
+
import { createPortal as he } from "react-dom";
|
|
7
|
+
import { IMaskInput as Re } from "react-imask";
|
|
8
|
+
import Pe, { InputMask as Ie } from "imask";
|
|
9
|
+
import { useIsTouchDevice as je } from "./index4.js";
|
|
10
|
+
import { cn as re } from "./index2.js";
|
|
11
|
+
import { DayPicker as Ce } from "./index32.js";
|
|
12
|
+
import { dateMatchModifiers as Se } from "./index33.js";
|
|
13
|
+
const ge = Pe;
|
|
14
|
+
typeof ge.InputMask != "function" && (ge.InputMask = Ie);
|
|
15
|
+
function de(o) {
|
|
16
|
+
const e = ye.c(18);
|
|
17
|
+
let d, s, w, b, v;
|
|
18
|
+
e[0] !== o ? ({
|
|
19
|
+
className: d,
|
|
20
|
+
classNames: s,
|
|
21
|
+
components: w,
|
|
22
|
+
showOutsideDays: v,
|
|
23
|
+
...b
|
|
24
|
+
} = o, e[0] = o, e[1] = d, e[2] = s, e[3] = w, e[4] = b, e[5] = v) : (d = e[1], s = e[2], w = e[3], b = e[4], v = e[5]);
|
|
25
|
+
const p = v === void 0 ? !0 : v;
|
|
26
|
+
let M;
|
|
27
|
+
e[6] !== d ? (M = re("p-3", d), e[6] = d, e[7] = M) : M = e[7];
|
|
28
|
+
let j;
|
|
29
|
+
e[8] !== s ? (j = {
|
|
30
30
|
month: "space-y-4",
|
|
31
31
|
months: "flex flex-col sm:flex-row space-y-4 sm:space-y-0 relative gap-2",
|
|
32
32
|
month_caption: "flex justify-center pt-1 relative items-center",
|
|
@@ -54,533 +54,444 @@ function Qe(s) {
|
|
|
54
54
|
outside: "day-outside text-muted-foreground opacity-50 !aria-selected:bg-accent/50 !aria-selected:text-muted-foreground !aria-selected:opacity-30",
|
|
55
55
|
disabled: "text-muted-foreground opacity-50",
|
|
56
56
|
hidden: "invisible",
|
|
57
|
-
...
|
|
58
|
-
},
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
Chevron:
|
|
62
|
-
...
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
return
|
|
57
|
+
...s
|
|
58
|
+
}, e[8] = s, e[9] = j) : j = e[9];
|
|
59
|
+
let E;
|
|
60
|
+
e[10] !== w ? (E = {
|
|
61
|
+
Chevron: Oe,
|
|
62
|
+
...w
|
|
63
|
+
}, e[10] = w, e[11] = E) : E = e[11];
|
|
64
|
+
let S;
|
|
65
|
+
return e[12] !== b || e[13] !== p || e[14] !== M || e[15] !== j || e[16] !== E ? (S = /* @__PURE__ */ h.jsx(Ce, { weekStartsOn: 1, showOutsideDays: p, className: M, classNames: j, components: E, ...b }), e[12] = b, e[13] = p, e[14] = M, e[15] = j, e[16] = E, e[17] = S) : S = e[17], S;
|
|
66
|
+
}
|
|
67
|
+
function Oe(o) {
|
|
68
|
+
return o.orientation === "left" ? /* @__PURE__ */ h.jsx(Ee, { ...o, className: "h-4 w-4" }) : /* @__PURE__ */ h.jsx(Ne, { ...o, className: "h-4 w-4" });
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
de.displayName = "DayPicker";
|
|
71
|
+
function se(o) {
|
|
72
|
+
return String(o).padStart(2, "0");
|
|
69
73
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return
|
|
74
|
+
function T(o) {
|
|
75
|
+
const e = new Date(o);
|
|
76
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
73
77
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
return t.setHours(0, 0, 0, 0), t;
|
|
78
|
+
function ue(o) {
|
|
79
|
+
return T(new Date(o.getFullYear(), o.getMonth(), 1));
|
|
77
80
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
81
|
+
function ie(o) {
|
|
82
|
+
return o.getFullYear() * 12 + o.getMonth();
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
84
|
+
function ne(o) {
|
|
85
|
+
const e = Math.floor(o / 12), d = o - e * 12;
|
|
86
|
+
return T(new Date(e, d, 1));
|
|
83
87
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
function $(o) {
|
|
89
|
+
return `${se(o.getDate())}/${se(o.getMonth() + 1)}/${o.getFullYear()}`;
|
|
90
|
+
}
|
|
91
|
+
function ae({
|
|
92
|
+
day: o,
|
|
93
|
+
month: e,
|
|
94
|
+
year: d
|
|
88
95
|
}) {
|
|
89
|
-
if (!Number.isFinite(
|
|
90
|
-
const
|
|
91
|
-
return
|
|
96
|
+
if (!Number.isFinite(o) || !Number.isFinite(e) || !Number.isFinite(d)) return null;
|
|
97
|
+
const s = new Date(d, e - 1, o);
|
|
98
|
+
return s.getFullYear() !== d || s.getMonth() !== e - 1 || s.getDate() !== o ? null : T(s);
|
|
92
99
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
return
|
|
99
|
-
day: Number(
|
|
100
|
-
month: Number(
|
|
101
|
-
year: Number(
|
|
100
|
+
function fe(o, e) {
|
|
101
|
+
const d = o.trim();
|
|
102
|
+
if (!d) return null;
|
|
103
|
+
const s = /^(\d{2})\/(\d{2})\/(\d{4})$/.exec(d);
|
|
104
|
+
if (s)
|
|
105
|
+
return ae({
|
|
106
|
+
day: Number(s[1]),
|
|
107
|
+
month: Number(s[2]),
|
|
108
|
+
year: Number(s[3])
|
|
102
109
|
});
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
return Number.isFinite(
|
|
107
|
-
day: Number(
|
|
108
|
-
month: Number(
|
|
109
|
-
year: 2e3 +
|
|
110
|
+
const w = /^(\d{2})\/(\d{2})\/(\d{2})$/.exec(d);
|
|
111
|
+
if (w) {
|
|
112
|
+
const v = Number(w[3]);
|
|
113
|
+
return Number.isFinite(v) ? ae({
|
|
114
|
+
day: Number(w[1]),
|
|
115
|
+
month: Number(w[2]),
|
|
116
|
+
year: 2e3 + v
|
|
110
117
|
}) : null;
|
|
111
118
|
}
|
|
112
|
-
const
|
|
113
|
-
return
|
|
114
|
-
day: Number(
|
|
115
|
-
month: Number(
|
|
116
|
-
year:
|
|
119
|
+
const b = /^(\d{2})\/(\d{2})$/.exec(d);
|
|
120
|
+
return b ? ae({
|
|
121
|
+
day: Number(b[1]),
|
|
122
|
+
month: Number(b[2]),
|
|
123
|
+
year: e.getFullYear()
|
|
117
124
|
}) : null;
|
|
118
125
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
e
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
o && v && se(Te(v));
|
|
173
|
-
}, N = [v, o], e[37] = v, e[38] = o, e[39] = C, e[40] = N) : (C = e[39], N = e[40]), f.useEffect(C, N);
|
|
174
|
-
let L;
|
|
175
|
-
e[41] !== o || e[42] !== c ? (L = () => {
|
|
176
|
-
if (!o)
|
|
126
|
+
const xe = r.forwardRef(function({
|
|
127
|
+
value: e,
|
|
128
|
+
onChange: d,
|
|
129
|
+
onValueUpdate: s,
|
|
130
|
+
className: w,
|
|
131
|
+
inputClassName: b,
|
|
132
|
+
placeholder: v = "DD/MM/YYYY",
|
|
133
|
+
disabled: p,
|
|
134
|
+
readOnly: M,
|
|
135
|
+
open: j,
|
|
136
|
+
onOpenChange: E,
|
|
137
|
+
dayPickerComponent: S,
|
|
138
|
+
dayPickerProps: L,
|
|
139
|
+
onFocus: H,
|
|
140
|
+
onBlur: O,
|
|
141
|
+
onKeyDown: z,
|
|
142
|
+
onPointerDown: A,
|
|
143
|
+
onMouseDown: W,
|
|
144
|
+
...B
|
|
145
|
+
}, m) {
|
|
146
|
+
const y = r.useRef(null), N = r.useRef(null), K = r.useRef(null), X = r.useRef(!1), oe = r.useRef(!1), Z = r.useRef(!1), F = r.useRef(!1), q = r.useRef(!1), g = r.useRef(null), [R, P] = r.useState(!1), c = j ?? R, f = E ?? P;
|
|
147
|
+
oe.current = c;
|
|
148
|
+
const [x, C] = r.useState(() => e ? $(e) : ""), a = r.useMemo(() => fe(x, /* @__PURE__ */ new Date()), [x]), [Y, k] = r.useState(() => ue(e ?? /* @__PURE__ */ new Date())), U = r.useRef(Y);
|
|
149
|
+
U.current = Y;
|
|
150
|
+
const [V, ve] = r.useState(() => ({
|
|
151
|
+
left: 0,
|
|
152
|
+
top: 0
|
|
153
|
+
})), _ = Math.max(1, L?.numberOfMonths ?? 1), le = r.useRef(c), ce = r.useCallback((t) => {
|
|
154
|
+
s && s(t);
|
|
155
|
+
}, [s]), ee = r.useCallback((t) => {
|
|
156
|
+
s && s(t), d(t);
|
|
157
|
+
}, [d, s]);
|
|
158
|
+
r.useEffect(() => {
|
|
159
|
+
X.current || C(e ? $(e) : "");
|
|
160
|
+
}, [e]), r.useEffect(() => {
|
|
161
|
+
const t = le.current;
|
|
162
|
+
if (le.current = c, !c) return;
|
|
163
|
+
const n = ie(e ?? /* @__PURE__ */ new Date());
|
|
164
|
+
if (!t) {
|
|
165
|
+
k(ne(n));
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const u = ie(U.current), l = u + _ - 1;
|
|
169
|
+
if (n < u) {
|
|
170
|
+
k(ne(n));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
n > l && k(ne(n - (_ - 1)));
|
|
174
|
+
}, [_, c, e]), r.useEffect(() => {
|
|
175
|
+
if (!c || !a) return;
|
|
176
|
+
const t = ie(a), i = ie(U.current), n = i + _ - 1;
|
|
177
|
+
if (t < i) {
|
|
178
|
+
k(ne(t));
|
|
177
179
|
return;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
}
|
|
181
|
+
t > n && k(ne(t - (_ - 1)));
|
|
182
|
+
}, [a, _, c]), r.useEffect(() => {
|
|
183
|
+
if (!c) return;
|
|
184
|
+
const t = y.current?.ownerDocument ?? document, i = t.defaultView ?? window, n = (l) => {
|
|
185
|
+
const D = l.target;
|
|
186
|
+
D instanceof Node && (y.current?.contains(D) || N.current?.contains(D) || f(!1));
|
|
187
|
+
}, u = (l) => {
|
|
188
|
+
if (l.key !== "Escape" || !oe.current) return;
|
|
189
|
+
const D = l.target;
|
|
190
|
+
D instanceof Node && (!y.current?.contains(D) && !N.current?.contains(D) || (l.preventDefault(), l.stopPropagation(), f(!1)));
|
|
183
191
|
};
|
|
184
|
-
return
|
|
185
|
-
|
|
192
|
+
return t.addEventListener("pointerdown", n, !0), i.addEventListener("keydown", u, !0), () => {
|
|
193
|
+
t.removeEventListener("pointerdown", n, !0), i.removeEventListener("keydown", u, !0);
|
|
186
194
|
};
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
e[44] !== o ? ($ = [o], e[44] = o, e[45] = $) : $ = e[45], f.useEffect(L, $);
|
|
190
|
-
let de;
|
|
191
|
-
e[46] !== o || e[47] !== c ? (de = () => {
|
|
192
|
-
if (!o || typeof window > "u" || !("IntersectionObserver" in window))
|
|
195
|
+
}, [c]), r.useEffect(() => {
|
|
196
|
+
if (!c || typeof window > "u" || !("IntersectionObserver" in window))
|
|
193
197
|
return;
|
|
194
|
-
const
|
|
195
|
-
if (!
|
|
198
|
+
const t = y.current;
|
|
199
|
+
if (!t)
|
|
196
200
|
return;
|
|
197
|
-
let
|
|
198
|
-
const
|
|
199
|
-
if (!
|
|
201
|
+
let i = !0;
|
|
202
|
+
const n = new IntersectionObserver((u) => {
|
|
203
|
+
if (!i)
|
|
200
204
|
return;
|
|
201
|
-
const
|
|
202
|
-
|
|
205
|
+
const l = u[0];
|
|
206
|
+
l && !l.isIntersecting && f(!1);
|
|
203
207
|
});
|
|
204
|
-
return
|
|
205
|
-
|
|
208
|
+
return n.observe(t), () => {
|
|
209
|
+
i = !1, n.disconnect();
|
|
206
210
|
};
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const r = A.current, y = q.current;
|
|
223
|
-
if (!r || !y)
|
|
224
|
-
return;
|
|
225
|
-
const l = r.getBoundingClientRect(), m = y.offsetWidth, j = y.offsetHeight, ae = window.innerWidth ?? 0, ge = window.innerHeight ?? 0;
|
|
226
|
-
let _e = l.left;
|
|
227
|
-
_e + m > ae - 8 && (_e = Math.max(8, ae - m - 8)), _e < 8 && (_e = 8);
|
|
228
|
-
let ye = l.bottom + 8;
|
|
229
|
-
const ot = ye + j > ge - 8, Xe = l.top - j - 8;
|
|
230
|
-
ot && Xe >= 8 && (ye = Xe), ye < 8 && (ye = 8), ye + j > ge - 8 && (ye = Math.max(8, ge - j - 8)), Ye({
|
|
231
|
-
left: _e,
|
|
232
|
-
top: ye
|
|
211
|
+
}, [c]);
|
|
212
|
+
const De = r.useCallback((t) => {
|
|
213
|
+
K.current = t, typeof m == "function" ? m(t) : m && (m.current = t);
|
|
214
|
+
}, [m]), pe = () => f(!1), ke = S ?? de, G = r.useCallback(() => {
|
|
215
|
+
if (typeof window > "u") return;
|
|
216
|
+
const t = y.current, i = N.current;
|
|
217
|
+
if (!t || !i) return;
|
|
218
|
+
const n = t.getBoundingClientRect(), u = i.offsetWidth, l = i.offsetHeight, D = window.innerWidth ?? 0, J = window.innerHeight ?? 0, I = 8;
|
|
219
|
+
let te = n.left;
|
|
220
|
+
te + u > D - I && (te = Math.max(I, D - u - I)), te < I && (te = I);
|
|
221
|
+
let Q = n.bottom + I;
|
|
222
|
+
const Me = Q + l > J - I, me = n.top - l - I;
|
|
223
|
+
Me && me >= I && (Q = me), Q < I && (Q = I), Q + l > J - I && (Q = Math.max(I, J - l - I)), ve({
|
|
224
|
+
left: te,
|
|
225
|
+
top: Q
|
|
233
226
|
});
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const r = window.requestAnimationFrame(me);
|
|
242
|
-
return window.addEventListener("scroll", me, !0), window.addEventListener("resize", me), () => {
|
|
243
|
-
window.cancelAnimationFrame(r), window.removeEventListener("scroll", me, !0), window.removeEventListener("resize", me);
|
|
227
|
+
}, []);
|
|
228
|
+
return r.useLayoutEffect(() => {
|
|
229
|
+
if (!c || p || typeof window > "u") return;
|
|
230
|
+
G();
|
|
231
|
+
const t = window.requestAnimationFrame(G);
|
|
232
|
+
return window.addEventListener("scroll", G, !0), window.addEventListener("resize", G), () => {
|
|
233
|
+
window.cancelAnimationFrame(t), window.removeEventListener("scroll", G, !0), window.removeEventListener("resize", G);
|
|
244
234
|
};
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
let Ce;
|
|
294
|
-
e[80] !== P || e[81] !== d || e[82] !== v || e[83] !== T || e[84] !== o || e[85] !== c || e[86] !== R || e[87] !== n ? (Ce = (r) => {
|
|
295
|
-
const y = r.defaultPrevented;
|
|
296
|
-
if (T?.(r), !(!y && r.defaultPrevented)) {
|
|
297
|
-
if (r.key === "Enter") {
|
|
298
|
-
if (!v)
|
|
299
|
-
return;
|
|
300
|
-
if (r.preventDefault(), o) {
|
|
301
|
-
const l = `${v.getFullYear()}-${Ue(v.getMonth() + 1)}-${Ue(v.getDate())}`, m = q.current?.querySelector(`[data-day='${l}']:not([data-outside]) button`);
|
|
302
|
-
if (m instanceof HTMLButtonElement) {
|
|
303
|
-
if (m.disabled)
|
|
304
|
-
return;
|
|
305
|
-
m.focus();
|
|
235
|
+
}, [p, c, G]), /* @__PURE__ */ h.jsxs("div", { ref: y, "data-slot": "day-picker-input", className: re("relative group", w), children: [
|
|
236
|
+
/* @__PURE__ */ h.jsx(Re, { ...B, "data-slot": "day-picker-input-input", disabled: p, readOnly: M, autoComplete: "off", inputRef: De, mask: [{
|
|
237
|
+
mask: "00/00",
|
|
238
|
+
lazy: !0
|
|
239
|
+
}, {
|
|
240
|
+
mask: "00/00/00",
|
|
241
|
+
lazy: !0
|
|
242
|
+
}, {
|
|
243
|
+
mask: "00/00/0000",
|
|
244
|
+
lazy: !0
|
|
245
|
+
}], dispatch: (t, i) => {
|
|
246
|
+
const n = (i.value + t).replace(/\D/g, "");
|
|
247
|
+
return n.length <= 4 ? i.compiledMasks[0] : n.length <= 6 ? i.compiledMasks[1] : i.compiledMasks[2];
|
|
248
|
+
}, placeholder: v, value: x, className: re("flex h-10 w-full rounded-md border border-input bg-background py-2 pr-3 pl-[37px] 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", b), onAccept: (t) => {
|
|
249
|
+
const i = typeof t == "string" ? t : String(t ?? ""), n = x.replace(/\D/g, "").length;
|
|
250
|
+
C(i), i.replace(/\D/g, "").length === 0 && (c && k(ue(/* @__PURE__ */ new Date())), n !== 0 && ce(null));
|
|
251
|
+
}, onComplete: (t) => {
|
|
252
|
+
const i = typeof t == "string" ? t : String(t ?? "");
|
|
253
|
+
if (g.current === i) {
|
|
254
|
+
g.current = null;
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const n = fe(i, /* @__PURE__ */ new Date());
|
|
258
|
+
n && (e && n.getTime() === T(e).getTime() || ce(n));
|
|
259
|
+
}, onPointerDown: (t) => {
|
|
260
|
+
Z.current = !0, F.current = typeof document < "u" && document.activeElement === t.currentTarget, A?.(t);
|
|
261
|
+
}, onMouseDown: (t) => {
|
|
262
|
+
Z.current = !0, F.current = typeof document < "u" && document.activeElement === t.currentTarget, W?.(t);
|
|
263
|
+
}, onFocus: (t) => {
|
|
264
|
+
const i = !Z.current || !F.current;
|
|
265
|
+
if (Z.current = !1, F.current = !1, X.current = !0, H?.(t), i) {
|
|
266
|
+
const n = t.currentTarget;
|
|
267
|
+
requestAnimationFrame(() => n.select());
|
|
268
|
+
}
|
|
269
|
+
p || f(!0);
|
|
270
|
+
}, onKeyDown: (t) => {
|
|
271
|
+
const i = t.defaultPrevented;
|
|
272
|
+
if (z?.(t), !(!i && t.defaultPrevented)) {
|
|
273
|
+
if (t.key === "Enter") {
|
|
274
|
+
if (!a)
|
|
275
|
+
return;
|
|
276
|
+
if (t.preventDefault(), c) {
|
|
277
|
+
const n = `${a.getFullYear()}-${se(a.getMonth() + 1)}-${se(a.getDate())}`, u = N.current?.querySelector(`[data-day='${n}']:not([data-outside]) button`);
|
|
278
|
+
if (u instanceof HTMLButtonElement) {
|
|
279
|
+
if (u.disabled)
|
|
280
|
+
return;
|
|
281
|
+
u.focus();
|
|
282
|
+
}
|
|
306
283
|
}
|
|
284
|
+
C($(a)), ee(a), f(!1);
|
|
285
|
+
return;
|
|
307
286
|
}
|
|
308
|
-
|
|
309
|
-
|
|
287
|
+
if (t.key === "ArrowUp" || t.key === "ArrowDown") {
|
|
288
|
+
const n = a ?? e;
|
|
289
|
+
if (!n)
|
|
290
|
+
return;
|
|
291
|
+
const u = T(new Date(n));
|
|
292
|
+
if (u.setDate(u.getDate() + (t.key === "ArrowUp" ? 1 : -1)), L?.disabled && Se(u, L.disabled))
|
|
293
|
+
return;
|
|
294
|
+
t.preventDefault();
|
|
295
|
+
const l = $(u);
|
|
296
|
+
g.current = l, C(l), ce(u);
|
|
297
|
+
}
|
|
298
|
+
c || (t.key.length === 1 || t.key === "Backspace" || t.key === "Delete" || t.key === "ArrowUp" || t.key === "ArrowDown") && !t.ctrlKey && !t.metaKey && !t.altKey && f(!0), t.key === "Tab" && !t.defaultPrevented && f(!1);
|
|
310
299
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
300
|
+
}, onBlur: (t) => {
|
|
301
|
+
X.current = !1, O?.(t);
|
|
302
|
+
const i = q.current;
|
|
303
|
+
if (q.current = !1, i)
|
|
304
|
+
return;
|
|
305
|
+
const n = t.relatedTarget;
|
|
306
|
+
if (n instanceof Node) {
|
|
307
|
+
const D = y.current;
|
|
308
|
+
if (!D || D.contains(n) || N.current?.contains(n))
|
|
314
309
|
return;
|
|
315
|
-
|
|
316
|
-
|
|
310
|
+
}
|
|
311
|
+
c && typeof window < "u" && requestAnimationFrame(() => {
|
|
312
|
+
const D = y.current;
|
|
313
|
+
if (!D)
|
|
317
314
|
return;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
const J = document.activeElement;
|
|
316
|
+
J && (D.contains(J) || N.current?.contains(J)) || f(!1);
|
|
317
|
+
});
|
|
318
|
+
const u = x.trim();
|
|
319
|
+
if (u === "") {
|
|
320
|
+
e && (C(""), ee(null));
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
let Re;
|
|
327
|
-
e[89] !== P || e[90] !== b || e[91] !== a || e[92] !== o || e[93] !== c || e[94] !== n ? (Re = (r) => {
|
|
328
|
-
oe.current = !1, a?.(r);
|
|
329
|
-
const y = Q.current;
|
|
330
|
-
if (Q.current = !1, y)
|
|
331
|
-
return;
|
|
332
|
-
const l = r.relatedTarget;
|
|
333
|
-
if (l instanceof Node) {
|
|
334
|
-
const ae = A.current;
|
|
335
|
-
if (!ae || ae.contains(l) || q.current?.contains(l))
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
o && typeof window < "u" && requestAnimationFrame(() => {
|
|
339
|
-
const ae = A.current;
|
|
340
|
-
if (!ae)
|
|
341
|
-
return;
|
|
342
|
-
const ge = document.activeElement;
|
|
343
|
-
ge && (ae.contains(ge) || q.current?.contains(ge)) || c(!1);
|
|
344
|
-
});
|
|
345
|
-
const m = b.trim();
|
|
346
|
-
if (m === "") {
|
|
347
|
-
n && (O(""), P(null));
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const j = Je(m, /* @__PURE__ */ new Date());
|
|
351
|
-
if (j) {
|
|
352
|
-
O(ce(j)), (!n || j.getTime() !== re(n).getTime()) && P(j);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
O(n ? ce(n) : "");
|
|
356
|
-
}, e[89] = P, e[90] = b, e[91] = a, e[92] = o, e[93] = c, e[94] = n, e[95] = Re) : Re = e[95];
|
|
357
|
-
let je;
|
|
358
|
-
e[96] !== i || e[97] !== b || e[98] !== k || e[99] !== S || e[100] !== _ || e[101] !== K || e[102] !== De || e[103] !== ke || e[104] !== Pe || e[105] !== Ne || e[106] !== Ee || e[107] !== Me || e[108] !== Ce || e[109] !== Re ? (je = /* @__PURE__ */ E.jsx(lt, { ..._, "data-slot": "day-picker-input-input", disabled: i, readOnly: S, autoComplete: "off", inputRef: K, mask: Be, dispatch: bt, placeholder: k, value: b, className: De, onAccept: ke, onComplete: Pe, onPointerDown: Ne, onMouseDown: Ee, onFocus: Me, onKeyDown: Ce, onBlur: Re }), e[96] = i, e[97] = b, e[98] = k, e[99] = S, e[100] = _, e[101] = K, e[102] = De, e[103] = ke, e[104] = Pe, e[105] = Ne, e[106] = Ee, e[107] = Me, e[108] = Ce, e[109] = Re, e[110] = je) : je = e[110];
|
|
359
|
-
let Ie, Se;
|
|
360
|
-
e[111] !== i ? (Ie = (r) => {
|
|
361
|
-
r.preventDefault(), !i && fe.current?.focus({
|
|
362
|
-
preventScroll: !0
|
|
363
|
-
});
|
|
364
|
-
}, Se = (r) => {
|
|
365
|
-
r.preventDefault(), !i && fe.current?.focus({
|
|
366
|
-
preventScroll: !0
|
|
367
|
-
});
|
|
368
|
-
}, e[111] = i, e[112] = Ie, e[113] = Se) : (Ie = e[112], Se = e[113]);
|
|
369
|
-
let Oe;
|
|
370
|
-
e[114] !== i || e[115] !== c ? (Oe = () => {
|
|
371
|
-
i || (fe.current?.focus({
|
|
372
|
-
preventScroll: !0
|
|
373
|
-
}), c(!0));
|
|
374
|
-
}, e[114] = i, e[115] = c, e[116] = Oe) : Oe = e[116];
|
|
375
|
-
let We;
|
|
376
|
-
e[117] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (We = /* @__PURE__ */ E.jsx(et, { "aria-hidden": !0, className: "size-4" }), e[117] = We) : We = e[117];
|
|
377
|
-
let Fe;
|
|
378
|
-
e[118] !== i || e[119] !== Ie || e[120] !== Se || e[121] !== Oe ? (Fe = /* @__PURE__ */ E.jsx("button", { type: "button", tabIndex: -1, disabled: i, "aria-label": "Open calendar", "data-slot": "day-picker-input-trigger", className: "absolute left-[13px] top-1/2 -translate-y-1/2 text-muted-foreground transition-colors group-hover:text-accent-foreground", onPointerDown: Ie, onMouseDown: Se, onClick: Oe, children: We }), e[118] = i, e[119] = Ie, e[120] = Se, e[121] = Oe, e[122] = Fe) : Fe = e[122];
|
|
379
|
-
let Le;
|
|
380
|
-
e[123] !== Ve || e[124] !== pe || e[125] !== P || e[126] !== d || e[127] !== i || e[128] !== b || e[129] !== v || e[130] !== V || e[131] !== o || e[132] !== le || e[133] !== n ? (Le = o && !i && (() => {
|
|
381
|
-
const r = b.trim() === "" ? void 0 : v ?? n ?? void 0, y = /* @__PURE__ */ E.jsx(tt, { children: /* @__PURE__ */ E.jsx("div", { ref: q, "data-slot": "day-picker-input-popover", className: "pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md", style: {
|
|
382
|
-
left: le.left,
|
|
383
|
-
top: le.top
|
|
384
|
-
}, onPointerDownCapture: () => {
|
|
385
|
-
Q.current = !0;
|
|
386
|
-
}, onMouseDownCapture: () => {
|
|
387
|
-
Q.current = !0;
|
|
388
|
-
}, children: /* @__PURE__ */ E.jsx(Ve, { mode: "single", month: V, onMonthChange: se, selected: r, onSelect: (l) => {
|
|
389
|
-
if (!l) {
|
|
390
|
-
n && P(null), O(""), pe();
|
|
323
|
+
const l = fe(u, /* @__PURE__ */ new Date());
|
|
324
|
+
if (l) {
|
|
325
|
+
C($(l)), (!e || l.getTime() !== T(e).getTime()) && ee(l);
|
|
391
326
|
return;
|
|
392
327
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
328
|
+
C(e ? $(e) : "");
|
|
329
|
+
} }),
|
|
330
|
+
/* @__PURE__ */ h.jsx("button", { type: "button", tabIndex: -1, disabled: p, "aria-label": "Open calendar", "data-slot": "day-picker-input-trigger", className: "absolute left-[13px] top-1/2 -translate-y-1/2 text-muted-foreground transition-colors group-hover:text-accent-foreground", onPointerDown: (t) => {
|
|
331
|
+
t.preventDefault(), !p && K.current?.focus({
|
|
332
|
+
preventScroll: !0
|
|
333
|
+
});
|
|
334
|
+
}, onMouseDown: (t) => {
|
|
335
|
+
t.preventDefault(), !p && K.current?.focus({
|
|
336
|
+
preventScroll: !0
|
|
337
|
+
});
|
|
338
|
+
}, onClick: () => {
|
|
339
|
+
p || (K.current?.focus({
|
|
340
|
+
preventScroll: !0
|
|
341
|
+
}), f(!0));
|
|
342
|
+
}, children: /* @__PURE__ */ h.jsx(we, { "aria-hidden": !0, className: "size-4" }) }),
|
|
343
|
+
c && !p && (() => {
|
|
344
|
+
const t = x.trim() === "" ? void 0 : a ?? e ?? void 0, i = /* @__PURE__ */ h.jsx(be, { children: /* @__PURE__ */ h.jsx("div", { ref: N, "data-slot": "day-picker-input-popover", className: "pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md", style: {
|
|
345
|
+
left: V.left,
|
|
346
|
+
top: V.top
|
|
347
|
+
}, onPointerDownCapture: () => {
|
|
348
|
+
q.current = !0;
|
|
349
|
+
}, onMouseDownCapture: () => {
|
|
350
|
+
q.current = !0;
|
|
351
|
+
}, children: /* @__PURE__ */ h.jsx(ke, { mode: "single", month: Y, onMonthChange: k, selected: t, onSelect: (n) => {
|
|
352
|
+
if (!n) {
|
|
353
|
+
e && ee(null), C(""), pe();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const u = T(n);
|
|
357
|
+
(!e || u.getTime() !== T(e).getTime()) && ee(u), C($(u)), pe();
|
|
358
|
+
}, ...L }) }) });
|
|
359
|
+
return typeof document > "u" ? i : he(i, document.body);
|
|
360
|
+
})()
|
|
361
|
+
] });
|
|
404
362
|
});
|
|
405
|
-
|
|
406
|
-
function
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
363
|
+
xe.displayName = "DayPickerInput";
|
|
364
|
+
function Fe({
|
|
365
|
+
id: o,
|
|
366
|
+
value: e,
|
|
367
|
+
onChange: d,
|
|
368
|
+
onValueUpdate: s,
|
|
369
|
+
className: w,
|
|
370
|
+
inputClassName: b,
|
|
371
|
+
placeholder: v = "DD/MM/YYYY",
|
|
372
|
+
disabled: p,
|
|
373
|
+
open: M,
|
|
374
|
+
onOpenChange: j,
|
|
375
|
+
dayPickerComponent: E,
|
|
376
|
+
dayPickerProps: S,
|
|
377
|
+
triggerTestId: L,
|
|
378
|
+
isHydrated: H
|
|
379
|
+
}) {
|
|
380
|
+
const O = r.useRef(null), z = r.useRef(null), A = r.useRef(!1), [W, B] = r.useState(!1), m = M ?? W, y = j ?? B;
|
|
381
|
+
A.current = m;
|
|
382
|
+
const [N, K] = r.useState(() => ue(e ?? /* @__PURE__ */ new Date())), [X, oe] = r.useState(() => ({
|
|
383
|
+
left: 0,
|
|
384
|
+
top: 0
|
|
385
|
+
}));
|
|
386
|
+
r.useEffect(() => {
|
|
387
|
+
m && K(ue(e ?? /* @__PURE__ */ new Date()));
|
|
388
|
+
}, [m, e]), r.useEffect(() => {
|
|
389
|
+
if (!m) return;
|
|
390
|
+
const g = O.current?.ownerDocument ?? document, R = g.defaultView ?? window, P = (f) => {
|
|
391
|
+
const x = f.target;
|
|
392
|
+
x instanceof Node && (O.current?.contains(x) || z.current?.contains(x) || y(!1));
|
|
393
|
+
}, c = (f) => {
|
|
394
|
+
if (f.key !== "Escape" || !A.current) return;
|
|
395
|
+
const x = f.target;
|
|
396
|
+
x instanceof Node && (!O.current?.contains(x) && !z.current?.contains(x) || (f.preventDefault(), f.stopPropagation(), y(!1)));
|
|
439
397
|
};
|
|
440
|
-
return
|
|
441
|
-
|
|
398
|
+
return g.addEventListener("pointerdown", P, !0), R.addEventListener("keydown", c, !0), () => {
|
|
399
|
+
g.removeEventListener("pointerdown", P, !0), R.removeEventListener("keydown", c, !0);
|
|
442
400
|
};
|
|
443
|
-
},
|
|
444
|
-
|
|
445
|
-
t[9] !== n ? (ve = [n], t[9] = n, t[10] = ve) : ve = t[10], f.useEffect(ie, ve);
|
|
446
|
-
let we;
|
|
447
|
-
t[11] !== n || t[12] !== k ? (we = () => {
|
|
448
|
-
if (!n || typeof window > "u" || !("IntersectionObserver" in window))
|
|
401
|
+
}, [m]), r.useEffect(() => {
|
|
402
|
+
if (!m || typeof window > "u" || !("IntersectionObserver" in window))
|
|
449
403
|
return;
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
404
|
+
const g = O.current;
|
|
405
|
+
if (!g)
|
|
452
406
|
return;
|
|
453
|
-
let
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
407
|
+
let R = !0;
|
|
408
|
+
const P = new IntersectionObserver((c) => {
|
|
409
|
+
if (!R)
|
|
456
410
|
return;
|
|
457
|
-
const
|
|
458
|
-
|
|
411
|
+
const f = c[0];
|
|
412
|
+
f && !f.isIntersecting && y(!1);
|
|
459
413
|
});
|
|
460
|
-
return
|
|
461
|
-
|
|
414
|
+
return P.observe(g), () => {
|
|
415
|
+
R = !1, P.disconnect();
|
|
462
416
|
};
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
G + L > de - 8 && (G = Math.max(8, de - L - 8)), G < 8 && (G = 8);
|
|
477
|
-
let K = N.bottom + 8;
|
|
478
|
-
const he = K + $ > ue - 8, pe = N.top - $ - 8;
|
|
479
|
-
he && pe >= 8 && (K = pe), K < 8 && (K = 8), K + $ > ue - 8 && (K = Math.max(8, ue - $ - 8)), be({
|
|
480
|
-
left: G,
|
|
481
|
-
top: K
|
|
417
|
+
}, [m]);
|
|
418
|
+
const Z = E ?? de, F = r.useCallback(() => {
|
|
419
|
+
if (typeof window > "u") return;
|
|
420
|
+
const g = O.current, R = z.current;
|
|
421
|
+
if (!g || !R) return;
|
|
422
|
+
const P = g.getBoundingClientRect(), c = R.offsetWidth, f = R.offsetHeight, x = window.innerWidth ?? 0, C = window.innerHeight ?? 0, a = 8;
|
|
423
|
+
let Y = P.left;
|
|
424
|
+
Y + c > x - a && (Y = Math.max(a, x - c - a)), Y < a && (Y = a);
|
|
425
|
+
let k = P.bottom + a;
|
|
426
|
+
const U = k + f > C - a, V = P.top - f - a;
|
|
427
|
+
U && V >= a && (k = V), k < a && (k = a), k + f > C - a && (k = Math.max(a, C - f - a)), oe({
|
|
428
|
+
left: Y,
|
|
429
|
+
top: k
|
|
482
430
|
});
|
|
483
|
-
},
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const w = window.requestAnimationFrame(b);
|
|
491
|
-
return window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
|
|
492
|
-
window.cancelAnimationFrame(w), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
|
|
431
|
+
}, []);
|
|
432
|
+
r.useLayoutEffect(() => {
|
|
433
|
+
if (!m || p || typeof window > "u") return;
|
|
434
|
+
F();
|
|
435
|
+
const g = window.requestAnimationFrame(F);
|
|
436
|
+
return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
|
|
437
|
+
window.cancelAnimationFrame(g), window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
493
438
|
};
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
const w = /* @__PURE__ */ E.jsx(tt, { children: /* @__PURE__ */ E.jsx("div", { ref: S, "data-slot": "day-picker-input-popover", className: "pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md", style: {
|
|
521
|
-
left: oe.left,
|
|
522
|
-
top: oe.top
|
|
523
|
-
}, children: /* @__PURE__ */ E.jsx(c, { mode: "single", month: q, onMonthChange: fe, selected: e ?? void 0, onSelect: (C) => {
|
|
524
|
-
if (!C) {
|
|
525
|
-
ee(null), k(!1);
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
const N = re(C);
|
|
529
|
-
(!e || N.getTime() !== re(e).getTime()) && ee(N), k(!1);
|
|
530
|
-
}, ...I }) }) });
|
|
531
|
-
return typeof document > "u" ? w : nt(w, document.body);
|
|
532
|
-
})(), t[46] = c, t[47] = ee, t[48] = I, t[49] = a, t[50] = q, t[51] = n, t[52] = oe, t[53] = k, t[54] = e, t[55] = W) : W = t[55];
|
|
533
|
-
let ne;
|
|
534
|
-
return t[56] !== V || t[57] !== B || t[58] !== W ? (ne = /* @__PURE__ */ E.jsxs("div", { ref: F, "data-slot": "day-picker-input", className: V, children: [
|
|
535
|
-
B,
|
|
536
|
-
W
|
|
537
|
-
] }), t[56] = V, t[57] = B, t[58] = W, t[59] = ne) : ne = t[59], ne;
|
|
538
|
-
}
|
|
539
|
-
function gt() {
|
|
540
|
-
return {
|
|
541
|
-
left: 0,
|
|
542
|
-
top: 0
|
|
543
|
-
};
|
|
439
|
+
}, [p, m, F]);
|
|
440
|
+
const q = r.useCallback((g) => {
|
|
441
|
+
s && s(g), d(g);
|
|
442
|
+
}, [d, s]);
|
|
443
|
+
return /* @__PURE__ */ h.jsxs("div", { ref: O, "data-slot": "day-picker-input", className: re("relative group", w), children: [
|
|
444
|
+
/* @__PURE__ */ h.jsxs("button", { id: o, type: "button", disabled: p, "data-testid": L, "data-hydrated": H ? "true" : void 0, "data-slot": "day-picker-input-input", className: re("flex h-10 w-full items-center rounded-md border border-input bg-background px-3 py-2 text-left 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", !e && "text-muted-foreground", m && "ring-2 ring-primary ring-offset-2", b), onClick: () => {
|
|
445
|
+
p || y(!m);
|
|
446
|
+
}, children: [
|
|
447
|
+
/* @__PURE__ */ h.jsx(we, { "aria-hidden": !0, className: "mr-2 size-4 text-muted-foreground transition-colors group-hover:text-accent-foreground" }),
|
|
448
|
+
e ? $(e) : v
|
|
449
|
+
] }),
|
|
450
|
+
m && !p && (() => {
|
|
451
|
+
const g = /* @__PURE__ */ h.jsx(be, { children: /* @__PURE__ */ h.jsx("div", { ref: z, "data-slot": "day-picker-input-popover", className: "pointer-events-auto fixed z-[60] w-max rounded-md border bg-popover text-popover-foreground shadow-md", style: {
|
|
452
|
+
left: X.left,
|
|
453
|
+
top: X.top
|
|
454
|
+
}, children: /* @__PURE__ */ h.jsx(Z, { mode: "single", month: N, onMonthChange: K, selected: e ?? void 0, onSelect: (R) => {
|
|
455
|
+
if (!R) {
|
|
456
|
+
q(null), y(!1);
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
const P = T(R);
|
|
460
|
+
(!e || P.getTime() !== T(e).getTime()) && q(P), y(!1);
|
|
461
|
+
}, ...S }) }) });
|
|
462
|
+
return typeof document > "u" ? g : he(g, document.body);
|
|
463
|
+
})()
|
|
464
|
+
] });
|
|
544
465
|
}
|
|
545
|
-
function
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
let
|
|
549
|
-
return
|
|
466
|
+
function Ge(o) {
|
|
467
|
+
const e = ye.c(18);
|
|
468
|
+
if (je()) {
|
|
469
|
+
let N;
|
|
470
|
+
return e[0] !== o ? (N = /* @__PURE__ */ h.jsx(Fe, { ...o }), e[0] = o, e[1] = N) : N = e[1], N;
|
|
550
471
|
}
|
|
551
472
|
const {
|
|
552
|
-
id:
|
|
553
|
-
value:
|
|
554
|
-
onChange:
|
|
555
|
-
onValueUpdate:
|
|
556
|
-
className:
|
|
557
|
-
inputClassName:
|
|
558
|
-
placeholder:
|
|
559
|
-
disabled:
|
|
560
|
-
readOnly:
|
|
561
|
-
dayPickerComponent:
|
|
562
|
-
dayPickerProps:
|
|
563
|
-
triggerTestId:
|
|
564
|
-
isHydrated:
|
|
565
|
-
open:
|
|
566
|
-
onOpenChange:
|
|
567
|
-
} =
|
|
568
|
-
let
|
|
569
|
-
return
|
|
570
|
-
}
|
|
571
|
-
function yt() {
|
|
572
|
-
return {
|
|
573
|
-
left: 0,
|
|
574
|
-
top: 0
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
function bt(s, t) {
|
|
578
|
-
const u = (t.value + s).replace(/\D/g, "");
|
|
579
|
-
return u.length <= 4 ? t.compiledMasks[0] : u.length <= 6 ? t.compiledMasks[1] : t.compiledMasks[2];
|
|
473
|
+
id: s,
|
|
474
|
+
value: w,
|
|
475
|
+
onChange: b,
|
|
476
|
+
onValueUpdate: v,
|
|
477
|
+
className: p,
|
|
478
|
+
inputClassName: M,
|
|
479
|
+
placeholder: j,
|
|
480
|
+
disabled: E,
|
|
481
|
+
readOnly: S,
|
|
482
|
+
dayPickerComponent: L,
|
|
483
|
+
dayPickerProps: H,
|
|
484
|
+
triggerTestId: O,
|
|
485
|
+
isHydrated: z,
|
|
486
|
+
open: A,
|
|
487
|
+
onOpenChange: W
|
|
488
|
+
} = o, B = j === void 0 ? "DD/MM/YYYY" : j, m = z ? "true" : void 0;
|
|
489
|
+
let y;
|
|
490
|
+
return e[2] !== p || e[3] !== L || e[4] !== H || e[5] !== E || e[6] !== s || e[7] !== M || e[8] !== b || e[9] !== W || e[10] !== v || e[11] !== A || e[12] !== B || e[13] !== S || e[14] !== m || e[15] !== O || e[16] !== w ? (y = /* @__PURE__ */ h.jsx(xe, { id: s, value: w, onChange: b, onValueUpdate: v, className: p, inputClassName: M, placeholder: B, disabled: E, readOnly: S, open: A, onOpenChange: W, dayPickerComponent: L, dayPickerProps: H, "data-testid": O, "data-hydrated": m }), e[2] = p, e[3] = L, e[4] = H, e[5] = E, e[6] = s, e[7] = M, e[8] = b, e[9] = W, e[10] = v, e[11] = A, e[12] = B, e[13] = S, e[14] = m, e[15] = O, e[16] = w, e[17] = y) : y = e[17], y;
|
|
580
491
|
}
|
|
581
492
|
export {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
493
|
+
de as DayPicker,
|
|
494
|
+
Ge as DayPickerField,
|
|
495
|
+
xe as DayPickerInput
|
|
585
496
|
};
|
|
586
497
|
//# sourceMappingURL=index12.js.map
|