energy-components 1.0.2
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/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/.empty +0 -0
- package/dist/components/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/accordion.es.js +121 -0
- package/dist/components/accordionGroup.es.js +32 -0
- package/dist/components/actionButton.es.js +64 -0
- package/dist/components/breadcrumbs.es.js +90 -0
- package/dist/components/button.es.js +144 -0
- package/dist/components/checkbox.es.js +130 -0
- package/dist/components/divider.es.js +35 -0
- package/dist/components/dropdown.es.js +331 -0
- package/dist/components/floatingActionButton.es.js +97 -0
- package/dist/components/functions-DIHwdgF0.js +18 -0
- package/dist/components/icon-svg-Cpx09myr.js +10818 -0
- package/dist/components/iconList.es.js +49 -0
- package/dist/components/iconSvg.es.js +5 -0
- package/dist/components/index.es.js +81 -0
- package/dist/components/indicator.es.js +175 -0
- package/dist/components/link.es.js +147 -0
- package/dist/components/multiselect.es.js +1039 -0
- package/dist/components/pagination.es.js +138 -0
- package/dist/components/radioButton.es.js +111 -0
- package/dist/components/style/accordion.css +1 -0
- package/dist/components/style/accordionGroup.css +1 -0
- package/dist/components/style/actionButton.css +1 -0
- package/dist/components/style/breadcrumbs.css +1 -0
- package/dist/components/style/button.css +1 -0
- package/dist/components/style/checkbox.css +1 -0
- package/dist/components/style/divider.css +1 -0
- package/dist/components/style/dropdown.css +1 -0
- package/dist/components/style/floatingActionButton.css +1 -0
- package/dist/components/style/icon-svg.css +1 -0
- package/dist/components/style/iconList.css +1 -0
- package/dist/components/style/indicator.css +1 -0
- package/dist/components/style/link.css +1 -0
- package/dist/components/style/multiselect.css +1 -0
- package/dist/components/style/pagination.css +1 -0
- package/dist/components/style/radioButton.css +1 -0
- package/dist/components/style/switch.css +1 -0
- package/dist/components/style/tabBar.css +1 -0
- package/dist/components/style/tag.css +1 -0
- package/dist/components/style/textArea.css +1 -0
- package/dist/components/style/textField.css +1 -0
- package/dist/components/style/tooltip.css +1 -0
- package/dist/components/switch.es.js +96 -0
- package/dist/components/tabBar.es.js +181 -0
- package/dist/components/tag.es.js +91 -0
- package/dist/components/textArea.es.js +259 -0
- package/dist/components/textField.es.js +254 -0
- package/dist/components/tooltip.es.js +1082 -0
- package/dist/energy-components.es.js +15368 -0
- package/dist/energy-components.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +100 -0
- package/dist/types/src/components/buttons/button/button.vue.d.ts +196 -0
- package/dist/types/src/components/buttons/constants/buttonDocs.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/buttonPosition.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/socialMedia.d.ts +1 -0
- package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +136 -0
- package/dist/types/src/components/content/accordion/accordion.vue.d.ts +122 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.d.ts +6 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.vue.d.ts +33 -0
- package/dist/types/src/components/content/divider/divider.vue.d.ts +35 -0
- package/dist/types/src/components/content/tag/tag.vue.d.ts +105 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +100 -0
- package/dist/types/src/components/icon-svg/icon-list.d.ts +11 -0
- package/dist/types/src/components/icon-svg/icon-list.vue.d.ts +2 -0
- package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +68 -0
- package/dist/types/src/components/index.d.ts +20 -0
- package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +151 -0
- package/dist/types/src/components/input/dropdown/Multiselect/Multiselect.vue.d.ts +2 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +270 -0
- package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +114 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +104 -0
- package/dist/types/src/components/input/text-area/text-area.vue.d.ts +281 -0
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +271 -0
- package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +63 -0
- package/dist/types/src/components/navigation/link/link.types.d.ts +15 -0
- package/dist/types/src/components/navigation/link/link.vue.d.ts +175 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +67 -0
- package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +132 -0
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +118 -0
- package/dist/types/src/helpers/functions.d.ts +3 -0
- package/dist/types/src/helpers/stories.helpers.d.ts +1 -0
- package/dist/types/src/helpers/validation.d.ts +1 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent as p, ref as a, computed as v, openBlock as s, createElementBlock as i, Fragment as u, withDirectives as f, createElementVNode as r, vModelText as C, renderList as L, normalizeClass as x, createVNode as g, toDisplayString as h } from "vue";
|
|
2
|
+
import { i as m, R as k } from "./icon-svg-Cpx09myr.js";
|
|
3
|
+
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/iconList.css';const y = { class: "rds-icon-list" }, D = ["onClick"], N = /* @__PURE__ */ p({
|
|
5
|
+
__name: "icon-list",
|
|
6
|
+
setup(S) {
|
|
7
|
+
const o = a(""), l = a(!1), c = a(""), d = v(() => {
|
|
8
|
+
let t = m;
|
|
9
|
+
return o.value.length > 2 && (t = m.filter(
|
|
10
|
+
(n) => n.name.toLowerCase().includes(o.value.toLowerCase())
|
|
11
|
+
)), t.sort(
|
|
12
|
+
(n, e) => n.name.localeCompare(e.name)
|
|
13
|
+
);
|
|
14
|
+
}), _ = (t) => {
|
|
15
|
+
navigator.clipboard.writeText(t).then(() => {
|
|
16
|
+
c.value = t, l.value = !0;
|
|
17
|
+
}), setTimeout(() => {
|
|
18
|
+
l.value = !1;
|
|
19
|
+
}, 1e3);
|
|
20
|
+
};
|
|
21
|
+
return (t, n) => (s(), i(u, null, [
|
|
22
|
+
f(r("input", {
|
|
23
|
+
"onUpdate:modelValue": n[0] || (n[0] = (e) => o.value = e),
|
|
24
|
+
class: "rds-icon-list__filter",
|
|
25
|
+
type: "text",
|
|
26
|
+
placeholder: "Filtrar iconos"
|
|
27
|
+
}, null, 512), [
|
|
28
|
+
[C, o.value]
|
|
29
|
+
]),
|
|
30
|
+
r("div", y, [
|
|
31
|
+
(s(!0), i(u, null, L(d.value, (e) => (s(), i("div", {
|
|
32
|
+
key: e.name,
|
|
33
|
+
class: x(["rds-icon-list__item", {
|
|
34
|
+
"rds-icon-list__item--active": l.value && c.value === e.name
|
|
35
|
+
}]),
|
|
36
|
+
onClick: (T) => _(e.name)
|
|
37
|
+
}, [
|
|
38
|
+
g(k, {
|
|
39
|
+
name: e.name
|
|
40
|
+
}, null, 8, ["name"]),
|
|
41
|
+
r("code", null, h(e.name), 1)
|
|
42
|
+
], 10, D))), 128))
|
|
43
|
+
])
|
|
44
|
+
], 64));
|
|
45
|
+
}
|
|
46
|
+
}), E = /* @__PURE__ */ w(N, [["__scopeId", "data-v-29b3c814"]]);
|
|
47
|
+
export {
|
|
48
|
+
E as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { R as i } from "./icon-svg-Cpx09myr.js";
|
|
2
|
+
import n from "./button.es.js";
|
|
3
|
+
import a from "./floatingActionButton.es.js";
|
|
4
|
+
import m from "./actionButton.es.js";
|
|
5
|
+
import c from "./checkbox.es.js";
|
|
6
|
+
import e from "./textField.es.js";
|
|
7
|
+
import S from "./textArea.es.js";
|
|
8
|
+
import p from "./switch.es.js";
|
|
9
|
+
import D from "./radioButton.es.js";
|
|
10
|
+
import R from "./dropdown.es.js";
|
|
11
|
+
import d from "./tag.es.js";
|
|
12
|
+
import f from "./accordionGroup.es.js";
|
|
13
|
+
import s from "./accordion.es.js";
|
|
14
|
+
import u from "./divider.es.js";
|
|
15
|
+
import l from "./link.es.js";
|
|
16
|
+
import b from "./breadcrumbs.es.js";
|
|
17
|
+
import A from "./tabBar.es.js";
|
|
18
|
+
import B from "./pagination.es.js";
|
|
19
|
+
import T from "./indicator.es.js";
|
|
20
|
+
import g from "./tooltip.es.js";
|
|
21
|
+
const r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
RDSAccordion: s,
|
|
24
|
+
RDSAccordionGroup: f,
|
|
25
|
+
RDSActionButton: m,
|
|
26
|
+
RDSBreadcrumbs: b,
|
|
27
|
+
RDSButton: n,
|
|
28
|
+
RDSCheckbox: c,
|
|
29
|
+
RDSDivider: u,
|
|
30
|
+
RDSDropdown: R,
|
|
31
|
+
RDSFloatinActionButton: a,
|
|
32
|
+
RDSIconSvg: i,
|
|
33
|
+
RDSIndicator: T,
|
|
34
|
+
RDSLink: l,
|
|
35
|
+
RDSPagination: B,
|
|
36
|
+
RDSRadioButton: D,
|
|
37
|
+
RDSSwitch: p,
|
|
38
|
+
RDSTabBar: A,
|
|
39
|
+
RDSTag: d,
|
|
40
|
+
RDSTextArea: S,
|
|
41
|
+
RDSTextField: e,
|
|
42
|
+
RDSTooltip: g
|
|
43
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
44
|
+
let x;
|
|
45
|
+
function H(o) {
|
|
46
|
+
x = o;
|
|
47
|
+
}
|
|
48
|
+
const J = {
|
|
49
|
+
install: (o) => {
|
|
50
|
+
for (const t in r)
|
|
51
|
+
o.component(
|
|
52
|
+
t,
|
|
53
|
+
r[t]
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
s as RDSAccordion,
|
|
59
|
+
f as RDSAccordionGroup,
|
|
60
|
+
m as RDSActionButton,
|
|
61
|
+
b as RDSBreadcrumbs,
|
|
62
|
+
n as RDSButton,
|
|
63
|
+
c as RDSCheckbox,
|
|
64
|
+
u as RDSDivider,
|
|
65
|
+
R as RDSDropdown,
|
|
66
|
+
a as RDSFloatinActionButton,
|
|
67
|
+
i as RDSIconSvg,
|
|
68
|
+
T as RDSIndicator,
|
|
69
|
+
l as RDSLink,
|
|
70
|
+
B as RDSPagination,
|
|
71
|
+
D as RDSRadioButton,
|
|
72
|
+
p as RDSSwitch,
|
|
73
|
+
A as RDSTabBar,
|
|
74
|
+
d as RDSTag,
|
|
75
|
+
S as RDSTextArea,
|
|
76
|
+
e as RDSTextField,
|
|
77
|
+
g as RDSTooltip,
|
|
78
|
+
x as VueInstance,
|
|
79
|
+
J as default,
|
|
80
|
+
H as setVueInstance
|
|
81
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { defineComponent as k, toRefs as z, ref as y, computed as N, watch as S, onMounted as q, onBeforeUnmount as P, openBlock as d, createElementBlock as u, normalizeClass as h, createElementVNode as p, normalizeStyle as V, Fragment as W, renderList as I, toDisplayString as B, createCommentVNode as C } from "vue";
|
|
2
|
+
import { d as T, t as A, a as D } from "./functions-DIHwdgF0.js";
|
|
3
|
+
import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/indicator.css';const M = { class: "rds-indicator__inner" }, U = { class: "rds-indicator__step-content" }, X = { key: 0 }, Y = /* @__PURE__ */ k({
|
|
5
|
+
__name: "indicator",
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* Los pasos a mostrar en el indicador.
|
|
9
|
+
*/
|
|
10
|
+
steps: {
|
|
11
|
+
type: Array,
|
|
12
|
+
required: !0,
|
|
13
|
+
validator(i) {
|
|
14
|
+
return !Array.isArray(i) || i.length === 0 ? (console.warn("Advertencia: steps debe ser un array no vacío de strings."), !1) : i.every((o) => typeof o != "string" ? (console.warn(`Advertencia: Todos los elementos en steps deben ser strings. Encontrado: ${typeof o}`), !1) : /^[a-z0-9\s]+$/i.test(o) ? !0 : (console.warn(`Advertencia: El paso "${o}" contiene caracteres no permitidos. Solo se permiten letras, números y espacios.`), !1));
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* El paso actual en el indicador.
|
|
19
|
+
*/
|
|
20
|
+
currentStep: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: !0,
|
|
23
|
+
validator(i) {
|
|
24
|
+
return typeof i != "number" ? (console.warn("Advertencia: currentStep debe ser un número."), !1) : i <= 0 ? (console.warn("Advertencia: currentStep debe ser mayor que 0."), !1) : Number.isInteger(i) ? !0 : (console.warn("Advertencia: currentStep debe ser un número entero."), !1);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* La dirección del indicador, ya sea 'horizontal' o 'vertical'.
|
|
29
|
+
*/
|
|
30
|
+
direction: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "horizontal"
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* La variante del indicador, ya sea 'default' o 'small'.
|
|
36
|
+
*/
|
|
37
|
+
variant: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "default"
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Si el indicador debe ocupar todo el ancho.
|
|
43
|
+
*/
|
|
44
|
+
fullWidth: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Si las etiquetas deben ser elipsadas.
|
|
50
|
+
*/
|
|
51
|
+
ellipsis: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
setup(i) {
|
|
57
|
+
const t = i, {
|
|
58
|
+
direction: o,
|
|
59
|
+
currentStep: f,
|
|
60
|
+
steps: $,
|
|
61
|
+
fullWidth: R
|
|
62
|
+
} = z(t), _ = y(null), v = y(null), c = y([]), E = N(() => {
|
|
63
|
+
let r = t.currentStep;
|
|
64
|
+
const e = t.steps.length, s = o.value === "vertical" ? "height" : "width";
|
|
65
|
+
if (r < 1)
|
|
66
|
+
return {
|
|
67
|
+
[s]: "0%"
|
|
68
|
+
};
|
|
69
|
+
if (r > e && (r = e), e === 1)
|
|
70
|
+
return {
|
|
71
|
+
[s]: "100%"
|
|
72
|
+
};
|
|
73
|
+
const a = (r - 1) / (e - 1) * 100, n = r < e ? 100 / (e - 1) / 2 : 0;
|
|
74
|
+
return {
|
|
75
|
+
[s]: `${a + n}%`
|
|
76
|
+
};
|
|
77
|
+
}), b = () => {
|
|
78
|
+
if (_.value && v.value) {
|
|
79
|
+
const r = v.value, e = c.value[0];
|
|
80
|
+
if (e) {
|
|
81
|
+
if (o.value === "vertical") {
|
|
82
|
+
const s = e.getBoundingClientRect(), a = _.value.getBoundingClientRect(), n = s.left + s.width / 2 - a.left;
|
|
83
|
+
r.style.left = `${n}px`;
|
|
84
|
+
}
|
|
85
|
+
if (o.value === "horizontal") {
|
|
86
|
+
const s = e.getBoundingClientRect(), a = _.value.getBoundingClientRect(), n = s.top + s.height / 2 - a.top;
|
|
87
|
+
r.style.top = `${n}px`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, L = (r) => {
|
|
92
|
+
const e = r === 0 || r === t.steps.length - 1, s = !e;
|
|
93
|
+
return {
|
|
94
|
+
"rds-indicator__step-wrapper--first": r === 0,
|
|
95
|
+
"rds-indicator__step-wrapper--last": r === t.steps.length - 1,
|
|
96
|
+
"rds-indicator__step-wrapper--side": e,
|
|
97
|
+
"rds-indicator__step-wrapper--central": s
|
|
98
|
+
};
|
|
99
|
+
}, g = () => {
|
|
100
|
+
!t.steps || !t.steps.length || t.steps.forEach((r, e) => {
|
|
101
|
+
var w;
|
|
102
|
+
const s = e < f.value, a = e === f.value - 1;
|
|
103
|
+
let n = (w = c.value[e]) == null ? void 0 : w.classList, l = [];
|
|
104
|
+
n && (n = Array.from(n), l = Array.from(n), l = A(
|
|
105
|
+
l,
|
|
106
|
+
"rds-indicator__bullet--active",
|
|
107
|
+
s
|
|
108
|
+
), l = A(
|
|
109
|
+
l,
|
|
110
|
+
"rds-indicator__bullet--current",
|
|
111
|
+
a
|
|
112
|
+
), D(n, l) || setTimeout(() => {
|
|
113
|
+
c.value[e].classList.remove(...n), c.value[e].classList.add(...l);
|
|
114
|
+
}, 150));
|
|
115
|
+
});
|
|
116
|
+
}, m = () => {
|
|
117
|
+
b();
|
|
118
|
+
};
|
|
119
|
+
return S(
|
|
120
|
+
[o, $, R],
|
|
121
|
+
() => {
|
|
122
|
+
m(), g();
|
|
123
|
+
},
|
|
124
|
+
{ immediate: !0 }
|
|
125
|
+
), S(f, () => {
|
|
126
|
+
g();
|
|
127
|
+
}), q(() => {
|
|
128
|
+
b(), g(), window.addEventListener("resize", T(m, 200));
|
|
129
|
+
}), P(() => {
|
|
130
|
+
window.removeEventListener("resize", m);
|
|
131
|
+
}), (r, e) => (d(), u("div", {
|
|
132
|
+
ref_key: "$indicator",
|
|
133
|
+
ref: _,
|
|
134
|
+
class: h(["rds-indicator", [
|
|
135
|
+
`rds-indicator--${t.direction}`,
|
|
136
|
+
{ "rds-indicator--small": t.variant === "small" },
|
|
137
|
+
{ "rds-indicator--full-width": t.fullWidth }
|
|
138
|
+
]])
|
|
139
|
+
}, [
|
|
140
|
+
p("div", M, [
|
|
141
|
+
p("div", {
|
|
142
|
+
ref_key: "$progressBar",
|
|
143
|
+
ref: v,
|
|
144
|
+
class: "rds-indicator__progress-bar"
|
|
145
|
+
}, [
|
|
146
|
+
p("div", {
|
|
147
|
+
class: "rds-indicator__progress-bar__fill",
|
|
148
|
+
style: V(E.value)
|
|
149
|
+
}, null, 4)
|
|
150
|
+
], 512),
|
|
151
|
+
(d(!0), u(W, null, I(t.steps, (s, a) => (d(), u("div", {
|
|
152
|
+
key: a,
|
|
153
|
+
class: h(["rds-indicator__step-wrapper", L(a)])
|
|
154
|
+
}, [
|
|
155
|
+
p("div", U, [
|
|
156
|
+
p("div", {
|
|
157
|
+
ref_for: !0,
|
|
158
|
+
ref: (n) => c.value[a] = n,
|
|
159
|
+
class: "rds-indicator__bullet"
|
|
160
|
+
}, [
|
|
161
|
+
t.variant !== "small" ? (d(), u("span", X, B(a + 1), 1)) : C("", !0)
|
|
162
|
+
], 512)
|
|
163
|
+
]),
|
|
164
|
+
t.variant !== "small" ? (d(), u("div", {
|
|
165
|
+
key: 0,
|
|
166
|
+
class: h(["rds-indicator__label", { "rds-indicator__label--ellipsis": t.ellipsis }])
|
|
167
|
+
}, B(s), 3)) : C("", !0)
|
|
168
|
+
], 2))), 128))
|
|
169
|
+
])
|
|
170
|
+
], 2));
|
|
171
|
+
}
|
|
172
|
+
}), J = /* @__PURE__ */ F(Y, [["__scopeId", "data-v-9e7f9ded"]]);
|
|
173
|
+
export {
|
|
174
|
+
J as default
|
|
175
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { defineComponent as R, toRefs as j, computed as c, openBlock as l, createBlock as d, resolveDynamicComponent as E, unref as e, normalizeClass as m, withCtx as L, mergeProps as _, createCommentVNode as i, createElementBlock as B, renderSlot as C, createTextVNode as S, toDisplayString as I } from "vue";
|
|
2
|
+
import { R as k } from "./icon-svg-Cpx09myr.js";
|
|
3
|
+
import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/link.css';const V = /* @__PURE__ */ R({
|
|
5
|
+
__name: "link",
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* <span>Texto a mostrar en el link</span>
|
|
9
|
+
*/
|
|
10
|
+
text: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: !0
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* <span>Url a la que redirige el link</span>
|
|
16
|
+
*/
|
|
17
|
+
to: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* <span>Icono a mostrar en el link</span>
|
|
23
|
+
*/
|
|
24
|
+
icon: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({ name: "", modifier: "" }),
|
|
27
|
+
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)
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* <span>Tag del link</span>
|
|
31
|
+
*/
|
|
32
|
+
tag: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "router-link"
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* <span>Indica si el link esta deshabilitado</span>
|
|
38
|
+
*/
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* <span>Indica si el link tiene underline</span>
|
|
45
|
+
*/
|
|
46
|
+
underline: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* <span>Indica si el link es inverso</span>
|
|
52
|
+
*/
|
|
53
|
+
inverse: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* <span>Indica si el link tiene una flecha</span>
|
|
59
|
+
*/
|
|
60
|
+
arrow: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* <span>Indica si el icono esta a la derecha</span>
|
|
66
|
+
*/
|
|
67
|
+
right: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: !0
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
setup(s) {
|
|
73
|
+
const v = s, {
|
|
74
|
+
text: y,
|
|
75
|
+
to: g,
|
|
76
|
+
icon: n,
|
|
77
|
+
tag: o,
|
|
78
|
+
disabled: p,
|
|
79
|
+
inverse: f,
|
|
80
|
+
arrow: u,
|
|
81
|
+
right: t,
|
|
82
|
+
underline: h
|
|
83
|
+
} = j(v), D = c(() => {
|
|
84
|
+
var r, b;
|
|
85
|
+
const a = ["rds-link"];
|
|
86
|
+
return f.value && a.push("rds-link--inverse"), h.value && a.push("rds-link--underline"), p.value && a.push("rds-style-state-disabled"), ((r = n == null ? void 0 : n.value) == null ? void 0 : r.name) !== "arrow" && a.push("link"), ((b = n == null ? void 0 : n.value) == null ? void 0 : b.name) !== "arrow" && f.value && a.push("link__icon--inverse"), a.join(" ");
|
|
87
|
+
}), w = c(() => {
|
|
88
|
+
var r;
|
|
89
|
+
const a = ["link__icon--arrow"];
|
|
90
|
+
return n != null && n.value && (a.push("link__icon"), p.value && a.push("link__icon--disabled")), ((r = n == null ? void 0 : n.value) == null ? void 0 : r.name) !== "arrow" && f.value && a.push("link__icon--inverse"), a.push(
|
|
91
|
+
t.value ? "link__icon--animation-right" : "link__icon--animation-left"
|
|
92
|
+
), a.join(" ");
|
|
93
|
+
}), x = c(() => {
|
|
94
|
+
var a;
|
|
95
|
+
return u.value || ((a = n == null ? void 0 : n.value) == null ? void 0 : a.name);
|
|
96
|
+
});
|
|
97
|
+
return (a, r) => (l(), d(E(e(o) === "a" ? e(o) : "router-link"), {
|
|
98
|
+
class: m(D.value),
|
|
99
|
+
to: e(o) === "router-link" ? e(g) : null,
|
|
100
|
+
href: e(o) === "a" ? e(g) : null,
|
|
101
|
+
disable: e(p)
|
|
102
|
+
}, {
|
|
103
|
+
default: L(() => [
|
|
104
|
+
e(n) && !e(t) && !e(u) ? (l(), d(k, _({
|
|
105
|
+
key: 0,
|
|
106
|
+
name: e(n).name
|
|
107
|
+
}, {
|
|
108
|
+
...e(n)
|
|
109
|
+
}, { class: w.value }), null, 16, ["name", "class"])) : i("", !0),
|
|
110
|
+
e(t) ? (l(), B("span", {
|
|
111
|
+
key: 1,
|
|
112
|
+
class: m(["rds-link__text", {
|
|
113
|
+
"rds-mr-xs": x.value,
|
|
114
|
+
"rds-link__text--underline": e(h)
|
|
115
|
+
}])
|
|
116
|
+
}, [
|
|
117
|
+
C(a.$slots, "default", {}, () => [
|
|
118
|
+
S(I(e(y)), 1)
|
|
119
|
+
], !0)
|
|
120
|
+
], 2)) : i("", !0),
|
|
121
|
+
e(u) ? (l(), d(k, _({ key: 2 }, {
|
|
122
|
+
name: e(t) ? "arrow_right" : "arrow_left"
|
|
123
|
+
}, {
|
|
124
|
+
class: ["link__icon--arrow", [
|
|
125
|
+
e(t) ? "link__icon--animation-right" : "link__icon--animation-left"
|
|
126
|
+
]]
|
|
127
|
+
}), null, 16, ["class"])) : i("", !0),
|
|
128
|
+
e(t) ? i("", !0) : (l(), B("span", {
|
|
129
|
+
key: 3,
|
|
130
|
+
class: m(["rds-link__text", { "rds-ml-xs": x.value }])
|
|
131
|
+
}, [
|
|
132
|
+
C(a.$slots, "default", {}, () => [
|
|
133
|
+
S(I(e(y)), 1)
|
|
134
|
+
], !0)
|
|
135
|
+
], 2)),
|
|
136
|
+
e(n) && e(t) && !e(u) ? (l(), d(k, _({
|
|
137
|
+
key: 4,
|
|
138
|
+
name: e(n).name
|
|
139
|
+
}, e(n), { class: w.value }), null, 16, ["name", "class"])) : i("", !0)
|
|
140
|
+
]),
|
|
141
|
+
_: 3
|
|
142
|
+
}, 8, ["class", "to", "href", "disable"]));
|
|
143
|
+
}
|
|
144
|
+
}), M = /* @__PURE__ */ N(V, [["__scopeId", "data-v-8883f921"]]);
|
|
145
|
+
export {
|
|
146
|
+
M as default
|
|
147
|
+
};
|