energy-components 2.0.0-beta.3 → 2.0.0-beta.4

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 (63) hide show
  1. package/dist/components/dropdown.es.js +252 -223
  2. package/dist/components/indicator.es.js +137 -81
  3. package/dist/components/link.es.js +7 -7
  4. package/dist/components/multiselect.es.js +104 -51
  5. package/dist/components/style/actionButton.css +1 -1
  6. package/dist/components/style/button.css +1 -1
  7. package/dist/components/style/checkbox.css +1 -1
  8. package/dist/components/style/collapsable.css +1 -1
  9. package/dist/components/style/directAccess.css +1 -1
  10. package/dist/components/style/dropdown.css +1 -1
  11. package/dist/components/style/filterChip.css +1 -1
  12. package/dist/components/style/filterTag.css +1 -1
  13. package/dist/components/style/floatingActionButton.css +1 -1
  14. package/dist/components/style/indicator.css +1 -1
  15. package/dist/components/style/link.css +1 -1
  16. package/dist/components/style/multiselect.css +1 -1
  17. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  18. package/dist/components/style/selectionChip.css +1 -1
  19. package/dist/components/style/switch.css +1 -1
  20. package/dist/components/style/tag.css +1 -1
  21. package/dist/components/style/textArea.css +1 -1
  22. package/dist/components/style/textField.css +1 -1
  23. package/dist/components/style/toggle.css +1 -1
  24. package/dist/components/tag.es.js +33 -22
  25. package/dist/components/toggle.es.js +31 -26
  26. package/dist/energy-components.css +1 -1
  27. package/dist/energy-components.es.js +5002 -4849
  28. package/dist/energy-components.umd.js +2 -2
  29. package/dist/style.css +1 -1
  30. package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +3 -3
  31. package/dist/types/src/components/buttons/button/button.vue.d.ts +4 -4
  32. package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +3 -3
  33. package/dist/types/src/components/content/avatar/avatar.vue.d.ts +1 -1
  34. package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +2 -2
  35. package/dist/types/src/components/content/table/table.vue.d.ts +1 -1
  36. package/dist/types/src/components/content/tag/tag.vue.d.ts +23 -2
  37. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +88 -1
  38. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +3 -3
  39. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +3 -3
  40. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +2 -2
  41. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +7 -7
  42. package/dist/types/src/components/input/file-upload-item/file-upload-item.vue.d.ts +2 -2
  43. package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +4 -4
  44. package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +3 -3
  45. package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +1 -1
  46. package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +4 -4
  47. package/dist/types/src/components/input/switch/switch.vue.d.ts +1 -1
  48. package/dist/types/src/components/input/text-area/text-area.vue.d.ts +2 -2
  49. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +7 -7
  50. package/dist/types/src/components/input/toggle/toggle.vue.d.ts +7 -0
  51. package/dist/types/src/components/navigation/direct-access/direct-access.vue.d.ts +4 -4
  52. package/dist/types/src/components/navigation/link/link.vue.d.ts +2 -2
  53. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +2 -2
  54. package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +2 -2
  55. package/dist/types/src/components/overlay/modal/modal.vue.d.ts +1 -1
  56. package/dist/types/src/components/overlay/popover/popover.vue.d.ts +7 -7
  57. package/dist/types/src/components/overlay/popover-menu/popover-menu.vue.d.ts +5 -5
  58. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +9 -9
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/llms/rdsindicator.md +5 -0
  61. package/llms/rdstag.md +1 -0
  62. package/llms/rdstoggle.md +1 -0
  63. package/package.json +2 -2
