energy-components 1.8.0 → 1.9.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 (45) hide show
  1. package/dist/components/avatar.es.js +161 -0
  2. package/dist/components/checkbox.es.js +51 -35
  3. package/dist/components/directAccess.es.js +146 -0
  4. package/dist/components/dragAndDrop.es.js +77 -60
  5. package/dist/components/fileUploadItem.es.js +182 -0
  6. package/dist/components/filterChip.es.js +26 -22
  7. package/dist/components/index.es.js +76 -64
  8. package/dist/components/link.es.js +67 -55
  9. package/dist/components/loader.es.js +178 -0
  10. package/dist/components/progressBar.es.js +52 -28
  11. package/dist/components/selectionChip.es.js +15 -14
  12. package/dist/components/style/avatar.css +1 -0
  13. package/dist/components/style/button.css +1 -1
  14. package/dist/components/style/checkbox.css +1 -1
  15. package/dist/components/style/directAccess.css +1 -0
  16. package/dist/components/style/dragAndDrop.css +1 -1
  17. package/dist/components/style/fileUploadItem.css +1 -0
  18. package/dist/components/style/filterChip.css +1 -1
  19. package/dist/components/style/link.css +1 -1
  20. package/dist/components/style/loader.css +1 -0
  21. package/dist/components/style/progressBar.css +1 -1
  22. package/dist/components/style/selectionChip.css +1 -1
  23. package/dist/components/style/tabBar.css +1 -1
  24. package/dist/components/style/textField.css +1 -1
  25. package/dist/components/style/toggle.css +1 -1
  26. package/dist/components/tabBar.es.js +63 -64
  27. package/dist/components/textField.es.js +134 -110
  28. package/dist/components/toggle.es.js +21 -20
  29. package/dist/energy-components.es.js +5424 -4679
  30. package/dist/energy-components.umd.js +2 -2
  31. package/dist/style.css +1 -1
  32. package/dist/types/src/components/content/avatar/avatar.vue.d.ts +153 -0
  33. package/dist/types/src/components/feedback/loader/loader.vue.d.ts +151 -0
  34. package/dist/types/src/components/feedback/progress-bar/progress-bar.vue.d.ts +34 -0
  35. package/dist/types/src/components/index.d.ts +4 -0
  36. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +15 -0
  37. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +14 -2
  38. package/dist/types/src/components/input/file-upload-item/file-upload-item.vue.d.ts +229 -0
  39. package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +2 -0
  40. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +23 -4
  41. package/dist/types/src/components/navigation/direct-access/direct-access.vue.d.ts +178 -0
  42. package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
  43. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +2 -2
