energy-components 1.8.1 → 1.10.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 (65) hide show
  1. package/dist/components/accordion.es.js +1 -1
  2. package/dist/components/avatar.es.js +161 -0
  3. package/dist/components/button.es.js +1 -1
  4. package/dist/components/checkbox.es.js +52 -36
  5. package/dist/components/directAccess.es.js +146 -0
  6. package/dist/components/dragAndDrop.es.js +77 -60
  7. package/dist/components/dropdown.es.js +125 -112
  8. package/dist/components/fileUploadItem.es.js +182 -0
  9. package/dist/components/filterChip.es.js +27 -23
  10. package/dist/components/icon-svg-YXBqzlJN.js +14398 -0
  11. package/dist/components/iconList.es.js +1 -1
  12. package/dist/components/iconSvg.es.js +1 -1
  13. package/dist/components/index.es.js +77 -65
  14. package/dist/components/infoBox.es.js +1 -1
  15. package/dist/components/link.es.js +67 -55
  16. package/dist/components/loader.es.js +178 -0
  17. package/dist/components/modal.es.js +1 -1
  18. package/dist/components/multiselect.es.js +73 -65
  19. package/dist/components/persistentToast.es.js +1 -1
  20. package/dist/components/progressBar.es.js +52 -28
  21. package/dist/components/quantitySelector.es.js +1 -1
  22. package/dist/components/radioButton.es.js +1 -1
  23. package/dist/components/selectionChip.es.js +15 -14
  24. package/dist/components/sidedrawer.es.js +1 -1
  25. package/dist/components/style/avatar.css +1 -0
  26. package/dist/components/style/button.css +1 -1
  27. package/dist/components/style/checkbox.css +1 -1
  28. package/dist/components/style/directAccess.css +1 -0
  29. package/dist/components/style/dragAndDrop.css +1 -1
  30. package/dist/components/style/dropdown.css +1 -1
  31. package/dist/components/style/fileUploadItem.css +1 -0
  32. package/dist/components/style/filterChip.css +1 -1
  33. package/dist/components/style/link.css +1 -1
  34. package/dist/components/style/loader.css +1 -0
  35. package/dist/components/style/multiselect.css +1 -1
  36. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  37. package/dist/components/style/progressBar.css +1 -1
  38. package/dist/components/style/selectionChip.css +1 -1
  39. package/dist/components/style/toggle.css +1 -1
  40. package/dist/components/switch.es.js +1 -1
  41. package/dist/components/tabBar.es.js +1 -1
  42. package/dist/components/tableslotedcomponent.es.js +1 -1
  43. package/dist/components/tag.es.js +1 -1
  44. package/dist/components/textArea.es.js +1 -1
  45. package/dist/components/textField.es.js +1 -1
  46. package/dist/components/toggle.es.js +21 -20
  47. package/dist/components/tooltip.es.js +1 -1
  48. package/dist/energy-components.es.js +14281 -9987
  49. package/dist/energy-components.umd.js +2 -2
  50. package/dist/style.css +1 -1
  51. package/dist/types/src/components/content/avatar/avatar.vue.d.ts +153 -0
  52. package/dist/types/src/components/feedback/loader/loader.vue.d.ts +151 -0
  53. package/dist/types/src/components/feedback/progress-bar/progress-bar.vue.d.ts +34 -0
  54. package/dist/types/src/components/index.d.ts +4 -0
  55. package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +15 -0
  56. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +14 -2
  57. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +23 -0
  58. package/dist/types/src/components/input/file-upload-item/file-upload-item.vue.d.ts +229 -0
  59. package/dist/types/src/components/input/filter-chip/filter-chip.vue.d.ts +2 -0
  60. package/dist/types/src/components/navigation/direct-access/direct-access.vue.d.ts +178 -0
  61. package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
  62. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +1 -1
  63. package/dist/types/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +2 -2
  65. package/dist/components/icon-svg-_WCkLP8-.js +0 -10847
