energy-components 1.16.1 → 1.17.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 (44) hide show
  1. package/dist/components/accordion.es.js +1 -1
  2. package/dist/components/avatar.es.js +1 -1
  3. package/dist/components/button.es.js +1 -1
  4. package/dist/components/checkbox.es.js +1 -1
  5. package/dist/components/collapsable.es.js +1 -1
  6. package/dist/components/{collapsable.scss_vue_type_style_index_0_src_true_lang-CWwaY_PV.js → collapsable.scss_vue_type_style_index_0_src_true_lang-C2ohjDhp.js} +1 -1
  7. package/dist/components/directAccess.es.js +1 -1
  8. package/dist/components/dragAndDrop.es.js +1 -1
  9. package/dist/components/dropdown.es.js +115 -107
  10. package/dist/components/fileUploadItem.es.js +1 -1
  11. package/dist/components/filterChip.es.js +1 -1
  12. package/dist/components/filterTag.es.js +1 -1
  13. package/dist/components/{icon-svg-BGa9K9qG.js → icon-svg-arye8CV8.js} +908 -846
  14. package/dist/components/iconList.es.js +1 -1
  15. package/dist/components/iconSvg.es.js +1 -1
  16. package/dist/components/index.es.js +2 -2
  17. package/dist/components/infoBox.es.js +1 -1
  18. package/dist/components/link.es.js +1 -1
  19. package/dist/components/modal.es.js +1 -1
  20. package/dist/components/persistentToast.es.js +1 -1
  21. package/dist/components/popover.es.js +1 -1
  22. package/dist/components/progressBar.es.js +1 -1
  23. package/dist/components/quantitySelector.es.js +1 -1
  24. package/dist/components/radioButton.es.js +1 -1
  25. package/dist/components/selectionChip.es.js +1 -1
  26. package/dist/components/sidedrawer.es.js +1 -1
  27. package/dist/components/style/dropdown.css +1 -1
  28. package/dist/components/style/tag.css +1 -1
  29. package/dist/components/style/textField.css +1 -1
  30. package/dist/components/switch.es.js +1 -1
  31. package/dist/components/tabBar.es.js +1 -1
  32. package/dist/components/tableslotedcomponent.es.js +1 -1
  33. package/dist/components/tag.es.js +50 -31
  34. package/dist/components/textArea.es.js +1 -1
  35. package/dist/components/textField.es.js +67 -55
  36. package/dist/components/tooltip.es.js +1 -1
  37. package/dist/energy-components.es.js +2853 -2752
  38. package/dist/energy-components.umd.js +2 -2
  39. package/dist/style.css +1 -1
  40. package/dist/types/src/components/content/tag/tag.vue.d.ts +32 -2
  41. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +15 -0
  42. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +18 -3
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
- import { defineComponent as re, toRefs as ie, ref as f, computed as v, watch as F, onMounted as ue, onBeforeUnmount as de, createElementBlock as V, openBlock as h, normalizeClass as k, createElementVNode as g, createCommentVNode as S, renderSlot as E, createBlock as R, mergeProps as A, toHandlers as ce, unref as d, toDisplayString as M, withModifiers as fe } from "vue";
1
+ import { defineComponent as re, toRefs as ie, ref as f, computed as v, watch as A, onMounted as ue, onBeforeUnmount as de, createElementBlock as V, openBlock as p, normalizeClass as S, createElementVNode as g, createCommentVNode as y, renderSlot as B, createBlock as E, mergeProps as M, toHandlers as ce, unref as d, toDisplayString as K, withModifiers as fe } from "vue";
2
2
  import { g as ve } from "./getInstance-GhoEcxLF.js";
3
- import { R as K, s as pe } from "./icon-svg-BGa9K9qG.js";
3
+ import { R as T, s as pe } from "./icon-svg-arye8CV8.js";
4
4
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/textField.css';const he = { class: "rds-e-textfield__input-container" }, ge = ["id", "type", "maxlength", "minlength", "disabled", "value", "autocomplete", "readonly"], _e = ["for"], ye = {
5
+ import './style/textField.css';const he = { class: "rds-e-textfield__input-container" }, ge = ["id", "type", "maxlength", "minlength", "disabled", "value", "autocomplete", "readonly"], ye = ["for"], _e = {
6
6
  key: 0,
7
7
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
8
8
  }, xe = {
@@ -133,6 +133,13 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
133
133
  type: Boolean,
134
134
  default: !1
135
135
  },
