energy-components 1.10.0 → 1.11.0

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.
Files changed (37) hide show
  1. package/dist/components/breadcrumbs.es.js +21 -19
  2. package/dist/components/button.es.js +56 -48
  3. package/dist/components/collapsable.es.js +4 -0
  4. package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js +86 -0
  5. package/dist/components/datepicker.es.js +717 -708
  6. package/dist/components/index.es.js +73 -70
  7. package/dist/components/link.es.js +59 -47
  8. package/dist/components/pagination.es.js +129 -80
  9. package/dist/components/sidedrawer.es.js +48 -43
  10. package/dist/components/style/actionButton.css +1 -1
  11. package/dist/components/style/breadcrumbs.css +1 -1
  12. package/dist/components/style/button.css +1 -1
  13. package/dist/components/style/collapsable.css +1 -0
  14. package/dist/components/style/datepicker.css +1 -1
  15. package/dist/components/style/floatingActionButton.css +1 -1
  16. package/dist/components/style/link.css +1 -1
  17. package/dist/components/style/modal.css +1 -1
  18. package/dist/components/style/pagination.css +1 -1
  19. package/dist/components/style/selectionChip.css +1 -1
  20. package/dist/components/style/sidedrawer.css +1 -1
  21. package/dist/components/style/tabBar.css +1 -1
  22. package/dist/components/style/textField.css +1 -1
  23. package/dist/components/tabBar.es.js +95 -84
  24. package/dist/components/textField.es.js +122 -108
  25. package/dist/energy-components.es.js +4468 -4276
  26. package/dist/energy-components.umd.js +2 -2
  27. package/dist/style.css +1 -1
  28. package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
  29. package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
  30. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
  31. package/dist/types/src/components/index.d.ts +1 -0
  32. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
  33. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +7 -5
  34. package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
  35. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +29 -0
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +2 -2
@@ -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
  };
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,86 @@
1
+ import { defineComponent as w, ref as d, computed as r, watch as f, nextTick as c, createElementBlock as B, openBlock as m, normalizeClass as i, createElementVNode as a, withKeys as C, createBlock as S, createCommentVNode as $, createVNode as I, toDisplayString as v, renderSlot as N, createTextVNode as V } from "vue";
2
+ import { R as h } from "./icon-svg-DuzOdbk1.js";
3
+ import './style/collapsable.css';const H = ["id", "aria-expanded", "aria-controls", "disabled"], x = { class: "rds-e-collapsable__header-title" }, D = { class: "rds-e-collapsable__header-title-text" }, E = ["id", "aria-labelledby"], W = /* @__PURE__ */ w({
4
+ __name: "collapsable",
5
+ props: {
6
+ title: {},
7
+ content: { default: "" },
8
+ icon: { default: "" },
9
+ open: { type: Boolean, default: !1 },
10
+ disabled: { type: Boolean, default: !1 },
11
+ fullWidth: { type: Boolean, default: !1 },
12
+ id: { default: "" }
13
+ },
14
+ emits: ["update:open"],
15
+ setup(y, { emit: g }) {
16
+ const o = y, k = g, l = d(o.open), t = d(null), s = d(null), p = r(() => o.id || `rds-collapsable-${Math.random().toString(36).substr(2, 9)}`), u = r(() => `${p.value}-panel`), b = r(() => `${p.value}-header`), n = () => {
17
+ if (!t.value || !s.value) return;
18
+ const e = s.value.scrollHeight;
19
+ t.value.style.maxHeight = l.value ? `${e}px` : "0px";
20
+ }, _ = () => {
21
+ o.disabled || (l.value = !l.value, k("update:open", l.value), c(() => {
22
+ n();
23
+ }));
24
+ };
25
+ return f(() => o.open, (e) => {
26
+ l.value = e, c(() => {
27
+ n();
28
+ });
29
+ }), f(l, () => {
30
+ c(() => {
31
+ n();
32
+ });
33
+ }, { immediate: !0 }), (e, K) => (m(), B("div", {
34
+ class: i(["rds-e-collapsable", {
35
+ "rds-e-collapsable--open": l.value,
36
+ "rds-e-collapsable--disabled": e.disabled,
37
+ "rds-e-collapsable--full-width": e.fullWidth
38
+ }])
39
+ }, [
40
+ a("button", {
41
+ id: b.value,
42
+ class: "rds-e-collapsable__header",
43
+ type: "button",
44
+ "aria-expanded": l.value,
45
+ "aria-controls": u.value,
46
+ disabled: e.disabled,
47
+ onClick: _,
48
+ onKeydown: C(_, ["enter", "space"])
49
+ }, [
50
+ e.icon ? (m(), S(h, {
51
+ key: 0,
52
+ name: e.icon,
53
+ class: "rds-e-collapsable__header-icon"
54
+ }, null, 8, ["name"])) : $("", !0),
55
+ a("span", x, [
56
+ a("span", D, v(e.title), 1)
57
+ ]),
58
+ I(h, {
59
+ class: i(["rds-e-collapsable__header-arrow", { "rds-e-collapsable__header-arrow--open": l.value }]),
60
+ name: "arrow_down"
61
+ }, null, 8, ["class"])
62
+ ], 40, H),
63
+ a("div", {
64
+ id: u.value,
65
+ ref_key: "panel",
66
+ ref: t,
67
+ class: i(["rds-e-collapsable__panel", { "rds-e-collapsable__panel--open": l.value }]),
68
+ role: "region",
69
+ "aria-labelledby": b.value
70
+ }, [
71
+ a("div", {
72
+ ref_key: "panelContent",
73
+ ref: s,
74
+ class: "rds-e-collapsable__panel-content"
75
+ }, [
76
+ N(e.$slots, "default", {}, () => [
77
+ V(v(e.content), 1)
78
+ ])
79
+ ], 512)
80
+ ], 10, E)
81
+ ], 2));
82
+ }
83
+ });
84
+ export {
85
+ W as _
86
+ };