react-ecosistema-unp 0.9.5 → 0.9.7
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.
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as s, Fragment as h, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useRef as g, useEffect as y } from "react";
|
|
3
3
|
import '../../assets/Bootstrap.css';import '../../assets/Paginador.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { C as
|
|
6
|
-
import { B as
|
|
7
|
-
const
|
|
8
|
-
const [
|
|
9
|
-
return
|
|
10
|
-
|
|
5
|
+
import { C as v } from "../../Card-BXqmurzN.js";
|
|
6
|
+
import { B as f } from "../../Button-DMwpnJlD.js";
|
|
7
|
+
const w = ({ stepContent: a, onSubmit: d, canJump: c = !0 }) => {
|
|
8
|
+
const [e, t] = p(0), o = g(null);
|
|
9
|
+
return y(() => {
|
|
10
|
+
o.current && e > 0 && o.current.scrollIntoView({
|
|
11
11
|
behavior: "smooth"
|
|
12
12
|
});
|
|
13
|
-
}, [
|
|
14
|
-
/* @__PURE__ */ i(
|
|
13
|
+
}, [e]), /* @__PURE__ */ s(h, { children: [
|
|
14
|
+
/* @__PURE__ */ i(v, { ref: o, className: "border-0 paginador-card", children: /* @__PURE__ */ i("ul", { id: "progressbar", children: a.map((l, r) => /* @__PURE__ */ s(
|
|
15
15
|
"li",
|
|
16
16
|
{
|
|
17
|
-
className:
|
|
18
|
-
onClick: () => {
|
|
19
|
-
|
|
17
|
+
className: r <= e ? "active" : "",
|
|
18
|
+
onClick: async () => {
|
|
19
|
+
if (a[e].handleNextClick && !c) {
|
|
20
|
+
const n = a[e].handleNextClick;
|
|
21
|
+
let u = !0;
|
|
22
|
+
if (n) {
|
|
23
|
+
const m = await n();
|
|
24
|
+
typeof m == "boolean" && (u = m);
|
|
25
|
+
}
|
|
26
|
+
u && t(e + 1);
|
|
27
|
+
} else c ? c && t(r) : (r === e + 1 || r < e) && t(r);
|
|
20
28
|
},
|
|
21
29
|
children: [
|
|
22
|
-
/* @__PURE__ */ i("div", { className: `step ${
|
|
23
|
-
/* @__PURE__ */ i("strong", { children:
|
|
30
|
+
/* @__PURE__ */ i("div", { className: `step ${r <= e ? "active" : ""}`, children: /* @__PURE__ */ i(l.icon, { size: 18 }) }),
|
|
31
|
+
/* @__PURE__ */ i("strong", { children: l.label })
|
|
24
32
|
]
|
|
25
33
|
},
|
|
26
|
-
|
|
34
|
+
r
|
|
27
35
|
)) }) }),
|
|
28
|
-
/* @__PURE__ */ i("div", { className: "paginador-content", children: a[
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
/* @__PURE__ */ i("div", { className: "paginador-content", children: a[e].content }),
|
|
37
|
+
/* @__PURE__ */ s("div", { className: "paginador-buttons", style: { display: "flex", justifyContent: "end" }, children: [
|
|
38
|
+
e > 0 && /* @__PURE__ */ i(
|
|
39
|
+
f,
|
|
32
40
|
{
|
|
33
41
|
variant: "unp_secondary",
|
|
34
|
-
onClick: () => t(
|
|
42
|
+
onClick: () => t(e - 1),
|
|
35
43
|
children: "Anterior"
|
|
36
44
|
}
|
|
37
45
|
),
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
e < a.length - 1 && /* @__PURE__ */ i(
|
|
47
|
+
f,
|
|
40
48
|
{
|
|
41
49
|
variant: "unp_primary",
|
|
42
50
|
style: { justifySelf: "end", marginLeft: "1rem" },
|
|
43
51
|
onClick: async () => {
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
typeof
|
|
52
|
+
const l = a[e].handleNextClick;
|
|
53
|
+
let r = !0;
|
|
54
|
+
if (l) {
|
|
55
|
+
const n = await l();
|
|
56
|
+
typeof n == "boolean" && (r = n);
|
|
49
57
|
}
|
|
50
|
-
|
|
58
|
+
r && t(e + 1);
|
|
51
59
|
},
|
|
52
60
|
children: "Siguiente"
|
|
53
61
|
}
|
|
54
62
|
),
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
e === a.length - 1 && d && /* @__PURE__ */ i(
|
|
64
|
+
f,
|
|
57
65
|
{
|
|
58
66
|
type: "submit",
|
|
59
67
|
variant: "unp_send",
|
|
60
|
-
onClick:
|
|
68
|
+
onClick: d,
|
|
61
69
|
style: { marginLeft: "1rem" },
|
|
62
70
|
children: "Enviar"
|
|
63
71
|
}
|
|
@@ -66,5 +74,5 @@ const j = ({ stepContent: a, onSubmit: s, canJump: d = !0 }) => {
|
|
|
66
74
|
] });
|
|
67
75
|
};
|
|
68
76
|
export {
|
|
69
|
-
|
|
77
|
+
w as Paginador
|
|
70
78
|
};
|
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as l, Fragment as f, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import t from "react";
|
|
3
3
|
import '../../assets/Bootstrap.css';import '../../assets/Tarjeta.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { C
|
|
6
|
-
import { C as
|
|
7
|
-
import { B as
|
|
8
|
-
const
|
|
5
|
+
import { C, a as j } from "../../Card-BXqmurzN.js";
|
|
6
|
+
import { C as S } from "../../CardBody-RoDe1y90.js";
|
|
7
|
+
import { B as b } from "../../Button-DMwpnJlD.js";
|
|
8
|
+
const g = {
|
|
9
9
|
marginBottom: "20px",
|
|
10
10
|
width: "100px"
|
|
11
|
-
},
|
|
11
|
+
}, V = ({
|
|
12
12
|
title: p,
|
|
13
13
|
children: s,
|
|
14
14
|
method: n,
|
|
15
|
-
|
|
15
|
+
validated: m = !1,
|
|
16
|
+
onSubmit: d
|
|
16
17
|
}) => {
|
|
17
|
-
const r =
|
|
18
|
-
(
|
|
19
|
-
),
|
|
20
|
-
isGray:
|
|
21
|
-
isLast:
|
|
22
|
-
}) :
|
|
23
|
-
return /* @__PURE__ */ l(
|
|
24
|
-
/* @__PURE__ */ l(
|
|
25
|
-
/* @__PURE__ */ a(
|
|
26
|
-
|
|
18
|
+
const r = t.Children.toArray(s), c = r[0] && t.isValidElement(r[0]) && r[0].type.displayName === "Subtitulo", i = r.filter(
|
|
19
|
+
(e) => t.isValidElement(e) && e.type.displayName === "SeccionTarjeta"
|
|
20
|
+
), y = i.length > 0, u = t.Children.map(s, (e, o) => t.isValidElement(e) && e.type.displayName === "SeccionTarjeta" ? t.cloneElement(e, {
|
|
21
|
+
isGray: e.props.isGray ?? o % 2 === 1,
|
|
22
|
+
isLast: e.props.isLast ?? o === i.length - 1
|
|
23
|
+
}) : e);
|
|
24
|
+
return /* @__PURE__ */ l(f, { children: [
|
|
25
|
+
/* @__PURE__ */ l(C, { className: "border-0 mb-4 tarjeta-unp", children: [
|
|
26
|
+
/* @__PURE__ */ a(j, { className: "d-flex justify-content-between align-items-center bg-unp text-light py-3 tarjeta-header-unp", children: p }),
|
|
27
|
+
/* @__PURE__ */ a(
|
|
28
|
+
"form",
|
|
29
|
+
{
|
|
30
|
+
method: n,
|
|
31
|
+
noValidate: !0,
|
|
32
|
+
className: m ? "was-validated" : "",
|
|
33
|
+
children: y ? u : /* @__PURE__ */ a(S, { className: `${c ? "pt-0" : ""}`, children: s })
|
|
34
|
+
}
|
|
35
|
+
)
|
|
27
36
|
] }),
|
|
28
|
-
n === "POST" || n === "post" && /* @__PURE__ */ a("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ a(
|
|
37
|
+
n === "POST" || n === "post" && /* @__PURE__ */ a("div", { style: { display: "flex", justifyContent: "end" }, children: /* @__PURE__ */ a(b, { variant: "unp_send", style: g, onClick: d, children: "Enviar" }) })
|
|
29
38
|
] });
|
|
30
39
|
};
|
|
31
40
|
export {
|
|
32
|
-
|
|
41
|
+
V as Tarjeta
|
|
33
42
|
};
|