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.
Files changed (37) hide show
  1. package/dist/components/accordion.es.js +13 -13
  2. package/dist/components/button.es.js +11 -11
  3. package/dist/components/checkbox.es.js +7 -7
  4. package/dist/components/datepicker.es.js +2 -2
  5. package/dist/components/dropdown.es.js +11 -11
  6. package/dist/components/{icon-svg-GoL3_ayS.js → icon-svg-u9BWBbvW.js} +1 -1
  7. package/dist/components/iconList.es.js +5 -5
  8. package/dist/components/iconSvg.es.js +1 -1
  9. package/dist/components/index.es.js +59 -56
  10. package/dist/components/infoBox.es.js +8 -8
  11. package/dist/components/link.es.js +15 -15
  12. package/dist/components/modal.es.js +12 -12
  13. package/dist/components/persistentToast.es.js +5 -5
  14. package/dist/components/quantitySelector.es.js +9 -9
  15. package/dist/components/radioButton.es.js +16 -16
  16. package/dist/components/selectionChip.es.js +5 -5
  17. package/dist/components/sidedrawer.es.js +85 -0
  18. package/dist/components/style/datepicker.css +1 -1
  19. package/dist/components/style/overlay.css +1 -1
  20. package/dist/components/style/sidedrawer.css +1 -0
  21. package/dist/components/style/switch.css +1 -1
  22. package/dist/components/style/textField.css +1 -1
  23. package/dist/components/switch.es.js +40 -36
  24. package/dist/components/tabBar.es.js +12 -12
  25. package/dist/components/tag.es.js +5 -5
  26. package/dist/components/textArea.es.js +22 -22
  27. package/dist/components/textField.es.js +86 -74
  28. package/dist/components/tooltip.es.js +61 -61
  29. package/dist/energy-components.es.js +2840 -2744
  30. package/dist/energy-components.umd.js +1 -1
  31. package/dist/style.css +1 -1
  32. package/dist/types/src/components/index.d.ts +1 -0
  33. package/dist/types/src/components/input/switch/switch.vue.d.ts +12 -3
  34. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +8 -0
  35. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +75 -0
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +2 -2
@@ -1,12 +1,12 @@
1
- import { defineComponent as v, ref as i, onMounted as k, onBeforeUnmount as y, openBlock as n, createElementBlock as c, normalizeClass as g, createElementVNode as r, renderSlot as p, createTextVNode as S, toDisplayString as B, createBlock as V, createCommentVNode as u } from "vue";
2
- import { I as x } from "./icon-svg-GoL3_ayS.js";
3
- import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/switch.css';const _ = ["id", "disabled", "checked"], N = ["for", "aria-label"], C = {
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
- }, L = /* @__PURE__ */ v({
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
- emits: ["update:modelValue"],
47
- setup(e, { emit: m }) {
48
- const f = e, l = m, a = i(!1), o = i(!1), h = () => {
49
- o.value && (a.value = !0);
50
- }, w = () => a.value = !1, s = (t) => {
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
- }, d = () => {
55
+ }, i = () => {
53
56
  o.value = !1;
54
- }, b = (t) => {
55
- l("update:modelValue", t.target.checked);
57
+ }, k = (t) => {
58
+ const n = t.target.checked;
59
+ a.value = n, w("update:checked", n);
56
60
  };
57
- return k(() => {
58
- l("update:modelValue", f.checked), window.addEventListener("keydown", s), window.addEventListener("mousedown", d);
59
- }), y(() => {
60
- window.removeEventListener("keydown", s), window.removeEventListener("mousedown", d);
61
- }), (t, D) => (n(), c("div", {
62
- class: g(["rds-e-switch", { "rds-e-switch--focused": a.value }])
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
- r("input", {
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: b,
71
- onFocus: h,
72
- onBlur: w
73
- }, null, 40, _),
74
- r("label", {
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"] ? (n(), c("span", C, [
83
+ e.label || t.$slots["text-label"] ? (d(), u("span", L, [
80
84
  p(t.$slots, "text-label", {}, () => [
81
- S(B(e.label), 1)
85
+ x(E(e.label), 1)
82
86
  ], !0),
83
- e.icon ? (n(), V(x, {
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"])) : u("", !0)
89
- ])) : u("", !0)
90
- ], 8, N)
92
+ }, null, 8, ["name"])) : f("", !0)
93
+ ])) : f("", !0)
94
+ ], 8, D)
91
95
  ], 2));
