energy-components 1.10.0 → 1.10.1

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,7 +1,7 @@
1
- import { defineComponent as g, toRefs as h, ref as y, watchEffect as C, onMounted as L, createElementBlock as c, openBlock as l, Fragment as I, renderList as w, normalizeClass as x, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as T, createCommentVNode as D } from "vue";
1
+ import { defineComponent as g, toRefs as h, ref as C, watchEffect as y, onMounted as L, createElementBlock as c, openBlock as l, Fragment as I, renderList as w, normalizeClass as x, unref as B, createVNode as j, mergeProps as E, toHandlers as P, withCtx as T, createCommentVNode as D } from "vue";
2
2
  import N from "./link.es.js";
3
3
  import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
4
+ import './style/breadcrumbs.css';const R = { key: 0 }, S = /* @__PURE__ */ g({
5
5
  __name: "breadcrumbs",
6
6
  props: {
7
7
  /**
@@ -28,14 +28,14 @@ import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
28
28
  },
29
29
  emits: ["onClickTrimmedList"],
30
30
  setup(d, { emit: p }) {
31
- const s = d, f = p, {
32
- items: t,
31
+ const t = d, f = p, {
32
+ items: s,
33
33
  inverse: o
34
- } = h(s), n = y(), v = () => {
35
- f("onClickTrimmedList", t.value.slice(1, -1));
36
- }, m = () => {
34
+ } = h(t), n = C(), m = () => {
35
+ f("onClickTrimmedList", s.value.slice(1, -1));
36
+ }, v = () => {
37
37
  n.value = [
38
- t.value[0],
38
+ s.value[0],
39
39
  {
40
40
  text: "...",
41
41
  active: !1,
@@ -43,29 +43,31 @@ import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
43
43
  to: "",
44
44
  clickable: !0
45
45
  },
46
- t.value[t.value.length - 1]
46
+ s.value[s.value.length - 1]
47
47
  ];
48
48
  }, u = () => {
49
- s.trimItems && t.value.length > 3 ? m() : typeof s.items == "object" ? n.value = s.items : console.error("energy-components: The prop is not an Object");
50
- }, b = (e, a) => {
49
+ t.trimItems && s.value.length > 3 ? v() : typeof t.items == "object" ? n.value = t.items : console.error("energy-components: The prop is not an Object");
50
+ }, _ = (e, a) => {
51
51
  const r = {
52
52
  ...e,
53
- inverse: o.value
53
+ inverse: o.value,
54
+ customClass: "rds-e-breadcrumbs__link--text"
54
55
  };
55
56
  return a !== n.value.length - 1 && Object.assign(r, {
56
57
  arrow: !0,
57
- right: !0
58
+ right: !0,
59
+ arrowSmall: !0
58
60
  }), r;
59
- }, _ = (e) => ({
61
+ }, b = (e) => ({
60
62
  click: (r) => {
61
- r.preventDefault(), r.stopPropagation(), e != null && e.clickable && v();
63
+ r.preventDefault(), r.stopPropagation(), e != null && e.clickable && m();
62
64
  }
63
65
  }), k = (e) => [
64
66
  "rds-e-breadcrumbs__link",
65
67
  e != null && e.active ? "rds-e-breadcrumbs__link--active" : "",
66
68
  o.value && (e != null && e.active) ? "rds-e-breadcrumbs__link--inverse-active" : ""
67
69
  ];
68
- return C(() => {
70
+ return y(() => {
69
71
  u();
70
72
  }), L(() => {
71
73
  u();
@@ -75,7 +77,7 @@ import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
75
77
  }, [
76
78
  j(N, E({
77
79
  class: k(r)
78
- }, { ref_for: !0 }, b(r, i), P(_(r))), {
80
+ }, { ref_for: !0 }, _(r, i), P(b(r))), {
79
81
  default: T(() => [
80
82
  r != null && r.clickable ? (l(), c("span", R, "...")) : D("", !0)
81
83
  ]),
@@ -83,7 +85,7 @@ import './style/breadcrumbs.css';const R = { key: 0 }, V = /* @__PURE__ */ g({
83
85
  }, 1040, ["class"])
84
86
  ], 2))), 128));
85
87
  }
