energy-components 1.7.0 → 1.8.1

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 (93) hide show
  1. package/dist/components/accordion.es.js +13 -13
  2. package/dist/components/accordionGroup.es.js +2 -2
  3. package/dist/components/actionButton.es.js +2 -2
  4. package/dist/components/breadcrumbs.es.js +3 -3
  5. package/dist/components/button.es.js +2 -2
  6. package/dist/components/card.es.js +5 -5
  7. package/dist/components/checkbox.es.js +5 -5
  8. package/dist/components/datepicker.es.js +588 -590
  9. package/dist/components/divider.es.js +2 -2
  10. package/dist/components/dragAndDrop.es.js +187 -0
  11. package/dist/components/dropdown.es.js +92 -92
  12. package/dist/components/filterChip.es.js +2 -2
  13. package/dist/components/floatingActionButton.es.js +2 -2
  14. package/dist/components/{icon-svg-BmDOQ0kL.js → icon-svg-_WCkLP8-.js} +12 -63
  15. package/dist/components/iconList.es.js +4 -4
  16. package/dist/components/iconSvg.es.js +1 -1
  17. package/dist/components/index.es.js +81 -75
  18. package/dist/components/indicator.es.js +6 -6
  19. package/dist/components/infoBox.es.js +16 -16
  20. package/dist/components/link.es.js +2 -2
  21. package/dist/components/modal.es.js +26 -26
  22. package/dist/components/multiselect.es.js +5 -5
  23. package/dist/components/multiselectcontentwrapper.es.js +6 -6
  24. package/dist/components/overlay.es.js +3 -3
  25. package/dist/components/pagination.es.js +1 -1
  26. package/dist/components/persistentToast.es.js +12 -12
  27. package/dist/components/progressBar.es.js +86 -0
  28. package/dist/components/quantitySelector.es.js +9 -9
  29. package/dist/components/{radio-group.vue_vue_type_script_setup_true_lang-B-kg-575.js → radio-group.vue_vue_type_script_setup_true_lang-DpguLlRK.js} +2 -2
  30. package/dist/components/radioButton.es.js +4 -4
  31. package/dist/components/radioGroup.es.js +1 -1
  32. package/dist/components/selectionChip.es.js +3 -3
  33. package/dist/components/sidebar.es.js +13 -13
  34. package/dist/components/sidedrawer.es.js +11 -11
  35. package/dist/components/style/actionButton.css +1 -1
  36. package/dist/components/style/button.css +1 -1
  37. package/dist/components/style/dragAndDrop.css +1 -0
  38. package/dist/components/style/progressBar.css +1 -0
  39. package/dist/components/style/switch.css +1 -1
  40. package/dist/components/style/tabBar.css +1 -1
  41. package/dist/components/style/textField.css +1 -1
  42. package/dist/components/switch.es.js +45 -38
  43. package/dist/components/tabBar.es.js +84 -70
  44. package/dist/components/tablepaginatedcomponent.es.js +22 -22
  45. package/dist/components/tableslotedcomponent.es.js +26 -26
  46. package/dist/components/tag.es.js +2 -2
  47. package/dist/components/textArea.es.js +2 -2
  48. package/dist/components/textField.es.js +134 -110
  49. package/dist/components/toggle.es.js +2 -2
  50. package/dist/components/tooltip.es.js +319 -311
  51. package/dist/energy-components.es.js +4874 -4612
  52. package/dist/energy-components.umd.js +2 -1
  53. package/dist/style.css +1 -1
  54. package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +1 -1
  55. package/dist/types/src/components/buttons/button/button.vue.d.ts +6 -11
  56. package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +1 -1
  57. package/dist/types/src/components/content/accordion/accordion.vue.d.ts +6 -17
  58. package/dist/types/src/components/content/acordion-group/accordion-group.vue.d.ts +6 -11
  59. package/dist/types/src/components/content/card/card.vue.d.ts +6 -11
  60. package/dist/types/src/components/content/divider/divider.vue.d.ts +1 -1
  61. package/dist/types/src/components/content/table/table-paginated/TablePaginatedComponent.vue.d.ts +88 -0
  62. package/dist/types/src/components/content/table/table-sloted/TableSlotedComponent.vue.d.ts +32 -31
  63. package/dist/types/src/components/content/tag/tag.vue.d.ts +1 -1
  64. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -4
  65. package/dist/types/src/components/feedback/info-box/info-box.vue.d.ts +8 -18
  66. package/dist/types/src/components/feedback/persistent-toast/persistent-toast.vue.d.ts +8 -12
  67. package/dist/types/src/components/feedback/progress-bar/progress-bar.vue.d.ts +101 -0
  68. package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +1 -1
  69. package/dist/types/src/components/index.d.ts +2 -0
  70. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +6 -11
  71. package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +258 -0
  72. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +203 -0
  73. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +30 -550
  74. package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +1 -3
  75. package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +1 -4
  76. package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +1 -1
  77. package/dist/types/src/components/input/radio-button/radio-group.vue.d.ts +6 -11
  78. package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +1 -3
  79. package/dist/types/src/components/input/switch/switch.vue.d.ts +24 -21
  80. package/dist/types/src/components/input/text-area/text-area.vue.d.ts +12 -15
  81. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +33 -21
  82. package/dist/types/src/components/input/toggle/toggle.vue.d.ts +1 -1
  83. package/dist/types/src/components/layout/sidebar/sidebar.vue.d.ts +10 -17
  84. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +8 -16
  85. package/dist/types/src/components/navigation/link/link.vue.d.ts +7 -11
  86. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +1 -1
  87. package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +24 -18
  88. package/dist/types/src/components/overlay/modal/modal.vue.d.ts +10 -141
  89. package/dist/types/src/components/overlay/overlay/overlay.vue.d.ts +5 -10
  90. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +8 -20
  91. package/dist/types/src/helpers/mobileMockup.vue.d.ts +1 -1
  92. package/dist/types/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- import { defineComponent as w, toRefs as I, getCurrentInstance as ee, ref as p, computed as m, watchEffect as le, watch as te, onMounted as se, openBlock as n, createElementBlock as c, normalizeClass as u, createElementVNode as i, Fragment as g, renderList as x, renderSlot as h, createVNode as f, normalizeStyle as ae, toDisplayString as U, createCommentVNode as b, unref as C, Transition as O, withCtx as N, nextTick as oe } from "vue";
