react-ecosistema-unp 0.9.5 → 0.9.6
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/ui/paginador/Paginador.js +41 -33
- package/package.json +1 -1
|
@@ -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
|
};
|