86
- }), F = /* @__PURE__ */ O(V, [["__scopeId", "data-v-f9b5ced9"]]);
88
+ }), A = /* @__PURE__ */ O(S, [["__scopeId", "data-v-696e4937"]]);
87
89
  export {
88
- F as default
90
+ A as default
89
91
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as B, toRefs as S, computed as l, createElementBlock as x, openBlock as b, normalizeClass as m, unref as o, createBlock as I, createCommentVNode as k, createElementVNode as $, renderSlot as C, createTextVNode as N, toDisplayString as R } from "vue";
2
- import { R as V } from "./icon-svg-DuzOdbk1.js";
3
- import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-btn__text" }, w = /* @__PURE__ */ B({
1
+ import { defineComponent as S, toRefs as x, computed as r, createElementBlock as I, openBlock as b, normalizeClass as m, unref as s, createBlock as $, createCommentVNode as k, createElementVNode as C, renderSlot as N, createTextVNode as R, toDisplayString as V } from "vue";
2
+ import { R as D } from "./icon-svg-DuzOdbk1.js";
3
+ import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/button.css';const L = ["type", "disabled"], w = { class: "rds-e-btn__text" }, W = /* @__PURE__ */ S({
5
5
  __name: "button",
6
6
  props: {
7
7
  /**
@@ -10,8 +10,8 @@ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-
10
10
  text: {
11
11
  type: String,
12
12
  default: "",
13
- validator(e, t) {
14
- return !e && !t.icon ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
13
+ validator(t, a) {
14
+ return !t && !a.icon ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
15
15
  }
16
16
  },
17
17
  /**
@@ -20,8 +20,8 @@ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-
20
20
  icon: {
21
21
  type: String,
22
22
  default: "",
23
- validator(e, t) {
24
- return !e && !t.text ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
23
+ validator(t, a) {
24
+ return !t && !a.text ? (console.info("No se han pasado ni texto ni icono al botón"), !1) : !0;
25
25
  }
26
26
  },
27
27
  /**
@@ -32,11 +32,11 @@ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-
32
32
  type: {
33
33
  type: String,
34
34
  default: "button",
35
- validator(e) {
36
- const t = ["button", "submit", "reset"].includes(e);
37
- return t || console.info(
38
- `El tipo ${e} no es válido. Los tipos válidos son: button, submit, reset`
39
- ), t;
35
+ validator(t) {
36
+ const a = ["button", "submit", "reset"].includes(t);
37
+ return a || console.info(
38
+ `El tipo ${t} no es válido. Los tipos válidos son: button, submit, reset`
39
+ ), a;
40
40
  }
41
41
  },
42
42
  /**
@@ -47,11 +47,11 @@ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-
47
47
  variant: {
48
48
  type: String,
49
49
  default: "primary",
50
- validator(e) {
51
- const t = ["primary", "secondary", "ghost", "commercial"].includes(e);
52
- return t || console.info(
53
- `La variante ${e} no es válida. Las variantes válidas son: primary, secondary, ghost, commercial`
54
- ), t;
50
+ validator(t) {
51
+ const a = ["primary", "secondary", "ghost", "commercial"].includes(t);
52
+ return a || console.info(
53
+ `La variante ${t} no es válida. Las variantes válidas son: primary, secondary, ghost, commercial`
54
+ ), a;
55
55
  }
56
56
  },
57
57
  /**
@@ -95,49 +95,57 @@ import './style/button.css';const E = ["type", "disabled"], L = { class: "rds-e-
95
95
  loading: {
96
96
  type: Boolean,
97
97
  default: !1
98
+ },
99
+ /**
100
+ * <span>Indica si el botón es destructivo (solo para variantes 'secondary' y 'ghost')</span>
101
+ */
102
+ destructive: {
103
+ type: Boolean,
104
+ default: !1
98
105
  }
99
106
  },