@@ -0,0 +1,182 @@
1
+ import { defineComponent as M, ref as N, computed as c, createElementBlock as l, openBlock as o, normalizeClass as $, createElementVNode as r, renderSlot as v, createVNode as p, createCommentVNode as n, toDisplayString as m, withModifiers as I } from "vue";
2
+ import { R as g } from "./icon-svg-_WCkLP8-.js";
3
+ import z from "./progressBar.es.js";
4
+ import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/fileUploadItem.css';const R = { class: "rds-e-file-upload-item__icon-container" }, w = { class: "rds-e-file-upload-item__details" }, E = { class: "rds-e-file-upload-item__info-wrapper" }, F = { class: "rds-e-file-upload-item__name" }, x = {
6
+ key: 0,
7
+ class: "rds-e-file-upload-item__meta"
8
+ }, D = { class: "rds-e-file-upload-item__size" }, P = {
9
+ key: 0,
10
+ class: "rds-e-file-upload-item__time-remaining"
11
+ }, V = {
12
+ key: 1,
13
+ class: "rds-e-file-upload-item__error-message"
14
+ }, q = {
15
+ key: 0,
16
+ class: "rds-e-file-upload-item__progress-indicator-container"
17
+ }, T = { class: "rds-e-file-upload-item__action" }, j = ["aria-label", "disabled"], A = /* @__PURE__ */ M({
18
+ __name: "file-upload-item",
19
+ props: {
20
+ /**
21
+ * Identificador único para el ítem de archivo (opcional, pero útil para eventos).
22
+ */
23
+ id: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ /**
28
+ * Nombre del archivo a mostrar.
29
+ */
30
+ fileName: {
31
+ type: String,
32
+ required: !0
33
+ },
34
+ /**
35
+ * Tamaño del archivo en bytes.
36
+ */
37
+ fileSize: {
38
+ type: Number,
39
+ required: !0
40
+ },
41
+ /**
42
+ * Nombre del icono a mostrar para el archivo.
43
+ * Ver la sección 'Options > Icon' en el diseño para ejemplos.
44
+ * Por defecto es 'document_generic' (representando "Document final content").
45
+ */
46
+ fileIcon: {
47
+ type: String,
48
+ default: "document-final-content"
49
+ },
50
+ /**
51
+ * Estado actual del ítem de archivo.
52
+ * Determina la apariencia y elementos mostrados (ej. barra de progreso, mensaje de error).
53
+ * Posibles valores: 'default', 'uploading', 'error', 'disabled'.
54
+ */
55
+ status: {
56
+ type: String,
57
+ default: "default",
58
+ validator: (e) => ["default", "uploading", "error", "disabled"].includes(e)
59
+ },
60
+ /**
61
+ * Progreso de la subida (0-100). Usado por RDSProgressBar si showProgressBar es true.
62
+ */
63
+ progress: {
64
+ type: Number,
65
+ default: 0,
66
+ validator: (e) => e >= 0 && e <= 100
67
+ },
68
+ /**
69
+ * Texto que indica el tiempo restante de subida (ej. "4 second left").
70
+ * Solo visible si status es 'uploading'.
71
+ */
72
+ timeRemaining: {
73
+ type: String,
74
+ default: null
75
+ },
76
+ /**
77
+ * Mensaje de error a mostrar. Solo visible si status es 'error'.
78
+ * Reemplaza el campo de detalle con el contexto de error.
79
+ */
80
+ errorMessage: {
81
+ type: String,
82
+ default: null
83
+ },
84
+ /**
85
+ * Indica si el componente está deshabilitado.
86
+ * Esto aplicará estilos de deshabilitado y prevendrá interacciones.
87
+ */
88
+ disabled: {
89
+ type: Boolean,
90
+ default: !1
91
+ },
92
+ /**
93
+ * Define la acción disponible para el ítem.
94
+ * Por defecto es una acción de eliminar.
95
+ * Ejemplo: { type: 'delete', icon: 'delete', label: 'Eliminar archivo' }
96
+ */
97
+ action: {
98
+ type: Object,
99
+ default: () => ({ type: "delete", icon: "delete", label: "Eliminar archivo" })
100
+ },
101
+ /**
102
+ * Indica si se debe mostrar el componente RDSProgressBar durante el estado 'uploading'.
103
+ * Si es false, no se muestra ninguna barra de progreso.
104
+ */
105
+ showProgressBar: {
106
+ type: Boolean,
107
+ default: !1
108
+ }
109
+ },
110
+ emits: ["action"],
111
+ setup(e, { emit: _ }) {
112
+ const s = e, b = _, f = N(!1), a = c(() => s.disabled ? "disabled" : s.status), y = c(() => {
113
+ const t = [`rds-e-file-upload-item--${a.value}`];
114
+ return f.value && a.value !== "disabled" && a.value !== "uploading" && a.value !== "error" && t.push("rds-e-file-upload-item--hover"), t;
115
+ }), h = c(() => s.fileIcon), S = c(() => {
116
+ const t = s.fileSize;
117
+ if (t === 0) return "0 Bytes";
118
+ const i = 1024, d = ["Bytes", "KB", "MB", "GB", "TB"], u = Math.floor(Math.log(t) / Math.log(i)), k = u === 1 ? 0 : u > 1 ? 1 : 0;
119
+ return `${Number.parseFloat((t / i ** u).toFixed(k))} ${d[u]}`;
120
+ }), B = (t) => {
121
+ !s.disabled && t && b("action", { actionType: t.type, fileId: s.id });
122
+ };
123
+ return (t, i) => (o(), l("div", {
124
+ class: $(["rds-e-file-upload-item rds-radius-inputs", [y.value]]),
125
+ onMouseover: i[1] || (i[1] = (d) => f.value = !0),
126
+ onMouseleave: i[2] || (i[2] = (d) => f.value = !1)
127
+ }, [
128
+ r("div", R, [
129
+ v(t.$slots, "file-icon", {}, () => [
130
+ p(g, {
131
+ name: h.value,
132
+ class: "rds-e-file-upload-item__file-icon",
133
+ "aria-hidden": "true"
134
+ }, null, 8, ["name"])
135
+ ], !0)
136
+ ]),
137
+ r("div", w, [
138
+ r("div", E, [
139
+ r("span", F, m(e.fileName), 1),
140
+ a.value !== "error" ? (o(), l("div", x, [
141
+ r("span", D, m(S.value), 1),
142
+ a.value === "uploading" && e.timeRemaining ? (o(), l("span", P, m(e.timeRemaining), 1)) : n("", !0)
143
+ ])) : n("", !0),
144
+ a.value === "error" && e.errorMessage ? (o(), l("div", V, m(e.errorMessage), 1)) : n("", !0)
145
+ ]),
146
+ a.value === "uploading" && e.showProgressBar ? (o(), l("div", q, [
147
+ p(z, {
148
+ class: "rds-e-file-upload-item__progress-bar",
149
+ step: e.progress,
150
+ "max-steps": 100,
151
+ percentage: !1,
152
+ "back-button": !1,
153
+ "white-bar": "",
154
+ "hide-counter": "",
155
+ inverse: ""
156
+ }, null, 8, ["step"])
157
+ ])) : n("", !0)
158
+ ]),
159
+ r("div", T, [
160
+ v(t.$slots, "action", {}, () => [
161
+ e.action ? (o(), l("button", {
162
+ key: 0,
163
+ type: "button",
164
+ class: "rds-e-file-upload-item__action-button",
165
+ "aria-label": e.action.label || "Eliminar archivo",
166
+ disabled: e.disabled,
167
+ onClick: i[0] || (i[0] = I((d) => B(e.action), ["stop"]))
168
+ }, [
169
+ p(g, {
170
+ name: e.action.icon,
171
+ class: "rds-e-file-upload-item__action-icon",
172
+ "aria-hidden": "true"
173
+ }, null, 8, ["name"])
174
+ ], 8, j)) : n("", !0)
175
+ ], !0)
176
+ ])
177
+ ], 34));
178
+ }
179
+ }), U = /* @__PURE__ */ C(A, [["__scopeId", "data-v-1de9506e"]]);
180
+ export {
181
+ U as default
182
+ };
@@ -1,10 +1,13 @@
1
- import { defineComponent as m, ref as g, computed as y, createElementBlock as c, openBlock as l, normalizeClass as b, createElementVNode as s, createBlock as a, createCommentVNode as r, toDisplayString as n } from "vue";
1
+ import { defineComponent as g, ref as b, computed as c, createElementBlock as s, openBlock as l, normalizeClass as y, createCommentVNode as r, createElementVNode as _, createBlock as a, toDisplayString as n } from "vue";
2
2
  import { R as o } from "./icon-svg-_WCkLP8-.js";