92
96
  }
93
- }), M = /* @__PURE__ */ E(L, [["__scopeId", "data-v-5f2be083"]]);
97
+ }), T = /* @__PURE__ */ M(F, [["__scopeId", "data-v-be80169d"]]);
94
98
  export {
95
- M as default
99
+ T as default
96
100
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as N, mergeModels as B, toRefs as W, useModel as K, ref as m, computed as h, onMounted as $, nextTick as D, onUnmounted as F, watch as L, openBlock as s, createElementBlock as d, normalizeClass as u, createVNode as S, createCommentVNode as g, createElementVNode as f, Fragment as q, renderList as H, unref as O, withKeys as V, withModifiers as A, createBlock as P, createTextVNode as U, toDisplayString as j, renderSlot as G } from "vue";
2
- import { I as w } from "./icon-svg-GoL3_ayS.js";
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, M = v, {
65
+ const i = o, A = v, {
66
66
  options: r
67
- } = W(i), R = K(o, "activeTab"), a = m(""), b = m(null), l = m(null);
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 $(async () => {
96
- await D(), b.value && (p = Array.from(
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), M("activeTabChanged", k(!1));
103
- }), L(R, (e) => c(e)), (e, t) => (s(), d("div", {
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
- S(w, {
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(A(x, ["prevent"]), ["left"]),
144
- V(A(I, ["prevent"]), ["right"])
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
- S(w, {
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 B, toDisplayString as S } from "vue";
2
- import { I as f } from "./icon-svg-GoL3_ayS.js";
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
- B(" " + S(t(_)) + " ", 1),
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
- }), j = /* @__PURE__ */ k(C, [["__scopeId", "data-v-e784d437"]]);
88
+ }), D = /* @__PURE__ */ k(C, [["__scopeId", "data-v-e784d437"]]);
89
89
  export {
90
- j as default
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 M, mergeProps as q, toHandlers as T, createCommentVNode as i, createTextVNode as X, toDisplayString as u } from "vue";
2
- import { I as $ } from "./icon-svg-GoL3_ayS.js";
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: k,
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: S,
148
- helper: z,
147
+ rightIcon: k,
148
+ helper: D,
149
149
  error: x,
150
- helperText: D,
150
+ helperText: R,
151
151
  clearable: V,
152
- lengthError: F
153
- } = L(_), v = O(!1), P = () => {
152
+ lengthError: z
153
+ } = L(_), v = O(!1), F = () => {
154
154
  v.value = !1;
155
- }, j = () => {
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(() => F.value && (B.value || E.value)), H = 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: S.value }
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
- }), R = o(() => c.value.length);
180
+ }), H = o(() => c.value.length);
181
181
  return (r, n) => {
182
- var C, I;
182
+ var C, M;
183
183
  return s(), f("div", {
184
- class: h(["rds-e-textarea", H.value])
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(k)) == null ? void 0 : C.toString(),
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: P,
199
- onFocus: j
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: (I = e(k)) == null ? void 0 : I.toString(),
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(), M($, q({
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(S) ? (s(), f("p", ae, u(R.value) + "/" + u(e(m)), 1)) : i("", !0),
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(), M($, q({
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(z) || e(x) ? (s(), f("span", se, u(e(D)), 1)) : i("", !0)
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 M, toRefs as U, ref as w, computed as s, watch as A, openBlock as u, createElementBlock as v, normalizeClass as h, createElementVNode as i, renderSlot as _, createBlock as G, mergeProps as L, toHandlers as J, createCommentVNode as g, unref as t, toDisplayString as S, createVNode as K, withModifiers as O } from "vue";
2
- import { g as Q } from "./getInstance-GhoEcxLF.js";
3
- import { I as B } from "./icon-svg-GoL3_ayS.js";
4
- import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/textField.css';const X = { class: "rds-e-textfield__container" }, Y = { class: "rds-e-textfield__input-container" }, Z = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], ee = ["for"], te = {
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
- }, le = { class: "rds-e-textfield__helper" }, re = /* @__PURE__ */ M({
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, c) => {
121
- const a = ["new-password", "current-password", "off"];
122
- return c.password && !a.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${a.join(", ")}`), !1) : !0;
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: c }) {
128
- const a = l, x = c, {
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: d,
131
- maxLength: y,
130
+ disabled: u,
131
+ maxLength: x,
132
132
  minLength: b,
133
133
  modelValue: o,
134
134
  icon: E,
135
135
  rightIcon: I,
136
- helper: T,
137
- error: f,
138
- helperText: $,
139
- clearable: C,
140
- password: p,
141
- autocomplete: R
142
- } = U(a), n = w(!0), m = w(!1), q = Q(), N = s(() => a.id || `text-field-${q}`), D = s(() => {
143
- if (p.value)
144
- return R.value;
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
- x(
146
+ r(
147
147
  "update:modelValue",
148
148
  e.target.value
149
149
  );
150
+ }, K = () => {
151
+ h.value = !1;
150
152
  }, j = () => {
151
- m.value = !1;
152
- }, P = () => {
153
- m.value = !0;
154
- }, z = s(() => !!(f.value || o.value.length && (o.value.length < b.value || o.value.length > y.value))), H = s(() => {
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"), z.value && e.push("rds-e-textfield--error"), d.value && e.push("rds-e-textfield--disabled"), e.join(" ");
157
- }), r = s(() => {
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
- }, k = {
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 p.value ? {
182
+ return m.value ? {
175
183
  left: {
176
184
  ...e,
177
185
  name: null
178
186
  },
179
187
  right: {
180
188
  ...e,
181
- name: n.value ? "eye_open" : "eye_close",
189
+ name: s.value ? "eye_open" : "eye_close",
182
190
  class: "rds-e-textfield__icon--password",
183
191
  events: {
184
- click: () => n.value = !n.value
192
+ click: () => s.value = !s.value
185
193
  }
186
194
  }
187
- } : C.value ? {
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: () => x("update:modelValue", "")
204
+ click: () => r("update:modelValue", "")
197
205
  }
198
206
  }
199
- } : k;
207
+ } : w;
200
208
  });
201
- return A(
202
- p,
203
- (e) => n.value = !e,
209
+ return O(
210
+ m,
211
+ (e) => s.value = !e,
204
212
  { immediate: !0 }
205
- ), (e, k) => (u(), v("div", {
206
- class: h(["rds-e-textfield", H.value])
213
+ ), (e, w) => (c(), v("div", {
214
+ class: _(["rds-e-textfield", A.value])
207
215
  }, [
208
- i("div", X, [
209
- _(e.$slots, "left-icon", {}, () => [
210
- r.value.left.name ? (u(), G(B, L({
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": m.value }],
220
+ class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": h.value }],
213
221
  "aria-hidden": "true"
214
- }, r.value.left, J(r.value.left.events)), null, 16, ["class"])) : g("", !0)
222
+ }, a.value.left, W(a.value.left.events)), null, 16, ["class"])) : y("", !0)
215
223
  ], !0),
216
- i("div", Y, [
217
- i("input", {
218
- id: N.value,
219
- type: n.value ? "text" : "password",
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(y),
229
+ maxLength: t(x),
222
230
  minLength: t(b),
223
- disabled: t(d),
231
+ disabled: t(u),
224
232
  value: t(o),
225
- autocomplete: D.value,
233
+ autocomplete: q.value,
226
234
  readonly: l.readonly,
227
235
  onInput: F,
228
- onBlur: j,
229
- onFocus: P
230
- }, null, 40, Z),
231
- i("label", {
232
- for: N.value,
233
- class: h(["rds-e-textfield__label", t(d) ? "rds-e-textfield__label--disabled" : ""])
234
- }, S(t(V)), 11, ee)
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
- r.value.right.name || e.$slots["right-icon"] ? (u(), v("span", te, [
237
- _(e.$slots, "right-icon", {}, () => [
238
- K(B, L({
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
- }, r.value.right, {
242
- onClick: O(r.value.right.events.click, ["stop"])
253
+ }, a.value.right, {
254
+ onClick: Y(a.value.right.events.click, ["stop"])
243
255
  }), null, 16, ["onClick"])
244
256
  ], !0)
245
- ])) : g("", !0)
257
+ ])) : y("", !0)
246
258
  ]),
247
- i("div", le, [
248
- _(e.$slots, "helper-text", {}, () => [
249
- (t(T) || t(f)) && !t(d) ? (u(), v("span", {
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: h(t(f) ? "rds-e-textfield__helper--error" : "")
252
- }, S(t($)), 3)) : g("", !0)
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
- }), ie = /* @__PURE__ */ W(re, [["__scopeId", "data-v-ec322549"]]);
269
+ }), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-b490642c"]]);
258
270
  export {
259
- ie as default
271
+ fe as default
260
272
  };