energy-components 1.3.0 → 1.4.0-beta.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.
- package/dist/components/accordion.es.js +13 -13
- package/dist/components/button.es.js +11 -11
- package/dist/components/checkbox.es.js +7 -7
- package/dist/components/datepicker.es.js +2 -2
- package/dist/components/dropdown.es.js +11 -11
- package/dist/components/{icon-svg-GoL3_ayS.js → icon-svg-u9BWBbvW.js} +1 -1
- package/dist/components/iconList.es.js +5 -5
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +59 -56
- package/dist/components/infoBox.es.js +8 -8
- package/dist/components/link.es.js +15 -15
- package/dist/components/modal.es.js +12 -12
- package/dist/components/persistentToast.es.js +5 -5
- package/dist/components/quantitySelector.es.js +9 -9
- package/dist/components/radioButton.es.js +16 -16
- package/dist/components/selectionChip.es.js +5 -5
- package/dist/components/sidedrawer.es.js +85 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/overlay.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -0
- package/dist/components/style/switch.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/switch.es.js +40 -36
- package/dist/components/tabBar.es.js +12 -12
- package/dist/components/tag.es.js +5 -5
- package/dist/components/textArea.es.js +22 -22
- package/dist/components/textField.es.js +86 -74
- package/dist/components/tooltip.es.js +61 -61
- package/dist/energy-components.es.js +2840 -2744
- package/dist/energy-components.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +12 -3
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +8 -0
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +75 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
4
|
-
import './style/switch.css';const
|
|
1
|
+
import { defineComponent as y, mergeModels as c, useModel as g, ref as r, onMounted as S, onBeforeUnmount as B, openBlock as d, createElementBlock as u, normalizeClass as V, createElementVNode as m, renderSlot as p, createTextVNode as x, toDisplayString as E, createBlock as _, createCommentVNode as f } from "vue";
|
|
2
|
+
import { R as C } from "./icon-svg-u9BWBbvW.js";
|
|
3
|
+
import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/switch.css';const N = ["id", "disabled", "checked"], D = ["for", "aria-label"], L = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "rds-e-switch__label-text"
|
|
7
|
-
},
|
|
7
|
+
}, F = /* @__PURE__ */ y({
|
|
8
8
|
__name: "switch",
|
|
9
|
-
props: {
|
|
9
|
+
props: /* @__PURE__ */ c({
|
|
10
10
|
/**
|
|
11
11
|
* ID del interruptor
|
|
12
12
|
*/
|
|
@@ -42,55 +42,59 @@ import './style/switch.css';const _ = ["id", "disabled", "checked"], N = ["for",
|
|
|
42
42
|
type: Boolean,
|
|
43
43
|
default: !1
|
|
44
44
|
}
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
}, {
|
|
46
|
+
modelValue: { type: Boolean },
|
|
47
|
+
modelModifiers: {}
|
|
48
|
+
}),
|
|
49
|
+
emits: /* @__PURE__ */ c(["update:checked"], ["update:modelValue"]),
|
|
50
|
+
setup(e, { emit: h }) {
|
|
51
|
+
const w = h, a = g(e, "modelValue"), l = r(!1), o = r(!1), b = () => {
|
|
52
|
+
o.value && (l.value = !0);
|
|
53
|
+
}, v = () => l.value = !1, s = (t) => {
|
|
51
54
|
t.key === "Tab" && (o.value = !0);
|
|
52
|
-
},
|
|
55
|
+
}, i = () => {
|
|
53
56
|
o.value = !1;
|
|
54
|
-
},
|
|
55
|
-
|
|
57
|
+
}, k = (t) => {
|
|
58
|
+
const n = t.target.checked;
|
|
59
|
+
a.value = n, w("update:checked", n);
|
|
56
60
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
window.removeEventListener("keydown", s), window.removeEventListener("mousedown",
|
|
61
|
-
}), (t,
|
|
62
|
-
class:
|
|
61
|
+
return S(() => {
|
|
62
|
+
window.addEventListener("keydown", s), window.addEventListener("mousedown", i);
|
|
63
|
+
}), B(() => {
|
|
64
|
+
window.removeEventListener("keydown", s), window.removeEventListener("mousedown", i);
|
|
65
|
+
}), (t, n) => (d(), u("div", {
|
|
66
|
+
class: V(["rds-e-switch", { "rds-e-switch--focused": l.value }])
|
|
63
67
|
}, [
|
|
64
|
-
|
|
68
|
+
m("input", {
|
|
65
69
|
id: e.id.toString(),
|
|
66
70
|
class: "rds-e-switch__input",
|
|
67
71
|
type: "checkbox",
|
|
68
72
|
disabled: e.disabled,
|
|
69
|
-
checked: e.checked,
|
|
70
|
-
onChange:
|
|
71
|
-
onFocus:
|
|
72
|
-
onBlur:
|
|
73
|
-
}, null, 40,
|
|
74
|
-
|
|
73
|
+
checked: a.value !== void 0 ? a.value : e.checked,
|
|
74
|
+
onChange: k,
|
|
75
|
+
onFocus: b,
|
|
76
|
+
onBlur: v
|
|
77
|
+
}, null, 40, N),
|
|
78
|
+
m("label", {
|
|
75
79
|
class: "rds-e-switch__label",
|
|
76
80
|
for: e.id.toString(),
|
|
77
81
|
"aria-label": e.label
|
|
78
82
|
}, [
|
|
79
|
-
e.label || t.$slots["text-label"] ? (
|
|
83
|
+
e.label || t.$slots["text-label"] ? (d(), u("span", L, [
|
|
80
84
|
p(t.$slots, "text-label", {}, () => [
|
|
81
|
-
|
|
85
|
+
x(E(e.label), 1)
|
|
82
86
|
], !0),
|
|
83
|
-
e.icon ? (
|
|
87
|
+
e.icon ? (d(), _(C, {
|
|
84
88
|
key: 0,
|
|
85
89
|
name: e.icon,
|
|
86
90
|
class: "rds-e-switch__label-icon",
|
|
87
91
|
"aria-hidden": "true"
|
|
88
|
-
}, null, 8, ["name"])) :
|
|
89
|
-
])) :
|
|
90
|
-
], 8,
|
|
92
|
+
}, null, 8, ["name"])) : f("", !0)
|
|
93
|
+
])) : f("", !0)
|
|
94
|
+
], 8, D)
|
|
91
95
|
], 2));
|
|
92
96
|
}
|
|
93
|
-
}),
|
|
97
|
+
}), T = /* @__PURE__ */ M(F, [["__scopeId", "data-v-be80169d"]]);
|
|
94
98
|
export {
|
|
95
|
-
|
|
99
|
+
T as default
|
|
96
100
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as N, mergeModels as B, toRefs as W, useModel as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as N, mergeModels as B, toRefs as W, useModel as D, ref as m, computed as h, onMounted as K, nextTick as $, onUnmounted as F, watch as L, openBlock as s, createElementBlock as d, normalizeClass as u, createVNode as R, createCommentVNode as g, createElementVNode as f, Fragment as q, renderList as H, unref as O, withKeys as S, withModifiers as V, createBlock as P, createTextVNode as U, toDisplayString as j, renderSlot as G } from "vue";
|
|
2
|
+
import { R as w } from "./icon-svg-u9BWBbvW.js";
|
|
3
3
|
import { d as J } from "./functions-DIHwdgF0.js";
|
|
4
4
|
import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "onKeydown"], Y = { class: "rds-e-top-bar__item-title" }, Z = {
|
|
@@ -62,9 +62,9 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
|
|
|
62
62
|
}),
|
|
63
63
|
emits: /* @__PURE__ */ B(["activeTabChanged"], ["update:activeTab"]),
|
|
64
64
|
setup(o, { emit: v }) {
|
|
65
|
-
const i = o,
|
|
65
|
+
const i = o, A = v, {
|
|
66
66
|
options: r
|
|
67
|
-
} = W(i),
|
|
67
|
+
} = W(i), M = D(o, "activeTab"), a = m(""), b = m(null), l = m(null);
|
|
68
68
|
let p = [];
|
|
69
69
|
const y = h(() => l.value ? l.value.scrollWidth > l.value.clientWidth : !1), z = h(() => r.value.findIndex((t) => t.id === a.value) > 0 && y.value), E = h(() => l.value ? r.value.findIndex((t) => t.id === a.value) < i.options.length - 1 && y.value : !1), k = (e) => {
|
|
70
70
|
const t = i.options.find((n) => n.id === a.value);
|
|
@@ -92,15 +92,15 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
|
|
|
92
92
|
const C = () => {
|
|
93
93
|
T(a.value);
|
|
94
94
|
};
|
|
95
|
-
return
|
|
96
|
-
await
|
|
95
|
+
return K(async () => {
|
|
96
|
+
await $(), b.value && (p = Array.from(
|
|
97
97
|
b.value.children
|
|
98
98
|
)), a.value = i.options[0].id ?? "", window.addEventListener("resize", J(C, 200));
|
|
99
99
|
}), F(() => {
|
|
100
100
|
window.removeEventListener("resize", C);
|
|
101
101
|
}), L(a, (e) => {
|
|
102
|
-
T(e),
|
|
103
|
-
}), L(
|
|
102
|
+
T(e), A("activeTabChanged", k(!1));
|
|
103
|
+
}), L(M, (e) => c(e)), (e, t) => (s(), d("div", {
|
|
104
104
|
class: u(["rds-e-top-bar", {
|
|
105
105
|
"rds-e-top-bar--fluid": o.fluid,
|
|
106
106
|
"rds-e-top-bar--divider": o.divider
|
|
@@ -114,7 +114,7 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
|
|
|
114
114
|
]),
|
|
115
115
|
onClick: x
|
|
116
116
|
}, [
|
|
117
|
-
|
|
117
|
+
R(w, {
|
|
118
118
|
class: "rds-e-top-bar__icon",
|
|
119
119
|
name: "arrow_left"
|
|
120
120
|
})
|
|
@@ -140,8 +140,8 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
|
|
|
140
140
|
tabindex: a.value === n.id ? 0 : -1,
|
|
141
141
|
onClick: (te) => c(n.id),
|
|
142
142
|
onKeydown: [
|
|
143
|
-
V(
|
|
144
|
-
V(
|
|
143
|
+
S(V(x, ["prevent"]), ["left"]),
|
|
144
|
+
S(V(I, ["prevent"]), ["right"])
|
|
145
145
|
]
|
|
146
146
|
}, [
|
|
147
147
|
f("span", Y, [
|
|
@@ -163,7 +163,7 @@ import './style/tabBar.css';const X = ["aria-selected", "tabindex", "onClick", "
|
|
|
163
163
|
]),
|
|
164
164
|
onClick: I
|
|
165
165
|
}, [
|
|
166
|
-
|
|
166
|
+
R(w, {
|
|
167
167
|
class: "rds-e-top-bar__icon",
|
|
168
168
|
name: "arrow_right"
|
|
169
169
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as h, toRefs as x, computed as u, openBlock as o, createElementBlock as $, normalizeClass as r, unref as t, createBlock as p, createCommentVNode as d, createTextVNode as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as h, toRefs as x, computed as u, openBlock as o, createElementBlock as $, normalizeClass as r, unref as t, createBlock as p, createCommentVNode as d, createTextVNode as S, toDisplayString as B } from "vue";
|
|
2
|
+
import { R as f } from "./icon-svg-u9BWBbvW.js";
|
|
3
3
|
import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
import './style/tag.css';const C = /* @__PURE__ */ h({
|
|
5
5
|
__name: "tag",
|
|
@@ -76,7 +76,7 @@ import './style/tag.css';const C = /* @__PURE__ */ h({
|
|
|
76
76
|
class: r(["rds-e-tag__icon", i.value]),
|
|
77
77
|
"aria-hidden": "true"
|
|
78
78
|
}, null, 8, ["name", "class"])) : d("", !0),
|
|
79
|
-
|
|
79
|
+
S(" " + B(t(_)) + " ", 1),
|
|
80
80
|
t(c) ? (o(), p(f, {
|
|
81
81
|
key: 1,
|
|
82
82
|
name: "arrow_right",
|
|
@@ -85,7 +85,7 @@ import './style/tag.css';const C = /* @__PURE__ */ h({
|
|
|
85
85
|
}, null, 8, ["class"])) : d("", !0)
|
|
86
86
|
], 2));
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
88
|
+
}), D = /* @__PURE__ */ k(C, [["__scopeId", "data-v-e784d437"]]);
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
D as default
|
|
91
91
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as G, mergeModels as J, useModel as K, toRefs as L, ref as O, computed as o, openBlock as s, createElementBlock as f, normalizeClass as h, createElementVNode as a, withDirectives as Q, unref as e, vModelText as W, renderSlot as y, createBlock as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as G, mergeModels as J, useModel as K, toRefs as L, ref as O, computed as o, openBlock as s, createElementBlock as f, normalizeClass as h, createElementVNode as a, withDirectives as Q, unref as e, vModelText as W, renderSlot as y, createBlock as I, mergeProps as q, toHandlers as T, createCommentVNode as i, createTextVNode as X, toDisplayString as u } from "vue";
|
|
2
|
+
import { R as $ } from "./icon-svg-u9BWBbvW.js";
|
|
3
3
|
import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
import './style/textArea.css';function b(t, _ = !0, d = !0) {
|
|
5
5
|
return _ && !t.trim() ? (console.warn("Advertencia: El valor no puede estar vacío"), !1) : d && !/^[\w\-:]+$/.test(t) ? (console.warn("Advertencia: El valor contiene caracteres inválidos"), !1) : !0;
|
|
@@ -138,23 +138,23 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
138
138
|
setup(t) {
|
|
139
139
|
const _ = t, d = K(t, "modelValue"), {
|
|
140
140
|
label: w,
|
|
141
|
-
id:
|
|
141
|
+
id: S,
|
|
142
142
|
disabled: p,
|
|
143
143
|
maxlength: m,
|
|
144
144
|
minlength: g,
|
|
145
145
|
modelValue: c,
|
|
146
146
|
icon: A,
|
|
147
|
-
rightIcon:
|
|
148
|
-
helper:
|
|
147
|
+
rightIcon: k,
|
|
148
|
+
helper: D,
|
|
149
149
|
error: x,
|
|
150
|
-
helperText:
|
|
150
|
+
helperText: R,
|
|
151
151
|
clearable: V,
|
|
152
|
-
lengthError:
|
|
153
|
-
} = L(_), v = O(!1),
|
|
152
|
+
lengthError: z
|
|
153
|
+
} = L(_), v = O(!1), F = () => {
|
|
154
154
|
v.value = !1;
|
|
155
|
-
},
|
|
155
|
+
}, P = () => {
|
|
156
156
|
v.value = !0;
|
|
157
|
-
}, B = o(() => c.value.length === m.value), E = o(() => c.value.length === 0 ? !1 : c.value.length < g.value), N = o(() =>
|
|
157
|
+
}, B = o(() => c.value.length === m.value), E = o(() => c.value.length === 0 ? !1 : c.value.length < g.value), N = o(() => z.value && (B.value || E.value)), j = o(() => {
|
|
158
158
|
const r = [];
|
|
159
159
|
return c.value && r.push("rds-e-textarea--filled"), x.value && r.push("rds-e-textarea--error"), p.value && r.push("rds-e-textarea--disabled"), N.value && r.push("rds-e-textarea--error"), r.join(" ");
|
|
160
160
|
}), l = o(() => {
|
|
@@ -167,7 +167,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
167
167
|
}
|
|
168
168
|
}, n = {
|
|
169
169
|
left: { ...r },
|
|
170
|
-
right: { ...r, name:
|
|
170
|
+
right: { ...r, name: k.value }
|
|
171
171
|
};
|
|
172
172
|
return V.value && (n.right = {
|
|
173
173
|
...r,
|
|
@@ -177,16 +177,16 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
177
177
|
click: () => d.value = ""
|
|
178
178
|
}
|
|
179
179
|
}), n;
|
|
180
|
-
}),
|
|
180
|
+
}), H = o(() => c.value.length);
|
|
181
181
|
return (r, n) => {
|
|
182
|
-
var C,
|
|
182
|
+
var C, M;
|
|
183
183
|
return s(), f("div", {
|
|
184
|
-
class: h(["rds-e-textarea",
|
|
184
|
+
class: h(["rds-e-textarea", j.value])
|
|
185
185
|
}, [
|
|
186
186
|
a("div", Z, [
|
|
187
187
|
a("div", ee, [
|
|
188
188
|
Q(a("textarea", {
|
|
189
|
-
id: (C = e(
|
|
189
|
+
id: (C = e(S)) == null ? void 0 : C.toString(),
|
|
190
190
|
"onUpdate:modelValue": n[0] || (n[0] = (U) => d.value = U),
|
|
191
191
|
type: "text",
|
|
192
192
|
class: h(["rds-e-textarea__input", { "rds-e-textarea__input--active": v.value }]),
|
|
@@ -195,8 +195,8 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
195
195
|
minlength: e(g),
|
|
196
196
|
rows: t.rows,
|
|
197
197
|
disabled: e(p),
|
|
198
|
-
onBlur:
|
|
199
|
-
onFocus:
|
|
198
|
+
onBlur: F,
|
|
199
|
+
onFocus: P
|
|
200
200
|
}, null, 42, te), [
|
|
201
201
|
[W, d.value]
|
|
202
202
|
]),
|
|
@@ -216,14 +216,14 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
216
216
|
])
|
|
217
217
|
], -1)),
|
|
218
218
|
a("label", {
|
|
219
|
-
for: (
|
|
219
|
+
for: (M = e(S)) == null ? void 0 : M.toString(),
|
|
220
220
|
class: h(["rds-e-textarea__label", {
|
|
221
221
|
"rds-e-textarea__label--with-icon": l.value.left.name,
|
|
222
222
|
"rds-e-textarea__label--active": v.value
|
|
223
223
|
}])
|
|
224
224
|
}, [
|
|
225
225
|
y(r.$slots, "left-icon", {}, () => [
|
|
226
|
-
l.value.left.name ? (s(),
|
|
226
|
+
l.value.left.name ? (s(), I($, q({
|
|
227
227
|
key: 0,
|
|
228
228
|
class: ["rds-e-textarea__icon rds-e-textarea__icon--left", { "rds-e-textarea__icon--hidden": v.value }],
|
|
229
229
|
"aria-hidden": "true"
|
|
@@ -237,9 +237,9 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
237
237
|
"rds-e-textarea__counter--clearable": e(V)
|
|
238
238
|
}])
|
|
239
239
|
}, [
|
|
240
|
-
t.counter && !e(
|
|
240
|
+
t.counter && !e(k) ? (s(), f("p", ae, u(H.value) + "/" + u(e(m)), 1)) : i("", !0),
|
|
241
241
|
y(r.$slots, "right-icon", {}, () => [
|
|
242
|
-
l.value.right.name && !l.value.left.name ? (s(),
|
|
242
|
+
l.value.right.name && !l.value.left.name ? (s(), I($, q({
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "rds-e-textarea__icon rds-e-textarea__icon--right",
|
|
245
245
|
"aria-hidden": "true"
|
|
@@ -255,7 +255,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
255
255
|
E.value ? (s(), f("li", ne, " Min text length is " + u(e(g)), 1)) : i("", !0),
|
|
256
256
|
a("li", null, [
|
|
257
257
|
y(r.$slots, "helper-text", {}, () => [
|
|
258
|
-
e(
|
|
258
|
+
e(D) || e(x) ? (s(), f("span", se, u(e(R)), 1)) : i("", !0)
|
|
259
259
|
], !0)
|
|
260
260
|
])
|
|
261
261
|
], 2)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
import './style/textField.css';const
|
|
1
|
+
import { defineComponent as G, toRefs as J, ref as N, computed as i, watch as O, openBlock as c, createElementBlock as v, normalizeClass as _, createElementVNode as d, renderSlot as g, createBlock as Q, mergeProps as S, toHandlers as W, createCommentVNode as y, unref as t, toDisplayString as L, createVNode as X, withModifiers as Y } from "vue";
|
|
2
|
+
import { g as Z } from "./getInstance-GhoEcxLF.js";
|
|
3
|
+
import { R as B } from "./icon-svg-u9BWBbvW.js";
|
|
4
|
+
import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/textField.css';const te = { class: "rds-e-textfield__container" }, le = { class: "rds-e-textfield__input-container" }, re = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], ae = ["for"], ne = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
8
|
-
},
|
|
8
|
+
}, oe = { class: "rds-e-textfield__helper" }, se = /* @__PURE__ */ G({
|
|
9
9
|
__name: "text-field",
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -117,44 +117,52 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
|
|
|
117
117
|
autocomplete: {
|
|
118
118
|
type: String,
|
|
119
119
|
default: "off",
|
|
120
|
-
validator: (l,
|
|
121
|
-
const
|
|
122
|
-
return
|
|
120
|
+
validator: (l, f) => {
|
|
121
|
+
const n = ["new-password", "current-password", "off"];
|
|
122
|
+
return f.password && !n.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${n.join(", ")}`), !1) : !0;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
|
-
emits: ["update:modelValue"],
|
|
127
|
-
setup(l, { emit:
|
|
128
|
-
const
|
|
126
|
+
emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
|
|
127
|
+
setup(l, { emit: f }) {
|
|
128
|
+
const n = l, r = f, {
|
|
129
129
|
label: V,
|
|
130
|
-
disabled:
|
|
131
|
-
maxLength:
|
|
130
|
+
disabled: u,
|
|
131
|
+
maxLength: x,
|
|
132
132
|
minLength: b,
|
|
133
133
|
modelValue: o,
|
|
134
134
|
icon: E,
|
|
135
135
|
rightIcon: I,
|
|
136
|
-
helper:
|
|
137
|
-
error:
|
|
138
|
-
helperText:
|
|
139
|
-
clearable:
|
|
140
|
-
password:
|
|
141
|
-
autocomplete:
|
|
142
|
-
} =
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
136
|
+
helper: C,
|
|
137
|
+
error: p,
|
|
138
|
+
helperText: R,
|
|
139
|
+
clearable: T,
|
|
140
|
+
password: m,
|
|
141
|
+
autocomplete: $
|
|
142
|
+
} = J(n), s = N(!0), h = N(!1), D = Z(), k = i(() => n.id || `text-field-${D}`), q = i(() => {
|
|
143
|
+
if (m.value)
|
|
144
|
+
return $.value;
|
|
145
145
|
}), F = (e) => {
|
|
146
|
-
|
|
146
|
+
r(
|
|
147
147
|
"update:modelValue",
|
|
148
148
|
e.target.value
|
|
149
149
|
);
|
|
150
|
+
}, K = () => {
|
|
151
|
+
h.value = !1;
|
|
150
152
|
}, j = () => {
|
|
151
|
-
|
|
152
|
-
}, P = () => {
|
|
153
|
-
|
|
154
|
-
}, z =
|
|
153
|
+
h.value = !0;
|
|
154
|
+
}, P = (e) => {
|
|
155
|
+
r("keydown", e);
|
|
156
|
+
}, z = (e) => {
|
|
157
|
+
r("keyup", e);
|
|
158
|
+
}, H = (e) => {
|
|
159
|
+
r("keypress", e);
|
|
160
|
+
}, M = (e) => {
|
|
161
|
+
r("change", e);
|
|
162
|
+
}, U = i(() => !!(p.value || o.value.length && (o.value.length < b.value || o.value.length > x.value))), A = i(() => {
|
|
155
163
|
const e = [];
|
|
156
|
-
return o.value && e.push("rds-e-textfield--filled"),
|
|
157
|
-
}),
|
|
164
|
+
return o.value && e.push("rds-e-textfield--filled"), U.value && e.push("rds-e-textfield--error"), u.value && e.push("rds-e-textfield--disabled"), e.join(" ");
|
|
165
|
+
}), a = i(() => {
|
|
158
166
|
const e = {
|
|
159
167
|
name: E.value,
|
|
160
168
|
class: "",
|
|
@@ -162,7 +170,7 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
|
|
|
162
170
|
click: () => {
|
|
163
171
|
}
|
|
164
172
|
}
|
|
165
|
-
},
|
|
173
|
+
}, w = {
|
|
166
174
|
left: {
|
|
167
175
|
...e
|
|
168
176
|
},
|
|
@@ -171,20 +179,20 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
|
|
|
171
179
|
name: I.value
|
|
172
180
|
}
|
|
173
181
|
};
|
|
174
|
-
return
|
|
182
|
+
return m.value ? {
|
|
175
183
|
left: {
|
|
176
184
|
...e,
|
|
177
185
|
name: null
|
|
178
186
|
},
|
|
179
187
|
right: {
|
|
180
188
|
...e,
|
|
181
|
-
name:
|
|
189
|
+
name: s.value ? "eye_open" : "eye_close",
|
|
182
190
|
class: "rds-e-textfield__icon--password",
|
|
183
191
|
events: {
|
|
184
|
-
click: () =>
|
|
192
|
+
click: () => s.value = !s.value
|
|
185
193
|
}
|
|
186
194
|
}
|
|
187
|
-
} :
|
|
195
|
+
} : T.value ? {
|
|
188
196
|
left: {
|
|
189
197
|
...e
|
|
190
198
|
},
|
|
@@ -193,68 +201,72 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
|
|
|
193
201
|
name: "close",
|
|
194
202
|
class: "rds-e-textfield__icon--clear",
|
|
195
203
|
events: {
|
|
196
|
-
click: () =>
|
|
204
|
+
click: () => r("update:modelValue", "")
|
|
197
205
|
}
|
|
198
206
|
}
|
|
199
|
-
} :
|
|
207
|
+
} : w;
|
|
200
208
|
});
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
(e) =>
|
|
209
|
+
return O(
|
|
210
|
+
m,
|
|
211
|
+
(e) => s.value = !e,
|
|
204
212
|
{ immediate: !0 }
|
|
205
|
-
), (e,
|
|
206
|
-
class:
|
|
213
|
+
), (e, w) => (c(), v("div", {
|
|
214
|
+
class: _(["rds-e-textfield", A.value])
|
|
207
215
|
}, [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
216
|
+
d("div", te, [
|
|
217
|
+
g(e.$slots, "left-icon", {}, () => [
|
|
218
|
+
a.value.left.name ? (c(), Q(B, S({
|
|
211
219
|
key: 0,
|
|
212
|
-
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden":
|
|
220
|
+
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": h.value }],
|
|
213
221
|
"aria-hidden": "true"
|
|
214
|
-
},
|
|
222
|
+
}, a.value.left, W(a.value.left.events)), null, 16, ["class"])) : y("", !0)
|
|
215
223
|
], !0),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
id:
|
|
219
|
-
type:
|
|
224
|
+
d("div", le, [
|
|
225
|
+
d("input", {
|
|
226
|
+
id: k.value,
|
|
227
|
+
type: s.value ? "text" : "password",
|
|
220
228
|
class: "rds-e-textfield__input",
|
|
221
|
-
maxLength: t(
|
|
229
|
+
maxLength: t(x),
|
|
222
230
|
minLength: t(b),
|
|
223
|
-
disabled: t(
|
|
231
|
+
disabled: t(u),
|
|
224
232
|
value: t(o),
|
|
225
|
-
autocomplete:
|
|
233
|
+
autocomplete: q.value,
|
|
226
234
|
readonly: l.readonly,
|
|
227
235
|
onInput: F,
|
|
228
|
-
onBlur:
|
|
229
|
-
onFocus:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
236
|
+
onBlur: K,
|
|
237
|
+
onFocus: j,
|
|
238
|
+
onKeydown: P,
|
|
239
|
+
onKeyup: z,
|
|
240
|
+
onKeypress: H,
|
|
241
|
+
onChange: M
|
|
242
|
+
}, null, 40, re),
|
|
243
|
+
d("label", {
|
|
244
|
+
for: k.value,
|
|
245
|
+
class: _(["rds-e-textfield__label", t(u) ? "rds-e-textfield__label--disabled" : ""])
|
|
246
|
+
}, L(t(V)), 11, ae)
|
|
235
247
|
]),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
248
|
+
a.value.right.name || e.$slots["right-icon"] ? (c(), v("span", ne, [
|
|
249
|
+
g(e.$slots, "right-icon", {}, () => [
|
|
250
|
+
X(B, S({
|
|
239
251
|
"aria-hidden": "true",
|
|
240
252
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
241
|
-
},
|
|
242
|
-
onClick:
|
|
253
|
+
}, a.value.right, {
|
|
254
|
+
onClick: Y(a.value.right.events.click, ["stop"])
|
|
243
255
|
}), null, 16, ["onClick"])
|
|
244
256
|
], !0)
|
|
245
|
-
])) :
|
|
257
|
+
])) : y("", !0)
|
|
246
258
|
]),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
(t(
|
|
259
|
+
d("div", oe, [
|
|
260
|
+
g(e.$slots, "helper-text", {}, () => [
|
|
261
|
+
(t(C) || t(p)) && !t(u) ? (c(), v("span", {
|
|
250
262
|
key: 0,
|
|
251
|
-
class:
|
|
252
|
-
},
|
|
263
|
+
class: _(t(p) ? "rds-e-textfield__helper--error" : "")
|
|
264
|
+
}, L(t(R)), 3)) : y("", !0)
|
|
253
265
|
], !0)
|
|
254
266
|
])
|
|
255
267
|
], 2));
|
|
256
268
|
}
|
|
257
|
-
}),
|
|
269
|
+
}), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-b490642c"]]);
|
|
258
270
|
export {
|
|
259
|
-
|
|
271
|
+
fe as default
|
|
260
272
|
};
|