2
- import { R as ne } from "./icon-svg-BmDOQ0kL.js";
1
+ import { defineComponent as w, toRefs as I, getCurrentInstance as ee, ref as p, computed as m, watchEffect as le, watch as te, onMounted as se, createElementBlock as n, openBlock as c, normalizeClass as u, createElementVNode as i, createVNode as f, createCommentVNode as b, Fragment as g, renderList as x, renderSlot as h, normalizeStyle as ae, toDisplayString as U, unref as C, Transition as O, withCtx as N, nextTick as oe } from "vue";
2
+ import { R as ne } from "./icon-svg-_WCkLP8-.js";
3
3
  import E from "./checkbox.es.js";
4
4
  import { g as ce } from "./getInstance-GhoEcxLF.js";
5
5
  import { _ as ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
@@ -15,7 +15,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
15
15
  }, pe = ["for"], fe = {
16
16
  key: 0,
17
17
  class: "loading-overlay"
18
- }, ye = ["onClick"], ve = ["column-key", "data-cell"], ge = ["title"], he = {
18
+ }, ve = ["onClick"], ye = ["column-key", "data-cell"], ge = ["title"], he = {
19
19
  key: 0,
20
20
  class: "table__cell table__cell--shadow table__cell--right"
21
21
  }, $e = ["for"], me = ["colspan"], Ce = ["colspan"], Se = /* @__PURE__ */ w({
@@ -40,7 +40,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
40
40
  },
41
41
  emits: ["selectAll", "onClickCheckbox", "onItemExpansion", "onHeaderSort"],
42
42
  setup(L, { expose: j, emit: q }) {
43
- const o = L, y = q, { item: k, listChecked: z, selectableKey: d } = I(o), S = ee(), F = p(), B = p(`table-${ce()}`), _ = p([]), $ = p([]), K = p([]), P = p(!0), G = m(() => {
43
+ const o = L, v = q, { item: k, listChecked: z, selectableKey: d } = I(o), S = ee(), F = p(), B = p(`table-${ce()}`), _ = p([]), $ = p([]), K = p([]), P = p(!0), G = m(() => {
44
44
  const e = "table";
45
45
  let t = e;
46
46
  return t = `${t} ${e}--${o.variant}`, o.condensed && (t = `${t} ${e}--condensed`), t;
@@ -51,7 +51,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
51
51
  }), Q = m(() => o.mockItems ? Array.from({ length: o.mockItems }, () => ({
52
52
  expandible: !1,
53
53
  visible: !1
54
- })) : []), v = m(() => o.loading && _.value.length === 0 ? Q.value : _.value), W = (e) => {
54
+ })) : []), y = m(() => o.loading && _.value.length === 0 ? Q.value : _.value), W = (e) => {
55
55
  if (d != null && d.value) {
56
56
  const t = e[d.value];
57
57
  return z.value.includes(t);
@@ -60,7 +60,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
60
60
  }, X = (e) => {
61
61
  if (d != null && d.value) {
62
62
  const t = String(e[d.value]);
63
- y("onClickCheckbox", t);
63
+ v("onClickCheckbox", t);
64
64
  }
65
65
  }, D = async (e, t = !1) => {
66
66
  var l;
@@ -71,14 +71,14 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
71
71
  );
72
72
  _.value = a;
73
73
  }
74
- y("onItemExpansion", {
74
+ v("onItemExpansion", {
75
75
  ...e,
76
76
  visible: o.isMobileDevice ? e.visible : !e.visible,
77
77
  isMobileDevice: o.isMobileDevice
78
78
  }), t && (await oe(), (l = document.querySelector(".table__group--is-open")) == null || l.scrollIntoView({ behavior: "smooth" }));
79
79
  }
80
80
  }, Y = (e) => {
81
- y("selectAll", e);
81
+ v("selectAll", e);
82
82
  }, A = (e) => e.align ? `table__cell--${e.align}` : "table__cell--left", Z = (e, t) => t === "actions" ? !1 : e.status === "BLOCKED" || e.status === "BUSINESS_BLOCK" || e.status === "PT_BLOCKED" ? !0 : !!e.$disabled, V = (e, t, l) => {
83
83
  var a, s;
84
84
  if (!t) return "---";
@@ -93,8 +93,8 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
93
93
  if ($.value.forEach((r) => {
94
94
  r.sortable && r.key !== t.key && (r.sort = "");
95
95
  }), t.sort = l[s], t.sort === "")
96
- return y("onHeaderSort", {});
97
- y("onHeaderSort", {
96
+ return v("onHeaderSort", {});
97
+ v("onHeaderSort", {
98
98
  sortBy: t.key,
99
99
  order: t.sort
100
100
  });
@@ -130,13 +130,13 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
130
130
  }), se(() => {
131
131
  var e;
132
132
  F.value = (e = S == null ? void 0 : S.vnode) == null ? void 0 : e.scopeId;
133
- }), (e, t) => (n(), c("div", {
133
+ }), (e, t) => (c(), n("div", {
134
134
  class: u(["table__container", G.value])
135
135
  }, [
136
136
  i("table", null, [
137
- e.hideHeaders ? b("", !0) : (n(), c("thead", de, [
137
+ e.hideHeaders ? b("", !0) : (c(), n("thead", de, [
138
138
  i("tr", null, [
139
- (n(!0), c(g, null, x($.value, (l, a) => (n(), c("th", {
139
+ (c(!0), n(g, null, x($.value, (l, a) => (c(), n("th", {
140
140
  key: `header-${a}`,
141
141
  "data-header": `data-header-${l.key}`,
142
142
  class: u(["table__cell table__cell--heading body-1", [
@@ -150,7 +150,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
150
150
  onClick: (s) => R(s, l)
151
151
  }, [
152
152
  h(e.$slots, `header-${l.key}`, { item: l }, () => [
153
- l.type === "selectAll" ? (n(), c(g, { key: 0 }, [
153
+ l.type === "selectAll" ? (c(), n(g, { key: 0 }, [
154
154
  f(E, {
155
155
  id: `checkbox_${l.key}`,
156
156
  "is-checked": l.allSelected,
@@ -160,14 +160,14 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
160
160
  for: `checkbox_${l.key}`,
161
161
  class: "rds-checkbox__label"
162
162
  }, null, 8, ue)
163
- ], 64)) : (n(), c("div", be, [
163
+ ], 64)) : (c(), n("div", be, [
164
164
  i("span", {
165
165
  style: ae({
166
166
  color: (l == null ? void 0 : l.sort) !== "" ? "#00ADC3" : ""
167
167
  }),
168
168
  class: "rds-title-02"
169
169
  }, U(l.text || ""), 5),
170
- l.sortable ? (n(), c("span", _e, [
170
+ l.sortable ? (c(), n("span", _e, [
171
171
  i("span", {
172
172
  class: u(["table__sortable-icon--up sortable-icon", `${l.sort === "asc" ? "active" : ""}`])
173
173
  }, "▲", 2),
@@ -178,7 +178,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
178
178
  ]))
179
179
  ], !0)
180
180
  ], 10, re))), 128)),
181
- C(d) && !e.hideSelectAll ? (n(), c("th", ke, [
181
+ C(d) && !e.hideSelectAll ? (c(), n("th", ke, [
182
182
  f(E, {
183
183
  id: `checkbox-all-${B.value}`,
184
184
  class: "rds-checkbox table__checkbox",
@@ -197,13 +197,13 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
197
197
  }, [
198
198
  f(O, { name: "fade" }, {
199
199
  default: N(() => [
200
- e.loading ? (n(), c("div", fe, [
200
+ e.loading ? (c(), n("div", fe, [
201
201
  f(ne, { name: "loading" })
202
202
  ])) : b("", !0)
203
203
  ]),
204
204
  _: 1
205
205
  }),
206
- v.value.length !== 0 ? (n(!0), c(g, { key: 0 }, x(v.value, (l, a) => (n(), c(g, {
206
+ y.value.length !== 0 ? (c(!0), n(g, { key: 0 }, x(y.value, (l, a) => (c(), n(g, {
207
207
  key: `row-${a}}`
208
208
  }, [
209
209
  i("tr", {
@@ -219,7 +219,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
219
219
  ]]),
220
220
  onClick: () => D(l)
221
221
  }, [
222
- (n(!0), c(g, null, x($.value, (s, r) => (n(), c("td", {
222
+ (c(!0), n(g, null, x($.value, (s, r) => (c(), n("td", {
223
223
  key: `column-${r}`,
224
224
  "column-key": r,
225
225
  "data-cell": `data-cell-${s.key}`,
@@ -241,8 +241,8 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
241
241
  title: V(s.key, String(l[s.key] || ""), a)
242
242
  }, U(V(s.key, String(l[s.key] || ""), a)), 9, ge)
243
243
  ], !0)
244
- ], 10, ve))), 128)),
245
- C(d) ? (n(), c("td", he, [
244
+ ], 10, ye))), 128)),
245
+ C(d) ? (c(), n("td", he, [
246
246
  h(e.$slots, "td-checkbox", { item: l }, () => [
247
247
  f(E, {
248
248
  id: `add-${a}-${l[C(d)]}`,
@@ -257,8 +257,8 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
257
257
  }, null, 8, $e)
258
258
  ], !0)
259
259
  ])) : b("", !0)
260
- ], 10, ye),
261
- v.value[a].visible ? (n(), c("tr", {
260
+ ], 10, ve),
261
+ y.value[a].visible ? (c(), n("tr", {
262
262
  key: 0,
263
263
  class: u(["table__group table__group--dropdown", [
264
264
  {
@@ -276,7 +276,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
276
276
  h(e.$slots, "expandible", { item: l }, void 0, !0)
277
277
  ], 10, me)
278
278
  ], 2)) : b("", !0),
279
- v.value[a].visible ? (n(), c("tr", {
279
+ y.value[a].visible ? (c(), n("tr", {
280
280
  key: 1,
281
281
  class: "table__group--spacer",
282
282
  colspan: M(l).length
@@ -286,7 +286,7 @@ import './style/tableslotedcomponent.css';const de = { key: 0 }, re = ["data-hea
286
286
  ]),
287
287
  f(O, { name: "fade" }, {
288
288
  default: N(() => [
289
- e.showEmptyState && !e.loading && v.value.length === 0 ? h(e.$slots, "empty", { key: 0 }, () => [
289
+ e.showEmptyState && !e.loading && y.value.length === 0 ? h(e.$slots, "empty", { key: 0 }, () => [
290
290
  t[0] || (t[0] = i("div", { class: "table__empty-state" }, [
291
291
  i("h3", { class: "rds-title-02" }, " No hay elementos a mostrar. ")
292
292
  ], -1))
@@ -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 S, toDisplayString as B } from "vue";
2
- import { R as f } from "./icon-svg-BmDOQ0kL.js";
1
+ import { defineComponent as h, toRefs as x, computed as u, createElementBlock as $, openBlock as o, normalizeClass as r, createBlock as p, createCommentVNode as d, createTextVNode as S, unref as t, toDisplayString as B } from "vue";
2
+ import { R as f } from "./icon-svg-_WCkLP8-.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",
@@ -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 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-BmDOQ0kL.js";
1
+ import { defineComponent as G, mergeModels as J, useModel as K, toRefs as L, ref as O, computed as o, createElementBlock as f, openBlock as s, normalizeClass as h, createElementVNode as a, withDirectives as Q, unref as e, vModelText as W, renderSlot as y, createTextVNode as X, createBlock as I, createCommentVNode as i, mergeProps as q, toHandlers as T, toDisplayString as u } from "vue";
2
+ import { R as $ } from "./icon-svg-_WCkLP8-.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;
@@ -1,11 +1,11 @@
1
- import { defineComponent as W, toRefs as X, ref as y, computed as d, watch as Y, openBlock as u, createElementBlock as x, normalizeClass as b, createElementVNode as c, renderSlot as k, createBlock as I, mergeProps as R, toHandlers as Z, createCommentVNode as m, unref as t, toDisplayString as T, withModifiers as ee } from "vue";
2
- import { g as te } from "./getInstance-GhoEcxLF.js";
3
- import { R as $, s as le } from "./icon-svg-BmDOQ0kL.js";
4
- import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/textField.css';const oe = { class: "rds-e-textfield__container" }, ae = { class: "rds-e-textfield__input-container" }, re = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], se = ["for"], ie = {
1
+ import { defineComponent as ee, toRefs as te, ref as w, computed as d, watch as le, createElementBlock as k, openBlock as p, normalizeClass as S, createElementVNode as m, renderSlot as N, createCommentVNode as y, createBlock as I, mergeProps as $, toHandlers as ne, unref as o, toDisplayString as C, withModifiers as ae } from "vue";
2
+ import { g as oe } from "./getInstance-GhoEcxLF.js";
3
+ import { R, s as re } from "./icon-svg-_WCkLP8-.js";
4
+ import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/textField.css';const ie = { class: "rds-e-textfield__container" }, ue = { class: "rds-e-textfield__input-container" }, de = ["id", "type", "maxlength", "minlength", "disabled", "value", "autocomplete", "readonly"], ce = ["for"], fe = {
6
6
  key: 0,
7
7
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
8
- }, de = { class: "rds-e-textfield__helper" }, ue = /* @__PURE__ */ W({
8
+ }, pe = { class: "rds-e-textfield__helper" }, me = /* @__PURE__ */ ee({
9
9
  __name: "text-field",
10
10
  props: {
11
11
  /**
@@ -26,7 +26,7 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
26
26
  * v-model valor de entrada y salida
27
27
  */
28
28
  modelValue: {
29
- type: String,
29
+ type: [String, Number, null],
30
30
  required: !0
31
31
  },
32
32
  /**
@@ -49,7 +49,7 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
49
49
  maxLength: {
50
50
  type: Number,
51
51
  default: 100,
52
- validator: (l) => l < 0 ? (console.info("El valor de maxLength no puede ser menor a 0"), !1) : Number.isNaN(l) ? (console.info("El valor de maxLength debe ser un número"), !1) : !0
52
+ validator: (t) => t < 0 ? (console.info("El valor de maxLength no puede ser menor a 0"), !1) : Number.isNaN(t) ? (console.info("El valor de maxLength debe ser un número"), !1) : !0
53
53
  },
54
54
  /**
55
55
  * Número mínimo de caracteres permitidos en el campo de entrada.
@@ -57,7 +57,19 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
57
57
  minLength: {
58
58
  type: Number,
59
59
  default: 0,
60
- validator: (l) => l < 0 ? (console.info("El valor de minLength no puede ser menor a 0"), !1) : Number.isNaN(l) ? (console.info("El valor de minLength debe ser un número"), !1) : !0
60
+ validator: (t) => t < 0 ? (console.info("El valor de minLength no puede ser menor a 0"), !1) : Number.isNaN(t) ? (console.info("El valor de minLength debe ser un número"), !1) : !0
61
+ },
62
+ /**
63
+ * Tipo del input HTML. Por defecto 'text'.
64
+ * Puede ser 'text' o 'number'. La prop 'password' tiene precedencia.
65
+ */
66
+ type: {
67
+ type: String,
68
+ default: "text",
69
+ validator: (t) => {
70
+ const r = ["text", "number", "password", "email", "tel", "url"], s = r.includes(t);
71
+ return s || console.warn(`[RDSTextfield]: El valor de la prop 'type' debe ser uno de: ${r.join(", ")}. Valor recibido: ${t}`), s;
72
+ }
61
73
  },
62
74
  /**
63
75
  * Nombre del icono que se mostrará dentro del campo de entrada.
@@ -117,60 +129,72 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
117
129
  autocomplete: {
118
130
  type: String,
119
131
  default: "off",
120
- validator: (l, v) => {
121
- const f = ["new-password", "current-password", "off"];
122
- return v.password && !f.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${f.join(", ")}`), !1) : !0;
132
+ validator: (t, r) => {
133
+ const s = ["new-password", "current-password", "off"];
134
+ return (r.password || r.type === "password") && !s.includes(t) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${s.join(", ")}`), !1) : !0;
123
135
  }
124
136
  }
125
137
  },
126
138
  emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
127
- setup(l, { expose: v, emit: f }) {
128
- const w = l, o = f, {
129
- label: C,
130
- disabled: p,
131
- maxLength: S,
132
- minLength: L,
133
- modelValue: a,
134
- icon: D,
139
+ setup(t, { expose: r, emit: s }) {
140
+ const n = t, i = s, {
141
+ type: v,
142
+ label: D,
143
+ disabled: h,
144
+ maxLength: F,
145
+ minLength: P,
146
+ modelValue: u,
147
+ icon: j,
135
148
  rightIcon: q,
136
- helper: F,
137
- error: h,
138
- helperText: K,
139
- clearable: j,
140
- password: _,
141
- autocomplete: P
142
- } = X(w), r = y(null), s = y(!0), g = y(!1), z = te(), N = d(() => w.id || `text-field-${z}`), H = d(() => {
143
- if (_.value)
144
- return P.value;
145
- }), M = (e) => {
146
- o(
147
- "update:modelValue",
148
- e.target.value
149
- );
150
- }, V = () => {
151
- g.value = !1;
152
- }, B = () => {
153
- g.value = !0;
154
- }, U = (e) => {
155
- o("keydown", e);
156
- }, A = (e) => {
157
- o("keyup", e);
158
- }, G = (e) => {
159
- o("keypress", e);
160
- }, J = (e) => {
161
- o("change", e);
162
- }, O = d(() => !!(h.value || a.value.length && (a.value.length < L.value || a.value.length > S.value))), Q = d(() => {
149
+ helper: K,
150
+ error: x,
151
+ helperText: z,
152
+ clearable: A,
153
+ password: g,
154
+ autocomplete: H
155
+ } = te(n), c = w(null), f = w(!0), b = w(!1), M = oe(), V = d(() => n.id || `text-field-${M}`), U = d(() => g.value ? f.value ? "text" : "password" : v.value), G = d(() => {
156
+ if (g.value || v.value === "password")
157
+ return H.value;
158
+ }), J = (e) => {
159
+ const l = e.target;
160
+ let _ = l.value;
161
+ if (v.value === "number")
162
+ if (l.value.trim() === "")
163
+ _ = null;
164
+ else {
165
+ const B = Number.parseFloat(l.value);
166
+ _ = Number.isNaN(B) ? l.value : B;
167
+ }
168
+ else l.value === "" && u.value === null && (_ = null);
169
+ i("update:modelValue", _);
170
+ }, E = () => {
171
+ b.value = !1;
172
+ }, L = () => {
173
+ b.value = !0;
174
+ }, O = (e) => {
175
+ i("keydown", e);
176
+ }, Q = (e) => {
177
+ i("keyup", e);
178
+ }, W = (e) => {
179
+ i("keypress", e);
180
+ }, X = (e) => {
181
+ i("change", e);
182
+ }, Y = d(() => {
183
+ if (x.value) return !0;
184
+ const e = u.value === null || u.value === void 0 ? "" : String(u.value);
185
+ return e.length > 0 && (e.length < P.value || v.value !== "number" && e.length > F.value);
186
+ }), Z = d(() => {
163
187
  const e = [];
164
- return a.value && e.push("rds-e-textfield--filled"), O.value && e.push("rds-e-textfield--error"), p.value && e.push("rds-e-textfield--disabled"), e.join(" ");
165
- }), n = d(() => {
188
+ return u.value !== null && String(u.value).length > 0 && e.push("rds-e-textfield--filled"), Y.value && e.push("rds-e-textfield--error"), h.value && e.push("rds-e-textfield--disabled"), e.join(" ");
189
+ }), a = d(() => {
166
190
  const e = {
167
- name: D.value,
191
+ name: j.value,
168
192
  class: "",
169
193
  events: {
170
194
  click: () => {
171
195
  }
172
196
  }
173
- }, i = {
197
+ }, l = {
174
198
  left: {
175
199
  ...e
176
200
  },
@@ -179,20 +203,20 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
179
203
  name: q.value
180
204
  }
181
205
  };
182
- return _.value ? {
206
+ return g.value ? {
183
207
  left: {
184
208
  ...e,
185
209
  name: null
186
210
  },
187
211
  right: {
188
212
  ...e,
189
- name: s.value ? "eye_open" : "eye_close",
213
+ name: f.value ? "eye_open" : "eye_close",
190
214
  class: "rds-e-textfield__icon--password",
191
215
  events: {
192
- click: () => s.value = !s.value
216
+ click: () => f.value = !f.value
193
217
  }
194
218
  }
195
- } : j.value ? {
219
+ } : A.value ? {
196
220
  left: {
197
221
  ...e
198
222
  },
@@ -201,87 +225,87 @@ import './style/textField.css';const oe = { class: "rds-e-textfield__container"
201
225
  name: "close",
202
226
  class: "rds-e-textfield__icon--clear",
203
227
  events: {
204
- click: () => o("update:modelValue", "")
228
+ click: () => i("update:modelValue", "")
205
229
  }
206
230
  }
207
- } : i;
231
+ } : l;
208
232
  });
209
- Y(
210
- _,
211
- (e) => s.value = !e,
233
+ le(
234
+ g,
235
+ (e) => f.value = !e,
212
236
  { immediate: !0 }
213
237
  );
214
- const E = (e) => {
215
- const i = le.includes(e);
216
- return i || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), i;
238
+ const T = (e) => {
239
+ const l = re.includes(e);
240
+ return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
217
241
  };
218
- return v({
242
+ return r({
219
243
  focus: () => {
220
- r.value && (r.value.focus(), B());
244
+ c.value && (c.value.focus(), L());
221
245
  },
222
246
  blur: () => {
223
- r.value && (r.value.blur(), V());
247
+ c.value && (c.value.blur(), E());
224
248
  }
225
- }), (e, i) => (u(), x("div", {
226
- class: b(["rds-e-textfield", Q.value])
249
+ }), (e, l) => (p(), k("div", {
250
+ class: S(["rds-e-textfield", Z.value])
227
251
  }, [
228
- c("div", oe, [
229
- k(e.$slots, "left-icon", {}, () => [
230
- n.value.left.name && E(n.value.left.name) ? (u(), I($, R({
252
+ m("div", ie, [
253
+ N(e.$slots, "left-icon", {}, () => [
254
+ a.value.left.name && T(a.value.left.name) ? (p(), I(R, $({
231
255
  key: 0,
232
- class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": g.value }],
256
+ class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": b.value }],
233
257
  "aria-hidden": "true"
234
- }, n.value.left, Z(n.value.left.events)), null, 16, ["class"])) : m("", !0)
258
+ }, a.value.left, ne(a.value.left.events)), null, 16, ["class"])) : y("", !0)
235
259
  ], !0),
236
- c("div", ae, [
237
- c("input", {
238
- id: N.value,
260
+ m("div", ue, [
261
+ m("input", {
262
+ id: V.value,
239
263
  ref_key: "input",
240
- ref: r,
241
- type: s.value ? "text" : "password",
264
+ ref: c,
265
+ type: U.value,
242
266
  class: "rds-e-textfield__input",
243
- maxLength: t(S),
244
- minLength: t(L),
245
- disabled: t(p),
246
- value: t(a),
247
- autocomplete: H.value,
248
- readonly: l.readonly,
249
- onInput: M,
250
- onBlur: V,
251
- onFocus: B,
252
- onKeydown: U,
253
- onKeyup: A,
254
- onKeypress: G,
255
- onChange: J
256
- }, null, 40, re),
257
- c("label", {
258
- for: N.value,
259
- class: b(["rds-e-textfield__label", t(p) ? "rds-e-textfield__label--disabled" : ""])
260
- }, T(t(C)), 11, se)
267
+ maxlength: n.type === "number" ? void 0 : n.maxLength,
268
+ minlength: n.type === "number" ? void 0 : n.minLength,
269
+ disabled: o(h),
270
+ value: n.modelValue === null ? "" : n.modelValue,
271
+ autocomplete: G.value,
272
+ readonly: t.readonly,
273
+ onInput: J,
274
+ onBlur: E,
275
+ onFocus: L,
276
+ onKeydown: O,
277
+ onKeyup: Q,
278
+ onKeypress: W,
279
+ onChange: X
280
+ }, null, 40, de),
281
+ m("label", {
282
+ for: V.value,
283
+ class: S(["rds-e-textfield__label", o(h) ? "rds-e-textfield__label--disabled" : ""])
284
+ }, C(o(D)), 11, ce)
261
285
  ]),
262
- n.value.right.name || e.$slots["right-icon"] ? (u(), x("span", ie, [
263
- k(e.$slots, "right-icon", {}, () => [
264
- n.value.right.name && E(n.value.right.name) ? (u(), I($, R({
286
+ a.value.right.name || e.$slots["right-icon"] ? (p(), k("span", fe, [
287
+ N(e.$slots, "right-icon", {}, () => [
288
+ a.value.right.name && T(a.value.right.name) ? (p(), I(R, $({
265
289
  key: 0,
266
290
  "aria-hidden": "true",
267
291
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
268
- }, n.value.right, {
269
- onClick: ee(n.value.right.events.click, ["stop"])
270
- }), null, 16, ["onClick"])) : m("", !0)
292
+ }, a.value.right, {
293
+ onClick: ae(a.value.right.events.click, ["stop"])
294
+ }), null, 16, ["onClick"])) : y("", !0)
271
295
  ], !0)
272
- ])) : m("", !0)
296
+ ])) : y("", !0)
273
297
  ]),
274
- c("div", de, [
275
- k(e.$slots, "helper-text", {}, () => [
276
- (t(F) || t(h)) && !t(p) ? (u(), x("span", {
298
+ m("div", pe, [
299
+ N(e.$slots, "helper-text", {}, () => [
300
+ (o(K) || o(x)) && !o(h) ? (p(), k("span", {
277
301
  key: 0,
278
- class: b(t(h) ? "rds-e-textfield__helper--error" : "")
279
- }, T(t(K)), 3)) : m("", !0)
302
+ class: S(o(x) ? "rds-e-textfield__helper--error" : "")
303
+ }, C(o(z)), 3)) : y("", !0)
280
304
  ], !0)
281
305
  ])
282
306
  ], 2));
283
307
  }
284
- }), ve = /* @__PURE__ */ ne(ue, [["__scopeId", "data-v-bf8d52de"]]);
308
+ }), ye = /* @__PURE__ */ se(me, [["__scopeId", "data-v-a6ab314d"]]);
285
309
  export {
286
- ve as default
310
+ ye as default
287
311
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as T, toRefs as E, ref as L, onMounted as _, openBlock as y, createElementBlock as B, normalizeClass as d, createElementVNode as p, unref as i, toDisplayString as m } from "vue";
1
+ import { defineComponent as T, toRefs as E, ref as L, onMounted as _, createElementBlock as y, openBlock as B, normalizeClass as d, createElementVNode as p, unref as i, toDisplayString as m } from "vue";
2
2
  import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  import './style/toggle.css';const I = /* @__PURE__ */ T({
4
4
  __name: "toggle",
@@ -22,7 +22,7 @@ import './style/toggle.css';const I = /* @__PURE__ */ T({
22
22
  };
23
23
  return _(() => {
24
24
  s != null && s.value ? (n("update:modelValue", e == null ? void 0 : e.value), a.value = e != null && e.value ? t.RIGHT : t.LEFT) : (e == null ? void 0 : e.value) === (o == null ? void 0 : o.value) ? (n("update:modelValue", o == null ? void 0 : o.value), a.value = t.RIGHT) : (n("update:modelValue", u == null ? void 0 : u.value), a.value = t.LEFT);
25
- }), (l, r) => (y(), B("div", {
25
+ }), (l, r) => (B(), y("div", {
26
26
  class: d(["rds-e-toggle", [
27
27
  {
28
28
  "rds-e-toggle--full-width": l.fullWidth && !l.small,