react-ecosistema-unp 0.9.4 → 0.9.5
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 +15 -15
- package/package.json +1 -1
|
@@ -4,55 +4,55 @@ import '../../assets/Bootstrap.css';import '../../assets/Paginador.css';/* empty
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { C as g } from "../../Card-BXqmurzN.js";
|
|
6
6
|
import { B as o } from "../../Button-DMwpnJlD.js";
|
|
7
|
-
const j = ({ stepContent:
|
|
8
|
-
const [r,
|
|
7
|
+
const j = ({ stepContent: a, onSubmit: s, canJump: d = !0 }) => {
|
|
8
|
+
const [r, t] = u(0), l = p(null);
|
|
9
9
|
return h(() => {
|
|
10
10
|
l.current && r > 0 && l.current.scrollIntoView({
|
|
11
11
|
behavior: "smooth"
|
|
12
12
|
});
|
|
13
13
|
}, [r]), /* @__PURE__ */ c(m, { children: [
|
|
14
|
-
/* @__PURE__ */ i(g, { ref: l, className: "border-0 paginador-card", children: /* @__PURE__ */ i("ul", { id: "progressbar", children:
|
|
14
|
+
/* @__PURE__ */ i(g, { ref: l, className: "border-0 paginador-card", children: /* @__PURE__ */ i("ul", { id: "progressbar", children: a.map((n, e) => /* @__PURE__ */ c(
|
|
15
15
|
"li",
|
|
16
16
|
{
|
|
17
17
|
className: e <= r ? "active" : "",
|
|
18
18
|
onClick: () => {
|
|
19
|
-
d ? d &&
|
|
19
|
+
d ? d && t(e) : (e === r + 1 || e < r) && t(e);
|
|
20
20
|
},
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */ i("div", { className: `step ${e <= r ? "active" : ""}`, children: /* @__PURE__ */ i(
|
|
23
|
-
/* @__PURE__ */ i("strong", { children:
|
|
22
|
+
/* @__PURE__ */ i("div", { className: `step ${e <= r ? "active" : ""}`, children: /* @__PURE__ */ i(n.icon, { size: 18 }) }),
|
|
23
|
+
/* @__PURE__ */ i("strong", { children: n.label })
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
e
|
|
27
27
|
)) }) }),
|
|
28
|
-
/* @__PURE__ */ i("div", { className: "paginador-content", children:
|
|
28
|
+
/* @__PURE__ */ i("div", { className: "paginador-content", children: a[r].content }),
|
|
29
29
|
/* @__PURE__ */ c("div", { className: "paginador-buttons", style: { display: "flex", justifyContent: "end" }, children: [
|
|
30
30
|
r > 0 && /* @__PURE__ */ i(
|
|
31
31
|
o,
|
|
32
32
|
{
|
|
33
33
|
variant: "unp_secondary",
|
|
34
|
-
onClick: () =>
|
|
34
|
+
onClick: () => t(r - 1),
|
|
35
35
|
children: "Anterior"
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
r <
|
|
38
|
+
r < a.length - 1 && /* @__PURE__ */ i(
|
|
39
39
|
o,
|
|
40
40
|
{
|
|
41
41
|
variant: "unp_primary",
|
|
42
42
|
style: { justifySelf: "end", marginLeft: "1rem" },
|
|
43
|
-
onClick: () => {
|
|
44
|
-
const
|
|
43
|
+
onClick: async () => {
|
|
44
|
+
const n = a[r].handleNextClick;
|
|
45
45
|
let e = !0;
|
|
46
|
-
if (
|
|
47
|
-
const f =
|
|
46
|
+
if (n) {
|
|
47
|
+
const f = await n();
|
|
48
48
|
typeof f == "boolean" && (e = f);
|
|
49
49
|
}
|
|
50
|
-
e &&
|
|
50
|
+
e && t(r + 1);
|
|
51
51
|
},
|
|
52
52
|
children: "Siguiente"
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
|
-
r ===
|
|
55
|
+
r === a.length - 1 && s && /* @__PURE__ */ i(
|
|
56
56
|
o,
|
|
57
57
|
{
|
|
58
58
|
type: "submit",
|