3
- import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/filterChip.css';const k = ["disabled"], C = { class: "rds-e-filter-chip__icon-container" }, I = {
3
+ import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/filterChip.css';const C = ["disabled"], I = {
5
+ key: 0,
6
+ class: "rds-e-filter-chip__icon-container"
7
+ }, N = {
5
8
  key: 1,
6
9
  class: "rds-e-filter-chip__number"
7
- }, w = { class: "rds-e-filter-chip__text" }, B = /* @__PURE__ */ m({
10
+ }, w = { class: "rds-e-filter-chip__text" }, B = /* @__PURE__ */ g({
8
11
  __name: "filter-chip",
9
12
  props: {
10
13
  /**
@@ -22,14 +25,15 @@ import './style/filterChip.css';const k = ["disabled"], C = { class: "rds-e-filt
22
25
  */
23
26
  leftIcon: {
24
27
  type: String,
25
- default: "check"
28
+ default: ""
26
29
  },
27
30
  /**
28
31
  * <span>Numero a mostrar en el chip (a la izquierda)</span>
29
32
  */
30
33
  leftNumber: {
31
34
  type: String,
32
- default: ""
35
+ default: "",
36
+ validator: (e) => e.length <= 2
33
37
  },
34
38
  /**
35
39
  * <span>Indica si se muestra el icono de flecha a la derecha</span>
@@ -76,39 +80,39 @@ import './style/filterChip.css';const k = ["disabled"], C = { class: "rds-e-filt
76
80
  },
77
81
  emits: ["onClickChip"],
78
82
  setup(e, { emit: d }) {
79
- const t = e, f = d, h = g(null), u = y(() => {
83
+ const t = e, f = d, h = b(null), u = c(() => t.leftNumber.slice(0, 2)), p = c(() => {
80
84
  const i = ["rds-e-filter-chip"];
81
- return i.push(`rds-e-filter-chip--${t.surfaceType}`), t.disabled && i.push("rds-e-filter-chip--disabled"), t.selected && !t.highlight && i.push("rds-e-filter-chip--selected"), t.highlight && i.push("rds-e-filter-chip--highlight"), t.selected && t.highlight && i.push("rds-e-filter-chip--selected-highlight"), t.arrowIcon && i.push("rds-e-filter-chip--with-arrow"), i;
82
- }), p = () => {
85
+ return i.push(`rds-e-filter-chip--${t.surfaceType}`), t.disabled && i.push("rds-e-filter-chip--disabled"), t.selected && !t.highlight && i.push("rds-e-filter-chip--selected"), t.highlight && i.push("rds-e-filter-chip--highlight"), t.selected && t.highlight && i.push("rds-e-filter-chip--selected-highlight"), t.arrowIcon && i.push("rds-e-filter-chip--with-arrow"), !t.leftIcon && !t.leftNumber && i.push("rds-e-filter-chip--no-icon"), i;
86
+ }), m = () => {
83
87
  t.disabled || f("onClickChip", t.filterValue);
84
88
  };
85
- return (i, S) => (l(), c("button", {
89
+ return (i, S) => (l(), s("button", {
86
90
  ref_key: "chipRef",
87
91
  ref: h,
88
- class: b(u.value),
92
+ class: y(p.value),
89
93
  disabled: e.disabled,
90
94
  type: "button",
91
- onClick: p
95
+ onClick: m
92
96
  }, [
93
- s("span", C, [
94
- e.leftIcon && !e.leftNumber ? (l(), a(o, {
97
+ e.leftIcon || e.leftNumber ? (l(), s("span", I, [
98
+ e.leftNumber ? r("", !0) : (l(), a(o, {
95
99
  key: 0,
96
100
  name: e.leftIcon,
97
101
  class: "rds-e-filter-chip__icon",
98
102
  "aria-hidden": "true"
99
- }, null, 8, ["name"])) : r("", !0),
100
- e.leftNumber && !e.leftIcon ? (l(), c("span", I, n(e.leftNumber), 1)) : r("", !0)
101
- ]),
102
- s("span", w, n(e.text), 1),
103
+ }, null, 8, ["name"])),
104
+ e.leftNumber && !e.leftIcon ? (l(), s("span", N, n(u.value), 1)) : r("", !0)
105
+ ])) : r("", !0),
106
+ _("span", w, n(e.text), 1),
103
107
  e.arrowIcon ? (l(), a(o, {
104
- key: 0,
108
+ key: 1,
105
109
  name: "arrow_down",
106
110
  class: "rds-e-filter-chip__arrow-icon",
107
111
  "aria-hidden": "true"
108
112
  })) : r("", !0)
109
- ], 10, k));
113
+ ], 10, C));
110
114
  }
111
- }), R = /* @__PURE__ */ _(B, [["__scopeId", "data-v-58cf5c6f"]]);
115
+ }), V = /* @__PURE__ */ k(B, [["__scopeId", "data-v-87cd4451"]]);
112
116
  export {
113
- R as default
117
+ V as default
114
118
  };
@@ -4,80 +4,88 @@ import e from "./floatingActionButton.es.js";
4
4
  import m from "./actionButton.es.js";
5
5
  import S from "./checkbox.es.js";
6
6
  import D from "./textField.es.js";
7
- import n from "./textArea.es.js";
8
- import p from "./switch.es.js";
9
- import R from "./radioButton.es.js";
7
+ import p from "./textArea.es.js";
8
+ import R from "./switch.es.js";
9
+ import n from "./radioButton.es.js";
10
10
  import { _ as s } from "./radio-group.vue_vue_type_script_setup_true_lang-DpguLlRK.js";
11
11
  import c from "./dropdown.es.js";
12
12
  import d from "./datepicker.es.js";
13
13
  import f from "./quantitySelector.es.js";
14
14
  import l from "./toggle.es.js";
15
15
  import u from "./selectionChip.es.js";
16
- import g from "./filterChip.es.js";
16
+ import A from "./filterChip.es.js";
17
17
  import b from "./dragAndDrop.es.js";
18
- import B from "./tag.es.js";
19
- import T from "./accordionGroup.es.js";
20
- import A from "./accordion.es.js";
21
- import h from "./divider.es.js";
22
- import x from "./card.es.js";
23
- import w from "./tablepaginatedcomponent.es.js";
18
+ import g from "./fileUploadItem.es.js";
19
+ import T from "./tag.es.js";
20
+ import B from "./accordionGroup.es.js";
21
+ import h from "./accordion.es.js";
22
+ import x from "./divider.es.js";
23
+ import I from "./card.es.js";
24
+ import v from "./tablepaginatedcomponent.es.js";
25
+ import w from "./avatar.es.js";
24
26
  import C from "./link.es.js";
25
27
  import P from "./breadcrumbs.es.js";
26
28
  import _ from "./tabBar.es.js";
27
29
  import y from "./pagination.es.js";
28
- import I from "./indicator.es.js";
29
- import v from "./persistentToast.es.js";
30
- import k from "./infoBox.es.js";
31
- import F from "./progressBar.es.js";
32
- import G from "./modal.es.js";
33
- import M from "./overlay.es.js";
34
- import O from "./tooltip.es.js";
35
- import j from "./sidebar.es.js";
36
- import Q from "./sidedrawer.es.js";
30
+ import F from "./directAccess.es.js";
31
+ import k from "./indicator.es.js";
32
+ import G from "./persistentToast.es.js";
33
+ import L from "./infoBox.es.js";
34
+ import M from "./progressBar.es.js";
35
+ import O from "./loader.es.js";
36
+ import U from "./modal.es.js";
37
+ import j from "./overlay.es.js";
38
+ import Q from "./tooltip.es.js";
39
+ import V from "./sidebar.es.js";
40
+ import q from "./sidedrawer.es.js";
37
41
  const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
38
42
  __proto__: null,
39
- RDSAccordion: A,
40
- RDSAccordionGroup: T,
43
+ RDSAccordion: h,
44
+ RDSAccordionGroup: B,
41
45
  RDSActionButton: m,
46
+ RDSAvatar: w,
42
47
  RDSBreadcrumbs: P,
43
48
  RDSButton: a,
44
- RDSCard: x,
49
+ RDSCard: I,
45
50
  RDSCheckbox: S,
46
51
  RDSDatePicker: d,
47
- RDSDivider: h,
52
+ RDSDirectAccess: F,
53
+ RDSDivider: x,
48
54
  RDSDragAndDrop: b,
49
55
  RDSDropdown: c,
50
- RDSFilterChip: g,
56
+ RDSFileUploadItem: g,
57
+ RDSFilterChip: A,
51
58
  RDSFloatinActionButton: e,
52
59
  RDSIconSvg: i,
53
- RDSIndicator: I,
54
- RDSInfoBox: k,
60
+ RDSIndicator: k,
61
+ RDSInfoBox: L,
55
62
  RDSLink: C,
56
- RDSModal: G,
57
- RDSOverlay: M,
63
+ RDSLoader: O,
64
+ RDSModal: U,
65
+ RDSOverlay: j,
58
66
  RDSPagination: y,
59
- RDSPersistentToast: v,
60
- RDSProgressBar: F,
67
+ RDSPersistentToast: G,
68
+ RDSProgressBar: M,
61
69
  RDSQuantitySelector: f,
62
- RDSRadioButton: R,
70
+ RDSRadioButton: n,
63
71
  RDSRadioGroup: s,
64
72
  RDSSelectionChip: u,
65
- RDSSidebar: j,
66
- RDSSidedrawer: Q,
67
- RDSSwitch: p,
73
+ RDSSidebar: V,
74
+ RDSSidedrawer: q,
75
+ RDSSwitch: R,
68
76
  RDSTabBar: _,
69
- RDSTable: w,
70
- RDSTag: B,
71
- RDSTextArea: n,
77
+ RDSTable: v,
78
+ RDSTag: T,
79
+ RDSTextArea: p,
72
80
  RDSTextField: D,
73
81
  RDSToggle: l,
74
- RDSTooltip: O
82
+ RDSTooltip: Q
75
83
  }, Symbol.toStringTag, { value: "Module" }));