100
- setup(e) {
101
- const t = e, {
102
- text: s,
107
+ setup(t) {
108
+ const a = t, {
109
+ text: l,
103
110
  icon: n,
104
- type: r,
105
- variant: i,
106
- small: f,
107
- disabled: u,
111
+ type: i,
112
+ variant: u,
113
+ small: p,
114
+ disabled: d,
108
115
  mobileWidth: y,
109
- inverse: d,
110
- revertIcon: _,
111
- loading: p
112
- } = S(t), c = l(() => p.value ? "loading" : n != null && n.value ? n == null ? void 0 : n.value : ""), h = l(() => r.value && ["button", "submit", "reset"].includes(r.value) ? r.value : "button"), v = l(() => ["primary", "secondary", "ghost", "commercial"].includes(i.value) ? i.value : "primary"), g = l(() => {
113
- const a = ["rds-e-btn"];
114
- return i.value && a.push(`rds-e-btn--${v.value}`), d.value && a.push(`rds-e-btn--${v.value}-inverse`), c.value && a.push(
115
- s != null && s.value ? "rds-e-btn--with-icon" : "rds-e-btn--icon"
116
- ), f.value && a.push("rds-e-btn--small"), _.value && a.push("rds-e-btn--revert"), u.value && a.push("rds-e-style-state-disabled"), p.value && a.push("rds-e-btn--loading"), y.value && a.push("rds-e-btn--mobile-width"), a.join(" ");
116
+ inverse: c,
117
+ revertIcon: h,
118
+ loading: v,
119
+ destructive: _
120
+ } = x(a), f = r(() => v.value ? "loading" : n != null && n.value ? n == null ? void 0 : n.value : ""), g = r(() => i.value && ["button", "submit", "reset"].includes(i.value) ? i.value : "button"), o = r(() => ["primary", "secondary", "ghost", "commercial"].includes(u.value) ? u.value : "primary"), B = r(() => {
121
+ const e = ["rds-e-btn"];
122
+ return u.value && e.push(`rds-e-btn--${o.value}`), c.value && e.push(`rds-e-btn--${o.value}-inverse`), f.value && e.push(
123
+ l != null && l.value ? "rds-e-btn--with-icon" : "rds-e-btn--icon"
124
+ ), p.value && e.push("rds-e-btn--small"), h.value && e.push("rds-e-btn--revert"), d.value && e.push("rds-e-style-state-disabled"), v.value && e.push("rds-e-btn--loading"), y.value && e.push("rds-e-btn--mobile-width"), _.value && (o.value === "secondary" || o.value === "ghost") && e.push(`rds-e-btn--${o.value}-destructive`), e.join(" ");
117
125
  });
118
- return (a, W) => (b(), x("button", {
119
- type: h.value,
120
- disabled: o(u),
121
- class: m(g.value)
126
+ return (e, j) => (b(), I("button", {
127
+ type: g.value,
128
+ disabled: s(d),
129
+ class: m(B.value)
122
130
  }, [
123
- c.value ? (b(), I(V, {
131
+ f.value ? (b(), $(D, {
124
132
  key: 0,
125
- name: c.value,
126
- small: o(f),
133
+ name: f.value,
134
+ small: s(p),
127
135
  class: m(["rds-e-btn__icon", [
128
- o(d) ? `rds-e-btn__icon--${o(d)}` : "",
129
- o(u) ? "rds-e-btn__icon--disabled" : ""
136
+ s(c) ? `rds-e-btn__icon--${s(c)}` : "",
137
+ s(d) ? "rds-e-btn__icon--disabled" : ""
130
138
  ]]),
131
139
  "aria-hidden": "true"
132
140
  }, null, 8, ["name", "small", "class"])) : k("", !0),
133
- $("span", L, [
134
- C(a.$slots, "default", {}, () => [
135
- N(R(o(s)), 1)
141
+ C("span", w, [
142
+ N(e.$slots, "default", {}, () => [
143
+ R(V(s(l)), 1)
136
144
  ], !0)
137
145
  ])
138
- ], 10, E));
146
+ ], 10, L));
139
147
  }
140
- }), T = /* @__PURE__ */ D(w, [["__scopeId", "data-v-ad01f4e1"]]);
148
+ }), q = /* @__PURE__ */ E(W, [["__scopeId", "data-v-9550b6cc"]]);
141
149
  export {
142
- T as default
150
+ q as default
143
151
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as E, toRefs as L, computed as c, createBlock as p, openBlock as o, resolveDynamicComponent as N, unref as e, normalizeStyle as V, normalizeClass as _, withCtx as $, createCommentVNode as i, createElementBlock as b, mergeProps as k, renderSlot as B, createTextVNode as I, toDisplayString as D } from "vue";
1
+ import { defineComponent as L, toRefs as N, computed as f, createBlock as p, openBlock as s, resolveDynamicComponent as V, unref as e, normalizeStyle as $, normalizeClass as _, withCtx as M, createCommentVNode as d, createElementBlock as I, mergeProps as k, renderSlot as D, createTextVNode as R, toDisplayString as j } from "vue";
2
2
  import { R as v } from "./icon-svg-DuzOdbk1.js";
3
- import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/link.css';const O = /* @__PURE__ */ E({
3
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/link.css';const P = /* @__PURE__ */ L({
5
5
  __name: "link",
6
6
  props: {
7
7
  /**
@@ -23,7 +23,7 @@ import './style/link.css';const O = /* @__PURE__ */ E({
23
23
  icon: {
24
24
  type: Object,
25
25
  default: () => ({ name: "", modifier: "" }),
26
- validator: (s) => typeof s.name == "string" && (s.modifier === void 0 || typeof s.modifier == "string") ? !0 : (console.error("El icono debe tener una propiedad name de tipo string y una propiedad modifier opcional de tipo string"), !1)
26
+ validator: (o) => typeof o.name == "string" && (o.modifier === void 0 || typeof o.modifier == "string") ? !0 : (console.error("El icono debe tener una propiedad name de tipo string y una propiedad modifier opcional de tipo string"), !1)
27
27
  },
28
28
  /**
29
29
  * <span>Tag del link</span>
@@ -60,6 +60,13 @@ import './style/link.css';const O = /* @__PURE__ */ E({
60
60
  type: Boolean,
61
61
  default: !1
62
62
  },
63
+ /**
64
+ * <span>Indica si la flecha del link debe ser pequeña</span>
65
+ */
66
+ arrowSmall: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
63
70
  /**
64
71
  * <span>Indica si el icono esta a la derecha</span>
65
72
  */
@@ -82,42 +89,45 @@ import './style/link.css';const O = /* @__PURE__ */ E({
82
89
  default: ""
83
90
  }
84
91
  },
85
- setup(s) {
86
- const y = s, {
87
- text: g,
88
- to: w,
92
+ setup(o) {
93
+ const y = o, {
94
+ text: w,
95
+ to: g,
89
96
  icon: r,
90
97
  tag: u,
91
- disabled: f,
98
+ disabled: i,
92
99
  inverse: m,
93
- arrow: d,
100
+ arrow: c,
94
101
  right: t,
95
102
  underline: h,
96
- customClass: R,
97
- color: l
98
- } = L(y), j = c(() => l.value ? { color: l.value } : void 0), z = c(() => {
99
- var n, C;
103
+ customClass: b,
104
+ color: l,
105
+ arrowSmall: x
106
+ } = N(y), z = f(() => l.value ? { color: l.value } : void 0), E = f(() => {
107
+ var n, B;
100
108
  const a = ["rds-e-link"];
101
- return m.value && a.push("rds-e-link--inverse"), h.value && a.push("rds-e-link--underline"), f.value && a.push("rds-e-style-state-disabled"), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && a.push("rds-e-arrow-link"), ((C = r == null ? void 0 : r.value) == null ? void 0 : C.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.join(" ");
102
- }), S = c(() => {
109
+ return m.value && a.push("rds-e-link--inverse"), h.value && a.push("rds-e-link--underline"), i.value && a.push("rds-e-style-state-disabled"), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && a.push("rds-e-arrow-link"), ((B = r == null ? void 0 : r.value) == null ? void 0 : B.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), b.value === "rds-e-breadcrumbs__link--text" && a.push("rds-e-link__breadcrumbs"), a.join(" ");
110
+ }), S = f(() => {
103
111
  var n;
104
112
  const a = ["rds-e-arrow-link__icon--arrow"];
105
- return r != null && r.value && (a.push("rds-e-arrow-link__icon"), f.value && a.push("rds-e-arrow-link__icon--disabled")), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.push(
113
+ return r != null && r.value && (a.push("rds-e-arrow-link__icon"), i.value && a.push("rds-e-arrow-link__icon--disabled")), ((n = r == null ? void 0 : r.value) == null ? void 0 : n.name) !== "arrow" && m.value && a.push("rds-e-arrow-link__icon--inverse"), a.push(
106
114
  t.value ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
107
115
  ), a.join(" ");
108
- }), x = c(() => {
116
+ }), C = f(() => {
109
117
  var a;
110
- return d.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
118
+ return c.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
111
119
  });
112
- return (a, n) => (o(), p(N(e(u) === "a" ? e(u) : "router-link"), {
113
- class: _(z.value),
114
- to: e(u) === "router-link" ? e(w) : null,
115
- href: e(u) === "a" ? e(w) : null,
116
- disable: e(f),
117
- style: V(j.value)
120
+ return (a, n) => (s(), p(V(e(u) === "a" ? e(u) : "router-link"), {
121
+ class: _(E.value),
122
+ to: e(u) === "router-link" ? e(g) : null,
123
+ href: e(u) === "a" ? e(g) : null,
124
+ disable: e(i),
125
+ style: $(z.value),
126
+ tabindex: e(i) ? -1 : void 0,
127
+ "aria-disabled": e(i)
118
128
  }, {
119
- default: $(() => [
120
- e(r).name && !e(t) && !e(d) ? (o(), p(v, k({
129
+ default: M(() => [
130
+ e(r).name && !e(t) && !e(c) ? (s(), p(v, k({
121
131
  key: 0,
122
132
  name: e(r).name
123
133
  }, {
@@ -125,46 +135,48 @@ import './style/link.css';const O = /* @__PURE__ */ E({
125
135
  }, {
126
136
  class: ["rds-e-link__icon-left", S.value],
127
137
  style: e(l) ? { color: e(l) } : void 0
128
- }), null, 16, ["name", "class", "style"])) : i("", !0),
129
- e(t) ? (o(), b("span", {
138
+ }), null, 16, ["name", "class", "style"])) : d("", !0),
139
+ e(t) ? (s(), I("span", {
130
140
  key: 1,
131
- class: _(["rds-e-link__text", [e(R), {
132
- "rds-e-mr-xs": x.value,
141
+ class: _(["rds-e-link__text", [e(b), {
142
+ "rds-e-mr-xs": C.value,
133
143
  "rds-e-link__text--underline": e(h)
134
144
  }]])
135
145
  }, [
136
- B(a.$slots, "default", {}, () => [
137
- I(D(e(g)), 1)
146
+ D(a.$slots, "default", {}, () => [
147
+ R(j(e(w)), 1)
138
148
  ], !0)
139
- ], 2)) : i("", !0),
140
- e(d) ? (o(), p(v, k({ key: 2 }, {
141
- name: e(t) ? "arrow_right" : "arrow_left"
149
+ ], 2)) : d("", !0),
150
+ e(c) ? (s(), p(v, k({ key: 2 }, {
151
+ name: e(t) ? "arrow_right" : "arrow_left",
152
+ size: e(x) ? 16 : void 0
142
153
  }, {
143
154
  class: ["rds-e-arrow-link__icon--arrow", [
144
- e(t) ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
155
+ e(t) ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left",
156
+ { "rds-flex rds-flex-center-center": e(x) }
145
157
  ]],
146
158
  style: e(l) ? { color: e(l) } : void 0
147
- }), null, 16, ["class", "style"])) : i("", !0),
148
- e(t) ? i("", !0) : (o(), b("span", {
159
+ }), null, 16, ["class", "style"])) : d("", !0),
160
+ e(t) ? d("", !0) : (s(), I("span", {
149
161
  key: 3,
150
- class: _(["rds-e-link__text", { "rds-e-ml-xs": x.value }])
162
+ class: _(["rds-e-link__text", { "rds-e-ml-xs": C.value }])
151
163
  }, [
152
- B(a.$slots, "default", {}, () => [
153
- I(D(e(g)), 1)
164
+ D(a.$slots, "default", {}, () => [
165
+ R(j(e(w)), 1)
154
166
  ], !0)
155
167
  ], 2)),
156
- e(r).name && e(t) && !e(d) ? (o(), p(v, k({
168
+ e(r).name && e(t) && !e(c) ? (s(), p(v, k({
157
169
  key: 4,
158
170
  name: e(r).name
159
171
  }, e(r), {
160
172
  class: ["rds-e-link__icon-right", S.value],
161
173
  style: e(l) ? { color: e(l) } : void 0
162
- }), null, 16, ["name", "class", "style"])) : i("", !0)
174
+ }), null, 16, ["name", "class", "style"])) : d("", !0)
163
175
  ]),
164
176
  _: 3
165
- }, 8, ["class", "to", "href", "disable", "style"]));
177
+ }, 8, ["class", "to", "href", "disable", "style", "tabindex", "aria-disabled"]));
166
178
  }
167
- }), A = /* @__PURE__ */ M(O, [["__scopeId", "data-v-49b40e60"]]);
179
+ }), F = /* @__PURE__ */ O(P, [["__scopeId", "data-v-377c1eda"]]);
168
180
  export {
169
- A as default
181
+ F as default
170
182
  };