136
+ /**
137
+ * Indica si el campo de texto está en estado de carga.
138
+ */
139
+ loading: {
140
+ type: Boolean,
141
+ default: !1
142
+ },
136
143
  /**
137
144
  * Indica si el campo de texto es para una nueva contraseña (solo para campos de contraseña).
138
145
  * Opciones permitidas: 'new-password', 'current-password', 'off'.
@@ -149,7 +156,7 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
149
156
  emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
150
157
  setup(t, { expose: s, emit: r }) {
151
158
  const n = t, c = r, {
152
- type: p,
159
+ type: m,
153
160
  label: P,
154
161
  disabled: N,
155
162
  maxLength: j,
@@ -164,27 +171,27 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
164
171
  password: _,
165
172
  autocomplete: G,
166
173
  fullWidth: J
167
- } = ie(n), a = f(null), m = f(!0), y = f(!1), x = f(!1), b = f(!1), Q = ve(), w = f(""), T = v(() => n.id || `text-field-${Q}`), X = v(() => _.value ? m.value ? "text" : "password" : ["text", "number", "password", "email", "tel", "url"].includes(p.value) ? p.value : "text"), Y = v(() => {
168
- if (_.value || p.value === "password")
174
+ } = ie(n), a = f(null), h = f(!0), x = f(!1), b = f(!1), w = f(!1), Q = ve(), k = f(""), I = v(() => n.id || `text-field-${Q}`), X = v(() => _.value ? h.value ? "text" : "password" : ["text", "number", "password", "email", "tel", "url"].includes(m.value) ? m.value : "text"), Y = v(() => {
175
+ if (_.value || m.value === "password")
169
176
  return G.value;
170
177
  }), Z = (e) => {
171
178
  const l = e.target;
172
179
  let u = l.value;
173
- if (p.value === "number")
180
+ if (m.value === "number")
174
181
  if (l.value.trim() === "")
175
182
  u = null;
176
183
  else {
177
- const D = Number.parseFloat(l.value);
178
- u = Number.isNaN(D) ? l.value : D;
184
+ const R = Number.parseFloat(l.value);
185
+ u = Number.isNaN(R) ? l.value : R;
179
186
  }
180
187
  else l.value === "" && i.value === null && (u = null);
181
188
  c("update:modelValue", u);
182
189
  }, ee = () => {
183
- b.value = !0;
184
- }, B = () => {
185
- y.value = !1, x.value = !1, b.value = !1;
186
- }, I = () => {
187
- y.value = !0, x.value = !b.value, b.value = !1;
190
+ w.value = !0;
191
+ }, C = () => {
192
+ x.value = !1, b.value = !1, w.value = !1;
193
+ }, $ = () => {
194
+ x.value = !0, b.value = !w.value, w.value = !1;
188
195
  }, te = (e) => {
189
196
  c("keydown", e);
190
197
  }, le = (e) => {
@@ -196,15 +203,15 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
196
203
  }, oe = v(() => {
197
204
  if (L.value) return !0;
198
205
  const e = i.value === null || i.value === void 0 ? "" : String(i.value);
199
- return e.length > 0 && (e.length < q.value || p.value !== "number" && e.length > j.value);
206
+ return e.length > 0 && (e.length < q.value || m.value !== "number" && e.length > j.value);
200
207
  }), se = v(() => {
201
208
  const e = [];
202
- return w.value !== "" && e.push(w.value), i.value !== null && String(i.value).length > 0 && e.push("rds-e-textfield--filled"), oe.value && e.push("rds-e-textfield--error"), N.value && e.push("rds-e-textfield--disabled"), J.value && e.push("rds-e-textfield--full-width"), e.join(" ");
209
+ return k.value !== "" && e.push(k.value), i.value !== null && String(i.value).length > 0 && e.push("rds-e-textfield--filled"), oe.value && e.push("rds-e-textfield--error"), N.value && e.push("rds-e-textfield--disabled"), J.value && e.push("rds-e-textfield--full-width"), e.join(" ");
203
210
  });
204
- F(
211
+ A(
205
212
  () => i.value,
206
213
  (e) => {
207
- e !== null && String(e).length > 0 && (w.value = "");
214
+ e !== null && String(e).length > 0 && (k.value = "");
208
215
  }
209
216
  );
210
217
  const o = v(() => {
@@ -231,10 +238,10 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
231
238
  },
232
239
  right: {
233
240
  ...e,
234
- name: m.value ? "eye_open" : "eye_close",
241
+ name: h.value ? "eye_open" : "eye_close",
235
242
  class: "rds-e-textfield__icon--password",
236
243
  events: {
237
- click: () => m.value = !m.value
244
+ click: () => h.value = !h.value
238
245
  }
239
246
  }
240
247
  } : H.value ? {
@@ -251,49 +258,54 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
251
258
  }
252
259
  } : l;
253
260
  });
254
- F(
261
+ A(
255
262
  _,
256
- (e) => m.value = !e,
263
+ (e) => h.value = !e,
257
264
  { immediate: !0 }
258
265
  );
259
- const C = (e) => {
266
+ const D = (e) => {
260
267
  const l = pe.includes(e);
261
268
  return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
262
- }, $ = (e) => {
269
+ }, F = (e) => {
263
270
  var u;
264
- ((u = a.value) == null ? void 0 : u.matches(":-webkit-autofill")) && e.animationName.startsWith("onAutoFillStart") && (w.value = "rds-e-textfield--filled");
271
+ ((u = a.value) == null ? void 0 : u.matches(":-webkit-autofill")) && e.animationName.startsWith("onAutoFillStart") && (k.value = "rds-e-textfield--filled");
265
272
  };
266
273
  return ue(() => {
267
- a.value && a.value.addEventListener("animationstart", $);
274
+ a.value && a.value.addEventListener("animationstart", F);
268
275
  }), de(() => {
269
- a.value && a.value.removeEventListener("animationstart", $);
276
+ a.value && a.value.removeEventListener("animationstart", F);
270
277
  }), s({
271
278
  focus: () => {
272
- a.value && (a.value.focus(), I());
279
+ a.value && (a.value.focus(), $());
273
280
  },
274
281
  blur: () => {
275
- a.value && (a.value.blur(), B());
282
+ a.value && (a.value.blur(), C());
276
283
  }
277
- }), (e, l) => (h(), V("div", {
278
- class: k(["rds-e-textfield", se.value])
284
+ }), (e, l) => (p(), V("div", {
285
+ class: S(["rds-e-textfield", se.value])
279
286
  }, [
280
287
  g("div", {
281
- class: k(["rds-e-textfield__container", {
282
- "rds-e-textfield__container--keyboard-focus": x.value,
283
- "rds-e-textfield__container--active": y.value && !x.value
288
+ class: S(["rds-e-textfield__container", {
289
+ "rds-e-textfield__container--keyboard-focus": b.value,
290
+ "rds-e-textfield__container--active": x.value && !b.value
284
291
  }]),
285
292
  onMousedown: ee
286
293
  }, [
287
- E(e.$slots, "left-icon", {}, () => [
288
- o.value.left.name && C(o.value.left.name) ? (h(), R(K, A({
294
+ B(e.$slots, "left-icon", {}, () => [
295
+ t.loading ? (p(), E(T, {
289
296
  key: 0,
290
- class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": y.value }],
297
+ name: "loading",
298
+ class: "rds-e-textfield__icon--loading"
299
+ })) : y("", !0),
300
+ o.value.left.name && D(o.value.left.name) && !t.loading ? (p(), E(T, M({
301
+ key: 1,
302
+ class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": x.value }],
291
303
  "aria-hidden": "true"
292
- }, o.value.left, ce(o.value.left.events)), null, 16, ["class"])) : S("", !0)
304
+ }, o.value.left, ce(o.value.left.events)), null, 16, ["class"])) : y("", !0)
293
305
  ], !0),
294
306
  g("div", he, [
295
307
  g("input", {
296
- id: T.value,
308
+ id: I.value,
297
309
  ref_key: "input",
298
310
  ref: a,
299
311
  type: X.value,
@@ -305,40 +317,40 @@ import './style/textField.css';const he = { class: "rds-e-textfield__input-conta
305
317
  autocomplete: Y.value,
306
318
  readonly: t.readonly,
307
319
  onInput: Z,
308
- onBlur: B,
309
- onFocus: I,
320
+ onBlur: C,
321
+ onFocus: $,
310
322
  onKeydown: te,
311
323
  onKeyup: le,
312
324
  onKeypress: ae,
313
325
  onChange: ne
314
326
  }, null, 40, ge),
315
327
  g("label", {
316
- for: T.value,
317
- class: k(["rds-e-textfield__label", d(N) ? "rds-e-textfield__label--disabled" : ""])
318
- }, M(d(P)), 11, _e)
328
+ for: I.value,
329
+ class: S(["rds-e-textfield__label", d(N) ? "rds-e-textfield__label--disabled" : ""])
330
+ }, K(d(P)), 11, ye)
319
331
  ]),
320
- o.value.right.name || e.$slots["right-icon"] ? (h(), V("span", ye, [
321
- E(e.$slots, "right-icon", {}, () => [
322
- o.value.right.name && C(o.value.right.name) ? (h(), R(K, A({
332
+ o.value.right.name || e.$slots["right-icon"] ? (p(), V("span", _e, [
333
+ B(e.$slots, "right-icon", {}, () => [
334
+ o.value.right.name && D(o.value.right.name) ? (p(), E(T, M({
323
335
  key: 0,
324
336
  "aria-hidden": "true",
325
337
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
326
338
  }, o.value.right, {
327
339
  onClick: fe(o.value.right.events.click, ["stop"])
328
- }), null, 16, ["onClick"])) : S("", !0)
340
+ }), null, 16, ["onClick"])) : y("", !0)
329
341
  ], !0)
330
- ])) : S("", !0)
342
+ ])) : y("", !0)
331
343
  ], 34),
332
- d(U) || d(L) ? (h(), V("div", xe, [
333
- E(e.$slots, "helper-text", {}, () => [
344
+ d(U) || d(L) ? (p(), V("div", xe, [
345
+ B(e.$slots, "helper-text", {}, () => [
334
346
  g("span", {
335
- class: k(d(L) ? "rds-e-textfield__helper--error" : "")
336
- }, M(d(z)), 3)
347
+ class: S(d(L) ? "rds-e-textfield__helper--error" : "")
348
+ }, K(d(z)), 3)
337
349
  ], !0)
338
- ])) : S("", !0)
350
+ ])) : y("", !0)
339
351
  ], 2));
340
352
  }
341
- }), Le = /* @__PURE__ */ me(be, [["__scopeId", "data-v-9e6e107e"]]);
353
+ }), Le = /* @__PURE__ */ me(be, [["__scopeId", "data-v-78d8f6ab"]]);
342
354
  export {
343
355
  Le as default
344
356
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as E, toRefs as I, ref as o, computed as S, createElementBlock as p, openBlock as f, createElementVNode as i, renderSlot as k, normalizeClass as R, createCommentVNode as $, unref as b, createVNode as P, toDisplayString as B, createTextVNode as F, nextTick as X } from "vue";
2
2
  import { c as Y, o as q, f as G, s as J, a as K, b as L } from "./floating-ui.vue-7LKzPqHI.js";
3
- import { R as Q } from "./icon-svg-BGa9K9qG.js";
3
+ import { R as Q } from "./icon-svg-arye8CV8.js";
4
4
  import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  import './style/tooltip.css';const Z = ["id"], ee = {
6
6
  key: 0,