@@ -1,21 +1,21 @@
1
- import { defineComponent as ne, mergeModels as K, toRefs as de, useModel as ie, ref as S, computed as p, provide as T, onMounted as ue, nextTick as F, onBeforeUnmount as ce, createElementBlock as y, openBlock as m, createVNode as V, mergeProps as H, unref as n, withModifiers as a, createSlots as P, withCtx as d, createElementVNode as u, createCommentVNode as D, createBlock as W, renderSlot as f, Fragment as pe, toDisplayString as M, normalizeClass as me } from "vue";
2
- import fe from "./multiselect.es.js";
3
- import ve from "./checkbox.es.js";
4
- import { _ as be } from "./radio-group.vue_vue_type_script_setup_true_lang-DpguLlRK.js";
5
- import ye from "./radioButton.es.js";
1
+ import { defineComponent as de, mergeModels as K, toRefs as ie, useModel as ue, ref as D, computed as u, provide as T, onMounted as ce, nextTick as F, onBeforeUnmount as pe, createElementBlock as y, openBlock as m, createVNode as S, mergeProps as H, unref as a, withModifiers as n, createSlots as P, withCtx as d, createElementVNode as c, createCommentVNode as V, createBlock as W, renderSlot as f, Fragment as me, toDisplayString as M, normalizeClass as fe } from "vue";
2
+ import ve from "./multiselect.es.js";
3
+ import be from "./checkbox.es.js";
4
+ import { _ as ye } from "./radio-group.vue_vue_type_script_setup_true_lang-DpguLlRK.js";
5
+ import ge from "./radioButton.es.js";
6
6
  import z from "./textField.es.js";
