energy-components 2.6.0 → 2.8.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 (70) 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-BfTKaP_f.js → collapsable.scss_vue_type_style_index_0_src_true_lang-CBOSJyvR.js} +1 -1
  7. package/dist/components/datepicker.es.js +1 -1
  8. package/dist/components/directAccess.es.js +1 -1
  9. package/dist/components/dragAndDrop.es.js +93 -75
  10. package/dist/components/dropdown.es.js +414 -272
  11. package/dist/components/fileUploadItem.es.js +1 -1
  12. package/dist/components/filterChip.es.js +1 -1
  13. package/dist/components/filterTag.es.js +1 -1
  14. package/dist/components/{icon-svg-CW3eQRcp.js → icon-svg-BWxX0W6p.js} +15 -3
  15. package/dist/components/iconList.es.js +1 -1
  16. package/dist/components/iconSvg.es.js +1 -1
  17. package/dist/components/index.es.js +2 -2
  18. package/dist/components/indicator.es.js +1 -1
  19. package/dist/components/indicatorDots.es.js +1 -1
  20. package/dist/components/infoBox.es.js +1 -1
  21. package/dist/components/link.es.js +1 -1
  22. package/dist/components/modal.es.js +1 -1
  23. package/dist/components/multiselect.es.js +14 -8
  24. package/dist/components/multiselectcontentwrapper.es.js +42 -36
  25. package/dist/components/persistentToast.es.js +1 -1
  26. package/dist/components/popover.es.js +90 -71
  27. package/dist/components/popoverMenu.es.js +67 -60
  28. package/dist/components/progressBar.es.js +1 -1
  29. package/dist/components/quantitySelector.es.js +1 -1
  30. package/dist/components/radioButton.es.js +1 -1
  31. package/dist/components/searchField.es.js +1 -1
  32. package/dist/components/selectionChip.es.js +1 -1
  33. package/dist/components/sidedrawer.es.js +1 -1
  34. package/dist/components/style/dragAndDrop.css +1 -1
  35. package/dist/components/style/dropdown.css +1 -1
  36. package/dist/components/style/multiselect.css +1 -1
  37. package/dist/components/style/multiselectcontentwrapper.css +1 -1
  38. package/dist/components/style/pagination.css +1 -1
  39. package/dist/components/style/popover.css +1 -1
  40. package/dist/components/style/popoverMenu.css +1 -1
  41. package/dist/components/style/table.css +1 -1
  42. package/dist/components/style/tableRenderer.css +1 -1
  43. package/dist/components/switch.es.js +1 -1
  44. package/dist/components/tabBar.es.js +1 -1
  45. package/dist/components/table.es.js +101 -92
  46. package/dist/components/tableRenderer.es.js +363 -214
  47. package/dist/components/tag.es.js +1 -1
  48. package/dist/components/textArea.es.js +1 -1
  49. package/dist/components/textField.es.js +1 -1
  50. package/dist/components/toggle.es.js +1 -1
  51. package/dist/components/tooltip.es.js +1 -1
  52. package/dist/energy-components.css +1 -1
  53. package/dist/energy-components.es.js +6511 -6143
  54. package/dist/energy-components.umd.js +2 -2
  55. package/dist/style.css +1 -1
  56. package/dist/types/src/components/content/table/table-renderer.vue.d.ts +7 -2
  57. package/dist/types/src/components/content/table/table.vue.d.ts +27 -1
  58. package/dist/types/src/components/content/table/use-column-reorder.d.ts +29 -0
  59. package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +15 -0
  60. package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +9 -0
  61. package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +25 -0
  62. package/dist/types/src/components/overlay/popover/popover.vue.d.ts +4 -0
  63. package/dist/types/src/components/overlay/popover-menu/popover-menu.vue.d.ts +10 -4
  64. package/dist/types/tsconfig.tsbuildinfo +1 -1
  65. package/llms/rdsdrag-and-drop.md +1 -0
  66. package/llms/rdsdropdown.md +4 -2
  67. package/llms/rdspopover-menu.md +2 -0
  68. package/llms/rdspopover.md +2 -0
  69. package/llms/rdstable.md +4 -0
  70. package/package.json +2 -2