76
- let V;
77
- function ho(o) {
78
- V = o;
84
+ let z;
85
+ function yo(o) {
86
+ z = o;
79
87
  }
80
- const xo = {
88
+ const Fo = {
81
89
  install: (o) => {
82
90
  for (const r in t)
83
91
  o.component(
@@ -87,43 +95,47 @@ const xo = {
87
95
  }
88
96
  };
89
97
  export {
90
- A as RDSAccordion,
91
- T as RDSAccordionGroup,
98
+ h as RDSAccordion,
99
+ B as RDSAccordionGroup,
92
100
  m as RDSActionButton,
101
+ w as RDSAvatar,
93
102
  P as RDSBreadcrumbs,
94
103
  a as RDSButton,
95
- x as RDSCard,
104
+ I as RDSCard,
96
105
  S as RDSCheckbox,
97
106
  d as RDSDatePicker,
98
- h as RDSDivider,
107
+ F as RDSDirectAccess,
108
+ x as RDSDivider,
99
109
  b as RDSDragAndDrop,
100
110
  c as RDSDropdown,
101
- g as RDSFilterChip,
111
+ g as RDSFileUploadItem,
112
+ A as RDSFilterChip,
102
113
  e as RDSFloatinActionButton,
103
114
  i as RDSIconSvg,
104
- I as RDSIndicator,
105
- k as RDSInfoBox,
115
+ k as RDSIndicator,
116
+ L as RDSInfoBox,
106
117
  C as RDSLink,
107
- G as RDSModal,
108
- M as RDSOverlay,
118
+ O as RDSLoader,
119
+ U as RDSModal,
120
+ j as RDSOverlay,
109
121
  y as RDSPagination,
110
- v as RDSPersistentToast,
111
- F as RDSProgressBar,
122
+ G as RDSPersistentToast,
123
+ M as RDSProgressBar,
112
124
  f as RDSQuantitySelector,
113
- R as RDSRadioButton,
125
+ n as RDSRadioButton,
114
126
  s as RDSRadioGroup,
115
127
  u as RDSSelectionChip,
116
- j as RDSSidebar,
117
- Q as RDSSidedrawer,
118
- p as RDSSwitch,
128
+ V as RDSSidebar,
129
+ q as RDSSidedrawer,
130
+ R as RDSSwitch,
119
131
  _ as RDSTabBar,
120
- w as RDSTable,
121
- B as RDSTag,
122
- n as RDSTextArea,
132
+ v as RDSTable,
133
+ T as RDSTag,
134
+ p as RDSTextArea,
123
135
  D as RDSTextField,
124
136
  l as RDSToggle,
125
- O as RDSTooltip,
126
- V as VueInstance,
127
- xo as default,
128
- ho as setVueInstance
137
+ Q as RDSTooltip,
138
+ z as VueInstance,
139
+ Fo as default,
140
+ yo as setVueInstance
129
141
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as j, toRefs as E, computed as f, createBlock as d, openBlock as r, resolveDynamicComponent as L, unref as e, normalizeClass as m, withCtx as N, createCommentVNode as i, createElementBlock as S, mergeProps as _, renderSlot as b, createTextVNode as B, toDisplayString as I } from "vue";
2
- import { R as k } from "./icon-svg-_WCkLP8-.js";
3
- import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/link.css';const $ = /* @__PURE__ */ j({
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";
2
+ import { R as v } from "./icon-svg-_WCkLP8-.js";
3
+ import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/link.css';const O = /* @__PURE__ */ E({
5
5
  __name: "link",
6
6
  props: {
7
7
  /**
@@ -73,86 +73,98 @@ import './style/link.css';const $ = /* @__PURE__ */ j({
73
73
  customClass: {
74
74
  type: String,
75
75
  default: ""
76
+ },
77
+ /**
78
+ * <span>Color personalizado para el link. Si se define, sobrescribe el color por defecto. Puede ser cualquier valor CSS válido: #333, rgb(), var(--color), etc.</span>
79
+ */
80
+ color: {
81
+ type: String,
82
+ default: ""
76
83
  }
77
84
  },
78
85
  setup(s) {
79
- const v = s, {
80
- text: y,
81
- to: g,
82
- icon: n,
83
- tag: o,
84
- disabled: c,
85
- inverse: p,
86
- arrow: u,
86
+ const y = s, {
87
+ text: g,
88
+ to: w,
89
+ icon: r,
90
+ tag: u,
91
+ disabled: f,
92
+ inverse: m,
93
+ arrow: d,
87
94
  right: t,
88
95
  underline: h,
89
- customClass: D
90
- } = E(v), R = f(() => {
91
- var l, C;
96
+ customClass: R,
97
+ color: l
98
+ } = L(y), j = c(() => l.value ? { color: l.value } : void 0), z = c(() => {
99
+ var n, C;
92
100
  const a = ["rds-e-link"];
93
- return p.value && a.push("rds-e-link--inverse"), h.value && a.push("rds-e-link--underline"), c.value && a.push("rds-e-style-state-disabled"), ((l = n == null ? void 0 : n.value) == null ? void 0 : l.name) !== "arrow" && a.push("link"), ((C = n == null ? void 0 : n.value) == null ? void 0 : C.name) !== "arrow" && p.value && a.push("link__icon--inverse"), a.join(" ");
94
- }), w = f(() => {
95
- var l;
96
- const a = ["link__icon--arrow"];
97
- return n != null && n.value && (a.push("link__icon"), c.value && a.push("link__icon--disabled")), ((l = n == null ? void 0 : n.value) == null ? void 0 : l.name) !== "arrow" && p.value && a.push("link__icon--inverse"), a.push(
98
- t.value ? "link__icon--animation-right" : "link__icon--animation-left"
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(() => {
103
+ var n;
104
+ 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(
106
+ t.value ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
99
107
  ), a.join(" ");
100
- }), x = f(() => {
108
+ }), x = c(() => {
101
109
  var a;
102
- return u.value || ((a = n == null ? void 0 : n.value) == null ? void 0 : a.name);
110
+ return d.value || ((a = r == null ? void 0 : r.value) == null ? void 0 : a.name);
103
111
  });
104
- return (a, l) => (r(), d(L(e(o) === "a" ? e(o) : "router-link"), {
105
- class: m(R.value),
106
- to: e(o) === "router-link" ? e(g) : null,
107
- href: e(o) === "a" ? e(g) : null,
108
- disable: e(c)
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)
109
118
  }, {
110
- default: N(() => [
111
- e(n).name && !e(t) && !e(u) ? (r(), d(k, _({
119
+ default: $(() => [
120
+ e(r).name && !e(t) && !e(d) ? (o(), p(v, k({
112
121
  key: 0,
113
- name: e(n).name
122
+ name: e(r).name
114
123
  }, {
115
- ...e(n)
124
+ ...e(r)
116
125
  }, {
117
- class: ["rds-e-link__icon-left", w.value]
118
- }), null, 16, ["name", "class"])) : i("", !0),
119
- e(t) ? (r(), S("span", {
126
+ class: ["rds-e-link__icon-left", S.value],
127
+ style: e(l) ? { color: e(l) } : void 0
128
+ }), null, 16, ["name", "class", "style"])) : i("", !0),
129
+ e(t) ? (o(), b("span", {
120
130
  key: 1,
121
- class: m(["rds-e-link__text", [e(D), {
131
+ class: _(["rds-e-link__text", [e(R), {
122
132
  "rds-e-mr-xs": x.value,
123
133
  "rds-e-link__text--underline": e(h)
124
134
  }]])
125
135
  }, [
126
- b(a.$slots, "default", {}, () => [
127
- B(I(e(y)), 1)
136
+ B(a.$slots, "default", {}, () => [
137
+ I(D(e(g)), 1)
128
138
  ], !0)
129
139
  ], 2)) : i("", !0),
130
- e(u) ? (r(), d(k, _({ key: 2 }, {
140
+ e(d) ? (o(), p(v, k({ key: 2 }, {
131
141
  name: e(t) ? "arrow_right" : "arrow_left"
132
142
  }, {
133
- class: ["link__icon--arrow", [
134
- e(t) ? "link__icon--animation-right" : "link__icon--animation-left"
135
- ]]
136
- }), null, 16, ["class"])) : i("", !0),
137
- e(t) ? i("", !0) : (r(), S("span", {
143
+ class: ["rds-e-arrow-link__icon--arrow", [
144
+ e(t) ? "rds-e-arrow-link__icon--animation-right" : "rds-e-arrow-link__icon--animation-left"
145
+ ]],
146
+ style: e(l) ? { color: e(l) } : void 0
147
+ }), null, 16, ["class", "style"])) : i("", !0),
148
+ e(t) ? i("", !0) : (o(), b("span", {
138
149
  key: 3,
139
- class: m(["rds-e-link__text", { "rds-e-ml-xs": x.value }])
150
+ class: _(["rds-e-link__text", { "rds-e-ml-xs": x.value }])
140
151
  }, [
141
- b(a.$slots, "default", {}, () => [
142
- B(I(e(y)), 1)
152
+ B(a.$slots, "default", {}, () => [
153
+ I(D(e(g)), 1)
143
154
  ], !0)
144
155
  ], 2)),
145
- e(n).name && e(t) && !e(u) ? (r(), d(k, _({
156
+ e(r).name && e(t) && !e(d) ? (o(), p(v, k({
146
157
  key: 4,
147
- name: e(n).name
148
- }, e(n), {
149
- class: ["rds-e-link__icon-right", w.value]
150
- }), null, 16, ["name", "class"])) : i("", !0)
158
+ name: e(r).name
159
+ }, e(r), {
160
+ class: ["rds-e-link__icon-right", S.value],
161
+ style: e(l) ? { color: e(l) } : void 0
162
+ }), null, 16, ["name", "class", "style"])) : i("", !0)
151
163
  ]),
152
164
  _: 3
153
- }, 8, ["class", "to", "href", "disable"]));
165
+ }, 8, ["class", "to", "href", "disable", "style"]));
154
166
  }
155
- }), P = /* @__PURE__ */ V($, [["__scopeId", "data-v-d51e1628"]]);
167
+ }), A = /* @__PURE__ */ M(O, [["__scopeId", "data-v-49b40e60"]]);
156
168
  export {
157
- P as default
169
+ A as default
158
170
  };