@@ -1,7 +1,14 @@
1
- import { defineComponent as L, toRefs as k, ref as y, computed as z, watch as w, onMounted as N, onBeforeUnmount as q, createElementBlock as d, openBlock as u, normalizeClass as h, createElementVNode as p, normalizeStyle as P, Fragment as V, renderList as W, createCommentVNode as S, toDisplayString as B } from "vue";
2
- import { d as F, t as C, a as I } from "./functions-D3GA3OzJ.js";
3
- import { _ as T } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/indicator.css';const D = ["id"], M = { class: "rds-e-indicator__inner" }, U = { class: "rds-e-indicator__step-content" }, X = { key: 0 }, Y = /* @__PURE__ */ L({
1
+ import { defineComponent as q, toRefs as C, ref as B, computed as I, watch as $, onMounted as P, onBeforeUnmount as T, createElementBlock as d, openBlock as l, normalizeClass as A, createElementVNode as f, normalizeStyle as W, Fragment as D, renderList as F, createCommentVNode as _, createBlock as M, toDisplayString as g, unref as u, createTextVNode as U } from "vue";
2
+ import { d as X, t as L, a as Y } from "./functions-D3GA3OzJ.js";
3
+ import { R as j } from "./icon-svg-CTR8GnC2.js";
4
+ import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/indicator.css';const H = ["id"], J = { class: "rds-e-indicator__inner" }, K = { class: "rds-e-indicator__step-content" }, O = { key: 0 }, Q = {
6
+ key: 0,
7
+ class: "rds-e-indicator__number"
8
+ }, Z = {
9
+ key: 0,
10
+ class: "rds-e-indicator__detail"
11
+ }, x = /* @__PURE__ */ q({
5
12
  __name: "indicator",
6
13
  props: {
7
14
  /**
@@ -11,7 +18,7 @@ import './style/indicator.css';const D = ["id"], M = { class: "rds-e-indicator__
11
18
  type: Array,
12
19
  required: !0,
13
20
  validator(a) {
14
- return !Array.isArray(a) || a.length === 0 ? (console.warn("Advertencia: steps debe ser un array no vacío de strings."), !1) : a.every((o) => typeof o != "string" ? (console.warn(`Advertencia: Todos los elementos en steps deben ser strings. Encontrado: ${typeof o}`), !1) : /^[a-z0-9\s\u00C0-\u017F]+$/i.test(o) ? !0 : (console.warn(`Advertencia: El paso "${o}" contiene caracteres no permitidos. Solo se permiten letras, números y espacios.`), !1));
21
+ return !Array.isArray(a) || a.length === 0 ? (console.warn("Advertencia: steps debe ser un array no vacío de strings."), !1) : a.every((i) => typeof i != "string" ? (console.warn(`Advertencia: Todos los elementos en steps deben ser strings. Encontrado: ${typeof i}`), !1) : /^[a-z0-9\s\u00C0-\u017F]+$/i.test(i) ? !0 : (console.warn(`Advertencia: El paso "${i}" contiene caracteres no permitidos. Solo se permiten letras, números y espacios.`), !1));
15
22
  }
16
23
  },
17
24
  /**
@@ -38,6 +45,46 @@ import './style/indicator.css';const D = ["id"], M = { class: "rds-e-indicator__
38
45
  type: String,
39
46
  default: "default"
40
47
  },
48
+ /**
49
+ * Estilo de numeración de pasos.
50
+ * 'none' mantiene el comportamiento anterior (número dentro del bullet).
51
+ * 'outside' muestra el número fuera del bullet.
52
+ * 'inline' integra la numeración en el título del paso.
53
+ */
54
+ numbering: {
55
+ type: String,
56
+ default: "none"
57
+ },
58
+ /**
59
+ * Mostrar etiquetas (labels). En variante 'small' se ocultan siempre.
60
+ */
61
+ showLabels: {
62
+ type: Boolean,
63
+ default: !0
64
+ },
65
+ /**
66
+ * Tipo de contenido interno del item.
67
+ * - 'empty': bullet sin contenido (por defecto). Si numbering es 'none', se mantiene número dentro para compatibilidad.
68
+ * - 'icon': muestra un icono dentro del bullet.
69
+ */
70
+ itemContent: {
71
+ type: String,
72
+ default: "empty"
73
+ },
74
+ /**
75
+ * Lista opcional de iconos (nombres) a renderizar por paso cuando itemContent='icon'.
76
+ */
77
+ icons: {
78
+ type: Array,
79
+ default: void 0
80
+ },
81
+ /**
82
+ * Detalles opcionales por paso. Si existe un detalle en el índice, se mostrará bajo el título.
83
+ */
84
+ details: {
85
+ type: Array,
86
+ default: void 0
87
+ },
41
88
  /**
42
89
  * Si el indicador debe ocupar todo el ancho.
43
90
  */
@@ -61,122 +108,131 @@ import './style/indicator.css';const D = ["id"], M = { class: "rds-e-indicator__
61
108
  }
62
109
  },
63
110
  setup(a) {
64
- const t = a, {
65
- direction: o,
66
- currentStep: f,
67
- steps: A,
68
- fullWidth: $
69
- } = k(t), _ = y(null), v = y(null), c = y([]), R = z(() => {
70
- let r = t.currentStep;
71
- const e = t.steps.length, s = o.value === "vertical" ? "height" : "width";
111
+ const e = a, {
112
+ direction: i,
113
+ currentStep: m,
114
+ steps: k,
115
+ fullWidth: E
116
+ } = C(e), v = B(null), y = B(null), p = B([]), b = C(e).icons?.value, h = C(e).details?.value, z = (r, t) => e.numbering === "inline" ? `${t + 1}. ${r}` : r, N = I(() => {
117
+ let r = e.currentStep;
118
+ const t = e.steps.length, n = i.value === "vertical" ? "height" : "width";
72
119
  if (r < 1)
73
120
  return {
74
- [s]: "0%"
121
+ [n]: "0%"
75
122
  };
76
- if (r > e && (r = e), e === 1)
123
+ if (r > t && (r = t), t === 1)
77
124
  return {
78
- [s]: "100%"
125
+ [n]: "100%"
79
126
  };
80
- const i = (r - 1) / (e - 1) * 100, n = r < e ? 100 / (e - 1) / 2 : 0;
127
+ const s = (r - 1) / (t - 1) * 100, o = r < t ? 100 / (t - 1) / 2 : 0;
81
128
  return {
82
- [s]: `${i + n}%`
129
+ [n]: `${s + o}%`
83
130
  };
84
- }), b = () => {
85
- if (_.value && v.value) {
86
- const r = v.value, e = c.value[0];
87
- if (e) {
88
- if (o.value === "vertical") {
89
- const s = e.getBoundingClientRect(), i = _.value.getBoundingClientRect(), n = s.left + s.width / 2 - i.left;
90
- r.style.left = `${n}px`;
131
+ }), R = () => {
132
+ if (v.value && y.value) {
133
+ const r = y.value, t = p.value[0];
134
+ if (t) {
135
+ if (i.value === "vertical") {
136
+ const n = t.getBoundingClientRect(), s = v.value.getBoundingClientRect(), o = n.left + n.width / 2 - s.left;
137
+ r.style.left = `${o}px`;
91
138
  }
92
- if (o.value === "horizontal") {
93
- const s = e.getBoundingClientRect(), i = _.value.getBoundingClientRect(), n = s.top + s.height / 2 - i.top;
94
- r.style.top = `${n}px`;
139
+ if (i.value === "horizontal") {
140
+ const n = t.getBoundingClientRect(), s = v.value.getBoundingClientRect(), o = n.top + n.height / 2 - s.top;
141
+ r.style.top = `${o}px`;
95
142
  }
96
143
  }
97
144
  }
98
- }, E = (r) => {
99
- const e = r === 0 || r === t.steps.length - 1, s = !e;
145
+ }, V = (r) => {
146
+ const t = r === 0 || r === e.steps.length - 1, n = !t;
100
147
  return {
101
148
  "rds-e-indicator__step-wrapper--first": r === 0,
102
- "rds-e-indicator__step-wrapper--last": r === t.steps.length - 1,
103
- "rds-e-indicator__step-wrapper--side": e,
104
- "rds-e-indicator__step-wrapper--central": s
149
+ "rds-e-indicator__step-wrapper--last": r === e.steps.length - 1,
150
+ "rds-e-indicator__step-wrapper--side": t,
151
+ "rds-e-indicator__step-wrapper--central": n
105
152
  };
106
- }, g = () => {
107
- !t.steps || !t.steps.length || t.steps.forEach((r, e) => {
108
- const s = e < f.value, i = e === f.value - 1;
109
- let n = c.value[e]?.classList, l = [];
110
- n && (n = Array.from(n), l = Array.from(n), l = C(
111
- l,
153
+ }, S = () => {
154
+ !e.steps || !e.steps.length || e.steps.forEach((r, t) => {
155
+ const n = t < m.value, s = t === m.value - 1;
156
+ let o = p.value[t]?.classList, c = [];
157
+ o && (o = Array.from(o), c = Array.from(o), c = L(
158
+ c,
112
159
  "rds-e-indicator__bullet--active",
113
- s
114
- ), l = C(
115
- l,
160
+ n
161
+ ), c = L(
162
+ c,
116
163
  "rds-e-indicator__bullet--current",
117
- i
118
- ), I(n, l) || setTimeout(() => {
119
- c.value[e].classList.remove(...n), c.value[e].classList.add(...l);
164
+ s
165
+ ), Y(o, c) || setTimeout(() => {
166
+ p.value[t].classList.remove(...o), p.value[t].classList.add(...c);
120
167
  }, 150));
121
168
  });
122
- }, m = () => {
123
- b();
169
+ }, w = () => {
170
+ R();
124
171
  };
125
- return w(
126
- [o, A, $],
172
+ return $(
173
+ [i, k, E],
127
174
  () => {
128
- m(), g();
175
+ w(), S();
129
176
  },
130
177
  { immediate: !0 }
131
- ), w(f, () => {
132
- g();
133
- }), N(() => {
134
- b(), g(), window.addEventListener("resize", F(m, 200));
135
- }), q(() => {
136
- window.removeEventListener("resize", m);
137
- }), (r, e) => (u(), d("div", {
178
+ ), $(m, () => {
179
+ S();
180
+ }), P(() => {
181
+ R(), S(), window.addEventListener("resize", X(w, 200)), e.variant === "small" && e.itemContent === "icon" && console.warn('RDSIndicator: Los iconos dentro del bullet no están soportados en la variante "small". El icono no se renderizará.');
182
+ }), T(() => {
183
+ window.removeEventListener("resize", w);
184
+ }), (r, t) => (l(), d("div", {
138
185
  id: a.id,
139
186
  ref_key: "$indicator",
140
- ref: _,
141
- class: h(["rds-e-indicator", [
142
- `rds-e-indicator--${t.direction}`,
143
- { "rds-e-indicator--small": t.variant === "small" },
144
- { "rds-e-indicator--full-width": t.fullWidth }
187
+ ref: v,
188
+ class: A(["rds-e-indicator", [
189
+ `rds-e-indicator--${e.direction}`,
190
+ { "rds-e-indicator--small": e.variant === "small" },
191
+ { "rds-e-indicator--full-width": e.fullWidth }
145
192
  ]])
146
193
  }, [
147
- p("div", M, [
148
- p("div", {
194
+ f("div", J, [
195
+ f("div", {
149
196
  ref_key: "$progressBar",
150
- ref: v,
197
+ ref: y,
151
198
  class: "rds-e-indicator__progress-bar"
152
199
  }, [
153
- p("div", {
200
+ f("div", {
154
201
  class: "rds-e-indicator__progress-bar__fill",
155
- style: P(R.value)
202
+ style: W(N.value)
156
203
  }, null, 4)
157
204
  ], 512),
158
- (u(!0), d(V, null, W(t.steps, (s, i) => (u(), d("div", {
159
- key: i,
160
- class: h(["rds-e-indicator__step-wrapper", E(i)])
205
+ (l(!0), d(D, null, F(e.steps, (n, s) => (l(), d("div", {
206
+ key: s,
207
+ class: A(["rds-e-indicator__step-wrapper", V(s)])
161
208
  }, [
162
- p("div", U, [
163
- p("div", {
209
+ f("div", K, [
210
+ f("div", {
164
211
  ref_for: !0,
165
- ref: (n) => c.value[i] = n,
212
+ ref: (o) => p.value[s] = o,
166
213
  class: "rds-e-indicator__bullet"
167
214
  }, [
168
- t.variant !== "small" ? (u(), d("span", X, B(i + 1), 1)) : S("", !0)
215
+ e.variant !== "small" && e.numbering === "none" && e.itemContent === "empty" ? (l(), d("span", O, g(s + 1), 1)) : _("", !0),
216
+ e.itemContent === "icon" && e.variant !== "small" && u(b) && u(b)[s] ? (l(), M(j, {
217
+ key: 1,
218
+ name: u(b)[s],
219
+ class: "rds-e-indicator__icon"
220
+ }, null, 8, ["name"])) : _("", !0)
169
221
  ], 512)
170
222
  ]),
171
- t.variant !== "small" ? (u(), d("div", {
172
- key: 0,
173
- class: h(["rds-e-indicator__label", { "rds-e-indicator__label--ellipsis": t.ellipsis }])
174
- }, B(s), 3)) : S("", !0)
223
+ e.numbering === "outside" ? (l(), d("div", Q, g(s + 1), 1)) : _("", !0),
224
+ e.variant !== "small" && e.showLabels ? (l(), d("div", {
225
+ key: 1,
226
+ class: A(["rds-e-indicator__label", { "rds-e-indicator__label--ellipsis": e.ellipsis }])
227
+ }, [
228
+ U(g(z(n, s)) + " ", 1),
229
+ u(h) && u(h)[s] ? (l(), d("div", Z, g(u(h)[s]), 1)) : _("", !0)
230
+ ], 2)) : _("", !0)
175
231
  ], 2))), 128))
176
232
  ])
177
- ], 10, D));
233
+ ], 10, H));
178
234
  }
179
- }), J = /* @__PURE__ */ T(Y, [["__scopeId", "data-v-2523e4b1"]]);
235
+ }), ne = /* @__PURE__ */ G(x, [["__scopeId", "data-v-942bba3b"]]);
180
236
  export {
181
- J as default
237
+ ne as default
182
238
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, useAttrs as z, computed as o, createBlock as s, openBlock as t, resolveDynamicComponent as I, mergeProps as a, withCtx as D, createCommentVNode as i, createElementBlock as _, normalizeClass as k, renderSlot as g, createTextVNode as y, toDisplayString as h } from "vue";
1
+ import { defineComponent as B, useAttrs as z, computed as o, createBlock as a, openBlock as t, resolveDynamicComponent as I, mergeProps as s, withCtx as D, createCommentVNode as i, createElementBlock as _, normalizeClass as k, renderSlot as g, createTextVNode as y, toDisplayString as h } from "vue";
2
2
  import { s as j } from "./functions-D3GA3OzJ.js";
3
3
  import { R as l } from "./icon-svg-CTR8GnC2.js";
4
4
  import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
@@ -120,7 +120,7 @@ import './style/link.css';const O = /* @__PURE__ */ B({
120
120
  }
121
121
  v("click", r);
122
122
  }, f = o(() => e.icon?.size ?? 14);
123
- return (r, m) => (t(), s(I(e.tag === "a" ? e.tag : "router-link"), a({
123
+ return (r, m) => (t(), a(I(e.tag === "a" ? e.tag : "router-link"), s({
124
124
  id: e.id,
125
125
  class: x.value,
126
126
  to: e.tag === "router-link" ? e.to : null,
@@ -128,12 +128,12 @@ import './style/link.css';const O = /* @__PURE__ */ B({
128
128
  }, r.$attrs, {
129
129
  rel: S.value,
130
130
  style: w.value,
131
- tabindex: e.disabled ? -1 : void 0,
131
+ tabindex: e.disabled ? -1 : 0,
132
132
  "aria-disabled": e.disabled,
133
133
  onClick: C
134
134
  }), {
135
135
  default: D(() => [
136
- e.icon.name && !e.right && !e.arrow ? (t(), s(l, a({
136
+ e.icon.name && !e.right && !e.arrow ? (t(), a(l, s({
137
137
  key: 0,
138
138
  name: e.icon.name
139
139
  }, {
@@ -154,7 +154,7 @@ import './style/link.css';const O = /* @__PURE__ */ B({
154
154
  y(h(e.text), 1)
155
155
  ], !0)
156
156
  ], 2)) : i("", !0),
157
- e.arrow ? (t(), s(l, a({ key: 2 }, {
157
+ e.arrow ? (t(), a(l, s({ key: 2 }, {
158
158
  name: e.right ? "arrow_right" : "arrow_left",
159
159
  size: e.arrowSmall ? 16 : void 0
160
160
  }, {
@@ -172,7 +172,7 @@ import './style/link.css';const O = /* @__PURE__ */ B({
172
172
  y(h(e.text), 1)
173
173
  ], !0)
174
174
  ], 2)),
175
- e.icon.name && e.right && !e.arrow ? (t(), s(l, a({
175
+ e.icon.name && e.right && !e.arrow ? (t(), a(l, s({
176
176
  key: 4,
177
177
  name: e.icon.name
178
178
  }, e.icon, {
@@ -184,7 +184,7 @@ import './style/link.css';const O = /* @__PURE__ */ B({
184
184
  _: 3
185
185
  }, 16, ["id", "class", "to", "href", "rel", "style", "tabindex", "aria-disabled"]));
186
186
  }
187
- }), N = /* @__PURE__ */ A(O, [["__scopeId", "data-v-d8f5c74d"]]);
187
+ }), N = /* @__PURE__ */ A(O, [["__scopeId", "data-v-f0ad4a8d"]]);
188
188
  export {
189
189
  N as default
190
190
  };