@@ -1,30 +1,33 @@
1
- import { defineComponent as ge, useSlots as we, toRefs as he, useModel as ke, ref as L, computed as u, provide as U, onMounted as xe, nextTick as V, onBeforeUnmount as $e, openBlock as c, createElementBlock as b, normalizeClass as T, unref as a, createVNode as S, mergeProps as X, withModifiers as r, createSlots as Y, withCtx as d, createElementVNode as m, createBlock as Z, createCommentVNode as A, renderSlot as v, Fragment as Se, toDisplayString as R, mergeModels as ee } from "vue";
2
- import De from "./multiselect.es.js";
3
- import Ce from "./checkbox.es.js";
4
- import { _ as Oe } from "./radio-group.vue_vue_type_script_setup_true_lang-CwgSZYeD.js";
5
- import Be from "./radioButton.es.js";
6
- import { R as te } from "./icon-svg-CW3eQRcp.js";
7
- import oe from "./textField.es.js";
8
- import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"], Ae = ["aria-expanded", "aria-controls"], Ee = { class: "rds-e-dropdown__option" }, Te = { class: "rds-e-dropdown__option-container" }, Re = ["onClick"], _e = { class: "rds-e-dropdown__option--content" }, Fe = {
1
+ import { defineComponent as Qe, useSlots as Xe, toRefs as Ye, useModel as Ze, ref as f, computed as s, provide as ae, watch as W, nextTick as L, onMounted as et, onBeforeUnmount as tt, openBlock as c, createElementBlock as m, normalizeClass as G, unref as i, createVNode as B, mergeProps as we, withModifiers as u, createSlots as he, withCtx as y, createElementVNode as v, createBlock as ke, createCommentVNode as x, renderSlot as h, Fragment as Le, toDisplayString as J, renderList as lt, mergeModels as xe } from "vue";
2
+ import ot from "./multiselect.es.js";
3
+ import nt from "./checkbox.es.js";
4
+ import { _ as at } from "./radio-group.vue_vue_type_script_setup_true_lang-CwgSZYeD.js";
5
+ import rt from "./radioButton.es.js";
6
+ import { R as Se } from "./icon-svg-BWxX0W6p.js";
7
+ import $e from "./textField.es.js";
8
+ import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ import './style/dropdown.css';const it = ["id", "aria-expanded", "aria-controls"], ut = ["aria-expanded", "aria-controls"], dt = { class: "rds-e-dropdown__option" }, ct = { class: "rds-e-dropdown__option-container" }, pt = ["onClick"], vt = { class: "rds-e-dropdown__option--content" }, ft = {
10
10
  key: 0,
11
11
  class: "rds-e-dropdown__option-detail"
12
- }, je = { key: 1 }, Ne = {
12
+ }, mt = { key: 1 }, yt = {
13
13
  key: 0,
14
14
  class: "rds-e-dropdown__option--append"
15
- }, Me = { class: "rds-e-dropdown__before-list-container" }, Ie = {
15
+ }, bt = { class: "rds-e-dropdown__before-list-container" }, gt = {
16
16
  key: 1,
17
17
  class: "rds-e-dropdown__before-list"
18
- }, qe = { class: "rds-e-dropdown__before-list-container" }, Ke = { class: "rds-e-dropdown__after-list" }, Ue = { class: "rds-e-dropdown__after-list-container" }, Pe = "beforeList", He = "afterList", We = "singleLabel", ze = "noOptions", Ge = "noResult", Je = "limit", Qe = "maxElements", Xe = /* @__PURE__ */ ge({
18
+ }, wt = { class: "rds-e-dropdown__before-list-container" }, ht = {
19
+ key: 0,
20
+ class: "rds-e-dropdown__after-list"
21
+ }, kt = { class: "rds-e-dropdown__after-list-container" }, Lt = "beforeList", xt = "afterList", St = "singleLabel", $t = "noOptions", Ot = "noResult", _t = "limit", Et = "maxElements", Dt = /* @__PURE__ */ Qe({
19
22
  __name: "dropdown",
20
- props: /* @__PURE__ */ ee({
23
+ props: /* @__PURE__ */ xe({
21
24
  /**
22
25
  * Id del dropdown
23
26
  */
24
27
  id: {
25
28
  type: [String, Number],
26
29
  required: !0,
27
- validator: (l) => !l || String(l).trim() === "" ? (console.error("[RDSDropdown]: `id` prop is required."), !1) : !0
30
+ validator: (o) => !o || String(o).trim() === "" ? (console.error("[RDSDropdown]: `id` prop is required."), !1) : !0
28
31
  },
29
32
  /**
30
33
  * Versión compacta del dropdown con altura reducida (42px en lugar de 52px).
@@ -41,7 +44,7 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
41
44
  label: {
42
45
  type: String,
43
46
  required: !0,
44
- validator: (l) => !l || l.trim() === "" ? (console.error("[RDSDropdown]: `label` prop is required."), !1) : !0
47
+ validator: (o) => !o || o.trim() === "" ? (console.error("[RDSDropdown]: `label` prop is required."), !1) : !0
45
48
  },
46
49
  /**
47
50
  * Valores a mostrar en el dropdown
@@ -86,7 +89,7 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
86
89
  showRadio: {
87
90
  type: Boolean,
88
91
  default: !1,
89
- validator: (l, _) => l && _.multiple ? (console.error("showRadio solo es valido para seleccion unica"), !1) : !0
92
+ validator: (o, Q) => o && Q.multiple ? (console.error("showRadio solo es valido para seleccion unica"), !1) : !0
90
93
  },
91
94
  /**
92
95
  * Indica si el campo de entrada contiene un error o no.
@@ -128,7 +131,7 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
128
131
  */
129
132
  limitText: {
130
133
  type: Function,
131
- default: (l) => `Más de ${l} elementos seleccionados.`
134
+ default: (o) => `Más de ${o} elementos seleccionados.`
132
135
  },
133
136
  /**
134
137
  * Indica si el dropdown debe renderizarse fuera del flujo del documento
@@ -147,8 +150,8 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
147
150
  openDirection: {
148
151
  type: String,
149
152
  default: "auto",
150
- validator(l) {
151
- return ["auto", "above", "below"].includes(l);
153
+ validator(o) {
154
+ return ["auto", "above", "below"].includes(o);
152
155
  }
153
156
  },
154
157
  /**
@@ -194,6 +197,14 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
194
197
  loading: {
195
198
  type: Boolean,
196
199
  default: !1
200
+ },
201
+ /**
202
+ * Habilita lazy load por scroll al final de la lista.
203
+ * Puede ser boolean (modo evento) o callback async (modo automático).
204
+ */
205
+ lazyLoad: {
206
+ type: [Boolean, Function],
207
+ default: !1
197
208
  }
198
209
  }, {
199
210
  modelValue: {
@@ -201,19 +212,51 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
201
212
  },
202
213
  modelModifiers: {}
203
214
  }),
204
- emits: /* @__PURE__ */ ee(["open", "close", "select", "change"], ["update:modelValue"]),
205
- setup(l, { expose: _, emit: le }) {
206
- const n = l, D = le, P = we(), p = (e) => !!(P && P[e]), {
207
- disabled: w,
208
- limit: F,
215
+ emits: /* @__PURE__ */ xe(["open", "close", "select", "change", "loadMore"], ["update:modelValue"]),
216
+ setup(o, { expose: Q, emit: Oe }) {
217
+ const n = o, O = Oe, re = Xe(), b = (e) => !!(re && re[e]), {
218
+ disabled: S,
219
+ limit: X,
209
220
  multiple: C,
210
- options: k,
211
- textOnly: j
212
- } = he(n), s = ke(l, "modelValue"), f = L([]), i = L(), g = L(), N = L(""), M = L(!1);
213
- let O = !1;
214
- const ne = () => {
215
- M.value = !0;
216
- }, h = u(() => i.value?.isOpen ?? !1), B = u(() => n.autocomplete && Object.keys(n.autocomplete).length > 0), se = u(() => ({
221
+ options: T,
222
+ textOnly: Y
223
+ } = Ye(n), a = Ze(o, "modelValue"), w = f([]), p = f(), k = f(), F = f(""), Z = f(!1), se = f(null), I = f(null), N = f([]), _ = f(!0), q = f(!1), K = f(1), _e = [1, 2, 3], ee = f(null);
224
+ let R = !1, V = !1;
225
+ const Ee = () => {
226
+ Z.value = !0;
227
+ }, g = s(() => p.value?.isOpen ?? !1), te = s(() => n.lazyLoad), E = s(() => !!te.value), D = s(() => typeof te.value == "function"), De = s(() => b("afterList") || E.value), ze = s(() => E.value && g.value && _.value), ie = s(() => D.value ? q.value : n.loading), Ae = s(() => E.value && ie.value), M = s(() => n.autocomplete && Object.keys(n.autocomplete).length > 0), Be = (e) => {
228
+ const t = /* @__PURE__ */ new WeakSet(), l = (r) => {
229
+ if (Array.isArray(r))
230
+ return r.map(l);
231
+ if (r && typeof r == "object") {
232
+ const d = r;
233
+ if (t.has(d))
234
+ return "[Circular]";
235
+ t.add(d);
236
+ const $ = Object.keys(d).sort().reduce((be, ge) => (be[ge] = l(d[ge]), be), {});
237
+ return t.delete(d), $;
238
+ }
239
+ return r;
240
+ };
241
+ return JSON.stringify(l(e));
242
+ }, ue = (e) => {
243
+ if (typeof e == "string")
244
+ return `string-${e}`;
245
+ if (e && typeof e == "object" && "id" in e)
246
+ return `object-${String(e.id)}`;
247
+ try {
248
+ return `object-${Be(e)}`;
249
+ } catch {
250
+ return `fallback-${String(e)}`;
251
+ }
252
+ }, de = (e, t) => {
253
+ const l = [...e], r = new Set(l.map(ue));
254
+ for (const d of t) {
255
+ const $ = ue(d);
256
+ r.has($) || (r.add($), l.push(d));
257
+ }
258
+ return l;
259
+ }, z = s(() => !D.value || N.value.length === 0 ? T.value : de(T.value, N.value)), Ce = s(() => ({
217
260
  id: n.autocomplete.id || `autocomplete-${n.id}`,
218
261
  label: n.autocomplete.label || n.label,
219
262
  icon: n.autocomplete.icon || "",
@@ -225,386 +268,485 @@ import './style/dropdown.css';const Ve = ["id", "aria-expanded", "aria-controls"
225
268
  helperText: n.autocomplete.helperText ?? "",
226
269
  readonly: n.autocomplete.readonly ?? !1
227
270
  }));
228
- U("registerDropdownFocusElement", (e) => {
229
- e && !f.value.includes(e) && f.value.push(e);
230
- }), U("unregisterDropdownFocusElement", (e) => {
231
- const t = f.value.findIndex((o) => o === e);
232
- t > -1 && f.value.splice(t, 1);
233
- }), U("isFocusWithinDropdown", (e) => {
234
- const t = f.value.some((y) => y === e || y.contains(e)), o = e.classList && (e.classList.contains("rds-e-dropdown__before-list") || e.closest(".rds-e-dropdown__before-list") || e.classList.contains("multiselect") || e.closest(".multiselect"));
235
- return t || o;
271
+ ae("registerDropdownFocusElement", (e) => {
272
+ e && !w.value.includes(e) && w.value.push(e);
273
+ }), ae("unregisterDropdownFocusElement", (e) => {
274
+ const t = w.value.findIndex((l) => l === e);
275
+ t > -1 && w.value.splice(t, 1);
276
+ }), ae("isFocusWithinDropdown", (e) => {
277
+ const t = w.value.some((r) => r === e || r.contains(e)), l = e.classList && (e.classList.contains("rds-e-dropdown__before-list") || e.closest(".rds-e-dropdown__before-list") || e.classList.contains("multiselect") || e.closest(".multiselect"));
278
+ return t || l;
236
279
  });
237
- const H = u({
238
- 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,
280
+ const ce = s({
281
+ get: () => a.value && typeof a.value == "object" && !Array.isArray(a.value) ? a.value.id : typeof a.value == "string" || typeof a.value == "number" ? a.value : null,
239
282
  set: (e) => {
240
- const t = k.value.find((o) => typeof o == "object" ? o.id === e : o === e);
241
- s.value = t || null;
283
+ const t = z.value.find((l) => typeof l == "object" ? l.id === e : l === e);
284
+ a.value = t || null;
242
285
  }
243
- }), ae = u(() => (k.value ?? []).every((e) => typeof e == "object" && e?.id && e?.label)), W = u(() => !C.value || n.closeOnSelect), I = u({
244
- get: () => s.value ? n.multiple ? Array.isArray(s.value) ? s.value.length > F.value ? n.limitText(F.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 : "" : "",
286
+ }), Ie = s(() => (z.value ?? []).every((e) => typeof e == "object" && e?.id && e?.label)), pe = s(() => !C.value || n.closeOnSelect), le = s({
287
+ get: () => a.value ? n.multiple ? Array.isArray(a.value) ? a.value.length > X.value ? n.limitText(X.value) : a.value.map((e) => typeof e == "string" ? e : e.label).join(", ") : "" : typeof a.value == "object" ? a.value.label : typeof a.value == "string" ? a.value : "" : "",
245
288
  set: () => null
246
- }), re = u(() => ({
289
+ }), Re = s(() => ({
247
290
  "rds-e-dropdown-input": !0,
248
- "rds-e-dropdown--disabled": w.value,
291
+ "rds-e-dropdown--disabled": S.value,
249
292
  "rds-e-dropdown--small": n.small
250
- })), ie = u(() => n.openDirection !== "auto" ? n.openDirection : "auto"), q = u(() => {
293
+ })), Ve = s(() => n.openDirection !== "auto" ? n.openDirection : "auto"), oe = s(() => {
251
294
  const e = {};
252
- return ae.value && Object.assign(e, {
295
+ return Ie.value && Object.assign(e, {
253
296
  "track-by": "id",
254
297
  label: "label"
255
298
  }), e;
256
- }), de = u(() => B.value && n.autocomplete.autocompleteFilter ? k.value.filter((e) => n.autocomplete.autocompleteFilter(e, N.value)) : k.value), E = (e) => {
257
- if (s.value === e) return !0;
258
- if (Array.isArray(s.value)) {
259
- if (typeof e == "string") return s.value.includes(e);
260
- if (q.value.label)
261
- return s.value.some((t) => t.id === e.id);
299
+ }), Me = s(() => M.value && n.autocomplete.autocompleteFilter ? z.value.filter((e) => n.autocomplete.autocompleteFilter(e, F.value)) : z.value), U = (e) => {
300
+ if (a.value === e) return !0;
301
+ if (Array.isArray(a.value)) {
302
+ if (typeof e == "string") return a.value.includes(e);
303
+ if (oe.value.label)
304
+ return a.value.some((t) => t.id === e.id);
262
305
  }
263
306
  return !1;
264
- }, ue = (e) => {
265
- D("open", e, n.id);
266
- }, ce = (e) => {
267
- D("close", e, n.id);
268
- }, pe = (e) => {
269
- V(() => {
270
- D("select", e);
307
+ }, je = (e) => {
308
+ O("open", e, n.id);
309
+ }, Te = (e) => {
310
+ O("close", e, n.id);
311
+ }, Fe = (e) => {
312
+ L(() => {
313
+ O("select", e);
271
314
  });
272
- }, fe = () => {
273
- V(() => {
315
+ }, Ne = () => {
316
+ L(() => {
274
317
  if (C.value) {
275
- const e = k.value.filter(
276
- (t) => E(t)
318
+ const e = z.value.filter(
319
+ (t) => U(t)
277
320
  ) || [];
278
- D("change", e);
321
+ O("change", e);
279
322
  } else {
280
- const e = k.value.find(
281
- (t) => E(t)
323
+ const e = z.value.find(
324
+ (t) => U(t)
282
325
  );
283
- D("change", [e]);
326
+ O("change", [e]);
284
327
  }
285
328
  });
286
- }, me = (e) => {
287
- w.value || typeof e == "object" && e?.$isDisabled || (i.value.select(e), O = !0);
288
- }, K = () => {
289
- i.value.activate();
290
- }, x = () => {
291
- i.value.deactivate();
329
+ }, qe = (e) => {
330
+ S.value || typeof e == "object" && e?.$isDisabled || (p.value.select(e), V = !0);
331
+ }, ne = () => {
332
+ p.value.activate();
333
+ }, A = () => {
334
+ p.value.deactivate();
335
+ }, Ke = () => {
336
+ p.value.toggle(), V = !0;
337
+ }, Ue = () => {
338
+ g.value ? A() : ne();
292
339
  }, ve = () => {
293
- i.value.toggle(), O = !0;
294
- }, ye = () => {
295
- h.value ? x() : K();
296
- }, z = () => {
297
- O = !0;
298
- }, G = (e) => {
299
- if (!w.value && e.key !== "Tab") {
300
- if (!h.value && (e.key === "Enter" || e.key === " ")) {
301
- e.preventDefault(), i.value?.toggle();
340
+ V = !0;
341
+ }, fe = (e) => {
342
+ if (!S.value && e.key !== "Tab") {
343
+ if (!g.value && (e.key === "Enter" || e.key === " ")) {
344
+ e.preventDefault(), p.value?.toggle();
302
345
  return;
303
346
  }
304
- if (!h.value && e.key === "ArrowDown") {
305
- e.preventDefault(), i.value?.toggle(), V(() => {
347
+ if (!g.value && e.key === "ArrowDown") {
348
+ e.preventDefault(), p.value?.toggle(), L(() => {
306
349
  try {
307
- i.value?.pointerForward?.();
350
+ p.value?.pointerForward?.();
308
351
  } catch {
309
352
  }
310
353
  });
311
354
  return;
312
355
  }
313
- if (h.value && e.key === "Escape") {
314
- e.preventDefault(), x();
356
+ if (g.value && e.key === "Escape") {
357
+ e.preventDefault(), A();
315
358
  return;
316
359
  }
317
- if (h.value && (e.key === "Enter" || e.key === " ")) {
360
+ if (g.value && (e.key === "Enter" || e.key === " ")) {
318
361
  e.preventDefault();
319
362
  try {
320
- i.value?.addPointerElement?.({ key: e.key });
363
+ p.value?.addPointerElement?.({ key: e.key });
321
364
  } catch {
322
365
  }
323
- W.value && x();
366
+ pe.value && A();
324
367
  }
325
368
  }
326
- }, be = () => {
327
- B.value && g.value && (ne(), K(), V(() => {
328
- g.value.focus();
369
+ }, Pe = () => {
370
+ M.value && k.value && (Ee(), ne(), L(() => {
371
+ k.value.focus();
329
372
  }));
330
- }, J = (e) => {
331
- if (O) {
332
- O = !1;
373
+ }, me = (e) => {
374
+ if (V) {
375
+ V = !1;
333
376
  return;
334
377
  }
335
- const t = e.target, o = t.closest(".multiselect__content-wrapper--teleported"), y = !i.value?.$el?.contains(t) && !o;
336
- if (M.value) {
337
- const $ = g.value && !g.value.$el.contains(t) && !t.closest(".rds-e-dropdown__before-list");
338
- y && $ && (M.value = !1, x());
339
- } else y && x();
378
+ const t = e.target, l = t.closest(".multiselect__content-wrapper--teleported"), r = !p.value?.$el?.contains(t) && !l;
379
+ if (Z.value) {
380
+ const d = k.value && !k.value.$el.contains(t) && !t.closest(".rds-e-dropdown__before-list");
381
+ r && d && (Z.value = !1, A());
382
+ } else r && A();
383
+ }, He = () => {
384
+ const e = `listbox-${n.id}`, t = `listbox-teleported-${n.id}`;
385
+ return document.getElementById(e) || document.getElementById(t);
386
+ }, j = (e) => {
387
+ const t = He();
388
+ t && (e ? t.setAttribute("aria-busy", "true") : t.removeAttribute("aria-busy"));
389
+ }, P = () => {
390
+ I.value && (I.value.disconnect(), I.value = null);
391
+ }, H = () => {
392
+ R = !1, ee.value = null;
393
+ }, We = () => {
394
+ R || n.loading || (R = !0, ee.value = T.value.length, O("loadMore", { page: K.value }), K.value += 1);
395
+ }, Ge = async () => {
396
+ if (D.value && !(q.value || !_.value)) {
397
+ P(), q.value = !0, j(!0);
398
+ try {
399
+ const e = te.value, t = await e(K.value), l = Array.isArray(t) ? t : [];
400
+ if (l.length === 0) {
401
+ _.value = !1;
402
+ return;
403
+ }
404
+ N.value = de(N.value, l), K.value += 1;
405
+ } catch (e) {
406
+ console.warn("[RDSDropdown]: lazy load callback failed.", e);
407
+ } finally {
408
+ q.value = !1, j(!1), E.value && g.value && _.value && L(() => {
409
+ ye();
410
+ });
411
+ }
412
+ }
413
+ }, Je = (e) => {
414
+ if (e[0]?.isIntersecting) {
415
+ if (D.value) {
416
+ Ge();
417
+ return;
418
+ }
419
+ We();
420
+ }
340
421
  };
341
- return xe(() => {
342
- i.value?.$el && f.value.push(i.value.$el), V(() => {
343
- if (B.value && g.value?.$el) {
344
- f.value.push(g.value.$el);
345
- const e = g.value.$el.closest(".rds-e-dropdown__before-list");
346
- e && !f.value.includes(e) && f.value.push(e);
422
+ function ye() {
423
+ if (P(), !E.value || !g.value || !_.value || typeof IntersectionObserver > "u") return;
424
+ const e = se.value;
425
+ if (!e) return;
426
+ const t = e.closest(".multiselect__content-wrapper");
427
+ I.value = new IntersectionObserver(Je, {
428
+ root: t instanceof HTMLElement ? t : null,
429
+ rootMargin: "0px 0px 96px 0px",
430
+ threshold: 0.01
431
+ }), I.value.observe(e);
432
+ }
433
+ return W(
434
+ () => [g.value, E.value, _.value],
435
+ async ([e, t]) => {
436
+ if (!e || !t) {
437
+ P(), H(), j(!1);
438
+ return;
439
+ }
440
+ await L(), ye();
441
+ }
442
+ ), W(
443
+ () => ie.value,
444
+ async (e) => {
445
+ await L(), j(e);
446
+ }
447
+ ), W(
448
+ () => n.loading,
449
+ (e, t) => {
450
+ D.value || !R || t && !e && H();
451
+ }
452
+ ), W(
453
+ () => T.value.length,
454
+ (e) => {
455
+ if (D.value || !R) return;
456
+ const t = ee.value;
457
+ t !== null && e !== t && H();
458
+ }
459
+ ), et(() => {
460
+ p.value?.$el && w.value.push(p.value.$el), L(() => {
461
+ if (M.value && k.value?.$el) {
462
+ w.value.push(k.value.$el);
463
+ const e = k.value.$el.closest(".rds-e-dropdown__before-list");
464
+ e && !w.value.includes(e) && w.value.push(e);
347
465
  }
348
- }), document.addEventListener("pointerdown", J);
349
- }), $e(() => {
350
- f.value = [], document.removeEventListener("pointerdown", J);
351
- }), _({
466
+ }), document.addEventListener("pointerdown", me);
467
+ }), tt(() => {
468
+ w.value = [], P(), H(), j(!1), document.removeEventListener("pointerdown", me);
469
+ }), Q({
352
470
  /**
353
471
  * Abre el dropdown
354
472
  */
355
- activate: K,
473
+ activate: ne,
356
474
  /**
357
475
  * Cierra el dropdown
358
476
  */
359
- deactivate: x
360
- }), (e, t) => (c(), b("div", {
361
- class: T(["rds-e-dropdown", {
362
- "rds-e-dropdown--text-only": a(j),
363
- "rds-e-dropdown--inverse": l.inverse
477
+ deactivate: A
478
+ }), (e, t) => (c(), m("div", {
479
+ class: G(["rds-e-dropdown", {
480
+ "rds-e-dropdown--text-only": i(Y),
481
+ "rds-e-dropdown--inverse": o.inverse
364
482
  }])
365
483
  }, [
366
- S(De, X({
484
+ B(ot, we({
367
485
  ref_key: "multiselect",
368
- ref: i,
369
- modelValue: s.value,
370
- "onUpdate:modelValue": t[12] || (t[12] = (o) => s.value = o),
371
- class: re.value,
372
- options: de.value,
373
- "close-on-select": W.value,
486
+ ref: p,
487
+ modelValue: a.value,
488
+ "onUpdate:modelValue": t[12] || (t[12] = (l) => a.value = l),
489
+ class: Re.value,
490
+ options: Me.value,
491
+ "close-on-select": pe.value,
374
492
  "show-labels": !1,
375
- disabled: a(w),
376
- multiple: a(C),
377
- "max-height": l.maxHeight,
493
+ disabled: i(S),
494
+ multiple: i(C),
495
+ "max-height": o.maxHeight,
378
496
  searchable: !1,
379
497
  "open-on-focus": !1,
380
- small: l.small,
381
- "open-direction": ie.value,
382
- limit: a(F),
383
- "limit-text": l.limitText
384
- }, { ...q.value, ...e.$attrs }, {
385
- "append-to-body": l.appendToBody,
386
- "text-only": a(j),
387
- onOpen: ue,
388
- onClose: ce,
389
- onSelect: pe,
390
- "onUpdate:modelValue": fe,
391
- onBlur: r(() => null, ["prevent"])
392
- }), Y({
393
- selection: d(({ isOpen: o }) => [
394
- a(j) ? (c(), b("div", {
498
+ small: o.small,
499
+ "open-direction": Ve.value,
500
+ limit: i(X),
501
+ "limit-text": o.limitText
502
+ }, { ...oe.value, ...e.$attrs }, {
503
+ "append-to-body": o.appendToBody,
504
+ "external-search": F.value,
505
+ "text-only": i(Y),
506
+ onOpen: je,
507
+ onClose: Te,
508
+ onSelect: Fe,
509
+ "onUpdate:modelValue": Ne,
510
+ onBlur: u(() => null, ["prevent"])
511
+ }), he({
512
+ selection: y(({ isOpen: l }) => [
513
+ i(Y) ? (c(), m("div", {
395
514
  key: 0,
396
- id: `multiselect-dropdown-${l.id}`,
397
- class: T([l.customTriggerClass, "rds-e-dropdown__text-only"]),
515
+ id: `multiselect-dropdown-${o.id}`,
516
+ class: G([o.customTriggerClass, "rds-e-dropdown__text-only"]),
398
517
  role: "combobox",
399
518
  "aria-haspopup": "listbox",
400
- "aria-expanded": h.value ? "true" : "false",
401
- "aria-controls": `listbox-${l.id}`,
519
+ "aria-expanded": g.value ? "true" : "false",
520
+ "aria-controls": `listbox-${o.id}`,
402
521
  tabindex: "0",
403
- onClick: r(ye, ["prevent", "stop"]),
404
- onMousedown: r(z, ["prevent", "stop"]),
405
- onKeydown: G
522
+ onClick: u(Ue, ["prevent", "stop"]),
523
+ onMousedown: u(ve, ["prevent", "stop"]),
524
+ onKeydown: fe
406
525
  }, [
407
- m("span", null, R(I.value || l.label), 1),
408
- S(a(te), {
526
+ v("span", null, J(le.value || o.label), 1),
527
+ B(i(Se), {
409
528
  name: "arrow_down",
410
529
  "aria-hidden": "true",
411
- class: T(["rds-e-dropdown__input-caret", {
412
- "rds-e-dropdown__input-caret--open": o
530
+ class: G(["rds-e-dropdown__input-caret", {
531
+ "rds-e-dropdown__input-caret--open": l
413
532
  }])
414
533
  }, null, 8, ["class"])
415
- ], 42, Ve)) : (c(), b("div", {
534
+ ], 42, it)) : (c(), m("div", {
416
535
  key: 1,
417
536
  class: "rds-e-dropdown__input-wrapper",
418
537
  role: "button",
419
538
  "aria-haspopup": "listbox",
420
- "aria-expanded": h.value ? "true" : "false",
421
- "aria-controls": `listbox-${l.id}`,
422
- onClick: r(ve, ["prevent"]),
423
- onMousedown: r(z, ["prevent"]),
424
- onKeydown: G
539
+ "aria-expanded": g.value ? "true" : "false",
540
+ "aria-controls": `listbox-${o.id}`,
541
+ onClick: u(Ke, ["prevent"]),
542
+ onMousedown: u(ve, ["prevent"]),
543
+ onKeydown: fe
425
544
  }, [
426
- S(a(oe), {
427
- id: `multiselect-dropdown-${l.id}`,
428
- modelValue: I.value,
429
- "onUpdate:modelValue": t[0] || (t[0] = (y) => I.value = y),
545
+ B(i($e), {
546
+ id: `multiselect-dropdown-${o.id}`,
547
+ modelValue: le.value,
548
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => le.value = r),
430
549
  class: "rds-e-dropdown__input",
431
- label: l.label,
550
+ label: o.label,
432
551
  "input-tabindex": -1,
433
- disabled: a(w),
434
- error: l.error,
435
- helper: l.helper,
436
- "helper-text": l.helperText,
437
- loading: l.loading,
438
- compact: l.compact,
552
+ disabled: i(S),
553
+ error: o.error,
554
+ helper: o.helper,
555
+ "helper-text": o.helperText,
556
+ loading: o.loading,
557
+ compact: o.compact,
439
558
  readonly: ""
440
- }, Y({
441
- "right-icon": d(() => [
442
- S(a(te), {
559
+ }, he({
560
+ "right-icon": y(() => [
561
+ B(i(Se), {
443
562
  name: "arrow_down",
444
563
  "aria-hidden": "true",
445
- class: T(["rds-e-dropdown__input-caret", {
446
- "rds-e-dropdown__input-caret--open": o
564
+ class: G(["rds-e-dropdown__input-caret", {
565
+ "rds-e-dropdown__input-caret--open": l
447
566
  }])
448
567
  }, null, 8, ["class"])
449
568
  ]),
450
569
  _: 2
451
570
  }, [
452
- p("helper-text") ? {
571
+ b("helper-text") ? {
453
572
  name: "helper-text",
454
- fn: d(() => [
455
- v(e.$slots, "helper-text", {}, void 0, !0)
573
+ fn: y(() => [
574
+ h(e.$slots, "helper-text", {}, void 0, !0)
456
575
  ]),
457
576
  key: "0"
458
577
  } : void 0
459
578
  ]), 1032, ["id", "modelValue", "label", "disabled", "error", "helper", "helper-text", "loading", "compact"])
460
- ], 40, Ae))
579
+ ], 40, ut))
461
580
  ]),
462
- option: d(({ option: o, search: y, index: $ }) => [
463
- m("div", Ee, [
464
- m("div", Te, [
465
- m("div", {
581
+ option: y(({ option: l, search: r, index: d }) => [
582
+ v("div", dt, [
583
+ v("div", ct, [
584
+ v("div", {
466
585
  class: "rds-e-dropdown__option--prepend",
467
- onClick: r((Q) => me(o), ["prevent", "stop"])
586
+ onClick: u(($) => qe(l), ["prevent", "stop"])
468
587
  }, [
469
- a(C) ? (c(), Z(a(Ce), {
588
+ i(C) ? (c(), ke(i(nt), {
470
589
  key: 0,
471
- id: `${$}-${o.id}`,
472
- small: l.small,
473
- "model-value": E(o),
474
- disabled: a(w) || o?.$isDisabled || !1
475
- }, null, 8, ["id", "small", "model-value", "disabled"])) : !a(C) && l.showRadio ? (c(), Z(a(Oe), {
590
+ id: `${d}-${l.id}`,
591
+ small: o.small,
592
+ "model-value": U(l),
593
+ disabled: i(S) || l?.$isDisabled || !1
594
+ }, null, 8, ["id", "small", "model-value", "disabled"])) : !i(C) && o.showRadio ? (c(), ke(i(at), {
476
595
  key: 1,
477
- modelValue: H.value,
478
- "onUpdate:modelValue": t[1] || (t[1] = (Q) => H.value = Q),
479
- "group-name": `group-${l.id}`
596
+ modelValue: ce.value,
597
+ "onUpdate:modelValue": t[1] || (t[1] = ($) => ce.value = $),
598
+ "group-name": `group-${o.id}`
480
599
  }, {
481
- default: d(() => [
482
- S(a(Be), {
483
- id: `${$}-${typeof o == "object" ? o.id : $}`,
484
- small: l.small,
485
- option: typeof o == "object" ? o.id : o,
486
- checked: E(o),
487
- disabled: a(w) || o?.$isDisabled || !1
600
+ default: y(() => [
601
+ B(i(rt), {
602
+ id: `${d}-${typeof l == "object" ? l.id : d}`,
603
+ small: o.small,
604
+ option: typeof l == "object" ? l.id : l,
605
+ checked: U(l),
606
+ disabled: i(S) || l?.$isDisabled || !1
488
607
  }, null, 8, ["id", "small", "option", "checked", "disabled"])
489
608
  ]),
490
609
  _: 2
491
- }, 1032, ["modelValue", "group-name"])) : A("", !0)
492
- ], 8, Re),
493
- m("div", _e, [
494
- v(e.$slots, "singleLabel", { option: o }, () => [
495
- q.value?.label ? (c(), b(Se, { key: 0 }, [
496
- m("span", null, R(o.label), 1),
497
- o?.detail ? (c(), b("span", Fe, R(o.detail), 1)) : A("", !0)
498
- ], 64)) : (c(), b("span", je, R(o), 1))
610
+ }, 1032, ["modelValue", "group-name"])) : x("", !0)
611
+ ], 8, pt),
612
+ v("div", vt, [
613
+ h(e.$slots, "singleLabel", { option: l }, () => [
614
+ oe.value?.label ? (c(), m(Le, { key: 0 }, [
615
+ v("span", null, J(l.label), 1),
616
+ l?.detail ? (c(), m("span", ft, J(l.detail), 1)) : x("", !0)
617
+ ], 64)) : (c(), m("span", mt, J(l), 1))
499
618
  ], !0)
500
619
  ])
501
620
  ]),
502
- p("optionAppend") ? (c(), b("div", Ne, [
503
- v(e.$slots, "optionAppend", {
504
- option: o,
505
- search: y,
506
- index: $
621
+ b("optionAppend") ? (c(), m("div", yt, [
622
+ h(e.$slots, "optionAppend", {
623
+ option: l,
624
+ search: r,
625
+ index: d
507
626
  }, void 0, !0)
508
- ])) : A("", !0)
627
+ ])) : x("", !0)
509
628
  ])
510
629
  ]),
511
630
  _: 2
512
631
  }, [
513
- B.value || p("beforeList") ? {
514
- name: Pe,
515
- fn: d(() => [
516
- B.value ? (c(), b("div", {
632
+ M.value || b("beforeList") ? {
633
+ name: Lt,
634
+ fn: y(() => [
635
+ M.value ? (c(), m("div", {
517
636
  key: 0,
518
637
  class: "rds-e-dropdown__before-list",
519
- onMousedown: t[5] || (t[5] = r(() => {
638
+ onMousedown: t[5] || (t[5] = u(() => {
520
639
  }, ["stop"])),
521
- onClick: r(be, ["stop"]),
522
- onBlur: t[6] || (t[6] = r(() => {
640
+ onClick: u(Pe, ["stop"]),
641
+ onBlur: t[6] || (t[6] = u(() => {
523
642
  }, ["stop"])),
524
- onFocus: t[7] || (t[7] = r(() => {
643
+ onFocus: t[7] || (t[7] = u(() => {
525
644
  }, ["stop"])),
526
- onKeydown: t[8] || (t[8] = r(() => {
645
+ onKeydown: t[8] || (t[8] = u(() => {
527
646
  }, ["stop"])),
528
- onKeyup: t[9] || (t[9] = r(() => {
647
+ onKeyup: t[9] || (t[9] = u(() => {
529
648
  }, ["stop"])),
530
- onKeypress: t[10] || (t[10] = r(() => {
649
+ onKeypress: t[10] || (t[10] = u(() => {
531
650
  }, ["stop"])),
532
- onChange: t[11] || (t[11] = r(() => {
651
+ onChange: t[11] || (t[11] = u(() => {
533
652
  }, ["stop"]))
534
653
  }, [
535
- m("div", Me, [
536
- S(a(oe), X({
654
+ v("div", bt, [
655
+ B(i($e), we({
537
656
  ref_key: "textFieldInput",
538
- ref: g,
539
- modelValue: N.value,
540
- "onUpdate:modelValue": t[2] || (t[2] = (o) => N.value = o)
541
- }, se.value, {
657
+ ref: k,
658
+ modelValue: F.value,
659
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => F.value = l)
660
+ }, Ce.value, {
542
661
  "full-width": "",
543
- onMousedown: t[3] || (t[3] = r(() => {
662
+ onMousedown: t[3] || (t[3] = u(() => {
544
663
  }, ["stop", "prevent"])),
545
- onFocus: t[4] || (t[4] = r(() => {
664
+ onFocus: t[4] || (t[4] = u(() => {
546
665
  }, ["stop"]))
547
666
  }), null, 16, ["modelValue"])
548
667
  ])
549
- ], 32)) : A("", !0),
550
- p("beforeList") ? (c(), b("div", Ie, [
551
- m("div", qe, [
552
- v(e.$slots, "beforeList", {}, void 0, !0)
668
+ ], 32)) : x("", !0),
669
+ b("beforeList") ? (c(), m("div", gt, [
670
+ v("div", wt, [
671
+ h(e.$slots, "beforeList", {}, void 0, !0)
553
672
  ])
554
- ])) : A("", !0)
673
+ ])) : x("", !0)
555
674
  ]),
556
675
  key: "0"
557
676
  } : void 0,
558
- p("afterList") ? {
559
- name: He,
560
- fn: d(() => [
561
- m("div", Ke, [
562
- m("div", Ue, [
563
- v(e.$slots, "afterList", {}, void 0, !0)
677
+ De.value ? {
678
+ name: xt,
679
+ fn: y(() => [
680
+ b("afterList") ? (c(), m("div", ht, [
681
+ v("div", kt, [
682
+ h(e.$slots, "afterList", {}, void 0, !0)
564
683
  ])
565
- ])
684
+ ])) : x("", !0),
685
+ ze.value ? (c(), m("li", {
686
+ key: 1,
687
+ ref_key: "lazyLoadSentinelRef",
688
+ ref: se,
689
+ class: "rds-e-dropdown__lazy-sentinel",
690
+ "aria-hidden": "true",
691
+ role: "presentation"
692
+ }, null, 512)) : x("", !0),
693
+ Ae.value ? (c(), m(Le, { key: 2 }, lt(_e, (l) => v("li", {
694
+ key: `skeleton-${l}`,
695
+ class: "rds-e-dropdown__skeleton-element",
696
+ "aria-hidden": "true",
697
+ role: "presentation"
698
+ }, [...t[13] || (t[13] = [
699
+ v("span", {
700
+ class: "multiselect__option rds-e-dropdown__skeleton-item",
701
+ "aria-hidden": "true",
702
+ role: "presentation"
703
+ }, [
704
+ v("span", { class: "rds-e-dropdown__skeleton-line rds-e-dropdown__skeleton-line--primary" }),
705
+ v("span", { class: "rds-e-dropdown__skeleton-line rds-e-dropdown__skeleton-line--secondary" })
706
+ ], -1)
707
+ ])])), 64)) : x("", !0)
566
708
  ]),
567
709
  key: "1"
568
710
  } : void 0,
569
- p("noOptions") ? {
570
- name: ze,
571
- fn: d(() => [
572
- v(e.$slots, "noOptions", {}, void 0, !0)
711
+ b("noOptions") ? {
712
+ name: $t,
713
+ fn: y(() => [
714
+ h(e.$slots, "noOptions", {}, void 0, !0)
573
715
  ]),
574
716
  key: "2"
575
717
  } : void 0,
576
- p("noResult") ? {
577
- name: Ge,
578
- fn: d(({ search: o }) => [
579
- v(e.$slots, "noResult", { search: o }, void 0, !0)
718
+ b("noResult") ? {
719
+ name: Ot,
720
+ fn: y(({ search: l }) => [
721
+ h(e.$slots, "noResult", { search: l }, void 0, !0)
580
722
  ]),
581
723
  key: "3"
582
724
  } : void 0,
583
- p("limit") ? {
584
- name: Je,
585
- fn: d(() => [
586
- v(e.$slots, "limit", {}, void 0, !0)
725
+ b("limit") ? {
726
+ name: _t,
727
+ fn: y(() => [
728
+ h(e.$slots, "limit", {}, void 0, !0)
587
729
  ]),
588
730
  key: "4"
589
731
  } : void 0,
590
- p("maxElements") ? {
591
- name: Qe,
592
- fn: d(() => [
593
- v(e.$slots, "maxElements", {}, void 0, !0)
732
+ b("maxElements") ? {
733
+ name: Et,
734
+ fn: y(() => [
735
+ h(e.$slots, "maxElements", {}, void 0, !0)
594
736
  ]),
595
737
  key: "5"
596
738
  } : void 0,
597
- p("singleLabel") ? {
598
- name: We,
599
- fn: d(({ option: o }) => [
600
- v(e.$slots, "singleLabel", { option: o }, void 0, !0)
739
+ b("singleLabel") ? {
740
+ name: St,
741
+ fn: y(({ option: l }) => [
742
+ h(e.$slots, "singleLabel", { option: l }, void 0, !0)
601
743
  ]),
602
744
  key: "6"
603
745
  } : void 0
604
- ]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "open-direction", "limit", "limit-text", "append-to-body", "text-only"])
746
+ ]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "open-direction", "limit", "limit-text", "append-to-body", "external-search", "text-only"])
605
747
  ], 2));
606
748
  }
607
- }), at = /* @__PURE__ */ Le(Xe, [["__scopeId", "data-v-82a10aa1"]]);
749
+ }), jt = /* @__PURE__ */ st(Dt, [["__scopeId", "data-v-32cd5611"]]);
608
750
  export {
609
- at as default
751
+ jt as default
610
752
  };