react-hook-form-next-ui 2.1.1 → 3.0.50
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/README.md +6 -3
- package/dist/index.d.ts +48 -48
- package/dist/index.js +681 -696
- package/package.json +91 -89
package/dist/index.js
CHANGED
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import c, { useState as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { mixed as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import c, { useState as B, useEffect as ne, useCallback as R, useMemo as P } from "react";
|
|
2
|
+
import { Table as ke, TableHeader as Ne, TableColumn as Fe, TableBody as Se, TableRow as Ie, TableCell as Pe, Skeleton as Je, Pagination as Qe, Button as Q, Input as Ze, Divider as He, Card as Xe, CardHeader as Ke, CardBody as et, DatePicker as oe, InputOtp as tt, Select as nt, SelectItem as rt, TimeInput as le, Textarea as at, Autocomplete as st, AutocompleteItem as ot, RadioGroup as lt, Radio as it, Checkbox as Re, CheckboxGroup as ct, Modal as ut, ModalContent as mt, ModalHeader as dt, ModalBody as ft, ModalFooter as ht } from "@heroui/react";
|
|
3
|
+
import { useFormContext as I, Controller as C, useWatch as X } from "react-hook-form";
|
|
4
|
+
import { mixed as J } from "yup";
|
|
5
|
+
const gt = ({
|
|
6
|
+
size: e = 10,
|
|
7
|
+
columns: n = []
|
|
8
|
+
}) => /* @__PURE__ */ c.createElement(ke, { "aria-label": "Tabla de resultados" }, /* @__PURE__ */ c.createElement(Ne, null, n.map(
|
|
9
|
+
(t) => /* @__PURE__ */ c.createElement(Fe, { ...n, key: t.key }, t.title)
|
|
7
10
|
)), /* @__PURE__ */ c.createElement(Se, null, Array.from(
|
|
8
|
-
{ length: e
|
|
9
|
-
(
|
|
10
|
-
))),
|
|
11
|
-
const [
|
|
11
|
+
{ length: e },
|
|
12
|
+
(t, r) => /* @__PURE__ */ c.createElement(Ie, { key: r }, () => /* @__PURE__ */ c.createElement(Pe, null, /* @__PURE__ */ c.createElement(Je, { className: "h-5 w-4/5 rounded-lg" })))
|
|
13
|
+
))), pt = (e, n) => {
|
|
14
|
+
const [t, r] = B(e);
|
|
12
15
|
return ne(() => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
+
const a = setTimeout(() => {
|
|
17
|
+
r(e);
|
|
18
|
+
}, n);
|
|
16
19
|
return () => {
|
|
17
|
-
clearTimeout(
|
|
20
|
+
clearTimeout(a);
|
|
18
21
|
};
|
|
19
|
-
}, [e,
|
|
22
|
+
}, [e, n]), t;
|
|
20
23
|
};
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
24
|
+
var Ve = /^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{2}:?[0-9]{2})?$/;
|
|
25
|
+
function Mt(e) {
|
|
26
|
+
const n = e.match(Ve);
|
|
27
|
+
if (n) {
|
|
28
|
+
const t = Number(n[2]);
|
|
29
|
+
if (t < 1 || t > 12)
|
|
27
30
|
return !1;
|
|
28
|
-
if (typeof
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
+
if (typeof n[3] !== void 0) {
|
|
32
|
+
const r = Number(n[3]);
|
|
33
|
+
if (r < 1 || r > 31)
|
|
31
34
|
return !1;
|
|
32
35
|
}
|
|
33
|
-
if (typeof
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
+
if (typeof n[4] !== void 0) {
|
|
37
|
+
const r = Number(n[4]);
|
|
38
|
+
if (r < 0 || r > 23)
|
|
36
39
|
return !1;
|
|
37
40
|
}
|
|
38
41
|
return !0;
|
|
39
42
|
}
|
|
40
43
|
return !1;
|
|
41
44
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
+
function vt(e) {
|
|
46
|
+
const n = e.match(Ve);
|
|
47
|
+
return n && typeof n[4] > "u" ? e += "T00:00:00" : e;
|
|
45
48
|
}
|
|
46
|
-
function
|
|
49
|
+
function T(e) {
|
|
47
50
|
if (e || (e = /* @__PURE__ */ new Date()), e instanceof Date) {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
51
|
+
const n = new Date(e);
|
|
52
|
+
return n.setMilliseconds(0), n;
|
|
50
53
|
}
|
|
51
|
-
if (e = e.trim(),
|
|
52
|
-
return new Date(
|
|
54
|
+
if (e = e.trim(), Mt(e))
|
|
55
|
+
return new Date(vt(e));
|
|
53
56
|
throw new Error(`Non ISO 8601 compliant date (${e}).`);
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
return
|
|
58
|
+
function Et(e) {
|
|
59
|
+
const n = T(e);
|
|
60
|
+
return n.setDate(1), n.setMonth(n.getMonth() + 1), n.setDate(0), n;
|
|
58
61
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
62
|
+
function je(e) {
|
|
63
|
+
return Et(e).getDate();
|
|
61
64
|
}
|
|
62
|
-
var
|
|
65
|
+
var ie = "1999-03-04T02:05:01.000Z", ae = /* @__PURE__ */ new Map(), ce = [
|
|
63
66
|
["YYYY", { year: "numeric" }],
|
|
64
67
|
["YY", { year: "2-digit" }],
|
|
65
68
|
["MMMM", { month: "long" }],
|
|
@@ -77,10 +80,10 @@ var ce = "1999-03-04T02:05:01.000Z", se = /* @__PURE__ */ new Map(), ue = [
|
|
|
77
80
|
["s", { second: "numeric" }],
|
|
78
81
|
["ZZ", { timeZoneName: "long" }],
|
|
79
82
|
["Z", { timeZoneName: "short" }]
|
|
80
|
-
],
|
|
83
|
+
], ue = [
|
|
81
84
|
["HH", { hour: "2-digit" }],
|
|
82
85
|
["H", { hour: "numeric" }]
|
|
83
|
-
],
|
|
86
|
+
], me = [
|
|
84
87
|
["hh", { hour: "2-digit" }],
|
|
85
88
|
["h", { hour: "numeric" }],
|
|
86
89
|
["a", { dayPeriod: "narrow" }],
|
|
@@ -102,19 +105,19 @@ function Le(e) {
|
|
|
102
105
|
return 5;
|
|
103
106
|
throw new Error("Invalid offset format");
|
|
104
107
|
}
|
|
105
|
-
var
|
|
106
|
-
/* @__PURE__ */ [...
|
|
107
|
-
),
|
|
108
|
+
var wt = ["MMMM", "MMM", "dddd", "ddd"], v = /* @__PURE__ */ new Map(
|
|
109
|
+
/* @__PURE__ */ [...ce, ...ue, ...me].map((e) => [e[0], e])
|
|
110
|
+
), xe = /* @__PURE__ */ new Map(), Ae = [
|
|
108
111
|
"full",
|
|
109
112
|
"long",
|
|
110
113
|
"medium",
|
|
111
114
|
"short"
|
|
112
|
-
],
|
|
113
|
-
function
|
|
115
|
+
], L = (e) => String(e).padStart(2, "0"), se = (e) => String(e).padStart(2, "0");
|
|
116
|
+
function V(e) {
|
|
114
117
|
return e.type === "literal" && (e.value = e.value.normalize("NFKC")), e;
|
|
115
118
|
}
|
|
116
|
-
function
|
|
117
|
-
const s =
|
|
119
|
+
function yt(e, n, t, r = !1, a = null) {
|
|
120
|
+
const s = bt(e, n, t, r), i = T(e);
|
|
118
121
|
function o({ partName: m, partValue: d, token: l }) {
|
|
119
122
|
if (m === "literal")
|
|
120
123
|
return d;
|
|
@@ -124,194 +127,194 @@ function xt(e, t, n, a = !1, r = null) {
|
|
|
124
127
|
if (["mm", "ss", "MM"].includes(l) && u.length === 1)
|
|
125
128
|
return `0${u}`;
|
|
126
129
|
if (m === "dayPeriod") {
|
|
127
|
-
const f =
|
|
130
|
+
const f = z(i.getUTCHours() < 12 ? "am" : "pm", t);
|
|
128
131
|
return l === "A" ? f.toUpperCase() : f.toLowerCase();
|
|
129
132
|
}
|
|
130
|
-
return m === "timeZoneName" ?
|
|
133
|
+
return m === "timeZoneName" ? a ?? Be(-1 * i.getTimezoneOffset(), l) : u;
|
|
131
134
|
}
|
|
132
|
-
return
|
|
135
|
+
return n.map((m) => ({
|
|
133
136
|
...m,
|
|
134
137
|
value: o(m)
|
|
135
138
|
}));
|
|
136
139
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
140
|
+
function bt(e, n, t, r = !1) {
|
|
141
|
+
const a = T(e), s = n.filter((l) => l.hour12), i = n.filter((l) => !l.hour12), o = [], m = [];
|
|
139
142
|
function d(l, u = !1) {
|
|
140
|
-
const f = `${
|
|
143
|
+
const f = `${t}-u-hc-${u ? "h12" : "h23"}`;
|
|
141
144
|
if (o.push(
|
|
142
145
|
...new Intl.DateTimeFormat(
|
|
143
146
|
f,
|
|
144
147
|
l.reduce(
|
|
145
|
-
(
|
|
148
|
+
(h, p) => p.partName === "literal" ? h : (r && wt.includes(p.token) && m.push(p), Object.assign(h, p.option)),
|
|
146
149
|
{ timeZone: "UTC" }
|
|
147
150
|
)
|
|
148
|
-
).formatToParts(
|
|
149
|
-
),
|
|
150
|
-
for (const
|
|
151
|
-
let
|
|
152
|
-
switch (
|
|
151
|
+
).formatToParts(a).map(V)
|
|
152
|
+
), r && m.length)
|
|
153
|
+
for (const h of m) {
|
|
154
|
+
let p = [];
|
|
155
|
+
switch (h.token) {
|
|
153
156
|
case "MMMM":
|
|
154
|
-
|
|
157
|
+
p = new Intl.DateTimeFormat(f, {
|
|
155
158
|
dateStyle: "long",
|
|
156
159
|
timeZone: "UTC"
|
|
157
|
-
}).formatToParts(
|
|
160
|
+
}).formatToParts(a).map(V);
|
|
158
161
|
break;
|
|
159
162
|
case "MMM":
|
|
160
|
-
|
|
163
|
+
p = new Intl.DateTimeFormat(f, {
|
|
161
164
|
dateStyle: "medium",
|
|
162
165
|
timeZone: "UTC"
|
|
163
|
-
}).formatToParts(
|
|
166
|
+
}).formatToParts(a).map(V);
|
|
164
167
|
break;
|
|
165
168
|
}
|
|
166
|
-
const
|
|
167
|
-
(
|
|
168
|
-
),
|
|
169
|
-
|
|
169
|
+
const w = p.find(
|
|
170
|
+
(M) => M.type === h.partName
|
|
171
|
+
), k = o.findIndex((M) => M.type === h.partName);
|
|
172
|
+
w && k > -1 && (o[k] = w);
|
|
170
173
|
}
|
|
171
174
|
}
|
|
172
175
|
return s.length && d(s, !0), i.length && d(i), o.reduce((l, u) => (l[u.type] = u.value, l), {});
|
|
173
176
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
177
|
+
function Be(e, n = "Z") {
|
|
178
|
+
const t = String(Math.floor(Math.abs(e / 60))).padStart(
|
|
176
179
|
2,
|
|
177
180
|
"0"
|
|
178
|
-
),
|
|
179
|
-
return
|
|
181
|
+
), r = String(Math.abs(e % 60)).padStart(2, "0"), a = e < 0 ? "-" : "+";
|
|
182
|
+
return n === "ZZ" ? `${a}${t}${r}` : `${a}${t}:${r}`;
|
|
180
183
|
}
|
|
181
|
-
function
|
|
182
|
-
|
|
183
|
-
const [
|
|
184
|
+
function xt(e, n) {
|
|
185
|
+
Ue(e, n);
|
|
186
|
+
const [t, r, a, s] = e.match(
|
|
184
187
|
/([+-])([0-3][0-9]):?([0-6][0-9])/
|
|
185
|
-
), i = Number(
|
|
186
|
-
return
|
|
188
|
+
), i = Number(a) * 60 + Number(s);
|
|
189
|
+
return r === "+" ? i : -i;
|
|
187
190
|
}
|
|
188
|
-
function
|
|
189
|
-
if (!((
|
|
190
|
-
switch (
|
|
191
|
+
function Ue(e, n = "Z") {
|
|
192
|
+
if (!((r) => {
|
|
193
|
+
switch (r) {
|
|
191
194
|
case "Z":
|
|
192
195
|
return /^([+-])[0-3][0-9]:[0-6][0-9]$/.test(e);
|
|
193
196
|
case "ZZ":
|
|
194
197
|
return /^([+-])[0-3][0-9][0-6][0-9]$/.test(e);
|
|
195
198
|
}
|
|
196
|
-
})(
|
|
199
|
+
})(n))
|
|
197
200
|
throw new Error(`Invalid offset: ${e}`);
|
|
198
201
|
return e;
|
|
199
202
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
203
|
+
function $t(e) {
|
|
204
|
+
return ce.concat(ue).concat(me).sort((n, t) => n[0].length > t[0].length ? 1 : -1).reduce((n, t) => n.replace(t[0], `\\${t[0]}`), e);
|
|
202
205
|
}
|
|
203
|
-
function
|
|
206
|
+
function Dt(e) {
|
|
204
207
|
return ["numeric", "2-digit"].includes(e.partValue);
|
|
205
208
|
}
|
|
206
|
-
function
|
|
207
|
-
let
|
|
208
|
-
for (const
|
|
209
|
-
if (
|
|
210
|
-
throw new Error(`Numbers in format (${
|
|
211
|
-
if (
|
|
209
|
+
function Tt(e) {
|
|
210
|
+
let n;
|
|
211
|
+
for (const t of e) {
|
|
212
|
+
if (t.partName === "literal" && !isNaN(parseFloat(t.partValue)))
|
|
213
|
+
throw new Error(`Numbers in format (${t.partValue}).`);
|
|
214
|
+
if (n && n.partName !== "literal" && t.partName !== "literal" && !(n.token in K) && !(t.token in K) && !(Dt(n) && t.token.toLowerCase() === "a"))
|
|
212
215
|
throw new Error(
|
|
213
|
-
`Illegal adjacent tokens (${
|
|
216
|
+
`Illegal adjacent tokens (${n.token}, ${t.token})`
|
|
214
217
|
);
|
|
215
|
-
|
|
218
|
+
n = t;
|
|
216
219
|
}
|
|
217
220
|
return e;
|
|
218
221
|
}
|
|
219
|
-
function
|
|
222
|
+
function Ct(e) {
|
|
220
223
|
return typeof e == "string" ? e.includes("ZZ") ? "ZZ" : "Z" : "time" in e && e.time === "full" ? "Z" : "ZZ";
|
|
221
224
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
return
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
const s = new Intl.DateTimeFormat(
|
|
225
|
+
function z(e, n) {
|
|
226
|
+
const t = xe.get(n);
|
|
227
|
+
if (t && t[e])
|
|
228
|
+
return t[e];
|
|
229
|
+
const r = new Date(ie);
|
|
230
|
+
r.setUTCHours(e === "am" ? 5 : 20);
|
|
231
|
+
const s = new Intl.DateTimeFormat(n, {
|
|
229
232
|
timeStyle: "full",
|
|
230
233
|
timeZone: "UTC",
|
|
231
234
|
hour12: !0
|
|
232
|
-
}).formatToParts(
|
|
235
|
+
}).formatToParts(r).map(V).find((i) => i.type === "dayPeriod");
|
|
233
236
|
if (s) {
|
|
234
|
-
const i =
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
+
const i = t || {};
|
|
238
|
+
return xe.set(
|
|
239
|
+
n,
|
|
237
240
|
Object.assign(i, { [e]: s.value })
|
|
238
241
|
), s.value;
|
|
239
242
|
}
|
|
240
243
|
return e;
|
|
241
244
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
switch (Le(
|
|
245
|
+
function Yt(e, n = "+00:00") {
|
|
246
|
+
const t = T(e), r = (() => {
|
|
247
|
+
switch (Le(n)) {
|
|
245
248
|
case 5:
|
|
246
249
|
return "ZZ";
|
|
247
250
|
case 6:
|
|
248
251
|
return "Z";
|
|
249
252
|
}
|
|
250
|
-
})(),
|
|
251
|
-
return new Date(
|
|
253
|
+
})(), a = xt(n, r);
|
|
254
|
+
return new Date(t.getTime() + a * 1e3 * 60);
|
|
252
255
|
}
|
|
253
|
-
function
|
|
256
|
+
function We() {
|
|
254
257
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
255
258
|
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
259
|
+
function $e(e, n) {
|
|
260
|
+
const t = new Intl.DateTimeFormat("en-US", {
|
|
258
261
|
year: "numeric",
|
|
259
262
|
month: "2-digit",
|
|
260
263
|
day: "2-digit",
|
|
261
264
|
hour: "2-digit",
|
|
262
265
|
minute: "2-digit",
|
|
263
266
|
second: "2-digit",
|
|
264
|
-
timeZone:
|
|
267
|
+
timeZone: n,
|
|
265
268
|
hourCycle: "h23"
|
|
266
|
-
}).formatToParts(e).map(
|
|
267
|
-
return
|
|
268
|
-
a
|
|
269
|
+
}).formatToParts(e).map(V), r = {};
|
|
270
|
+
return t.forEach((a) => {
|
|
271
|
+
r[a.type] = a.value;
|
|
269
272
|
}), /* @__PURE__ */ new Date(
|
|
270
|
-
`${
|
|
273
|
+
`${r.year}-${r.month}-${r.day}T${r.hour}:${r.minute}:${r.second}Z`
|
|
271
274
|
);
|
|
272
275
|
}
|
|
273
|
-
function
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
const s =
|
|
276
|
+
function De(e, n = "UTC", t = "device", r = "Z") {
|
|
277
|
+
var a;
|
|
278
|
+
t = t === "device" ? (a = We()) != null ? a : "utc" : t;
|
|
279
|
+
const s = T(e), i = $e(s, n), o = $e(s, t), m = Math.round(
|
|
277
280
|
(o.getTime() - i.getTime()) / 1e3 / 60
|
|
278
281
|
);
|
|
279
|
-
return
|
|
282
|
+
return Be(m, r);
|
|
280
283
|
}
|
|
281
|
-
function
|
|
282
|
-
if (
|
|
283
|
-
return
|
|
284
|
-
let
|
|
285
|
-
const
|
|
286
|
-
if (l[2] || (l[2] = new RegExp(`(.)?(${l[0]})`, "g")), l[2].test(
|
|
284
|
+
function de(e, n) {
|
|
285
|
+
if (Ae.includes(e) || typeof e == "object")
|
|
286
|
+
return kt(e, n);
|
|
287
|
+
let t = e, r = 0;
|
|
288
|
+
const a = (l) => {
|
|
289
|
+
if (l[2] || (l[2] = new RegExp(`(.)?(${l[0]})`, "g")), l[2].test(t)) {
|
|
287
290
|
let u = 0;
|
|
288
|
-
return
|
|
291
|
+
return t = t.replace(l[2], (f, h, p) => h === "\\" ? p : `${typeof h == "string" ? h : ""}{!${u++ ? r : r++}!}`), !!u;
|
|
289
292
|
}
|
|
290
293
|
return !1;
|
|
291
294
|
};
|
|
292
295
|
function s(l) {
|
|
293
|
-
const u = l.map((
|
|
296
|
+
const u = l.map((h) => h.partName), f = new Set(u);
|
|
294
297
|
if (u.length > f.size)
|
|
295
298
|
throw new Error("Cannot reuse format tokens.");
|
|
296
299
|
return l;
|
|
297
300
|
}
|
|
298
|
-
function i(l, [u, f,
|
|
299
|
-
const
|
|
301
|
+
function i(l, [u, f, h]) {
|
|
302
|
+
const p = Object.keys(f)[0], w = f[p];
|
|
300
303
|
return {
|
|
301
304
|
option: f,
|
|
302
|
-
partName:
|
|
303
|
-
partValue:
|
|
305
|
+
partName: p,
|
|
306
|
+
partValue: w,
|
|
304
307
|
token: u,
|
|
305
|
-
pattern:
|
|
308
|
+
pattern: h,
|
|
306
309
|
hour12: l
|
|
307
310
|
};
|
|
308
311
|
}
|
|
309
|
-
const o =
|
|
312
|
+
const o = ce.filter(a).concat(ue.filter(a)).map(i.bind(null, !1)), m = s(
|
|
310
313
|
o.concat(
|
|
311
|
-
|
|
314
|
+
me.filter(a).map(i.bind(null, !0))
|
|
312
315
|
)
|
|
313
316
|
), d = /^\{!(\d+)!\}$/;
|
|
314
|
-
return
|
|
317
|
+
return t.split(/(\{!\d+!\})/).map((l) => {
|
|
315
318
|
const u = l.match(d);
|
|
316
319
|
return u ? m[Number(u[1])] : {
|
|
317
320
|
option: { literal: l },
|
|
@@ -323,19 +326,19 @@ function fe(e, t) {
|
|
|
323
326
|
};
|
|
324
327
|
}).filter((l) => !(l.partName === "literal" && l.partValue === ""));
|
|
325
328
|
}
|
|
326
|
-
function
|
|
327
|
-
const
|
|
329
|
+
function kt(e, n) {
|
|
330
|
+
const t = {
|
|
328
331
|
timeZone: "UTC"
|
|
329
332
|
};
|
|
330
|
-
typeof e == "string" ?
|
|
331
|
-
const
|
|
332
|
-
return
|
|
333
|
-
const d = m.type, l =
|
|
333
|
+
typeof e == "string" ? t.dateStyle = e : ("date" in e && (t.dateStyle = e.date), "time" in e && (t.timeStyle = e.time));
|
|
334
|
+
const r = new Intl.DateTimeFormat(n, t), a = r.formatToParts(new Date(ie)).map(V), i = r.formatToParts(/* @__PURE__ */ new Date("1999-04-05T23:05:01.000Z")).map(V).find((m) => m.type === "hour"), o = i && i.value === "23" ? 24 : 12;
|
|
335
|
+
return a.map((m) => {
|
|
336
|
+
const d = m.type, l = Nt(
|
|
334
337
|
m.type,
|
|
335
338
|
m.value,
|
|
336
|
-
|
|
339
|
+
n,
|
|
337
340
|
m.type === "hour" ? o : void 0,
|
|
338
|
-
|
|
341
|
+
t
|
|
339
342
|
);
|
|
340
343
|
if (l === void 0)
|
|
341
344
|
return;
|
|
@@ -351,178 +354,178 @@ function Ft(e, t) {
|
|
|
351
354
|
};
|
|
352
355
|
}).filter((m) => !!m);
|
|
353
356
|
}
|
|
354
|
-
function
|
|
355
|
-
const s =
|
|
357
|
+
function Nt(e, n, t, r, a) {
|
|
358
|
+
const s = n.length, i = !isNaN(Number(n));
|
|
356
359
|
let o;
|
|
357
360
|
switch (e) {
|
|
358
361
|
case "year":
|
|
359
|
-
return s === 2 ?
|
|
362
|
+
return s === 2 ? v.get("YY") : v.get("YYYY");
|
|
360
363
|
case "month":
|
|
361
364
|
if (i)
|
|
362
|
-
return s === 1 ?
|
|
363
|
-
switch (o = Te(
|
|
365
|
+
return s === 1 ? v.get("M") : v.get("MM");
|
|
366
|
+
switch (o = Te(t, e, n), o) {
|
|
364
367
|
case "long":
|
|
365
|
-
return
|
|
368
|
+
return v.get("MMMM");
|
|
366
369
|
default:
|
|
367
|
-
return
|
|
370
|
+
return v.get("MMM");
|
|
368
371
|
}
|
|
369
372
|
case "day":
|
|
370
|
-
return s === 1 ?
|
|
373
|
+
return s === 1 ? v.get("D") : v.get("DD");
|
|
371
374
|
case "weekday":
|
|
372
|
-
switch (o = Te(
|
|
375
|
+
switch (o = Te(t, e, n), o) {
|
|
373
376
|
case "narrow":
|
|
374
|
-
return
|
|
377
|
+
return v.get("d");
|
|
375
378
|
case "short":
|
|
376
|
-
return
|
|
379
|
+
return v.get("ddd");
|
|
377
380
|
default:
|
|
378
|
-
return
|
|
381
|
+
return v.get("dddd");
|
|
379
382
|
}
|
|
380
383
|
case "hour":
|
|
381
|
-
return
|
|
384
|
+
return r === 12 ? s === 1 ? v.get("h") : v.get("hh") : s === 1 ? v.get("H") : v.get("HH");
|
|
382
385
|
case "minute":
|
|
383
|
-
return s === 1 ?
|
|
386
|
+
return s === 1 ? v.get("m") : v.get("mm");
|
|
384
387
|
case "second":
|
|
385
|
-
return s === 1 ?
|
|
388
|
+
return s === 1 ? v.get("s") : v.get("ss");
|
|
386
389
|
case "dayPeriod":
|
|
387
|
-
return /^[A-Z]+$/u.test(
|
|
390
|
+
return /^[A-Z]+$/u.test(n) ? v.get("A") : v.get("a");
|
|
388
391
|
case "literal":
|
|
389
|
-
return [
|
|
392
|
+
return [n, { literal: n }, new RegExp("")];
|
|
390
393
|
case "timeZoneName":
|
|
391
|
-
return
|
|
394
|
+
return a.timeStyle === "full" ? v.get("Z") : v.get("ZZ");
|
|
392
395
|
default:
|
|
393
396
|
return;
|
|
394
397
|
}
|
|
395
398
|
}
|
|
396
|
-
function Te(e,
|
|
397
|
-
if (!
|
|
398
|
-
const
|
|
399
|
+
function Te(e, n, t) {
|
|
400
|
+
if (!ae.has(e)) {
|
|
401
|
+
const a = new Date(ie), s = [3, 8, 9, 7, 6, 4, 3], i = ["weekday", "month", "dayPeriod"], o = ["long", "short", "narrow"], m = {};
|
|
399
402
|
for (let d = 0; d < 12; d++) {
|
|
400
|
-
|
|
403
|
+
a.setMonth(0 + d), d in s && a.setDate(s[d]), a.setUTCHours(8 + d);
|
|
401
404
|
for (const l of o) {
|
|
402
405
|
const u = new Intl.DateTimeFormat(
|
|
403
406
|
e,
|
|
404
407
|
i.reduce(
|
|
405
|
-
(f,
|
|
408
|
+
(f, h) => Object.assign(f, { [h]: l }),
|
|
406
409
|
{ hour12: !0, timeZone: "UTC" }
|
|
407
410
|
)
|
|
408
|
-
).formatToParts(
|
|
411
|
+
).formatToParts(a).map(V);
|
|
409
412
|
if (l === "long" || l === "short") {
|
|
410
|
-
const
|
|
413
|
+
const h = new Intl.DateTimeFormat(e, {
|
|
411
414
|
dateStyle: l === "short" ? "medium" : "long",
|
|
412
415
|
timeZone: "UTC"
|
|
413
|
-
}).formatToParts(
|
|
414
|
-
(
|
|
415
|
-
),
|
|
416
|
-
|
|
416
|
+
}).formatToParts(a).map(V).find(
|
|
417
|
+
(w) => w.type === "month"
|
|
418
|
+
), p = u.findIndex((w) => w.type === "month");
|
|
419
|
+
p > -1 && h && (u[p] = h);
|
|
417
420
|
}
|
|
418
421
|
u.forEach((f) => {
|
|
419
422
|
if (f.type === "literal")
|
|
420
423
|
return;
|
|
421
|
-
const
|
|
422
|
-
m[
|
|
424
|
+
const h = f.type;
|
|
425
|
+
m[h] = Object.assign(m[h] || {}, {
|
|
423
426
|
[f.value]: l
|
|
424
427
|
});
|
|
425
428
|
});
|
|
426
429
|
}
|
|
427
430
|
}
|
|
428
|
-
|
|
431
|
+
ae.set(e, m);
|
|
429
432
|
}
|
|
430
|
-
const
|
|
431
|
-
return
|
|
433
|
+
const r = ae.get(e);
|
|
434
|
+
return r ? r[n][t] : void 0;
|
|
432
435
|
}
|
|
433
|
-
function
|
|
434
|
-
const
|
|
435
|
-
return
|
|
436
|
+
function Ft(e, n = "+00:00") {
|
|
437
|
+
const t = n.slice(0, 1) === "+";
|
|
438
|
+
return Yt(
|
|
436
439
|
e,
|
|
437
|
-
|
|
440
|
+
n.replace(t ? "+" : "-", t ? "-" : "+")
|
|
438
441
|
);
|
|
439
442
|
}
|
|
440
|
-
function
|
|
443
|
+
function St() {
|
|
441
444
|
return Intl.DateTimeFormat().resolvedOptions().locale;
|
|
442
445
|
}
|
|
443
|
-
function
|
|
446
|
+
function Z(e, n = "long", t = "device", r = !1, a) {
|
|
444
447
|
let s, i;
|
|
445
448
|
return typeof e == "object" && !(e instanceof Date) && ({
|
|
446
449
|
date: e,
|
|
447
|
-
format:
|
|
448
|
-
locale:
|
|
449
|
-
genitive:
|
|
450
|
-
partFilter:
|
|
450
|
+
format: n,
|
|
451
|
+
locale: t,
|
|
452
|
+
genitive: r,
|
|
453
|
+
partFilter: a,
|
|
451
454
|
tz: s
|
|
452
|
-
} = e),
|
|
455
|
+
} = e), n === "ISO8601" ? T(e).toISOString() : (s && (i = De(e, "utc", s, Ct(n))), s ?? (s = We()), (s == null ? void 0 : s.toLowerCase()) !== "utc" && (e = Ft(
|
|
453
456
|
e,
|
|
454
|
-
|
|
455
|
-
)), (!
|
|
457
|
+
De(e, s, "utc")
|
|
458
|
+
)), (!t || t === "device") && (t = St()), yt(
|
|
456
459
|
e,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
+
de(n, t).filter(a ?? (() => !0)),
|
|
461
|
+
t,
|
|
462
|
+
r,
|
|
460
463
|
i
|
|
461
464
|
).map((o) => o.value).join(""));
|
|
462
465
|
}
|
|
463
|
-
function
|
|
464
|
-
return
|
|
465
|
-
(
|
|
466
|
+
function It(e, n = "en", t = !1, r = () => !0) {
|
|
467
|
+
return de(e, n).filter(r).reduce(
|
|
468
|
+
(a, s) => a += t && s.partName === "literal" ? $t(s.token) : s.token,
|
|
466
469
|
""
|
|
467
470
|
).normalize("NFKC");
|
|
468
471
|
}
|
|
469
|
-
function
|
|
470
|
-
const
|
|
471
|
-
return (
|
|
472
|
+
function Pt(e) {
|
|
473
|
+
const n = (/* @__PURE__ */ new Date()).getFullYear(), t = n % 100, r = Math.floor(n / 100), a = Number(e);
|
|
474
|
+
return (r + (a > t + 20 ? -1 : 0)) * 100 + a;
|
|
472
475
|
}
|
|
473
|
-
function
|
|
474
|
-
const
|
|
476
|
+
function _e(e, n = "en", t = !1) {
|
|
477
|
+
const r = (a, s) => Array(a).fill("").map((i, o) => `${s(o)}`);
|
|
475
478
|
if (e === "M")
|
|
476
|
-
return
|
|
479
|
+
return r(12, (a) => a + 1);
|
|
477
480
|
if (e === "MM")
|
|
478
|
-
return
|
|
479
|
-
const s =
|
|
481
|
+
return r(12, (a) => {
|
|
482
|
+
const s = a + 1;
|
|
480
483
|
return s < 10 ? `0${s}` : s;
|
|
481
484
|
});
|
|
482
485
|
if (e.startsWith("M"))
|
|
483
|
-
return
|
|
484
|
-
(
|
|
486
|
+
return _e("MM").map(
|
|
487
|
+
(a) => Z(`2000-${a}-05`, e, n, t)
|
|
485
488
|
);
|
|
486
489
|
if (e.startsWith("d"))
|
|
487
|
-
return
|
|
488
|
-
(
|
|
490
|
+
return r(7, (a) => `0${a + 2}`).map(
|
|
491
|
+
(a) => Z(`2022-10-${a}`, e, n)
|
|
489
492
|
);
|
|
490
493
|
if (e === "a")
|
|
491
|
-
return [
|
|
494
|
+
return [z("am", n).toLowerCase(), z("pm", n).toLowerCase()];
|
|
492
495
|
if (e === "A")
|
|
493
|
-
return [
|
|
496
|
+
return [z("am", n).toUpperCase(), z("pm", n).toUpperCase()];
|
|
494
497
|
if (e.startsWith("Y")) {
|
|
495
|
-
const
|
|
496
|
-
return
|
|
497
|
-
(s, i) => (i !== "120" && s.push(
|
|
498
|
-
[
|
|
498
|
+
const a = (/* @__PURE__ */ new Date()).getFullYear();
|
|
499
|
+
return r(120, (s) => s + 1).reduce(
|
|
500
|
+
(s, i) => (i !== "120" && s.push(Z(`${a + Number(i)}-06-06`, e, n)), s.unshift(Z(`${a - Number(i)}-06-06`, e, n)), s),
|
|
501
|
+
[Z(`${a}-06-06`, e, n)]
|
|
499
502
|
);
|
|
500
503
|
}
|
|
501
|
-
return e.startsWith("D") ?
|
|
504
|
+
return e.startsWith("D") ? r(31, (a) => `${e === "DD" && a < 9 ? "0" : ""}${a + 1}`) : e.startsWith("H") ? r(24, (a) => `${e === "HH" && a < 10 ? "0" : ""}${a}`) : e.startsWith("h") ? r(12, (a) => `${e === "hh" && a < 9 ? "0" : ""}${a + 1}`) : e.startsWith("m") || e.startsWith("s") ? r(60, (a) => `${e.length > 1 && a < 10 ? "0" : ""}${a}`) : [];
|
|
502
505
|
}
|
|
503
|
-
function A(e,
|
|
504
|
-
let
|
|
506
|
+
function A(e, n = "ISO8601", t = "device") {
|
|
507
|
+
let r = () => !0, a, s = "backward";
|
|
505
508
|
if (typeof e == "object" ? {
|
|
506
|
-
date:
|
|
507
|
-
format:
|
|
508
|
-
locale:
|
|
509
|
+
date: a,
|
|
510
|
+
format: n = "ISO8601",
|
|
511
|
+
locale: t = "device",
|
|
509
512
|
dateOverflow: s = "backward",
|
|
510
|
-
partFilter:
|
|
511
|
-
} = e :
|
|
513
|
+
partFilter: r = () => !0
|
|
514
|
+
} = e : a = e, !a)
|
|
512
515
|
throw new Error("parse() requires a date string.");
|
|
513
516
|
const i = () => {
|
|
514
517
|
throw new Error(
|
|
515
|
-
`Date (${
|
|
518
|
+
`Date (${a}) does not match format (${It(n, t)})`
|
|
516
519
|
);
|
|
517
520
|
};
|
|
518
|
-
if (
|
|
519
|
-
return
|
|
520
|
-
const o =
|
|
521
|
+
if (n === "ISO8601")
|
|
522
|
+
return T(a);
|
|
523
|
+
const o = Ae.includes(n) || typeof n == "object", m = Tt(de(n, t).filter(r));
|
|
521
524
|
if (!m.length)
|
|
522
525
|
throw new Error("parse() requires a pattern.");
|
|
523
526
|
let d;
|
|
524
527
|
try {
|
|
525
|
-
d =
|
|
528
|
+
d = Zt(a, m);
|
|
526
529
|
} catch {
|
|
527
530
|
return i();
|
|
528
531
|
}
|
|
@@ -534,295 +537,297 @@ function A(e, t = "ISO8601", n = "device") {
|
|
|
534
537
|
["mm", 0],
|
|
535
538
|
["ss", 0]
|
|
536
539
|
]);
|
|
537
|
-
let f = null,
|
|
538
|
-
d.forEach((
|
|
539
|
-
if (
|
|
540
|
+
let f = null, h = "";
|
|
541
|
+
d.forEach((y) => {
|
|
542
|
+
if (y.partName === "literal")
|
|
540
543
|
return;
|
|
541
|
-
if (
|
|
544
|
+
if (y.token === y.value)
|
|
542
545
|
return i();
|
|
543
|
-
const
|
|
544
|
-
if (u.has(
|
|
545
|
-
u.set(
|
|
546
|
-
else if (
|
|
547
|
-
u.set("YYYY",
|
|
546
|
+
const q = Number(y.value);
|
|
547
|
+
if (u.has(y.token))
|
|
548
|
+
u.set(y.token, q);
|
|
549
|
+
else if (y.token === "YY")
|
|
550
|
+
u.set("YYYY", Pt(y.value));
|
|
548
551
|
else {
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
552
|
+
const D = y.token;
|
|
553
|
+
if (D.startsWith("d"))
|
|
551
554
|
return;
|
|
552
|
-
if (
|
|
553
|
-
u.set("DD",
|
|
554
|
-
else if (
|
|
555
|
-
u.set("HH",
|
|
556
|
-
else if (
|
|
557
|
-
u.set("MM",
|
|
558
|
-
else if (
|
|
559
|
-
f =
|
|
560
|
-
else if (
|
|
561
|
-
|
|
555
|
+
if (D === "D")
|
|
556
|
+
u.set("DD", q);
|
|
557
|
+
else if (D === "H" || D.startsWith("h"))
|
|
558
|
+
u.set("HH", q);
|
|
559
|
+
else if (D === "M")
|
|
560
|
+
u.set("MM", q);
|
|
561
|
+
else if (D === "a" || D === "A")
|
|
562
|
+
f = y.value.toLowerCase() === z("am", t).toLowerCase();
|
|
563
|
+
else if (D === "Z" || D === "ZZ")
|
|
564
|
+
h = Ue(y.value, D);
|
|
562
565
|
else {
|
|
563
|
-
const
|
|
564
|
-
if (
|
|
565
|
-
switch (
|
|
566
|
+
const W = _e(D, t, o).indexOf(y.value);
|
|
567
|
+
if (W !== -1)
|
|
568
|
+
switch (D) {
|
|
566
569
|
case "MMM":
|
|
567
570
|
case "MMMM":
|
|
568
|
-
u.set("MM",
|
|
571
|
+
u.set("MM", W + 1);
|
|
569
572
|
break;
|
|
570
573
|
}
|
|
571
574
|
}
|
|
572
575
|
}
|
|
573
576
|
});
|
|
574
|
-
let
|
|
575
|
-
f === !1 ? (
|
|
576
|
-
let [
|
|
577
|
-
const
|
|
578
|
-
if (
|
|
579
|
-
throw new Error(`Invalid date ${
|
|
580
|
-
|
|
581
|
-
const U = `${
|
|
582
|
-
|
|
583
|
-
)}:${
|
|
584
|
-
return isFinite(+
|
|
577
|
+
let p = u.get("HH") || 0;
|
|
578
|
+
f === !1 ? (p += p === 12 ? 0 : 12, u.set("HH", p === 24 ? 0 : p)) : f === !0 && p === 12 && u.set("HH", 0), u.set("MM", (u.get("MM") || 1) - 1);
|
|
579
|
+
let [w, k, M, Y, x, $] = Array.from(u.values());
|
|
580
|
+
const N = je(/* @__PURE__ */ new Date(`${se(w)}-${L(k + 1)}-10`));
|
|
581
|
+
if (N < M && s === "throw")
|
|
582
|
+
throw new Error(`Invalid date ${se(w)}-${L(k + 1)}-${L(M)}`);
|
|
583
|
+
M = s === "backward" ? Math.min(M, N) : M;
|
|
584
|
+
const U = `${se(w)}-${L(k + 1)}-${L(M)}T${L(Y)}:${L(
|
|
585
|
+
x
|
|
586
|
+
)}:${L($)}${h}`, F = new Date(U);
|
|
587
|
+
return isFinite(+F) ? F : i();
|
|
585
588
|
}
|
|
586
|
-
function
|
|
587
|
-
let
|
|
588
|
-
const
|
|
589
|
-
o[
|
|
590
|
-
o[
|
|
589
|
+
function Zt(e, n) {
|
|
590
|
+
let t = 0;
|
|
591
|
+
const r = (o) => [
|
|
592
|
+
o[t++],
|
|
593
|
+
o[t]
|
|
591
594
|
];
|
|
592
|
-
let
|
|
595
|
+
let a = 0;
|
|
593
596
|
const s = [];
|
|
594
597
|
let i;
|
|
595
598
|
do {
|
|
596
|
-
const [o, m] =
|
|
599
|
+
const [o, m] = r(n);
|
|
597
600
|
i = m;
|
|
598
601
|
let d = 1;
|
|
599
602
|
if (o.partName === "literal")
|
|
600
603
|
d = o.partValue.length;
|
|
601
604
|
else if (o.partName === "timeZoneName")
|
|
602
|
-
d = Le(e.substring(
|
|
605
|
+
d = Le(e.substring(a));
|
|
603
606
|
else if (o.token in K)
|
|
604
607
|
d = K[o.token];
|
|
605
608
|
else if (m)
|
|
606
609
|
if (m.partName === "literal") {
|
|
607
|
-
if (d = e.indexOf(m.partValue,
|
|
610
|
+
if (d = e.indexOf(m.partValue, a) - a, d < 0)
|
|
608
611
|
throw new Error();
|
|
609
612
|
} else if (m.partName === "dayPeriod") {
|
|
610
613
|
for (let l = 1; l <= 4; l++)
|
|
611
|
-
if (isNaN(Number(e.charAt(
|
|
614
|
+
if (isNaN(Number(e.charAt(a + l)))) {
|
|
612
615
|
d = l;
|
|
613
616
|
break;
|
|
614
617
|
}
|
|
615
618
|
} else {
|
|
616
|
-
const l = e.substring(
|
|
617
|
-
l !== -1 && (d =
|
|
619
|
+
const l = e.substring(a).search(/\d/);
|
|
620
|
+
l !== -1 && (d = a + l);
|
|
618
621
|
}
|
|
619
622
|
else
|
|
620
623
|
d = e.length;
|
|
621
|
-
s.push({ ...o, value: e.substring(
|
|
624
|
+
s.push({ ...o, value: e.substring(a, a + d) }), a += d;
|
|
622
625
|
} while (i);
|
|
623
626
|
return s;
|
|
624
627
|
}
|
|
625
|
-
function
|
|
626
|
-
const
|
|
627
|
-
return +
|
|
628
|
+
function Ht(e, n) {
|
|
629
|
+
const t = T(e), r = T(n);
|
|
630
|
+
return +t > +r;
|
|
628
631
|
}
|
|
629
|
-
function
|
|
630
|
-
const
|
|
631
|
-
return +
|
|
632
|
+
function Rt(e, n) {
|
|
633
|
+
const t = T(e), r = T(n);
|
|
634
|
+
return +t == +r;
|
|
632
635
|
}
|
|
633
|
-
function
|
|
634
|
-
const
|
|
635
|
-
return +
|
|
636
|
+
function fe(e, n) {
|
|
637
|
+
const t = T(e), r = T(n);
|
|
638
|
+
return +t - +r;
|
|
636
639
|
}
|
|
637
|
-
function
|
|
638
|
-
const
|
|
639
|
-
return
|
|
640
|
+
function he(e, n = "trunc") {
|
|
641
|
+
const t = Math[n](e);
|
|
642
|
+
return t == 0 ? 0 : t;
|
|
640
643
|
}
|
|
641
|
-
function
|
|
642
|
-
return
|
|
644
|
+
function Vt(e, n, t) {
|
|
645
|
+
return he(fe(e, n) / 6e4, t);
|
|
643
646
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
646
|
-
|
|
647
|
+
function jt(e, n, t) {
|
|
648
|
+
return he(
|
|
649
|
+
fe(e, n) / 36e5,
|
|
647
650
|
// 1000 * 60 * 60
|
|
648
|
-
|
|
651
|
+
t
|
|
649
652
|
);
|
|
650
653
|
}
|
|
651
|
-
function
|
|
652
|
-
return
|
|
653
|
-
|
|
654
|
+
function Lt(e, n, t) {
|
|
655
|
+
return he(
|
|
656
|
+
fe(e, n) / 864e5,
|
|
654
657
|
// hour * 24
|
|
655
|
-
|
|
658
|
+
t
|
|
656
659
|
);
|
|
657
660
|
}
|
|
658
|
-
function
|
|
659
|
-
const
|
|
660
|
-
if (
|
|
661
|
-
const o =
|
|
661
|
+
function ge(e, n) {
|
|
662
|
+
const t = T(e), r = T(n);
|
|
663
|
+
if (t < r) {
|
|
664
|
+
const o = ge(r, t);
|
|
662
665
|
return o == 0 ? 0 : -o;
|
|
663
666
|
}
|
|
664
|
-
let
|
|
665
|
-
const s =
|
|
667
|
+
let a = (t.getFullYear() - r.getFullYear()) * 12 + (t.getMonth() - r.getMonth());
|
|
668
|
+
const s = t.getDate(), i = r.getDate();
|
|
666
669
|
if (s < i) {
|
|
667
|
-
const o =
|
|
668
|
-
o == s && o < i ||
|
|
670
|
+
const o = je(t);
|
|
671
|
+
o == s && o < i || a--;
|
|
669
672
|
}
|
|
670
|
-
return
|
|
673
|
+
return a == 0 ? 0 : a;
|
|
671
674
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
674
|
-
return
|
|
675
|
+
function At(e, n) {
|
|
676
|
+
const t = Math.trunc(ge(e, n) / 12);
|
|
677
|
+
return t == 0 ? 0 : t;
|
|
675
678
|
}
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
...M
|
|
679
|
+
const Bt = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-5" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" })), Xt = ({
|
|
680
|
+
hideFilterSearch: e,
|
|
681
|
+
loading: n,
|
|
682
|
+
isVirtualized: t,
|
|
683
|
+
onSelect: r,
|
|
684
|
+
selectionMode: a,
|
|
685
|
+
inputSearch: s,
|
|
686
|
+
hideRowsPerPageOptions: i,
|
|
687
|
+
extraTopContent: o,
|
|
688
|
+
cellClass: m,
|
|
689
|
+
rows: d = [],
|
|
690
|
+
columns: l = [],
|
|
691
|
+
keyRow: u = "id",
|
|
692
|
+
itemsName: f = "datos",
|
|
693
|
+
rowsPerPageOptions: h = { default: 10, options: [5, 10, 15] },
|
|
694
|
+
...p
|
|
693
695
|
}) => {
|
|
694
|
-
const [
|
|
695
|
-
|
|
696
|
+
const [w, k] = B(""), [M, Y] = B(h.default), [x, $] = B(1), [N, U] = B(/* @__PURE__ */ new Set()), [F, y] = B({ column: "", direction: "ascending" });
|
|
697
|
+
ne(() => {
|
|
698
|
+
$(1), U(/* @__PURE__ */ new Set());
|
|
699
|
+
}, [d]);
|
|
700
|
+
const D = !!pt(w, 500), pe = R((g) => {
|
|
701
|
+
U(g);
|
|
696
702
|
let b = [];
|
|
697
|
-
|
|
698
|
-
}, [
|
|
699
|
-
let g = [...
|
|
700
|
-
return
|
|
703
|
+
a === "single" ? b = d.find((E) => E[u] == [...g][0]) : g === "all" ? (b = d, U(new Set(d.map((E) => E[u])))) : b = d.filter((E) => [...g].includes(E[u])), r && r(b);
|
|
704
|
+
}, [r, d, a, u]), W = P(() => {
|
|
705
|
+
let g = [...d];
|
|
706
|
+
return D && (g = g.filter(
|
|
701
707
|
(b) => Object.values(b).some(
|
|
702
|
-
(E,
|
|
703
|
-
const
|
|
704
|
-
return !
|
|
708
|
+
(E, S) => {
|
|
709
|
+
const H = Object.keys(b)[S];
|
|
710
|
+
return !l.map((j) => j.key).includes(H) || E == null || !E ? !1 : E.toString().toLowerCase().includes(w.toLowerCase());
|
|
705
711
|
}
|
|
706
712
|
)
|
|
707
713
|
)), g;
|
|
708
|
-
}, [
|
|
709
|
-
const E = g[
|
|
710
|
-
let
|
|
711
|
-
if (!E && !
|
|
712
|
-
const
|
|
713
|
-
if (E &&
|
|
714
|
+
}, [w, D, d, l]), _ = Math.ceil(W.length / M) || 1, re = P(() => [...W].sort((g, b) => {
|
|
715
|
+
const E = g[F.column], S = b[F.column];
|
|
716
|
+
let H = 0;
|
|
717
|
+
if (!E && !S && (H = 0), E || (H = -1), S || (H = 1), typeof E == "number" && typeof S == "number" && (H = E - S), typeof E == "string" && typeof S == "string") {
|
|
718
|
+
const O = l.find((j) => j.key === F.column);
|
|
719
|
+
if (E && S && (O != null && O.dateFormat))
|
|
714
720
|
try {
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
} catch (
|
|
718
|
-
console.warn("date format is not correct",
|
|
721
|
+
const j = A(E, O.dateFormat), be = A(S, O.dateFormat);
|
|
722
|
+
H = j > be ? 1 : j < be ? -1 : 0;
|
|
723
|
+
} catch (j) {
|
|
724
|
+
console.warn("date format is not correct", j);
|
|
719
725
|
}
|
|
720
726
|
else
|
|
721
|
-
|
|
727
|
+
H = E.localeCompare(S);
|
|
722
728
|
}
|
|
723
|
-
return
|
|
724
|
-
}), [
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
729
|
+
return F.direction === "descending" ? -H : H;
|
|
730
|
+
}), [F, W, l]), Oe = P(() => {
|
|
731
|
+
if (t) return re;
|
|
732
|
+
const g = (x - 1) * M, b = g + M;
|
|
733
|
+
return re.slice(g, b);
|
|
734
|
+
}, [re, x, M, t]), Me = R(() => {
|
|
735
|
+
k(""), $(1);
|
|
736
|
+
}, []), ve = R(() => {
|
|
737
|
+
x < _ && $(x + 1);
|
|
738
|
+
}, [x, _]), Ee = R(() => {
|
|
739
|
+
x > 1 && $(x - 1);
|
|
740
|
+
}, [x]), we = R((g) => {
|
|
741
|
+
Y(Number(g.target.value)), $(1);
|
|
742
|
+
}, []), ye = R((g) => {
|
|
743
|
+
g ? (k(g), $(1)) : k("");
|
|
744
|
+
}, []), ze = R((g, b) => {
|
|
745
|
+
const E = l.find((S) => S.key === b);
|
|
739
746
|
return E.format ? /* @__PURE__ */ c.createElement("div", null, E.format({
|
|
740
747
|
value: g[b],
|
|
741
748
|
row: g
|
|
742
749
|
})) : /* @__PURE__ */ c.createElement("p", { title: g[b] }, g[b]);
|
|
743
|
-
}, [
|
|
744
|
-
|
|
750
|
+
}, [l]), Ge = P(() => /* @__PURE__ */ c.createElement("div", { className: "py-2 px-2 mt-2 flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "w-[30%] text-small text-default-400" }, [...N].length > 0 && /* @__PURE__ */ c.createElement(c.Fragment, null, [...N].length, " ", [...N].length === 1 ? "fila seleccionada" : "filas seleccionadas")), !t && /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
|
|
751
|
+
Qe,
|
|
745
752
|
{
|
|
746
753
|
isCompact: !0,
|
|
747
754
|
showControls: !0,
|
|
748
755
|
showShadow: !0,
|
|
749
|
-
page:
|
|
756
|
+
page: x,
|
|
750
757
|
total: _,
|
|
751
|
-
onChange:
|
|
752
|
-
color:
|
|
758
|
+
onChange: $,
|
|
759
|
+
color: p.color
|
|
753
760
|
}
|
|
754
|
-
), /* @__PURE__ */ c.createElement("div", { className: "hidden sm:flex w-[30%] justify-end gap-2" }, /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: Ee }, "Atrás"), /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress:
|
|
755
|
-
|
|
761
|
+
), /* @__PURE__ */ c.createElement("div", { className: "hidden sm:flex w-[30%] justify-end gap-2" }, /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: Ee }, "Atrás"), /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: ve }, "Siguiente")))), [x, _, ve, Ee, N, p.color, t]), qe = P(() => /* @__PURE__ */ c.createElement("div", { className: "flex flex-col gap-4 relative pb-2" }, /* @__PURE__ */ c.createElement("div", { className: "flex justify-between gap-3 items-end" }, !e && /* @__PURE__ */ c.createElement(
|
|
762
|
+
Ze,
|
|
756
763
|
{
|
|
757
|
-
...
|
|
758
|
-
className: (
|
|
759
|
-
placeholder: (
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
764
|
+
...s,
|
|
765
|
+
className: (s == null ? void 0 : s.className) ?? "w-full sm:max-w-[44%]",
|
|
766
|
+
placeholder: (s == null ? void 0 : s.placeholder) ?? "Buscar...",
|
|
767
|
+
startContent: /* @__PURE__ */ c.createElement(Bt, null),
|
|
768
|
+
value: w,
|
|
769
|
+
onClear: () => Me(),
|
|
770
|
+
onValueChange: ye,
|
|
763
771
|
isClearable: !0
|
|
764
772
|
}
|
|
765
|
-
),
|
|
773
|
+
), o), /* @__PURE__ */ c.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "text-default-400 text-small" }, "Total ", d.length, " ", f), !i && !t && /* @__PURE__ */ c.createElement("label", { className: "flex items-center text-default-400 text-small" }, "Filas por página:", /* @__PURE__ */ c.createElement(
|
|
766
774
|
"select",
|
|
767
775
|
{
|
|
768
776
|
className: "bg-transparent outline-none text-default-400 text-small",
|
|
769
777
|
onChange: we,
|
|
770
|
-
defaultValue:
|
|
778
|
+
defaultValue: M
|
|
771
779
|
},
|
|
772
|
-
h.map(
|
|
780
|
+
h.options.map(
|
|
773
781
|
(g) => /* @__PURE__ */ c.createElement("option", { key: g, value: g }, g)
|
|
774
782
|
)
|
|
775
783
|
)))), [
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
784
|
+
w,
|
|
785
|
+
d.length,
|
|
786
|
+
Me,
|
|
779
787
|
we,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
788
|
+
s,
|
|
789
|
+
o,
|
|
790
|
+
ye,
|
|
791
|
+
M,
|
|
792
|
+
t,
|
|
793
|
+
e,
|
|
794
|
+
i,
|
|
786
795
|
h,
|
|
787
|
-
|
|
796
|
+
f
|
|
788
797
|
]);
|
|
789
|
-
return /* @__PURE__ */ c.createElement(c.Fragment, null,
|
|
790
|
-
|
|
798
|
+
return /* @__PURE__ */ c.createElement(c.Fragment, null, n ? /* @__PURE__ */ c.createElement(gt, { columns: l, size: M }) : /* @__PURE__ */ c.createElement(c.Fragment, null, qe, /* @__PURE__ */ c.createElement(
|
|
799
|
+
ke,
|
|
791
800
|
{
|
|
792
|
-
...
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
onSortChange: W,
|
|
801
|
-
selectedKeys: U,
|
|
802
|
-
onSelectionChange: J,
|
|
803
|
-
selectionMode: o
|
|
801
|
+
...p,
|
|
802
|
+
"aria-label": "Tabla de datos",
|
|
803
|
+
isVirtualized: t,
|
|
804
|
+
sortDescriptor: F,
|
|
805
|
+
onSortChange: y,
|
|
806
|
+
selectedKeys: N,
|
|
807
|
+
onSelectionChange: pe,
|
|
808
|
+
selectionMode: a
|
|
804
809
|
},
|
|
805
|
-
/* @__PURE__ */ c.createElement(
|
|
806
|
-
/* @__PURE__ */ c.createElement(Se, { emptyContent: "No hay datos.", items: Oe }, (g) => /* @__PURE__ */ c.createElement(Ie, { key: g[
|
|
807
|
-
));
|
|
808
|
-
},
|
|
809
|
-
const [
|
|
810
|
-
return /* @__PURE__ */ c.createElement(
|
|
811
|
-
},
|
|
812
|
-
const { control:
|
|
810
|
+
/* @__PURE__ */ c.createElement(Ne, { columns: l }, (g) => /* @__PURE__ */ c.createElement(Fe, { ...g, children: void 0, key: g.key })),
|
|
811
|
+
/* @__PURE__ */ c.createElement(Se, { emptyContent: "No hay datos.", items: Oe }, (g) => /* @__PURE__ */ c.createElement(Ie, { key: g[u] }, (b) => /* @__PURE__ */ c.createElement(Pe, { className: m }, ze(g, b))))
|
|
812
|
+
), Ge));
|
|
813
|
+
}, Kt = ({ children: e, title: n, color: t = "primary" }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("header", { className: `bg-${t} w-full text-center text-white py-5` }, /* @__PURE__ */ c.createElement("h1", { className: "font-bold text-lg" }, n)), /* @__PURE__ */ c.createElement(He, null), /* @__PURE__ */ c.createElement("main", { className: "p-5 2xl:px-16 2xl:py-5 mx-auto" }, e)), Ut = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 18.75 7.5-7.5 7.5 7.5" }), /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 12.75 7.5-7.5 7.5 7.5" })), Wt = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 5.25 7.5 7.5 7.5-7.5m-15 6 7.5 7.5 7.5-7.5" })), en = ({ title: e, color: n = "default", children: t, collapse: r = !1 }) => {
|
|
814
|
+
const [a, s] = B(!0);
|
|
815
|
+
return /* @__PURE__ */ c.createElement(Xe, { className: "mb-5" }, /* @__PURE__ */ c.createElement(Ke, { className: `bg-${n} px-5 text-white flex justify-between` }, e, r && /* @__PURE__ */ c.createElement("div", { onClick: () => s(!a), className: "cursor-pointer" }, a ? /* @__PURE__ */ c.createElement(Ut, null) : /* @__PURE__ */ c.createElement(Wt, null))), /* @__PURE__ */ c.createElement(He, null), /* @__PURE__ */ c.createElement(et, { className: `p-5 ${a ? "" : "hidden"}` }, t));
|
|
816
|
+
}, tn = ({ name: e, rules: n, defaultValue: t = null, ...r }) => {
|
|
817
|
+
const { control: a } = I();
|
|
813
818
|
return /* @__PURE__ */ c.createElement(
|
|
814
|
-
|
|
819
|
+
C,
|
|
815
820
|
{
|
|
816
|
-
control:
|
|
821
|
+
control: a,
|
|
817
822
|
name: e,
|
|
818
|
-
rules:
|
|
819
|
-
defaultValue:
|
|
823
|
+
rules: n,
|
|
824
|
+
defaultValue: t,
|
|
820
825
|
render: ({ field: s, formState: { errors: i } }) => {
|
|
821
826
|
var o;
|
|
822
827
|
return /* @__PURE__ */ c.createElement(
|
|
823
|
-
|
|
828
|
+
oe,
|
|
824
829
|
{
|
|
825
|
-
...
|
|
830
|
+
...r,
|
|
826
831
|
...s,
|
|
827
832
|
value: s.value,
|
|
828
833
|
errorMessage: i[e] ? (o = i[e]) == null ? void 0 : o.message : "",
|
|
@@ -832,23 +837,23 @@ const Kt = ({
|
|
|
832
837
|
}
|
|
833
838
|
}
|
|
834
839
|
);
|
|
835
|
-
},
|
|
836
|
-
const { control:
|
|
840
|
+
}, nn = ({ startDate: e, endDate: n }) => {
|
|
841
|
+
const { control: t, trigger: r, getValues: a, formState: s } = I(), i = P(() => e.name, [e.name]), o = P(() => n.name, [n.name]), m = X({ control: t, name: [i] }), d = X({ control: t, name: [o] });
|
|
837
842
|
return ne(() => {
|
|
838
843
|
if (!s.isSubmitted) return;
|
|
839
|
-
const l =
|
|
840
|
-
l[i] && l[o] && (
|
|
841
|
-
}, [d, m,
|
|
842
|
-
|
|
844
|
+
const l = a();
|
|
845
|
+
l[i] && l[o] && (r([i]), r([o]));
|
|
846
|
+
}, [d, m, r, a, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
|
|
847
|
+
C,
|
|
843
848
|
{
|
|
844
|
-
control:
|
|
849
|
+
control: t,
|
|
845
850
|
name: i,
|
|
846
851
|
rules: e.rules,
|
|
847
852
|
defaultValue: e.defaultValue ?? null,
|
|
848
853
|
render: ({ field: l, formState: { errors: u } }) => {
|
|
849
854
|
var f;
|
|
850
855
|
return /* @__PURE__ */ c.createElement(
|
|
851
|
-
|
|
856
|
+
oe,
|
|
852
857
|
{
|
|
853
858
|
...e,
|
|
854
859
|
...l,
|
|
@@ -860,18 +865,18 @@ const Kt = ({
|
|
|
860
865
|
}
|
|
861
866
|
}
|
|
862
867
|
), /* @__PURE__ */ c.createElement(
|
|
863
|
-
|
|
868
|
+
C,
|
|
864
869
|
{
|
|
865
|
-
control:
|
|
870
|
+
control: t,
|
|
866
871
|
name: o,
|
|
867
|
-
rules:
|
|
868
|
-
defaultValue:
|
|
872
|
+
rules: n.rules,
|
|
873
|
+
defaultValue: n.defaultValue ?? null,
|
|
869
874
|
render: ({ field: l, formState: { errors: u } }) => {
|
|
870
875
|
var f;
|
|
871
876
|
return /* @__PURE__ */ c.createElement(
|
|
872
|
-
|
|
877
|
+
oe,
|
|
873
878
|
{
|
|
874
|
-
...
|
|
879
|
+
...n,
|
|
875
880
|
...l,
|
|
876
881
|
value: l.value,
|
|
877
882
|
errorMessage: u[o] ? (f = u[o]) == null ? void 0 : f.message : "",
|
|
@@ -881,121 +886,128 @@ const Kt = ({
|
|
|
881
886
|
}
|
|
882
887
|
}
|
|
883
888
|
));
|
|
884
|
-
},
|
|
885
|
-
const { control: s } =
|
|
889
|
+
}, rn = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
|
|
890
|
+
const { control: s } = I();
|
|
886
891
|
return /* @__PURE__ */ c.createElement(
|
|
887
|
-
|
|
892
|
+
C,
|
|
888
893
|
{
|
|
889
894
|
control: s,
|
|
890
895
|
defaultValue: e,
|
|
891
|
-
name:
|
|
892
|
-
rules:
|
|
896
|
+
name: t,
|
|
897
|
+
rules: n,
|
|
893
898
|
render: ({ field: i, formState: { errors: o } }) => {
|
|
894
899
|
var m;
|
|
895
900
|
return /* @__PURE__ */ c.createElement(
|
|
896
|
-
|
|
901
|
+
Ze,
|
|
897
902
|
{
|
|
898
|
-
...
|
|
903
|
+
...a,
|
|
899
904
|
...i,
|
|
900
|
-
isInvalid: !!o[
|
|
901
|
-
errorMessage: o[
|
|
905
|
+
isInvalid: !!o[t],
|
|
906
|
+
errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
|
|
902
907
|
classNames: {
|
|
903
|
-
...
|
|
904
|
-
input: `${(
|
|
908
|
+
...r,
|
|
909
|
+
input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
|
|
905
910
|
}
|
|
906
911
|
}
|
|
907
912
|
);
|
|
908
913
|
}
|
|
909
914
|
}
|
|
910
915
|
);
|
|
911
|
-
},
|
|
912
|
-
const { control: s } =
|
|
916
|
+
}, an = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
|
|
917
|
+
const { control: s } = I();
|
|
913
918
|
return /* @__PURE__ */ c.createElement(
|
|
914
|
-
|
|
919
|
+
C,
|
|
915
920
|
{
|
|
916
921
|
control: s,
|
|
917
922
|
defaultValue: e,
|
|
918
|
-
name:
|
|
919
|
-
rules:
|
|
923
|
+
name: t,
|
|
924
|
+
rules: n,
|
|
920
925
|
render: ({ field: i, formState: { errors: o } }) => {
|
|
921
926
|
var m;
|
|
922
927
|
return /* @__PURE__ */ c.createElement(
|
|
923
|
-
|
|
928
|
+
tt,
|
|
924
929
|
{
|
|
925
|
-
...
|
|
930
|
+
...a,
|
|
926
931
|
...i,
|
|
927
|
-
isInvalid: !!o[
|
|
928
|
-
errorMessage: o[
|
|
932
|
+
isInvalid: !!o[t],
|
|
933
|
+
errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
|
|
929
934
|
classNames: {
|
|
930
|
-
...
|
|
931
|
-
input: `${(
|
|
935
|
+
...r,
|
|
936
|
+
input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
|
|
932
937
|
}
|
|
933
938
|
}
|
|
934
939
|
);
|
|
935
940
|
}
|
|
936
941
|
}
|
|
937
942
|
);
|
|
938
|
-
},
|
|
939
|
-
const { control:
|
|
940
|
-
() =>
|
|
943
|
+
}, sn = ({ name: e, data: n, rules: t, defaultSelectedKeys: r, disabledKeys: a, renderValue: s, allOptions: i, allSelectText: o, onSelectionChange: m, selectionMode: d, ...l }) => {
|
|
944
|
+
const { control: u, setValue: f } = I(), h = P(() => d === "multiple", [d]), p = P(
|
|
945
|
+
() => i && h ? [
|
|
941
946
|
{
|
|
942
947
|
key: "all",
|
|
943
|
-
children:
|
|
944
|
-
textValue:
|
|
948
|
+
children: i.children,
|
|
949
|
+
textValue: i.textValue
|
|
945
950
|
},
|
|
946
|
-
...
|
|
947
|
-
] :
|
|
948
|
-
[
|
|
949
|
-
),
|
|
951
|
+
...n
|
|
952
|
+
] : n,
|
|
953
|
+
[n, i, h]
|
|
954
|
+
), w = R((M) => {
|
|
950
955
|
setTimeout(() => {
|
|
951
|
-
const
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
+
const Y = new Set(M), x = new Set(a), $ = Y.has("all");
|
|
957
|
+
let N = M;
|
|
958
|
+
if ($ && h)
|
|
959
|
+
if (Y.size - 1 === n.length)
|
|
960
|
+
f(e, ""), N = /* @__PURE__ */ new Set();
|
|
961
|
+
else {
|
|
962
|
+
const F = n.filter((y) => !x.has(y.key)).map((y) => y.key);
|
|
963
|
+
f(e, F.toString()), N = new Set(F);
|
|
964
|
+
}
|
|
965
|
+
m == null || m(N);
|
|
956
966
|
}, 250);
|
|
957
|
-
}, [
|
|
967
|
+
}, [n, e, m, f, a, h]), k = R((M) => /* @__PURE__ */ c.createElement("span", null, M.length >= n.length ? o ?? "Todas las opciones" : M.filter((Y) => Y.key !== "all").map((Y) => Y.textValue).join(", ")), [o, n]);
|
|
958
968
|
return /* @__PURE__ */ c.createElement(
|
|
959
|
-
|
|
969
|
+
C,
|
|
960
970
|
{
|
|
961
|
-
control:
|
|
962
|
-
rules:
|
|
971
|
+
control: u,
|
|
972
|
+
rules: t,
|
|
963
973
|
name: e,
|
|
964
|
-
defaultValue: (
|
|
965
|
-
render: ({ field:
|
|
974
|
+
defaultValue: (r == null ? void 0 : r.toString()) ?? void 0,
|
|
975
|
+
render: ({ field: M, formState: { errors: Y } }) => {
|
|
966
976
|
var x;
|
|
967
977
|
return /* @__PURE__ */ c.createElement(
|
|
968
|
-
|
|
978
|
+
nt,
|
|
969
979
|
{
|
|
970
|
-
...
|
|
971
|
-
...
|
|
972
|
-
items:
|
|
973
|
-
selectedKeys:
|
|
974
|
-
errorMessage: ((x =
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
980
|
+
...l,
|
|
981
|
+
...M,
|
|
982
|
+
items: p,
|
|
983
|
+
selectedKeys: M.value ? M.value.split(",") : [],
|
|
984
|
+
errorMessage: ((x = Y[e]) == null ? void 0 : x.message) || "",
|
|
985
|
+
selectionMode: d,
|
|
986
|
+
onSelectionChange: ($) => w($),
|
|
987
|
+
isInvalid: !!Y[e],
|
|
988
|
+
renderValue: s ?? h ? k : void 0,
|
|
989
|
+
disabledKeys: a
|
|
978
990
|
},
|
|
979
|
-
(
|
|
991
|
+
($) => /* @__PURE__ */ c.createElement(rt, { ...$, key: $.key })
|
|
980
992
|
);
|
|
981
993
|
}
|
|
982
994
|
}
|
|
983
995
|
);
|
|
984
|
-
},
|
|
985
|
-
const { control:
|
|
996
|
+
}, on = ({ name: e, rules: n, defaultValue: t, ...r }) => {
|
|
997
|
+
const { control: a } = I();
|
|
986
998
|
return /* @__PURE__ */ c.createElement(
|
|
987
|
-
|
|
999
|
+
C,
|
|
988
1000
|
{
|
|
989
|
-
control:
|
|
1001
|
+
control: a,
|
|
990
1002
|
name: e,
|
|
991
|
-
rules:
|
|
992
|
-
defaultValue:
|
|
1003
|
+
rules: n,
|
|
1004
|
+
defaultValue: t ?? null,
|
|
993
1005
|
render: ({ field: s, formState: { errors: i } }) => {
|
|
994
1006
|
var o;
|
|
995
1007
|
return /* @__PURE__ */ c.createElement(
|
|
996
|
-
|
|
1008
|
+
le,
|
|
997
1009
|
{
|
|
998
|
-
...
|
|
1010
|
+
...r,
|
|
999
1011
|
...s,
|
|
1000
1012
|
value: s.value,
|
|
1001
1013
|
isInvalid: !!i[e],
|
|
@@ -1005,23 +1017,23 @@ const Kt = ({
|
|
|
1005
1017
|
}
|
|
1006
1018
|
}
|
|
1007
1019
|
);
|
|
1008
|
-
},
|
|
1009
|
-
const { control:
|
|
1020
|
+
}, ln = ({ startTime: e, endTime: n }) => {
|
|
1021
|
+
const { control: t, trigger: r, getValues: a, formState: s } = I(), i = P(() => e.name, [e.name]), o = P(() => n.name, [n.name]), m = X({ control: t, name: [i] }), d = X({ control: t, name: [o] });
|
|
1010
1022
|
return ne(() => {
|
|
1011
1023
|
if (!s.isSubmitted) return;
|
|
1012
|
-
const l =
|
|
1013
|
-
l[i] && l[o] && (
|
|
1014
|
-
}, [d, m,
|
|
1015
|
-
|
|
1024
|
+
const l = a();
|
|
1025
|
+
l[i] && l[o] && (r([i]), r([o]));
|
|
1026
|
+
}, [d, m, r, a, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
|
|
1027
|
+
C,
|
|
1016
1028
|
{
|
|
1017
|
-
control:
|
|
1029
|
+
control: t,
|
|
1018
1030
|
name: i,
|
|
1019
1031
|
rules: e.rules,
|
|
1020
1032
|
defaultValue: e.defaultValue ?? null,
|
|
1021
1033
|
render: ({ field: l, formState: { errors: u } }) => {
|
|
1022
1034
|
var f;
|
|
1023
1035
|
return /* @__PURE__ */ c.createElement(
|
|
1024
|
-
|
|
1036
|
+
le,
|
|
1025
1037
|
{
|
|
1026
1038
|
...e,
|
|
1027
1039
|
...l,
|
|
@@ -1033,18 +1045,18 @@ const Kt = ({
|
|
|
1033
1045
|
}
|
|
1034
1046
|
}
|
|
1035
1047
|
), /* @__PURE__ */ c.createElement(
|
|
1036
|
-
|
|
1048
|
+
C,
|
|
1037
1049
|
{
|
|
1038
|
-
control:
|
|
1050
|
+
control: t,
|
|
1039
1051
|
name: o,
|
|
1040
|
-
rules:
|
|
1041
|
-
defaultValue:
|
|
1052
|
+
rules: n.rules,
|
|
1053
|
+
defaultValue: n.defaultValue ?? null,
|
|
1042
1054
|
render: ({ field: l, formState: { errors: u } }) => {
|
|
1043
1055
|
var f;
|
|
1044
1056
|
return /* @__PURE__ */ c.createElement(
|
|
1045
|
-
|
|
1057
|
+
le,
|
|
1046
1058
|
{
|
|
1047
|
-
...
|
|
1059
|
+
...n,
|
|
1048
1060
|
...l,
|
|
1049
1061
|
value: l.value,
|
|
1050
1062
|
isInvalid: !!u[o],
|
|
@@ -1054,258 +1066,231 @@ const Kt = ({
|
|
|
1054
1066
|
}
|
|
1055
1067
|
}
|
|
1056
1068
|
));
|
|
1057
|
-
},
|
|
1058
|
-
const { control: s } =
|
|
1069
|
+
}, cn = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
|
|
1070
|
+
const { control: s } = I();
|
|
1059
1071
|
return /* @__PURE__ */ c.createElement(
|
|
1060
|
-
|
|
1072
|
+
C,
|
|
1061
1073
|
{
|
|
1062
1074
|
control: s,
|
|
1063
1075
|
defaultValue: e,
|
|
1064
|
-
name:
|
|
1065
|
-
rules:
|
|
1076
|
+
name: t,
|
|
1077
|
+
rules: n,
|
|
1066
1078
|
render: ({ field: i, formState: { errors: o } }) => {
|
|
1067
1079
|
var m;
|
|
1068
1080
|
return /* @__PURE__ */ c.createElement(
|
|
1069
|
-
|
|
1081
|
+
at,
|
|
1070
1082
|
{
|
|
1071
|
-
...
|
|
1083
|
+
...a,
|
|
1072
1084
|
...i,
|
|
1073
|
-
isInvalid: !!o[
|
|
1074
|
-
errorMessage: o[
|
|
1085
|
+
isInvalid: !!o[t],
|
|
1086
|
+
errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
|
|
1075
1087
|
classNames: {
|
|
1076
|
-
...
|
|
1077
|
-
input: `${(
|
|
1088
|
+
...r,
|
|
1089
|
+
input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
|
|
1078
1090
|
}
|
|
1079
1091
|
}
|
|
1080
1092
|
);
|
|
1081
1093
|
}
|
|
1082
1094
|
}
|
|
1083
1095
|
);
|
|
1084
|
-
},
|
|
1085
|
-
const { control: i } =
|
|
1096
|
+
}, un = ({ onSelectionChange: e, defaultSelectedKey: n, name: t, data: r, rules: a, ...s }) => {
|
|
1097
|
+
const { control: i } = I(), o = (m) => {
|
|
1086
1098
|
e && e(m);
|
|
1087
1099
|
};
|
|
1088
1100
|
return /* @__PURE__ */ c.createElement(
|
|
1089
|
-
|
|
1101
|
+
C,
|
|
1090
1102
|
{
|
|
1091
1103
|
control: i,
|
|
1092
|
-
defaultValue:
|
|
1093
|
-
name:
|
|
1094
|
-
rules:
|
|
1104
|
+
defaultValue: n,
|
|
1105
|
+
name: t,
|
|
1106
|
+
rules: a,
|
|
1095
1107
|
render: ({ field: m, formState: { errors: d } }) => {
|
|
1096
1108
|
var l;
|
|
1097
1109
|
return /* @__PURE__ */ c.createElement(
|
|
1098
|
-
|
|
1110
|
+
st,
|
|
1099
1111
|
{
|
|
1100
1112
|
...s,
|
|
1101
1113
|
...m,
|
|
1102
1114
|
selectedKey: m.value ?? "",
|
|
1103
|
-
defaultItems:
|
|
1115
|
+
defaultItems: r,
|
|
1104
1116
|
onSelectionChange: (u) => {
|
|
1105
1117
|
m.onChange(u), o(u);
|
|
1106
1118
|
},
|
|
1107
|
-
isInvalid: !!d[
|
|
1108
|
-
errorMessage: d[
|
|
1119
|
+
isInvalid: !!d[t],
|
|
1120
|
+
errorMessage: d[t] ? (l = d[t]) == null ? void 0 : l.message : "",
|
|
1109
1121
|
inputProps: {
|
|
1110
1122
|
classNames: {
|
|
1111
|
-
input: d[
|
|
1123
|
+
input: d[t] ? "placeholder:text-danger" : ""
|
|
1112
1124
|
}
|
|
1113
1125
|
}
|
|
1114
1126
|
},
|
|
1115
|
-
|
|
1127
|
+
r.map((u) => /* @__PURE__ */ c.createElement(ot, { ...u, key: u.key }))
|
|
1116
1128
|
);
|
|
1117
1129
|
}
|
|
1118
1130
|
}
|
|
1119
1131
|
);
|
|
1120
|
-
},
|
|
1121
|
-
const { control: s } =
|
|
1132
|
+
}, mn = ({ data: e, rules: n, name: t, defaultValue: r, ...a }) => {
|
|
1133
|
+
const { control: s } = I();
|
|
1122
1134
|
return /* @__PURE__ */ c.createElement(
|
|
1123
|
-
|
|
1135
|
+
C,
|
|
1124
1136
|
{
|
|
1125
1137
|
control: s,
|
|
1126
|
-
rules:
|
|
1127
|
-
name:
|
|
1128
|
-
defaultValue:
|
|
1138
|
+
rules: n,
|
|
1139
|
+
name: t,
|
|
1140
|
+
defaultValue: r ?? "",
|
|
1129
1141
|
render: ({ field: i, formState: { errors: o } }) => {
|
|
1130
1142
|
var m;
|
|
1131
1143
|
return /* @__PURE__ */ c.createElement(
|
|
1132
|
-
|
|
1144
|
+
lt,
|
|
1133
1145
|
{
|
|
1134
1146
|
...i,
|
|
1135
|
-
...
|
|
1136
|
-
isInvalid: !!o[
|
|
1137
|
-
errorMessage: o[
|
|
1147
|
+
...a,
|
|
1148
|
+
isInvalid: !!o[t],
|
|
1149
|
+
errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : ""
|
|
1138
1150
|
},
|
|
1139
|
-
e.map((d, l) => /* @__PURE__ */ c.createElement(
|
|
1151
|
+
e.map((d, l) => /* @__PURE__ */ c.createElement(it, { ...d, key: l }))
|
|
1140
1152
|
);
|
|
1141
1153
|
}
|
|
1142
1154
|
}
|
|
1143
1155
|
);
|
|
1144
|
-
},
|
|
1145
|
-
const { control:
|
|
1156
|
+
}, dn = ({ rules: e, name: n, ...t }) => {
|
|
1157
|
+
const { control: r } = I();
|
|
1146
1158
|
return /* @__PURE__ */ c.createElement(
|
|
1147
|
-
|
|
1159
|
+
C,
|
|
1148
1160
|
{
|
|
1149
|
-
control:
|
|
1161
|
+
control: r,
|
|
1150
1162
|
rules: e,
|
|
1151
|
-
name:
|
|
1152
|
-
render: ({ field:
|
|
1163
|
+
name: n,
|
|
1164
|
+
render: ({ field: a, formState: { errors: s } }) => /* @__PURE__ */ c.createElement(
|
|
1153
1165
|
Re,
|
|
1154
1166
|
{
|
|
1155
|
-
...
|
|
1156
|
-
...
|
|
1157
|
-
isSelected: !!
|
|
1158
|
-
isInvalid: !!s[
|
|
1167
|
+
...a,
|
|
1168
|
+
...t,
|
|
1169
|
+
isSelected: !!a.value,
|
|
1170
|
+
isInvalid: !!s[n]
|
|
1159
1171
|
},
|
|
1160
|
-
|
|
1172
|
+
t.children
|
|
1161
1173
|
)
|
|
1162
1174
|
}
|
|
1163
1175
|
);
|
|
1164
|
-
},
|
|
1165
|
-
const { control: s } =
|
|
1176
|
+
}, fn = ({ defaultValue: e, rules: n, name: t, data: r, ...a }) => {
|
|
1177
|
+
const { control: s } = I();
|
|
1166
1178
|
return /* @__PURE__ */ c.createElement(
|
|
1167
|
-
|
|
1179
|
+
C,
|
|
1168
1180
|
{
|
|
1169
1181
|
control: s,
|
|
1170
|
-
rules:
|
|
1171
|
-
name:
|
|
1182
|
+
rules: n,
|
|
1183
|
+
name: t,
|
|
1172
1184
|
defaultValue: e ?? [],
|
|
1173
1185
|
render: ({ field: i, formState: { errors: o } }) => {
|
|
1174
1186
|
var m;
|
|
1175
1187
|
return /* @__PURE__ */ c.createElement(
|
|
1176
|
-
|
|
1188
|
+
ct,
|
|
1177
1189
|
{
|
|
1178
1190
|
...i,
|
|
1179
|
-
...
|
|
1180
|
-
isInvalid: !!o[
|
|
1191
|
+
...a,
|
|
1192
|
+
isInvalid: !!o[t]
|
|
1181
1193
|
},
|
|
1182
|
-
|
|
1183
|
-
!!o[
|
|
1194
|
+
r.map((d) => /* @__PURE__ */ c.createElement(Re, { ...d, key: d.value }, d.children)),
|
|
1195
|
+
!!o[t] && /* @__PURE__ */ c.createElement("div", { "data-slot": "error-message", className: "text-tiny text-danger w-full" }, o[t] ? (m = o[t]) == null ? void 0 : m.message : "")
|
|
1184
1196
|
);
|
|
1185
1197
|
}
|
|
1186
1198
|
}
|
|
1187
1199
|
);
|
|
1188
1200
|
};
|
|
1189
|
-
function
|
|
1201
|
+
function hn({
|
|
1190
1202
|
display: e = !1,
|
|
1203
|
+
onClose: n,
|
|
1191
1204
|
children: t,
|
|
1192
|
-
title:
|
|
1193
|
-
|
|
1194
|
-
cancelButton: r,
|
|
1205
|
+
title: r = "",
|
|
1206
|
+
cancelButton: a,
|
|
1195
1207
|
acceptButton: s,
|
|
1196
1208
|
...i
|
|
1197
1209
|
}) {
|
|
1198
|
-
|
|
1199
|
-
ne(() => {
|
|
1200
|
-
e && m();
|
|
1201
|
-
}, [e, m]);
|
|
1202
|
-
const f = () => {
|
|
1203
|
-
d(), a();
|
|
1204
|
-
}, p = async () => {
|
|
1205
|
-
s != null && s.onClick && (u(!0), await s.onClick(), u(!1));
|
|
1206
|
-
};
|
|
1207
|
-
return /* @__PURE__ */ c.createElement(dt, { isOpen: o, onOpenChange: f, ...i }, /* @__PURE__ */ c.createElement(ft, null, (h) => /* @__PURE__ */ c.createElement(c.Fragment, null, n && /* @__PURE__ */ c.createElement(ht, { className: "flex flex-col gap-1" }, n), /* @__PURE__ */ c.createElement(gt, null, t), /* @__PURE__ */ c.createElement(pt, null, r && /* @__PURE__ */ c.createElement(
|
|
1208
|
-
Q,
|
|
1209
|
-
{
|
|
1210
|
-
...r,
|
|
1211
|
-
isDisabled: l,
|
|
1212
|
-
onPress: () => {
|
|
1213
|
-
h(), a();
|
|
1214
|
-
}
|
|
1215
|
-
},
|
|
1216
|
-
(r == null ? void 0 : r.name) ?? "Cerrar"
|
|
1217
|
-
), s && /* @__PURE__ */ c.createElement(
|
|
1218
|
-
Q,
|
|
1219
|
-
{
|
|
1220
|
-
...s,
|
|
1221
|
-
isLoading: l,
|
|
1222
|
-
onPress: () => p()
|
|
1223
|
-
},
|
|
1224
|
-
s.name ?? "Aceptar"
|
|
1225
|
-
)))));
|
|
1210
|
+
return /* @__PURE__ */ c.createElement(ut, { isOpen: e, onOpenChange: n, ...i }, /* @__PURE__ */ c.createElement(mt, null, /* @__PURE__ */ c.createElement(dt, { className: "flex flex-col gap-1" }, r), /* @__PURE__ */ c.createElement(ft, null, t), /* @__PURE__ */ c.createElement(ht, null, a && /* @__PURE__ */ c.createElement(Q, { ...a, onPress: n }), s && /* @__PURE__ */ c.createElement(Q, { ...s }))));
|
|
1226
1211
|
}
|
|
1227
|
-
const
|
|
1228
|
-
const i =
|
|
1229
|
-
if (!i || !e || !
|
|
1212
|
+
const Ce = ({ value: e, context: n, name: t, range: r, rangeDate: a, type: s }) => {
|
|
1213
|
+
const i = n.parent[t];
|
|
1214
|
+
if (!i || !e || !r || r === 0 || !a) return !0;
|
|
1230
1215
|
const o = A(s == "min" ? i.toString() : e.toString()), m = A(s == "max" ? i.toString() : e.toString());
|
|
1231
1216
|
let d;
|
|
1232
|
-
switch (
|
|
1217
|
+
switch (a) {
|
|
1233
1218
|
case "days":
|
|
1234
|
-
d =
|
|
1219
|
+
d = Lt(o, m);
|
|
1235
1220
|
break;
|
|
1236
1221
|
case "months":
|
|
1237
|
-
d =
|
|
1222
|
+
d = ge(o, m);
|
|
1238
1223
|
break;
|
|
1239
1224
|
case "years":
|
|
1240
|
-
d =
|
|
1225
|
+
d = At(o, m);
|
|
1241
1226
|
break;
|
|
1242
1227
|
default:
|
|
1243
1228
|
d = 0;
|
|
1244
1229
|
break;
|
|
1245
1230
|
}
|
|
1246
|
-
return d <
|
|
1247
|
-
}, ee = ({ context: e, name:
|
|
1248
|
-
const
|
|
1249
|
-
if (!
|
|
1250
|
-
const s =
|
|
1251
|
-
return
|
|
1252
|
-
},
|
|
1253
|
-
if (!e || !
|
|
1254
|
-
let
|
|
1231
|
+
return d < r;
|
|
1232
|
+
}, ee = ({ context: e, name: n, type: t, value: r }) => {
|
|
1233
|
+
const a = e.parent[n];
|
|
1234
|
+
if (!a || !r) return !0;
|
|
1235
|
+
const s = r.compare(a);
|
|
1236
|
+
return t == "max" ? s >= 0 : s <= 0;
|
|
1237
|
+
}, G = ({ value: e, date: n, type: t }) => {
|
|
1238
|
+
if (!e || !n) return !0;
|
|
1239
|
+
let r, a;
|
|
1255
1240
|
try {
|
|
1256
|
-
|
|
1241
|
+
r = A(n), a = A(e.toString());
|
|
1257
1242
|
} catch {
|
|
1258
1243
|
return !1;
|
|
1259
1244
|
}
|
|
1260
|
-
if (
|
|
1261
|
-
const s =
|
|
1262
|
-
return
|
|
1263
|
-
},
|
|
1264
|
-
const i =
|
|
1265
|
-
if (!i || !e || !
|
|
1245
|
+
if (Rt(a, r)) return !0;
|
|
1246
|
+
const s = Ht(a, r);
|
|
1247
|
+
return t === "min" ? s : !s;
|
|
1248
|
+
}, Ye = ({ value: e, context: n, name: t, range: r, rangeDate: a, type: s }) => {
|
|
1249
|
+
const i = n.parent[t];
|
|
1250
|
+
if (!i || !e || !r || r === 0 || !a) return !0;
|
|
1266
1251
|
const o = e.toString(), m = i.toString(), d = A(s == "max" ? m : o, "HH:mm:ss"), l = A(s == "min" ? m : o, "HH:mm:ss");
|
|
1267
1252
|
let u = 0;
|
|
1268
|
-
return
|
|
1269
|
-
}, te = (e,
|
|
1253
|
+
return a === "hours" ? u = jt(l, d) : u = Vt(l, d), u < r;
|
|
1254
|
+
}, te = (e, n) => {
|
|
1270
1255
|
switch (e) {
|
|
1271
1256
|
case "days":
|
|
1272
|
-
return
|
|
1257
|
+
return n === 1 ? "El rango es de 1 dia" : `El rango es de ${n} dias`;
|
|
1273
1258
|
case "months":
|
|
1274
|
-
return
|
|
1259
|
+
return n === 1 ? "El rango es de 1 mes" : `El rango es de ${n} meses`;
|
|
1275
1260
|
case "years":
|
|
1276
|
-
return
|
|
1261
|
+
return n === 1 ? "El rango es de 1 año" : `El rango es de ${n} años`;
|
|
1277
1262
|
case "hours":
|
|
1278
|
-
return
|
|
1263
|
+
return n === 1 ? "El rango es de 1 hora" : `El rango es de ${n} horas`;
|
|
1279
1264
|
case "minutes":
|
|
1280
|
-
return
|
|
1265
|
+
return n === 1 ? "El rango es de 1 minuto" : `El rango es de ${n} minutos`;
|
|
1281
1266
|
default:
|
|
1282
1267
|
return "Custom Test";
|
|
1283
1268
|
}
|
|
1284
|
-
},
|
|
1269
|
+
}, _t = ({
|
|
1285
1270
|
endDate: e,
|
|
1286
|
-
startDate:
|
|
1287
|
-
range:
|
|
1288
|
-
type:
|
|
1289
|
-
maxEndDate:
|
|
1271
|
+
startDate: n,
|
|
1272
|
+
range: t = 0,
|
|
1273
|
+
type: r,
|
|
1274
|
+
maxEndDate: a,
|
|
1290
1275
|
maxStartDate: s,
|
|
1291
1276
|
minEndDate: i,
|
|
1292
1277
|
minStartDate: o
|
|
1293
1278
|
}) => {
|
|
1294
|
-
const m =
|
|
1279
|
+
const m = J().test(
|
|
1295
1280
|
"Menor",
|
|
1296
1281
|
"Este campo debe ser menor a la fecha final",
|
|
1297
1282
|
(l, u) => ee({ value: l, context: u, name: e, type: "min" })
|
|
1298
1283
|
).when([], {
|
|
1299
|
-
is:
|
|
1284
|
+
is: t && t > 0 && r,
|
|
1300
1285
|
then: (l) => l.test(
|
|
1301
1286
|
"Rango de tiempo",
|
|
1302
|
-
te(
|
|
1303
|
-
(u, f) =>
|
|
1287
|
+
te(r, t),
|
|
1288
|
+
(u, f) => Ce({
|
|
1304
1289
|
context: f,
|
|
1305
1290
|
value: u,
|
|
1306
|
-
range:
|
|
1291
|
+
range: t,
|
|
1307
1292
|
name: e,
|
|
1308
|
-
rangeDate:
|
|
1293
|
+
rangeDate: r,
|
|
1309
1294
|
type: "min"
|
|
1310
1295
|
})
|
|
1311
1296
|
)
|
|
@@ -1313,119 +1298,119 @@ const Ye = ({ value: e, context: t, name: n, range: a, rangeDate: r, type: s })
|
|
|
1313
1298
|
is: s,
|
|
1314
1299
|
then: (l) => l.test(
|
|
1315
1300
|
"Max Date",
|
|
1316
|
-
`Fecha maxima ${
|
|
1317
|
-
(u) =>
|
|
1301
|
+
`Fecha maxima ${Z(s, "DD/MM/YYYY")}`,
|
|
1302
|
+
(u) => G({ value: u, date: s, type: "max" })
|
|
1318
1303
|
)
|
|
1319
1304
|
}).when([], {
|
|
1320
1305
|
is: o,
|
|
1321
1306
|
then: (l) => l.test(
|
|
1322
1307
|
"Min Date",
|
|
1323
|
-
`Fecha minima ${
|
|
1324
|
-
(u) =>
|
|
1308
|
+
`Fecha minima ${Z(o, "DD/MM/YYYY")}`,
|
|
1309
|
+
(u) => G({ value: u, date: o, type: "min" })
|
|
1325
1310
|
)
|
|
1326
|
-
}), d =
|
|
1311
|
+
}), d = J().test(
|
|
1327
1312
|
"Mayor",
|
|
1328
1313
|
"Este campo debe ser mayor a la fecha inicial",
|
|
1329
|
-
(l, u) => ee({ value: l, context: u, name:
|
|
1314
|
+
(l, u) => ee({ value: l, context: u, name: n, type: "max" })
|
|
1330
1315
|
).when([], {
|
|
1331
|
-
is:
|
|
1316
|
+
is: t && t > 0 && r,
|
|
1332
1317
|
then: (l) => l.test(
|
|
1333
1318
|
"Rango de tiempo",
|
|
1334
|
-
te(
|
|
1335
|
-
(u, f) =>
|
|
1319
|
+
te(r, t),
|
|
1320
|
+
(u, f) => Ce({
|
|
1336
1321
|
context: f,
|
|
1337
1322
|
value: u,
|
|
1338
|
-
range:
|
|
1339
|
-
name:
|
|
1340
|
-
rangeDate:
|
|
1323
|
+
range: t,
|
|
1324
|
+
name: n,
|
|
1325
|
+
rangeDate: r,
|
|
1341
1326
|
type: "max"
|
|
1342
1327
|
})
|
|
1343
1328
|
)
|
|
1344
1329
|
}).when([], {
|
|
1345
|
-
is:
|
|
1330
|
+
is: a,
|
|
1346
1331
|
then: (l) => l.test(
|
|
1347
1332
|
"Max Date",
|
|
1348
|
-
`Fecha maxima ${
|
|
1349
|
-
(u) =>
|
|
1333
|
+
`Fecha maxima ${Z(a, "DD/MM/YYYY")}`,
|
|
1334
|
+
(u) => G({ value: u, date: a, type: "max" })
|
|
1350
1335
|
)
|
|
1351
1336
|
}).when([], {
|
|
1352
1337
|
is: i,
|
|
1353
1338
|
then: (l) => l.test(
|
|
1354
1339
|
"Min Date",
|
|
1355
|
-
`Fecha minima ${
|
|
1356
|
-
(u) =>
|
|
1340
|
+
`Fecha minima ${Z(i, "DD/MM/YYYY")}`,
|
|
1341
|
+
(u) => G({ value: u, date: i, type: "min" })
|
|
1357
1342
|
)
|
|
1358
1343
|
});
|
|
1359
1344
|
return { startDateRule: m, endDateRule: d };
|
|
1360
|
-
}, Ot = ({ minDate: e, maxDate:
|
|
1345
|
+
}, Ot = ({ minDate: e, maxDate: n }) => J().test(
|
|
1361
1346
|
"Min Date",
|
|
1362
|
-
`Fecha minima ${
|
|
1363
|
-
(
|
|
1347
|
+
`Fecha minima ${Z(e, "DD/MM/YYYY")}`,
|
|
1348
|
+
(t) => G({ value: t, date: e, type: "min" })
|
|
1364
1349
|
).test(
|
|
1365
1350
|
"Max Date",
|
|
1366
|
-
`Fecha maxima ${
|
|
1367
|
-
(
|
|
1368
|
-
),
|
|
1369
|
-
const
|
|
1351
|
+
`Fecha maxima ${Z(n, "DD/MM/YYYY")}`,
|
|
1352
|
+
(t) => G({ value: t, date: n, type: "max" })
|
|
1353
|
+
), zt = ({ endTime: e, startTime: n, range: t = 0, type: r }) => {
|
|
1354
|
+
const a = J().test(
|
|
1370
1355
|
"Menor",
|
|
1371
1356
|
"Este campo debe ser menor a la hora final",
|
|
1372
1357
|
(i, o) => ee({ value: i, context: o, name: e, type: "min" })
|
|
1373
1358
|
).when([], {
|
|
1374
|
-
is:
|
|
1359
|
+
is: t && t > 0 && r,
|
|
1375
1360
|
then: (i) => i.test(
|
|
1376
1361
|
"Rango de tiempo",
|
|
1377
|
-
te(
|
|
1378
|
-
(o, m) =>
|
|
1362
|
+
te(r, t),
|
|
1363
|
+
(o, m) => Ye({
|
|
1379
1364
|
value: o,
|
|
1380
1365
|
context: m,
|
|
1381
1366
|
name: e,
|
|
1382
1367
|
type: "min",
|
|
1383
|
-
range:
|
|
1384
|
-
rangeDate:
|
|
1368
|
+
range: t,
|
|
1369
|
+
rangeDate: r
|
|
1385
1370
|
})
|
|
1386
1371
|
)
|
|
1387
|
-
}), s =
|
|
1372
|
+
}), s = J().test(
|
|
1388
1373
|
"Mayor",
|
|
1389
1374
|
"Este campo debe ser mayor a la hora inicial",
|
|
1390
|
-
(i, o) => ee({ value: i, context: o, name:
|
|
1375
|
+
(i, o) => ee({ value: i, context: o, name: n, type: "max" })
|
|
1391
1376
|
).when([], {
|
|
1392
|
-
is:
|
|
1377
|
+
is: t && t > 0 && r,
|
|
1393
1378
|
then: (i) => i.test(
|
|
1394
1379
|
"Rango de tiempo",
|
|
1395
|
-
te(
|
|
1396
|
-
(o, m) =>
|
|
1380
|
+
te(r, t),
|
|
1381
|
+
(o, m) => Ye({
|
|
1397
1382
|
value: o,
|
|
1398
1383
|
context: m,
|
|
1399
|
-
name:
|
|
1384
|
+
name: n,
|
|
1400
1385
|
type: "max",
|
|
1401
|
-
range:
|
|
1402
|
-
rangeDate:
|
|
1386
|
+
range: t,
|
|
1387
|
+
rangeDate: r
|
|
1403
1388
|
})
|
|
1404
1389
|
)
|
|
1405
1390
|
});
|
|
1406
|
-
return { startTimeRule:
|
|
1407
|
-
},
|
|
1391
|
+
return { startTimeRule: a, endTimeRule: s };
|
|
1392
|
+
}, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1408
1393
|
__proto__: null,
|
|
1409
1394
|
dateMinMaxValidate: Ot,
|
|
1410
|
-
dualDateValidate:
|
|
1411
|
-
dualTimeValidate:
|
|
1395
|
+
dualDateValidate: _t,
|
|
1396
|
+
dualTimeValidate: zt
|
|
1412
1397
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1413
1398
|
export {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1399
|
+
Xt as DataTable,
|
|
1400
|
+
Kt as Layout,
|
|
1401
|
+
hn as Modal,
|
|
1402
|
+
en as Panel,
|
|
1403
|
+
un as RHFAutocomplete,
|
|
1404
|
+
dn as RHFCheckbox,
|
|
1405
|
+
fn as RHFCheckboxGroup,
|
|
1406
|
+
tn as RHFDate,
|
|
1407
|
+
nn as RHFDualDate,
|
|
1408
|
+
ln as RHFDualTime,
|
|
1409
|
+
rn as RHFInput,
|
|
1410
|
+
an as RHFInputOtp,
|
|
1411
|
+
mn as RHFRadioGroup,
|
|
1412
|
+
sn as RHFSelect,
|
|
1413
|
+
cn as RHFTextArea,
|
|
1414
|
+
on as RHFTime,
|
|
1415
|
+
gn as validation
|
|
1431
1416
|
};
|