osocna-react-tailwind 0.1.26 → 0.1.28
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/index.js +95 -89
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as G, jsx as u, Fragment as WA } from "react/jsx-runtime";
|
|
2
2
|
import nA, { useState as k, useEffect as cA, createContext as Vt, useCallback as YA, useMemo as dt, useContext as re, useRef as ie } from "react";
|
|
3
3
|
import Ut from "osocna-shared/OsocnaProvider";
|
|
4
|
-
import { promiseMapper as OA, apiClient as CA, setApiClientTokenProvider as ht, useAsyncRequest as MA, Card as kA, Collection as BA, Filter as bA, DataTable as ne, DropdownMenu as se, DropdownPanel as Kt, Avatar as St, Button as SA, useCrud as Ft, Loader as GA, Dialog as ZA, Input as
|
|
4
|
+
import { promiseMapper as OA, apiClient as CA, setApiClientTokenProvider as ht, useAsyncRequest as MA, Card as kA, Collection as BA, Filter as bA, DataTable as ne, DropdownMenu as se, DropdownPanel as Kt, Avatar as St, Button as SA, useCrud as Ft, Loader as GA, Dialog as ZA, Input as Tt, Checkbox as Lt, CrudProvider as Ot } from "flysoft-react-ui";
|
|
5
5
|
import { useInRouterContext as ae, MemoryRouter as fe, useSearchParams as ve } from "react-router-dom";
|
|
6
6
|
import { ResponsiveContainer as ue, BarChart as de, CartesianGrid as oe, XAxis as ge, YAxis as Ee, Tooltip as ce, Legend as le, Bar as mA } from "recharts";
|
|
7
7
|
import Jt from "osocna-shared/OsocnaContext";
|
|
@@ -38,11 +38,17 @@ const Yt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArwAAAVsCAYAAADaI07iAA
|
|
|
38
38
|
{
|
|
39
39
|
className: "w-24 h-24 mt-14 border border-[#9e0054] rounded-full",
|
|
40
40
|
style: {
|
|
41
|
+
width: "96px",
|
|
42
|
+
height: "96px",
|
|
43
|
+
marginTop: "56px",
|
|
44
|
+
border: "1px solid #9e0054",
|
|
45
|
+
borderRadius: "50%",
|
|
41
46
|
backgroundImage: `url(${/*foto ??*/
|
|
42
47
|
gt})`,
|
|
43
48
|
backgroundRepeat: "no-repeat",
|
|
44
49
|
backgroundSize: "cover",
|
|
45
|
-
backgroundPosition: "center"
|
|
50
|
+
backgroundPosition: "center",
|
|
51
|
+
flexShrink: 0
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
),
|
|
@@ -220,7 +226,7 @@ var Et = { exports: {} };
|
|
|
220
226
|
(function(A, i) {
|
|
221
227
|
e.exports = i();
|
|
222
228
|
})(jt, function() {
|
|
223
|
-
var A = 1e3, i = 6e4, v = 36e5, n = "millisecond", f = "second", d = "minute", F = "hour", K = "day", z = "week", x = "month", q = "quarter", X = "year",
|
|
229
|
+
var A = 1e3, i = 6e4, v = 36e5, n = "millisecond", f = "second", d = "minute", F = "hour", K = "day", z = "week", x = "month", q = "quarter", X = "year", L = "date", w = "Invalid Date", J = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, W = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, V = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(C) {
|
|
224
230
|
var c = ["th", "st", "nd", "rd"], E = C % 100;
|
|
225
231
|
return "[" + C + (c[(E - 20) % 10] || c[E] || c[0]) + "]";
|
|
226
232
|
} }, $ = function(C, c, E) {
|
|
@@ -236,7 +242,7 @@ var Et = { exports: {} };
|
|
|
236
242
|
}, a: function(C) {
|
|
237
243
|
return C < 0 ? Math.ceil(C) || 0 : Math.floor(C);
|
|
238
244
|
}, p: function(C) {
|
|
239
|
-
return { M: x, y: X, w: z, d: K, D:
|
|
245
|
+
return { M: x, y: X, w: z, d: K, D: L, h: F, m: d, s: f, ms: n, Q: q }[C] || String(C || "").toLowerCase().replace(/s$/, "");
|
|
240
246
|
}, u: function(C) {
|
|
241
247
|
return C === void 0;
|
|
242
248
|
} }, H = "en", O = {};
|
|
@@ -256,13 +262,13 @@ var Et = { exports: {} };
|
|
|
256
262
|
O[m] = c, I = m;
|
|
257
263
|
}
|
|
258
264
|
return !B && I && (H = I), I || !B && H;
|
|
259
|
-
},
|
|
265
|
+
}, T = function(C, c) {
|
|
260
266
|
if (M(C)) return C.clone();
|
|
261
267
|
var E = typeof c == "object" ? c : {};
|
|
262
268
|
return E.date = C, E.args = arguments, new h(E);
|
|
263
269
|
}, S = o;
|
|
264
270
|
S.l = sA, S.i = M, S.w = function(C, c) {
|
|
265
|
-
return
|
|
271
|
+
return T(C, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
|
|
266
272
|
};
|
|
267
273
|
var h = function() {
|
|
268
274
|
function C(E) {
|
|
@@ -292,12 +298,12 @@ var Et = { exports: {} };
|
|
|
292
298
|
}, c.isValid = function() {
|
|
293
299
|
return this.$d.toString() !== w;
|
|
294
300
|
}, c.isSame = function(E, B) {
|
|
295
|
-
var I =
|
|
301
|
+
var I = T(E);
|
|
296
302
|
return this.startOf(B) <= I && I <= this.endOf(B);
|
|
297
303
|
}, c.isAfter = function(E, B) {
|
|
298
|
-
return
|
|
304
|
+
return T(E) < this.startOf(B);
|
|
299
305
|
}, c.isBefore = function(E, B) {
|
|
300
|
-
return this.endOf(B) <
|
|
306
|
+
return this.endOf(B) < T(E);
|
|
301
307
|
}, c.$g = function(E, B, I) {
|
|
302
308
|
return S.u(E) ? this[B] : this.set(I, E);
|
|
303
309
|
}, c.unix = function() {
|
|
@@ -320,7 +326,7 @@ var Et = { exports: {} };
|
|
|
320
326
|
var DA = this.$locale().weekStart || 0, HA = (_ < DA ? _ + 7 : _) - DA;
|
|
321
327
|
return m(b ? vA - HA : vA + (6 - HA), tA);
|
|
322
328
|
case K:
|
|
323
|
-
case
|
|
329
|
+
case L:
|
|
324
330
|
return N(XA + "Hours", 0);
|
|
325
331
|
case F:
|
|
326
332
|
return N(XA + "Minutes", 1);
|
|
@@ -334,10 +340,10 @@ var Et = { exports: {} };
|
|
|
334
340
|
}, c.endOf = function(E) {
|
|
335
341
|
return this.startOf(E, !1);
|
|
336
342
|
}, c.$set = function(E, B) {
|
|
337
|
-
var I, b = S.p(E), p = "set" + (this.$u ? "UTC" : ""), m = (I = {}, I[K] = p + "Date", I[
|
|
343
|
+
var I, b = S.p(E), p = "set" + (this.$u ? "UTC" : ""), m = (I = {}, I[K] = p + "Date", I[L] = p + "Date", I[x] = p + "Month", I[X] = p + "FullYear", I[F] = p + "Hours", I[d] = p + "Minutes", I[f] = p + "Seconds", I[n] = p + "Milliseconds", I)[b], N = b === K ? this.$D + (B - this.$W) : B;
|
|
338
344
|
if (b === x || b === X) {
|
|
339
|
-
var _ = this.clone().set(
|
|
340
|
-
_.$d[m](N), _.init(), this.$d = _.set(
|
|
345
|
+
var _ = this.clone().set(L, 1);
|
|
346
|
+
_.$d[m](N), _.init(), this.$d = _.set(L, Math.min(this.$D, _.daysInMonth())).$d;
|
|
341
347
|
} else m && this.$d[m](N);
|
|
342
348
|
return this.init(), this;
|
|
343
349
|
}, c.set = function(E, B) {
|
|
@@ -348,7 +354,7 @@ var Et = { exports: {} };
|
|
|
348
354
|
var I, b = this;
|
|
349
355
|
E = Number(E);
|
|
350
356
|
var p = S.p(B), m = function(tA) {
|
|
351
|
-
var vA =
|
|
357
|
+
var vA = T(b);
|
|
352
358
|
return S.w(vA.date(vA.date() + Math.round(tA * E)), b);
|
|
353
359
|
};
|
|
354
360
|
if (p === x) return this.set(x, this.$M + E);
|
|
@@ -428,7 +434,7 @@ var Et = { exports: {} };
|
|
|
428
434
|
}, c.utcOffset = function() {
|
|
429
435
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
430
436
|
}, c.diff = function(E, B, I) {
|
|
431
|
-
var b, p = this, m = S.p(B), N =
|
|
437
|
+
var b, p = this, m = S.p(B), N = T(E), _ = (N.utcOffset() - this.utcOffset()) * i, tA = this - N, vA = function() {
|
|
432
438
|
return S.m(p, N);
|
|
433
439
|
};
|
|
434
440
|
switch (m) {
|
|
@@ -480,15 +486,15 @@ var Et = { exports: {} };
|
|
|
480
486
|
return this.$d.toUTCString();
|
|
481
487
|
}, C;
|
|
482
488
|
}(), Y = h.prototype;
|
|
483
|
-
return
|
|
489
|
+
return T.prototype = Y, [["$ms", n], ["$s", f], ["$m", d], ["$H", F], ["$W", K], ["$M", x], ["$y", X], ["$D", L]].forEach(function(C) {
|
|
484
490
|
Y[C[1]] = function(c) {
|
|
485
491
|
return this.$g(c, C[0], C[1]);
|
|
486
492
|
};
|
|
487
|
-
}),
|
|
488
|
-
return C.$i || (C(c, h,
|
|
489
|
-
},
|
|
490
|
-
return
|
|
491
|
-
},
|
|
493
|
+
}), T.extend = function(C, c) {
|
|
494
|
+
return C.$i || (C(c, h, T), C.$i = !0), T;
|
|
495
|
+
}, T.locale = sA, T.isDayjs = M, T.unix = function(C) {
|
|
496
|
+
return T(1e3 * C);
|
|
497
|
+
}, T.en = O[H], T.Ls = O, T.p = {}, T;
|
|
492
498
|
});
|
|
493
499
|
})(Et);
|
|
494
500
|
var Zt = Et.exports;
|
|
@@ -559,7 +565,7 @@ const Ke = () => ({
|
|
|
559
565
|
startDate: A.startDate ? lA(A.startDate) : void 0,
|
|
560
566
|
endDate: A.endDate ? lA(A.endDate) : void 0,
|
|
561
567
|
lastUpdate: A.lastUpdate ? lA(A.lastUpdate) : void 0,
|
|
562
|
-
origin: A.origin ?
|
|
568
|
+
origin: A.origin ? Le().mapFromDto(A.origin) : void 0,
|
|
563
569
|
familyGroup: A.familyGroup ? Ke().mapFromDto(A.familyGroup) : void 0,
|
|
564
570
|
relationship: A.relationship ? Ye().mapFromDto(A.relationship) : void 0,
|
|
565
571
|
beneficiaryType: A.beneficiaryType ? qe().mapFromDto(A.beneficiaryType) : void 0,
|
|
@@ -570,20 +576,20 @@ const Ke = () => ({
|
|
|
570
576
|
startDate: A.startDate ? A.startDate.toISOString() : void 0,
|
|
571
577
|
endDate: A.endDate ? A.endDate.toISOString() : void 0,
|
|
572
578
|
lastUpdate: A.lastUpdate ? A.lastUpdate.toISOString() : void 0,
|
|
573
|
-
origin: A.origin ?
|
|
579
|
+
origin: A.origin ? Le().mapToDto(A.origin) : void 0,
|
|
574
580
|
familyGroup: A.familyGroup ? Ke().mapToDto(A.familyGroup) : void 0,
|
|
575
581
|
relationship: A.relationship ? Ye().mapToDto(A.relationship) : void 0,
|
|
576
582
|
beneficiaryType: A.beneficiaryType ? qe().mapToDto(A.beneficiaryType) : void 0,
|
|
577
583
|
credential: A.credential ? Ve().mapToDto(A.credential) : void 0
|
|
578
584
|
})
|
|
579
|
-
}),
|
|
585
|
+
}), Te = () => ({
|
|
580
586
|
mapFromDto: (A) => ({
|
|
581
587
|
...A
|
|
582
588
|
}),
|
|
583
589
|
mapToDto: (A) => ({
|
|
584
590
|
...A
|
|
585
591
|
})
|
|
586
|
-
}),
|
|
592
|
+
}), Le = () => ({
|
|
587
593
|
mapFromDto: (A) => ({
|
|
588
594
|
...A
|
|
589
595
|
}),
|
|
@@ -599,7 +605,7 @@ const Ke = () => ({
|
|
|
599
605
|
lastUpdate: A.lastUpdate ? lA(A.lastUpdate) : void 0,
|
|
600
606
|
maritalStatus: A.maritalStatus ? Se().mapFromDto(A.maritalStatus) : void 0,
|
|
601
607
|
membership: A.membership ? Fe().mapFromDto(A.membership) : void 0,
|
|
602
|
-
nationality: A.nationality ?
|
|
608
|
+
nationality: A.nationality ? Te().mapFromDto(A.nationality) : void 0,
|
|
603
609
|
phone: A.phone ? Oe().mapFromDto(A.phone) : void 0,
|
|
604
610
|
emails: A.emails ? A.emails.map((i) => he().mapFromDto(i)) : void 0
|
|
605
611
|
}),
|
|
@@ -612,7 +618,7 @@ const Ke = () => ({
|
|
|
612
618
|
lastUpdate: A.lastUpdate ? A.lastUpdate.toString() : void 0,
|
|
613
619
|
maritalStatus: A.maritalStatus ? Se().mapToDto(A.maritalStatus) : void 0,
|
|
614
620
|
membership: A.membership ? Fe().mapToDto(A.membership) : void 0,
|
|
615
|
-
nationality: A.nationality ?
|
|
621
|
+
nationality: A.nationality ? Te().mapToDto(A.nationality) : void 0,
|
|
616
622
|
phone: A.phone ? Oe().mapToDto(A.phone) : void 0
|
|
617
623
|
})
|
|
618
624
|
}), Oe = () => ({
|
|
@@ -725,7 +731,7 @@ const Ke = () => ({
|
|
|
725
731
|
children: A,
|
|
726
732
|
oidcConfig: i
|
|
727
733
|
}) => {
|
|
728
|
-
const [v, n] = k(e), [f, d] = k(""), [F, K] = k(null), [z, x] = k([]), [q, X] = k(void 0),
|
|
734
|
+
const [v, n] = k(e), [f, d] = k(""), [F, K] = k(null), [z, x] = k([]), [q, X] = k(void 0), L = YA((o) => {
|
|
729
735
|
n(o);
|
|
730
736
|
}, []), w = YA((o) => {
|
|
731
737
|
d(o);
|
|
@@ -740,12 +746,12 @@ const Ke = () => ({
|
|
|
740
746
|
});
|
|
741
747
|
}, V = dt(
|
|
742
748
|
() => ({
|
|
743
|
-
setAppTitle:
|
|
749
|
+
setAppTitle: L,
|
|
744
750
|
setTabTitle: w,
|
|
745
751
|
setAppHeaderTools: J,
|
|
746
752
|
getCareLevels: W
|
|
747
753
|
}),
|
|
748
|
-
[
|
|
754
|
+
[L, w, J]
|
|
749
755
|
), $ = YA(
|
|
750
756
|
(o) => {
|
|
751
757
|
X(o), ht(() => o?.token?.token);
|
|
@@ -782,7 +788,7 @@ const Ke = () => ({
|
|
|
782
788
|
n.get(`${f}periodoHasta`) || ye()
|
|
783
789
|
),
|
|
784
790
|
nivelDeAtencion: n.get(`${f}nivelDeAtencion`) || ""
|
|
785
|
-
}), [K, z] = k([]), { getCareLevels: x } = re(Ie), [q, X] = k([]), [
|
|
791
|
+
}), [K, z] = k([]), { getCareLevels: x } = re(Ie), [q, X] = k([]), [L, w] = k([]), J = ie(""), W = MA({
|
|
786
792
|
errorMessage: "Error al cargar las afiliaciones por período y nivel de atención"
|
|
787
793
|
});
|
|
788
794
|
cA(() => {
|
|
@@ -813,10 +819,10 @@ const Ke = () => ({
|
|
|
813
819
|
name: U
|
|
814
820
|
};
|
|
815
821
|
return H.forEach((sA) => {
|
|
816
|
-
const
|
|
822
|
+
const T = K.find(
|
|
817
823
|
(S) => S.periodo === U && S.idNivelDeAtencion === sA.id
|
|
818
824
|
);
|
|
819
|
-
M[`plan-${sA.id}`] =
|
|
825
|
+
M[`plan-${sA.id}`] = T ? T.cantidadAfiliados : 0;
|
|
820
826
|
}), M;
|
|
821
827
|
});
|
|
822
828
|
}, $ = async (o) => {
|
|
@@ -915,7 +921,7 @@ const Ke = () => ({
|
|
|
915
921
|
/* @__PURE__ */ u(Ee, {}),
|
|
916
922
|
/* @__PURE__ */ u(ce, {}),
|
|
917
923
|
/* @__PURE__ */ u(le, {}),
|
|
918
|
-
|
|
924
|
+
L.map((o, H) => /* @__PURE__ */ u(
|
|
919
925
|
mA,
|
|
920
926
|
{
|
|
921
927
|
dataKey: `plan-${o.id}`,
|
|
@@ -946,7 +952,7 @@ const Ke = () => ({
|
|
|
946
952
|
rows: V(),
|
|
947
953
|
columns: [
|
|
948
954
|
{ header: "Periodo", value: (o) => o.name },
|
|
949
|
-
...
|
|
955
|
+
...L.map((o) => ({
|
|
950
956
|
header: o.name || `Plan ${o.id}`,
|
|
951
957
|
align: "right",
|
|
952
958
|
value: (H) => H[`plan-${o.id}`]
|
|
@@ -982,7 +988,7 @@ const Ke = () => ({
|
|
|
982
988
|
nivelDeAtencion: n.get(`${f}nivelDeAtencion`) || ""
|
|
983
989
|
}), [K, z] = k(
|
|
984
990
|
[]
|
|
985
|
-
), { getCareLevels: x } = re(Ie), [q, X] = k([]), [
|
|
991
|
+
), { getCareLevels: x } = re(Ie), [q, X] = k([]), [L, w] = k([]), J = ie(""), W = MA({
|
|
986
992
|
errorMessage: "Error al obtener las afiliaciones vigentes por periodo"
|
|
987
993
|
});
|
|
988
994
|
cA(() => {
|
|
@@ -1013,10 +1019,10 @@ const Ke = () => ({
|
|
|
1013
1019
|
name: U
|
|
1014
1020
|
};
|
|
1015
1021
|
return H.forEach((sA) => {
|
|
1016
|
-
const
|
|
1022
|
+
const T = K.find(
|
|
1017
1023
|
(S) => S.periodo === U && S.idNivelDeAtencion === sA.id
|
|
1018
1024
|
);
|
|
1019
|
-
M[`plan-${sA.id}`] =
|
|
1025
|
+
M[`plan-${sA.id}`] = T ? T.cantidadAfiliados : 0;
|
|
1020
1026
|
}), M;
|
|
1021
1027
|
});
|
|
1022
1028
|
}, $ = async (o) => {
|
|
@@ -1115,7 +1121,7 @@ const Ke = () => ({
|
|
|
1115
1121
|
/* @__PURE__ */ u(Ee, {}),
|
|
1116
1122
|
/* @__PURE__ */ u(ce, {}),
|
|
1117
1123
|
/* @__PURE__ */ u(le, {}),
|
|
1118
|
-
|
|
1124
|
+
L.map((o, H) => /* @__PURE__ */ u(
|
|
1119
1125
|
mA,
|
|
1120
1126
|
{
|
|
1121
1127
|
dataKey: `plan-${o.id}`,
|
|
@@ -1146,7 +1152,7 @@ const Ke = () => ({
|
|
|
1146
1152
|
rows: V(),
|
|
1147
1153
|
columns: [
|
|
1148
1154
|
{ header: "Periodo", value: (o) => o.name },
|
|
1149
|
-
...
|
|
1155
|
+
...L.map((o) => ({
|
|
1150
1156
|
header: o.name || `Plan ${o.id}`,
|
|
1151
1157
|
align: "right",
|
|
1152
1158
|
value: (H) => H[`plan-${o.id}`]
|
|
@@ -1201,7 +1207,7 @@ const Ke = () => ({
|
|
|
1201
1207
|
const X = async (w, J) => {
|
|
1202
1208
|
const W = await q.execute(() => nr({ periodoDesde: w, periodoHasta: J }));
|
|
1203
1209
|
W && A(W);
|
|
1204
|
-
},
|
|
1210
|
+
}, L = t.map((w) => ({ ...w, period: String(w.period) }));
|
|
1205
1211
|
return /* @__PURE__ */ u(WA, { children: /* @__PURE__ */ u(
|
|
1206
1212
|
kA,
|
|
1207
1213
|
{
|
|
@@ -1251,7 +1257,7 @@ const Ke = () => ({
|
|
|
1251
1257
|
children: /* @__PURE__ */ u(ue, { width: "100%", height: "100%", children: /* @__PURE__ */ G(
|
|
1252
1258
|
de,
|
|
1253
1259
|
{
|
|
1254
|
-
data:
|
|
1260
|
+
data: L,
|
|
1255
1261
|
className: "focus:outline-none",
|
|
1256
1262
|
style: { outline: "none" },
|
|
1257
1263
|
margin: { top: 20, right: 30, left: 20, bottom: 5 },
|
|
@@ -1271,7 +1277,7 @@ const Ke = () => ({
|
|
|
1271
1277
|
ne,
|
|
1272
1278
|
{
|
|
1273
1279
|
compact: !0,
|
|
1274
|
-
rows:
|
|
1280
|
+
rows: L,
|
|
1275
1281
|
columns: [
|
|
1276
1282
|
{ header: "Periodo", value: (w) => w.period, align: "left" },
|
|
1277
1283
|
{ header: "Procesados", value: (w) => w.processed, align: "right" },
|
|
@@ -1434,7 +1440,7 @@ function wA(e, t, A = /* @__PURE__ */ new WeakSet()) {
|
|
|
1434
1440
|
const It = nA.createContext(null);
|
|
1435
1441
|
It.displayName = "HookFormContext";
|
|
1436
1442
|
const gr = (e) => {
|
|
1437
|
-
const { children: t, watch: A, getValues: i, getFieldState: v, setError: n, clearErrors: f, setValue: d, trigger: F, formState: K, resetField: z, reset: x, handleSubmit: q, unregister: X, control:
|
|
1443
|
+
const { children: t, watch: A, getValues: i, getFieldState: v, setError: n, clearErrors: f, setValue: d, trigger: F, formState: K, resetField: z, reset: x, handleSubmit: q, unregister: X, control: L, register: w, setFocus: J, subscribe: W } = e;
|
|
1438
1444
|
return nA.createElement(
|
|
1439
1445
|
It.Provider,
|
|
1440
1446
|
{ value: nA.useMemo(() => ({
|
|
@@ -1450,13 +1456,13 @@ const gr = (e) => {
|
|
|
1450
1456
|
reset: x,
|
|
1451
1457
|
handleSubmit: q,
|
|
1452
1458
|
unregister: X,
|
|
1453
|
-
control:
|
|
1459
|
+
control: L,
|
|
1454
1460
|
register: w,
|
|
1455
1461
|
setFocus: J,
|
|
1456
1462
|
subscribe: W
|
|
1457
1463
|
}), [
|
|
1458
1464
|
f,
|
|
1459
|
-
|
|
1465
|
+
L,
|
|
1460
1466
|
K,
|
|
1461
1467
|
v,
|
|
1462
1468
|
i,
|
|
@@ -1472,7 +1478,7 @@ const gr = (e) => {
|
|
|
1472
1478
|
X,
|
|
1473
1479
|
A
|
|
1474
1480
|
]) },
|
|
1475
|
-
nA.createElement(lt.Provider, { value:
|
|
1481
|
+
nA.createElement(lt.Provider, { value: L }, t)
|
|
1476
1482
|
);
|
|
1477
1483
|
};
|
|
1478
1484
|
var Er = (e, t, A, i, v) => t ? {
|
|
@@ -1481,7 +1487,7 @@ var Er = (e, t, A, i, v) => t ? {
|
|
|
1481
1487
|
...A[e] && A[e].types ? A[e].types : {},
|
|
1482
1488
|
[i]: v || !0
|
|
1483
1489
|
}
|
|
1484
|
-
} : {},
|
|
1490
|
+
} : {}, TA = (e) => Array.isArray(e) ? e : [e], At = () => {
|
|
1485
1491
|
let e = [];
|
|
1486
1492
|
return {
|
|
1487
1493
|
get observers() {
|
|
@@ -1615,7 +1621,7 @@ var Br = (e, t, A, i) => {
|
|
|
1615
1621
|
});
|
|
1616
1622
|
const st = "AsyncFunction";
|
|
1617
1623
|
var Cr = (e) => !!e && !!e.validate && !!(gA(e.validate) && e.validate.constructor.name === st || eA(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === st)), Xr = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), at = (e, t, A) => !A && (t.watchAll || t.watch.has(e) || [...t.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
|
|
1618
|
-
const
|
|
1624
|
+
const LA = (e, t, A, i) => {
|
|
1619
1625
|
for (const v of A || Object.keys(e)) {
|
|
1620
1626
|
const n = D(e, v);
|
|
1621
1627
|
if (n) {
|
|
@@ -1625,9 +1631,9 @@ const TA = (e, t, A, i) => {
|
|
|
1625
1631
|
return !0;
|
|
1626
1632
|
if (f.ref && t(f.ref, f.name) && !i)
|
|
1627
1633
|
return !0;
|
|
1628
|
-
if (
|
|
1634
|
+
if (LA(d, t))
|
|
1629
1635
|
break;
|
|
1630
|
-
} else if (eA(d) &&
|
|
1636
|
+
} else if (eA(d) && LA(d, t))
|
|
1631
1637
|
break;
|
|
1632
1638
|
}
|
|
1633
1639
|
}
|
|
@@ -1664,8 +1670,8 @@ var Dr = (e, t, A, i) => {
|
|
|
1664
1670
|
A(e);
|
|
1665
1671
|
const { name: v, ...n } = e;
|
|
1666
1672
|
return fA(n) || Object.keys(n).length >= Object.keys(t).length || Object.keys(n).find((f) => t[f] === (!i || EA.all));
|
|
1667
|
-
}, Hr = (e, t, A) => !e || !t || e === t ||
|
|
1668
|
-
const i =
|
|
1673
|
+
}, Hr = (e, t, A) => !e || !t || e === t || TA(e).some((i) => i && (A ? i === t : i.startsWith(t) || t.startsWith(i))), Pr = (e, t, A, i, v) => v.isOnAll ? !1 : !A && v.isOnTouch ? !(t || e) : (A ? i.isOnBlur : v.isOnBlur) ? !e : (A ? i.isOnChange : v.isOnChange) ? e : !0, xr = (e, t) => !Be(D(e, t)).length && AA(e, t), wr = (e, t, A) => {
|
|
1674
|
+
const i = TA(D(e, A));
|
|
1669
1675
|
return j(i, "root", t[A]), j(e, A, i), e;
|
|
1670
1676
|
};
|
|
1671
1677
|
function vt(e, t, A = "validate") {
|
|
@@ -1680,18 +1686,18 @@ var hA = (e) => eA(e) && !yA(e) ? e : {
|
|
|
1680
1686
|
value: e,
|
|
1681
1687
|
message: ""
|
|
1682
1688
|
}, ut = async (e, t, A, i, v, n) => {
|
|
1683
|
-
const { ref: f, refs: d, required: F, maxLength: K, minLength: z, min: x, max: q, pattern: X, validate:
|
|
1689
|
+
const { ref: f, refs: d, required: F, maxLength: K, minLength: z, min: x, max: q, pattern: X, validate: L, name: w, valueAsNumber: J, mount: W } = e._f, V = D(A, w);
|
|
1684
1690
|
if (!W || t.has(w))
|
|
1685
1691
|
return {};
|
|
1686
1692
|
const $ = d ? d[0] : f, o = (h) => {
|
|
1687
1693
|
v && $.reportValidity && ($.setCustomValidity(QA(h) ? "" : h || ""), $.reportValidity());
|
|
1688
|
-
}, H = {}, O = De(f), U = JA(f), M = O || U, sA = (J || Xe(f)) && Z(f.value) && Z(V) || RA(f) && f.value === "" || V === "" || Array.isArray(V) && !V.length,
|
|
1694
|
+
}, H = {}, O = De(f), U = JA(f), M = O || U, sA = (J || Xe(f)) && Z(f.value) && Z(V) || RA(f) && f.value === "" || V === "" || Array.isArray(V) && !V.length, T = Er.bind(null, w, i, H), S = (h, Y, C, c = PA.maxLength, E = PA.minLength) => {
|
|
1689
1695
|
const B = h ? Y : C;
|
|
1690
1696
|
H[w] = {
|
|
1691
1697
|
type: h ? c : E,
|
|
1692
1698
|
message: B,
|
|
1693
1699
|
ref: f,
|
|
1694
|
-
...
|
|
1700
|
+
...T(h ? c : E, B)
|
|
1695
1701
|
};
|
|
1696
1702
|
};
|
|
1697
1703
|
if (n ? !Array.isArray(V) || !V.length : F && (!M && (sA || uA(V)) || QA(V) && !V || U && !Xt(d).isValid || O && !Ht(d).isValid)) {
|
|
@@ -1700,7 +1706,7 @@ var hA = (e) => eA(e) && !yA(e) ? e : {
|
|
|
1700
1706
|
type: PA.required,
|
|
1701
1707
|
message: Y,
|
|
1702
1708
|
ref: $,
|
|
1703
|
-
...
|
|
1709
|
+
...T(PA.required, Y)
|
|
1704
1710
|
}, !i))
|
|
1705
1711
|
return o(Y), H;
|
|
1706
1712
|
}
|
|
@@ -1728,27 +1734,27 @@ var hA = (e) => eA(e) && !yA(e) ? e : {
|
|
|
1728
1734
|
type: PA.pattern,
|
|
1729
1735
|
message: Y,
|
|
1730
1736
|
ref: f,
|
|
1731
|
-
...
|
|
1737
|
+
...T(PA.pattern, Y)
|
|
1732
1738
|
}, !i))
|
|
1733
1739
|
return o(Y), H;
|
|
1734
1740
|
}
|
|
1735
|
-
if (
|
|
1736
|
-
if (gA(
|
|
1737
|
-
const h = await
|
|
1741
|
+
if (L) {
|
|
1742
|
+
if (gA(L)) {
|
|
1743
|
+
const h = await L(V, A), Y = vt(h, $);
|
|
1738
1744
|
if (Y && (H[w] = {
|
|
1739
1745
|
...Y,
|
|
1740
|
-
...
|
|
1746
|
+
...T(PA.validate, Y.message)
|
|
1741
1747
|
}, !i))
|
|
1742
1748
|
return o(Y.message), H;
|
|
1743
|
-
} else if (eA(
|
|
1749
|
+
} else if (eA(L)) {
|
|
1744
1750
|
let h = {};
|
|
1745
|
-
for (const Y in
|
|
1751
|
+
for (const Y in L) {
|
|
1746
1752
|
if (!fA(h) && !i)
|
|
1747
1753
|
break;
|
|
1748
|
-
const C = vt(await
|
|
1754
|
+
const C = vt(await L[Y](V, A), $, Y);
|
|
1749
1755
|
C && (h = {
|
|
1750
1756
|
...C,
|
|
1751
|
-
...
|
|
1757
|
+
...T(Y, C.message)
|
|
1752
1758
|
}, o(C.message), i && (H[w] = h));
|
|
1753
1759
|
}
|
|
1754
1760
|
if (!fA(h) && (H[w] = {
|
|
@@ -1813,12 +1819,12 @@ function pr(e = {}) {
|
|
|
1813
1819
|
const X = {
|
|
1814
1820
|
array: At(),
|
|
1815
1821
|
state: At()
|
|
1816
|
-
},
|
|
1822
|
+
}, L = t.criteriaMode === EA.all, w = (r) => (s) => {
|
|
1817
1823
|
clearTimeout(K), K = setTimeout(r, s);
|
|
1818
1824
|
}, J = async (r) => {
|
|
1819
1825
|
if (!f.keepIsValid && !t.disabled && (x.isValid || q.isValid || r)) {
|
|
1820
1826
|
let s;
|
|
1821
|
-
t.resolver ? (s = fA((await M()).errors), W()) : s = await
|
|
1827
|
+
t.resolver ? (s = fA((await M()).errors), W()) : s = await T(i, !0), s !== A.isValid && X.state.next({
|
|
1822
1828
|
isValid: s
|
|
1823
1829
|
});
|
|
1824
1830
|
}
|
|
@@ -1909,7 +1915,7 @@ function pr(e = {}) {
|
|
|
1909
1915
|
else
|
|
1910
1916
|
A.errors = s;
|
|
1911
1917
|
return s;
|
|
1912
|
-
},
|
|
1918
|
+
}, T = async (r, s, a = {
|
|
1913
1919
|
valid: !0
|
|
1914
1920
|
}) => {
|
|
1915
1921
|
for (const Q in r) {
|
|
@@ -1919,12 +1925,12 @@ function pr(e = {}) {
|
|
|
1919
1925
|
if (g) {
|
|
1920
1926
|
const R = d.array.has(g.name), y = l._f && Cr(l._f);
|
|
1921
1927
|
y && x.validatingFields && W([g.name], !0);
|
|
1922
|
-
const aA = await ut(l, d.disabled, n,
|
|
1928
|
+
const aA = await ut(l, d.disabled, n, L, t.shouldUseNativeValidation && !s, R);
|
|
1923
1929
|
if (y && x.validatingFields && W([g.name]), aA[g.name] && (a.valid = !1, s || e.shouldUseNativeValidation))
|
|
1924
1930
|
break;
|
|
1925
1931
|
!s && (D(aA, g.name) ? R ? wr(A.errors, aA, g.name) : j(A.errors, g.name, aA[g.name]) : AA(A.errors, g.name));
|
|
1926
1932
|
}
|
|
1927
|
-
!fA(P) && await
|
|
1933
|
+
!fA(P) && await T(P, s, a);
|
|
1928
1934
|
}
|
|
1929
1935
|
}
|
|
1930
1936
|
return a.valid;
|
|
@@ -1998,7 +2004,7 @@ function pr(e = {}) {
|
|
|
1998
2004
|
y = be.error, a = be.name, aA = fA(we);
|
|
1999
2005
|
}
|
|
2000
2006
|
} else
|
|
2001
|
-
W([a], !0), y = (await ut(l, d.disabled, n,
|
|
2007
|
+
W([a], !0), y = (await ut(l, d.disabled, n, L, t.shouldUseNativeValidation))[a], W([a]), g(VA), Q && (y ? aA = !1 : (x.isValid || q.isValid) && (aA = await T(i, !0)));
|
|
2002
2008
|
Q && (l._f.deps && (!Array.isArray(l._f.deps) || l._f.deps.length > 0) && p(l._f.deps), U(a, aA, y, jA));
|
|
2003
2009
|
}
|
|
2004
2010
|
}, b = (r, s) => {
|
|
@@ -2006,19 +2012,19 @@ function pr(e = {}) {
|
|
|
2006
2012
|
return r.focus(), 1;
|
|
2007
2013
|
}, p = async (r, s = {}) => {
|
|
2008
2014
|
let a, Q;
|
|
2009
|
-
const l =
|
|
2015
|
+
const l = TA(r);
|
|
2010
2016
|
if (t.resolver) {
|
|
2011
2017
|
const g = await sA(Z(r) ? r : l);
|
|
2012
2018
|
a = fA(g), Q = r ? !l.some((P) => D(g, P)) : a;
|
|
2013
2019
|
} else r ? (Q = (await Promise.all(l.map(async (g) => {
|
|
2014
2020
|
const P = D(i, g);
|
|
2015
|
-
return await
|
|
2016
|
-
}))).every(Boolean), !(!Q && !A.isValid) && J()) : Q = a = await
|
|
2021
|
+
return await T(P && P._f ? { [g]: P } : P);
|
|
2022
|
+
}))).every(Boolean), !(!Q && !A.isValid) && J()) : Q = a = await T(i);
|
|
2017
2023
|
return X.state.next({
|
|
2018
2024
|
...!dA(r) || (x.isValid || q.isValid) && a !== A.isValid ? {} : { name: r },
|
|
2019
2025
|
...t.resolver || !r ? { isValid: a } : {},
|
|
2020
2026
|
errors: A.errors
|
|
2021
|
-
}), s.shouldFocus && !Q &&
|
|
2027
|
+
}), s.shouldFocus && !Q && LA(i, b, r ? l : d.mount), Q;
|
|
2022
2028
|
}, m = (r, s) => {
|
|
2023
2029
|
let a = {
|
|
2024
2030
|
...f.mount ? n : v
|
|
@@ -2031,7 +2037,7 @@ function pr(e = {}) {
|
|
|
2031
2037
|
isValidating: !!D(A.validatingFields, r),
|
|
2032
2038
|
isTouched: !!D((s || A).touchedFields, r)
|
|
2033
2039
|
}), _ = (r) => {
|
|
2034
|
-
r &&
|
|
2040
|
+
r && TA(r).forEach((s) => AA(A.errors, s)), X.state.next({
|
|
2035
2041
|
errors: r ? A.errors : {}
|
|
2036
2042
|
});
|
|
2037
2043
|
}, tA = (r, s, a) => {
|
|
@@ -2066,7 +2072,7 @@ function pr(e = {}) {
|
|
|
2066
2072
|
...r.formState
|
|
2067
2073
|
}
|
|
2068
2074
|
})), HA = (r, s = {}) => {
|
|
2069
|
-
for (const a of r ?
|
|
2075
|
+
for (const a of r ? TA(r) : d.mount)
|
|
2070
2076
|
d.mount.delete(a), d.array.delete(a), s.keepValue || (AA(i, a), AA(n, a)), !s.keepError && AA(A.errors, a), !s.keepDirty && AA(A.dirtyFields, a), !s.keepTouched && AA(A.touchedFields, a), !s.keepIsValidating && AA(A.validatingFields, a), !t.shouldUnregister && !s.keepDefaultValue && AA(v, a);
|
|
2071
2077
|
X.state.next({
|
|
2072
2078
|
values: rA(n)
|
|
@@ -2129,8 +2135,8 @@ function pr(e = {}) {
|
|
|
2129
2135
|
a = D(i, r, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || s.shouldUnregister) && !(fr(d.array, r) && f.action) && d.unMount.add(r);
|
|
2130
2136
|
}
|
|
2131
2137
|
};
|
|
2132
|
-
}, oA = () => t.shouldFocusError &&
|
|
2133
|
-
QA(r) && (X.state.next({ disabled: r }),
|
|
2138
|
+
}, oA = () => t.shouldFocusError && LA(i, b, d.mount), pA = (r) => {
|
|
2139
|
+
QA(r) && (X.state.next({ disabled: r }), LA(i, (s, a) => {
|
|
2134
2140
|
const Q = D(i, a);
|
|
2135
2141
|
Q && (s.disabled = Q._f.disabled || r, Array.isArray(Q._f.refs) && Q._f.refs.forEach((l) => {
|
|
2136
2142
|
l.disabled = Q._f.disabled || r;
|
|
@@ -2146,7 +2152,7 @@ function pr(e = {}) {
|
|
|
2146
2152
|
const { errors: g, values: P } = await M();
|
|
2147
2153
|
W(), A.errors = g, l = rA(P);
|
|
2148
2154
|
} else
|
|
2149
|
-
await
|
|
2155
|
+
await T(i);
|
|
2150
2156
|
if (d.disabled.size)
|
|
2151
2157
|
for (const g of d.disabled)
|
|
2152
2158
|
AA(l, g);
|
|
@@ -2395,7 +2401,7 @@ const Vr = () => {
|
|
|
2395
2401
|
const { list: e, updateItem: t, fetchItems: A } = Ft(), [i, v] = k(!1), [n, f] = k(!1), [d, F] = k(!1), [K, z] = k(), [
|
|
2396
2402
|
x,
|
|
2397
2403
|
q
|
|
2398
|
-
] = k(!1), X = qr(),
|
|
2404
|
+
] = k(!1), X = qr(), L = dt(
|
|
2399
2405
|
() => e?.filter((o) => o.destacada) || [],
|
|
2400
2406
|
[e]
|
|
2401
2407
|
), w = MA({
|
|
@@ -2403,8 +2409,8 @@ const Vr = () => {
|
|
|
2403
2409
|
errorMessage: "Error al archivar notificación"
|
|
2404
2410
|
});
|
|
2405
2411
|
cA(() => {
|
|
2406
|
-
|
|
2407
|
-
}, [
|
|
2412
|
+
L?.length > 0 && !x && (q(!0), v(!0));
|
|
2413
|
+
}, [L]), cA(() => {
|
|
2408
2414
|
K && X.reset(K);
|
|
2409
2415
|
}, [K]);
|
|
2410
2416
|
const J = (o) => {
|
|
@@ -2437,7 +2443,7 @@ const Vr = () => {
|
|
|
2437
2443
|
isOpen: i,
|
|
2438
2444
|
onClose: () => v(!1),
|
|
2439
2445
|
title: "Notificaciones Críticas",
|
|
2440
|
-
children: /* @__PURE__ */ u(BA, { children:
|
|
2446
|
+
children: /* @__PURE__ */ u(BA, { children: L?.map((o) => /* @__PURE__ */ u(
|
|
2441
2447
|
$e,
|
|
2442
2448
|
{
|
|
2443
2449
|
notificacion: o,
|
|
@@ -2468,7 +2474,7 @@ const Vr = () => {
|
|
|
2468
2474
|
] }),
|
|
2469
2475
|
children: /* @__PURE__ */ G(BA, { children: [
|
|
2470
2476
|
/* @__PURE__ */ u(
|
|
2471
|
-
|
|
2477
|
+
Tt,
|
|
2472
2478
|
{
|
|
2473
2479
|
label: "Notificación",
|
|
2474
2480
|
...X.register("mensaje", {
|
|
@@ -2478,7 +2484,7 @@ const Vr = () => {
|
|
|
2478
2484
|
}
|
|
2479
2485
|
),
|
|
2480
2486
|
/* @__PURE__ */ u(
|
|
2481
|
-
|
|
2487
|
+
Lt,
|
|
2482
2488
|
{
|
|
2483
2489
|
label: "Destacada",
|
|
2484
2490
|
...X.register("destacada")
|
|
@@ -2567,8 +2573,8 @@ export {
|
|
|
2567
2573
|
Gr as ListadoNotificacionesGrupoFamiliarCRUD,
|
|
2568
2574
|
Se as MaritalStatusMapper,
|
|
2569
2575
|
Fe as MembershipMapper,
|
|
2570
|
-
|
|
2571
|
-
|
|
2576
|
+
Te as NationalityMapper,
|
|
2577
|
+
Le as OriginMapper,
|
|
2572
2578
|
Ie as OsocnaAppContext,
|
|
2573
2579
|
kr as OsocnaAppProvider,
|
|
2574
2580
|
yr as PersonMapper,
|