7
- import { R as ge } from "./icon-svg-_WCkLP8-.js";
8
- import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { class: "rds-e-dropdown__option" }, $e = { class: "rds-e-dropdown__option-container" }, Ce = { class: "rds-e-dropdown__option--prepend" }, Se = { class: "rds-e-dropdown__option--content" }, Ve = {
7
+ import { R as we } from "./icon-svg-YXBqzlJN.js";
8
+ import { _ as he } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ import './style/dropdown.css';const ke = { class: "rds-e-dropdown" }, $e = { class: "rds-e-dropdown__option" }, Ce = { class: "rds-e-dropdown__option-container" }, De = { class: "rds-e-dropdown__option--prepend" }, Se = { class: "rds-e-dropdown__option--content" }, Ve = {
10
10
  key: 0,
11
11
  class: "rds-e-dropdown__option-detail"
12
- }, De = { key: 1 }, Be = {
12
+ }, Be = { key: 1 }, Oe = {
13
13
  key: 0,
14
14
  class: "rds-e-dropdown__option--append"
15
- }, Oe = { class: "rds-e-dropdown__before-list-container" }, Ae = {
15
+ }, Ae = { class: "rds-e-dropdown__before-list-container" }, Fe = {
16
16
  key: 1,
17
17
  class: "rds-e-dropdown__before-list"
18
- }, Fe = { class: "rds-e-dropdown__before-list-container" }, Re = { class: "rds-e-dropdown__after-list" }, Ee = { class: "rds-e-dropdown__after-list-container" }, Le = /* @__PURE__ */ ne({
18
+ }, Re = { class: "rds-e-dropdown__before-list-container" }, Ee = { class: "rds-e-dropdown__after-list" }, Le = { class: "rds-e-dropdown__after-list-container" }, xe = /* @__PURE__ */ de({
19
19
  __name: "dropdown",
20
20
  props: /* @__PURE__ */ K({
21
21
  /**
@@ -127,6 +127,19 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
127
127
  type: Boolean,
128
128
  default: !1
129
129
  },
130
+ /**
131
+ * Define la dirección de apertura del dropdown
132
+ * 'auto': detecta automáticamente (default)
133
+ * 'above': siempre se abre hacia arriba
134
+ * 'below': siempre se abre hacia abajo
135
+ */
136
+ openDirection: {
137
+ type: String,
138
+ default: "auto",
139
+ validator(o) {
140
+ return ["auto", "above", "below"].includes(o);
141
+ }
142
+ },
130
143
  /**
131
144
  * Muestra un campo de texto para filtrar los elementos del dropdown.
132
145
  * La propiedad `autocompleteFilter` es requerida cuando se usa esta opción.
@@ -151,24 +164,24 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
151
164
  }),
152
165
  emits: /* @__PURE__ */ K(["open", "close", "select", "change"], ["update:modelValue"]),
153
166
  setup(o, { expose: R, emit: G }) {
154
- const r = o, h = G, {
167
+ const s = o, h = G, {
155
168
  disabled: k,
156
169
  limit: E,
157
170
  multiple: $,
158
171
  options: g
159
- } = de(r), s = ie(o, "modelValue"), i = S([]), v = S(), b = S(), L = S(""), x = S(!1), J = () => {
172
+ } = ie(s), r = ue(o, "modelValue"), i = D([]), v = D(), b = D(), L = D(""), x = D(!1), J = () => {
160
173
  x.value = !0;
161
- }, C = p(() => r.autocomplete && Object.keys(r.autocomplete).length > 0), Q = p(() => ({
162
- id: r.autocomplete.id || `autocomplete-${r.id}`,
163
- label: r.autocomplete.label || r.label,
164
- icon: r.autocomplete.icon || "",
165
- rightIcon: r.autocomplete.rightIcon || "",
166
- disabled: r.autocomplete.disabled || !1,
167
- clearable: r.autocomplete.clearable || !1,
168
- error: r.autocomplete.error ?? !1,
169
- helper: r.autocomplete.helper ?? "",
170
- helperText: r.autocomplete.helperText ?? "",
171
- readonly: r.autocomplete.readonly ?? !1
174
+ }, C = u(() => s.autocomplete && Object.keys(s.autocomplete).length > 0), Q = u(() => ({
175
+ id: s.autocomplete.id || `autocomplete-${s.id}`,
176
+ label: s.autocomplete.label || s.label,
177
+ icon: s.autocomplete.icon || "",
178
+ rightIcon: s.autocomplete.rightIcon || "",
179
+ disabled: s.autocomplete.disabled || !1,
180
+ clearable: s.autocomplete.clearable || !1,
181
+ error: s.autocomplete.error ?? !1,
182
+ helper: s.autocomplete.helper ?? "",
183
+ helperText: s.autocomplete.helperText ?? "",
184
+ readonly: s.autocomplete.readonly ?? !1
172
185
  }));
173
186
  T("registerDropdownFocusElement", (e) => {
174
187
  e && !i.value.includes(e) && i.value.push(e);
@@ -176,45 +189,45 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
176
189
  const l = i.value.findIndex((t) => t === e);
177
190
  l > -1 && i.value.splice(l, 1);
178
191
  }), T("isFocusWithinDropdown", (e) => {
179
- const l = i.value.some((c) => c === e || c.contains(e)), t = e.classList && (e.classList.contains("rds-e-dropdown__before-list") || e.closest(".rds-e-dropdown__before-list") || e.classList.contains("multiselect") || e.closest(".multiselect"));
192
+ const l = i.value.some((p) => p === e || p.contains(e)), t = e.classList && (e.classList.contains("rds-e-dropdown__before-list") || e.closest(".rds-e-dropdown__before-list") || e.classList.contains("multiselect") || e.closest(".multiselect"));
180
193
  return l || t;
181
194
  });
182
- const I = p({
183
- get: () => s.value && typeof s.value == "object" && !Array.isArray(s.value) ? s.value.id : typeof s.value == "string" || typeof s.value == "number" ? s.value : null,
195
+ const I = u({
196
+ get: () => r.value && typeof r.value == "object" && !Array.isArray(r.value) ? r.value.id : typeof r.value == "string" || typeof r.value == "number" ? r.value : null,
184
197
  set: (e) => {
185
198
  const l = g.value.find((t) => typeof t == "object" ? t.id === e : t === e);
186
- s.value = l || null;
199
+ r.value = l || null;
187
200
  }
188
- }), X = p(() => (g.value ?? []).every((e) => typeof e == "object" && (e == null ? void 0 : e.id) && (e == null ? void 0 : e.label))), Y = p(() => !$.value || r.closeOnSelect), q = p({
189
- get: () => s.value ? r.multiple ? Array.isArray(s.value) ? s.value.length > E.value ? r.limitText(E.value) : s.value.map((e) => typeof e == "string" ? e : e.label).join(", ") : "" : typeof s.value == "object" ? s.value.label : typeof s.value == "string" ? s.value : "" : "",
201
+ }), X = u(() => (g.value ?? []).every((e) => typeof e == "object" && (e == null ? void 0 : e.id) && (e == null ? void 0 : e.label))), Y = u(() => !$.value || s.closeOnSelect), q = u({
202
+ get: () => r.value ? s.multiple ? Array.isArray(r.value) ? r.value.length > E.value ? s.limitText(E.value) : r.value.map((e) => typeof e == "string" ? e : e.label).join(", ") : "" : typeof r.value == "object" ? r.value.label : typeof r.value == "string" ? r.value : "" : "",
190
203
  set: () => null
191
- }), Z = p(() => ({
204
+ }), Z = u(() => ({
192
205
  "rds-e-dropdown-input": !0,
193
206
  "rds-e-dropdown--disabled": k.value,
194
- "rds-e-dropdown--small": r.small
195
- })), j = p(() => {
207
+ "rds-e-dropdown--small": s.small
208
+ })), ee = u(() => s.openDirection !== "auto" ? s.openDirection : ""), j = u(() => {
196
209
  const e = {};
197
210
  return X.value && Object.assign(e, {
198
211
  "track-by": "id",
199
212
  label: "label"
200
213
  }), e;
201
- }), ee = p(() => C.value && r.autocomplete.autocompleteFilter ? g.value.filter((e) => r.autocomplete.autocompleteFilter(e, L.value)) : g.value), B = (e) => {
202
- if (s.value === e) return !0;
203
- if (Array.isArray(s.value)) {
204
- if (typeof e == "string") return s.value.includes(e);
214
+ }), le = u(() => C.value && s.autocomplete.autocompleteFilter ? g.value.filter((e) => s.autocomplete.autocompleteFilter(e, L.value)) : g.value), B = (e) => {
215
+ if (r.value === e) return !0;
216
+ if (Array.isArray(r.value)) {
217
+ if (typeof e == "string") return r.value.includes(e);
205
218
  if (j.value.label)
206
- return s.value.some((l) => l.id === e.id);
219
+ return r.value.some((l) => l.id === e.id);
207
220
  }
208
221
  return !1;
209
- }, le = (e) => {
210
- h("open", e);
211
222
  }, te = (e) => {
212
- h("close", e);
223
+ h("open", e);
213
224
  }, oe = (e) => {
225
+ h("close", e);
226
+ }, se = (e) => {
214
227
  F(() => {
215
228
  h("select", e);
216
229
  });
217
- }, se = () => {
230
+ }, re = () => {
218
231
  F(() => {
219
232
  if ($.value) {
220
233
  const e = g.value.filter(
@@ -234,7 +247,7 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
234
247
  v.value.activate();
235
248
  }, U = () => {
236
249
  v.value.deactivate();
237
- }, re = () => {
250
+ }, ne = () => {
238
251
  v.value.toggle();
239
252
  }, ae = () => {
240
253
  C.value && b.value && (J(), O(), F(() => {
@@ -242,10 +255,10 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
242
255
  }));
243
256
  }, _ = (e) => {
244
257
  if (!x.value) return;
245
- const l = e.target, t = !v.value.$el.contains(l), c = b.value && !b.value.$el.contains(l) && !l.closest(".rds-e-dropdown__before-list");
246
- t && c && (x.value = !1, U());
258
+ const l = e.target, t = !v.value.$el.contains(l), p = b.value && !b.value.$el.contains(l) && !l.closest(".rds-e-dropdown__before-list");
259
+ t && p && (x.value = !1, U());
247
260
  };
248
- return ue(() => {
261
+ return ce(() => {
249
262
  var e;
250
263
  (e = v.value) != null && e.$el && i.value.push(v.value.$el), F(() => {
251
264
  var l;
@@ -255,7 +268,7 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
255
268
  t && !i.value.includes(t) && i.value.push(t);
256
269
  }
257
270
  }), document.addEventListener("click", _);
258
- }), ce(() => {
271
+ }), pe(() => {
259
272
  i.value = [], document.removeEventListener("click", _);
260
273
  }), R({
261
274
  /**
@@ -266,57 +279,57 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
266
279
  * Cierra el dropdown
267
280
  */
268
281
  deactivate: U
269
- }), (e, l) => (m(), y("div", he, [
270
- V(fe, H({
282
+ }), (e, l) => (m(), y("div", ke, [
283
+ S(ve, H({
271
284
  ref_key: "multiselect",
272
285
  ref: v,
273
- modelValue: s.value,
274
- "onUpdate:modelValue": l[13] || (l[13] = (t) => s.value = t),
286
+ modelValue: r.value,
287
+ "onUpdate:modelValue": l[13] || (l[13] = (t) => r.value = t),
275
288
  class: Z.value,
276
- options: ee.value,
289
+ options: le.value,
277
290
  "close-on-select": Y.value,
278
291
  "show-labels": !1,
279
- disabled: n(k),
280
- multiple: n($),
292
+ disabled: a(k),
293
+ multiple: a($),
281
294
  "max-height": o.maxHeight,
282
295
  searchable: !1,
283
296
  small: o.small,
284
- "open-direction": "bottom",
285
- limit: n(E),
297
+ "open-direction": ee.value,
298
+ limit: a(E),
286
299
  "limit-text": o.limitText
287
300
  }, j.value, {
288
301
  "append-to-body": o.appendToBody,
289
- onOpen: le,
290
- onClose: te,
291
- onSelect: oe,
292
- "onUpdate:modelValue": se,
293
- onFocus: l[14] || (l[14] = a(() => O(), ["prevent"])),
294
- onBlur: a(() => null, ["prevent"])
302
+ onOpen: te,
303
+ onClose: oe,
304
+ onSelect: se,
305
+ "onUpdate:modelValue": re,
306
+ onFocus: l[14] || (l[14] = n(() => O(), ["prevent"])),
307
+ onBlur: n(() => null, ["prevent"])
295
308
  }), P({
296
309
  selection: d(({ isOpen: t }) => [
297
- V(n(z), {
310
+ S(a(z), {
298
311
  id: `multiselect-dropdown-${o.id}`,
299
312
  modelValue: q.value,
300
- "onUpdate:modelValue": l[1] || (l[1] = (c) => q.value = c),
313
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => q.value = p),
301
314
  class: "rds-e-dropdown__input",
302
- disabled: n(k),
315
+ disabled: a(k),
303
316
  label: o.label,
304
317
  error: o.error,
305
318
  helper: o.helper,
306
319
  "helper-text": o.helperText,
307
320
  readonly: "",
308
- onClick: a((c) => t ? null : O(), ["prevent", "stop"])
321
+ onClick: n((p) => t ? null : O(), ["prevent", "stop"])
309
322
  }, P({
310
323
  "right-icon": d(() => [
311
- V(n(ge), {
324
+ S(a(we), {
312
325
  name: "arrow_down",
313
326
  "aria-hidden": "true",
314
- class: me(["rds-e-dropdown__input-caret", {
327
+ class: fe(["rds-e-dropdown__input-caret", {
315
328
  "rds-e-dropdown__input-caret--open": t
316
329
  }]),
317
- onClick: l[0] || (l[0] = a(() => {
330
+ onClick: l[0] || (l[0] = n(() => {
318
331
  }, ["self", "stop"])),
319
- onMousedown: a(re, ["self", "prevent", "stop"])
332
+ onMousedown: n(ne, ["self", "prevent", "stop"])
320
333
  }, null, 8, ["class"])
321
334
  ]),
322
335
  _: 2
@@ -331,57 +344,57 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
331
344
  ]), 1032, ["id", "modelValue", "disabled", "label", "error", "helper", "helper-text", "onClick"])
332
345
  ]),
333
346
  placeholder: d(() => [
334
- l[15] || (l[15] = u("span", null, null, -1))
347
+ l[15] || (l[15] = c("span", null, null, -1))
335
348
  ]),
336
- option: d(({ option: t, search: c, index: A }) => [
337
- u("div", ke, [
338
- u("div", $e, [
339
- u("div", Ce, [
340
- n($) ? (m(), W(n(ve), {
349
+ option: d(({ option: t, search: p, index: A }) => [
350
+ c("div", $e, [
351
+ c("div", Ce, [
352
+ c("div", De, [
353
+ a($) ? (m(), W(a(be), {
341
354
  key: 0,
342
355
  id: `${A}-${t.id}`,
343
356
  small: o.small,
344
357
  "is-checked": B(t),
345
- disabled: n(k) || (t == null ? void 0 : t.$isDisabled) || !1,
346
- onClick: a((w) => N(t), ["prevent", "stop"])
347
- }, null, 8, ["id", "small", "is-checked", "disabled", "onClick"])) : !n($) && o.showRadio ? (m(), W(n(be), {
358
+ disabled: a(k) || (t == null ? void 0 : t.$isDisabled) || !1,
359
+ onClick: n((w) => N(t), ["prevent", "stop"])
360
+ }, null, 8, ["id", "small", "is-checked", "disabled", "onClick"])) : !a($) && o.showRadio ? (m(), W(a(ye), {
348
361
  key: 1,
349
362
  modelValue: I.value,
350
363
  "onUpdate:modelValue": l[2] || (l[2] = (w) => I.value = w),
351
364
  "group-name": `group-${o.id}`
352
365
  }, {
353
366
  default: d(() => [
354
- V(n(ye), {
367
+ S(a(ge), {
355
368
  id: `${A}-${typeof t == "object" ? t.id : A}`,
356
369
  small: o.small,
357
370
  option: typeof t == "object" ? t.id : t,
358
371
  checked: B(t),
359
- disabled: n(k) || (t == null ? void 0 : t.$isDisabled) || !1,
360
- onClick: a((w) => N(t), ["prevent", "stop"])
372
+ disabled: a(k) || (t == null ? void 0 : t.$isDisabled) || !1,
373
+ onClick: n((w) => N(t), ["prevent", "stop"])
361
374
  }, null, 8, ["id", "small", "option", "checked", "disabled", "onClick"])
362
375
  ]),
363
376
  _: 2
364
- }, 1032, ["modelValue", "group-name"])) : D("", !0)
377
+ }, 1032, ["modelValue", "group-name"])) : V("", !0)
365
378
  ]),
366
- u("div", Se, [
379
+ c("div", Se, [
367
380
  f(e.$slots, "singleLabel", { option: t }, () => {
368
381
  var w;
369
382
  return [
370
- (w = j.value) != null && w.label ? (m(), y(pe, { key: 0 }, [
371
- u("span", null, M(t.label), 1),
372
- t != null && t.detail ? (m(), y("span", Ve, M(t.detail), 1)) : D("", !0)
373
- ], 64)) : (m(), y("span", De, M(t), 1))
383
+ (w = j.value) != null && w.label ? (m(), y(me, { key: 0 }, [
384
+ c("span", null, M(t.label), 1),
385
+ t != null && t.detail ? (m(), y("span", Ve, M(t.detail), 1)) : V("", !0)
386
+ ], 64)) : (m(), y("span", Be, M(t), 1))
374
387
  ];
375
388
  }, !0)
376
389
  ])
377
390
  ]),
378
- e.$slots.optionAppend ? (m(), y("div", Be, [
391
+ e.$slots.optionAppend ? (m(), y("div", Oe, [
379
392
  f(e.$slots, "optionAppend", {
380
393
  option: t,
381
- search: c,
394
+ search: p,
382
395
  index: A
383
396
  }, void 0, !0)
384
- ])) : D("", !0)
397
+ ])) : V("", !0)
385
398
  ])
386
399
  ]),
387
400
  _: 2
@@ -420,59 +433,59 @@ import './style/dropdown.css';const he = { class: "rds-e-dropdown" }, ke = { cla
420
433
  C.value ? (m(), y("div", {
421
434
  key: 0,
422
435
  class: "rds-e-dropdown__before-list",
423
- onMousedown: l[6] || (l[6] = a(() => {
436
+ onMousedown: l[6] || (l[6] = n(() => {
424
437
  }, ["stop"])),
425
- onClick: a(ae, ["stop"]),
426
- onBlur: l[7] || (l[7] = a(() => {
438
+ onClick: n(ae, ["stop"]),
439
+ onBlur: l[7] || (l[7] = n(() => {
427
440
  }, ["stop"])),
428
- onFocus: l[8] || (l[8] = a(() => {
441
+ onFocus: l[8] || (l[8] = n(() => {
429
442
  }, ["stop"])),
430
- onKeydown: l[9] || (l[9] = a(() => {
443
+ onKeydown: l[9] || (l[9] = n(() => {
431
444
  }, ["stop"])),
432
- onKeyup: l[10] || (l[10] = a(() => {
445
+ onKeyup: l[10] || (l[10] = n(() => {
433
446
  }, ["stop"])),
434
- onKeypress: l[11] || (l[11] = a(() => {
447
+ onKeypress: l[11] || (l[11] = n(() => {
435
448
  }, ["stop"])),
436
- onChange: l[12] || (l[12] = a(() => {
449
+ onChange: l[12] || (l[12] = n(() => {
437
450
  }, ["stop"]))
438
451
  }, [
439
- u("div", Oe, [
440
- V(n(z), H({
452
+ c("div", Ae, [
453
+ S(a(z), H({
441
454
  ref_key: "textFieldInput",
442
455
  ref: b,
443
456
  modelValue: L.value,
444
457
  "onUpdate:modelValue": l[3] || (l[3] = (t) => L.value = t)
445
458
  }, Q.value, {
446
- onMousedown: l[4] || (l[4] = a(() => {
459
+ onMousedown: l[4] || (l[4] = n(() => {
447
460
  }, ["stop", "prevent"])),
448
- onFocus: l[5] || (l[5] = a(() => {
461
+ onFocus: l[5] || (l[5] = n(() => {
449
462
  }, ["stop"]))
450
463
  }), null, 16, ["modelValue"])
451
464
  ])
452
- ], 32)) : D("", !0),
453
- e.$slots.beforeList ? (m(), y("div", Ae, [
454
- u("div", Fe, [
465
+ ], 32)) : V("", !0),
466
+ e.$slots.beforeList ? (m(), y("div", Fe, [
467
+ c("div", Re, [
455
468
  f(e.$slots, "beforeList", {}, void 0, !0)
456
469
  ])
457
- ])) : D("", !0)
470
+ ])) : V("", !0)
458
471
  ]),
459
472
  key: "4"
460
473
  } : void 0,
461
474
  e.$slots.afterList ? {
462
475
  name: "afterList",
463
476
  fn: d(() => [
464
- u("div", Re, [
465
- u("div", Ee, [
477
+ c("div", Ee, [
478
+ c("div", Le, [
466
479
  f(e.$slots, "afterList", {}, void 0, !0)
467
480
  ])
468
481
  ])
469
482
  ]),
470
483
  key: "5"
471
484
  } : void 0
472
- ]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "limit", "limit-text", "append-to-body"])
485
+ ]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "open-direction", "limit", "limit-text", "append-to-body"])
473
486
  ]));
474
487
  }
475
- }), _e = /* @__PURE__ */ we(Le, [["__scopeId", "data-v-c91ac7b6"]]);
488
+ }), Ke = /* @__PURE__ */ he(xe, [["__scopeId", "data-v-9000f56f"]]);
476
489
  export {
477
- _e as default
490
+ Ke as default
478
491
  };
@@ -0,0 +1,182 @@
1
+ import { defineComponent as M, ref as N, computed as c, createElementBlock as l, openBlock as o, normalizeClass as $, createElementVNode as r, renderSlot as v, createVNode as p, createCommentVNode as n, toDisplayString as m, withModifiers as I } from "vue";
2
+ import { R as g } from "./icon-svg-YXBqzlJN.js";
3
+ import z from "./progressBar.es.js";
4
+ import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/fileUploadItem.css';const R = { class: "rds-e-file-upload-item__icon-container" }, w = { class: "rds-e-file-upload-item__details" }, E = { class: "rds-e-file-upload-item__info-wrapper" }, F = { class: "rds-e-file-upload-item__name" }, x = {
6
+ key: 0,
7
+ class: "rds-e-file-upload-item__meta"
8
+ }, D = { class: "rds-e-file-upload-item__size" }, P = {
9
+ key: 0,
10
+ class: "rds-e-file-upload-item__time-remaining"
11
+ }, V = {
12
+ key: 1,
13
+ class: "rds-e-file-upload-item__error-message"
14
+ }, q = {
15
+ key: 0,
16
+ class: "rds-e-file-upload-item__progress-indicator-container"
17
+ }, T = { class: "rds-e-file-upload-item__action" }, j = ["aria-label", "disabled"], A = /* @__PURE__ */ M({
18
+ __name: "file-upload-item",
19
+ props: {
20
+ /**
21
+ * Identificador único para el ítem de archivo (opcional, pero útil para eventos).
22
+ */
23
+ id: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ /**
28
+ * Nombre del archivo a mostrar.
29
+ */
30
+ fileName: {
31
+ type: String,
32
+ required: !0
33
+ },
34
+ /**
35
+ * Tamaño del archivo en bytes.
36
+ */
37
+ fileSize: {
38
+ type: Number,
39
+ required: !0
40
+ },
41
+ /**
42
+ * Nombre del icono a mostrar para el archivo.
43
+ * Ver la sección 'Options > Icon' en el diseño para ejemplos.
44
+ * Por defecto es 'document_generic' (representando "Document final content").
45
+ */
46
+ fileIcon: {
47
+ type: String,
48
+ default: "document-final-content"
49
+ },
50
+ /**
51
+ * Estado actual del ítem de archivo.
52
+ * Determina la apariencia y elementos mostrados (ej. barra de progreso, mensaje de error).
53
+ * Posibles valores: 'default', 'uploading', 'error', 'disabled'.
54
+ */
55
+ status: {
56
+ type: String,
57
+ default: "default",
58
+ validator: (e) => ["default", "uploading", "error", "disabled"].includes(e)
59
+ },
60
+ /**
61
+ * Progreso de la subida (0-100). Usado por RDSProgressBar si showProgressBar es true.
62
+ */
63
+ progress: {
64
+ type: Number,
65
+ default: 0,
66
+ validator: (e) => e >= 0 && e <= 100
67
+ },
68
+ /**
69
+ * Texto que indica el tiempo restante de subida (ej. "4 second left").
70
+ * Solo visible si status es 'uploading'.
71
+ */
72
+ timeRemaining: {
73
+ type: String,
74
+ default: null
75
+ },
76
+ /**
77
+ * Mensaje de error a mostrar. Solo visible si status es 'error'.
78
+ * Reemplaza el campo de detalle con el contexto de error.
79
+ */
80
+ errorMessage: {
81
+ type: String,
82
+ default: null
83
+ },
84
+ /**
85
+ * Indica si el componente está deshabilitado.
86
+ * Esto aplicará estilos de deshabilitado y prevendrá interacciones.
87
+ */
88
+ disabled: {
89
+ type: Boolean,
90
+ default: !1
91
+ },
92
+ /**
93
+ * Define la acción disponible para el ítem.
94
+ * Por defecto es una acción de eliminar.
95
+ * Ejemplo: { type: 'delete', icon: 'delete', label: 'Eliminar archivo' }
96
+ */
97
+ action: {
98
+ type: Object,
99
+ default: () => ({ type: "delete", icon: "delete", label: "Eliminar archivo" })
100
+ },
101
+ /**
102
+ * Indica si se debe mostrar el componente RDSProgressBar durante el estado 'uploading'.
103
+ * Si es false, no se muestra ninguna barra de progreso.
104
+ */
105
+ showProgressBar: {
106
+ type: Boolean,
107
+ default: !1
108
+ }
109
+ },
110
+ emits: ["action"],
111
+ setup(e, { emit: _ }) {
112
+ const s = e, b = _, f = N(!1), a = c(() => s.disabled ? "disabled" : s.status), y = c(() => {
113
+ const t = [`rds-e-file-upload-item--${a.value}`];
114
+ return f.value && a.value !== "disabled" && a.value !== "uploading" && a.value !== "error" && t.push("rds-e-file-upload-item--hover"), t;
115
+ }), h = c(() => s.fileIcon), S = c(() => {
116
+ const t = s.fileSize;
117
+ if (t === 0) return "0 Bytes";
118
+ const i = 1024, d = ["Bytes", "KB", "MB", "GB", "TB"], u = Math.floor(Math.log(t) / Math.log(i)), k = u === 1 ? 0 : u > 1 ? 1 : 0;
119
+ return `${Number.parseFloat((t / i ** u).toFixed(k))} ${d[u]}`;
120
+ }), B = (t) => {
121
+ !s.disabled && t && b("action", { actionType: t.type, fileId: s.id });
122
+ };
123
+ return (t, i) => (o(), l("div", {
124
+ class: $(["rds-e-file-upload-item rds-radius-inputs", [y.value]]),
125
+ onMouseover: i[1] || (i[1] = (d) => f.value = !0),
126
+ onMouseleave: i[2] || (i[2] = (d) => f.value = !1)
127
+ }, [
128
+ r("div", R, [
129
+ v(t.$slots, "file-icon", {}, () => [
130
+ p(g, {
131
+ name: h.value,
132
+ class: "rds-e-file-upload-item__file-icon",
133
+ "aria-hidden": "true"
134
+ }, null, 8, ["name"])
135
+ ], !0)
136
+ ]),
137
+ r("div", w, [
138
+ r("div", E, [
139
+ r("span", F, m(e.fileName), 1),
140
+ a.value !== "error" ? (o(), l("div", x, [
141
+ r("span", D, m(S.value), 1),
142
+ a.value === "uploading" && e.timeRemaining ? (o(), l("span", P, m(e.timeRemaining), 1)) : n("", !0)
143
+ ])) : n("", !0),
144
+ a.value === "error" && e.errorMessage ? (o(), l("div", V, m(e.errorMessage), 1)) : n("", !0)
145
+ ]),
146
+ a.value === "uploading" && e.showProgressBar ? (o(), l("div", q, [
147
+ p(z, {
148
+ class: "rds-e-file-upload-item__progress-bar",
149
+ step: e.progress,
150
+ "max-steps": 100,
151
+ percentage: !1,
152
+ "back-button": !1,
153
+ "white-bar": "",
154
+ "hide-counter": "",
155
+ inverse: ""
156
+ }, null, 8, ["step"])
157
+ ])) : n("", !0)
158
+ ]),
159
+ r("div", T, [
160
+ v(t.$slots, "action", {}, () => [
161
+ e.action ? (o(), l("button", {
162
+ key: 0,
163
+ type: "button",
164
+ class: "rds-e-file-upload-item__action-button",
165
+ "aria-label": e.action.label || "Eliminar archivo",
166
+ disabled: e.disabled,
167
+ onClick: i[0] || (i[0] = I((d) => B(e.action), ["stop"]))
168
+ }, [
169
+ p(g, {
170
+ name: e.action.icon,
171
+ class: "rds-e-file-upload-item__action-icon",
172
+ "aria-hidden": "true"
173
+ }, null, 8, ["name"])
174
+ ], 8, j)) : n("", !0)
175
+ ], !0)
176
+ ])
177
+ ], 34));
178
+ }
179
+ }), U = /* @__PURE__ */ C(A, [["__scopeId", "data-v-1de9506e"]]);
180
+ export {
181
+ U as default
182
+ };