energy-components 2.6.0 → 2.7.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.
@@ -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 v, computed as s, provide as ae, watch as H, nextTick as L, onMounted as et, onBeforeUnmount as tt, openBlock as c, createElementBlock as m, normalizeClass as W, unref as i, createVNode as B, mergeProps as we, withModifiers as u, createSlots as he, withCtx as y, createElementVNode as f, createBlock as ke, createCommentVNode as x, renderSlot as h, Fragment as Le, toDisplayString as G, 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-CW3eQRcp.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"], ft = { class: "rds-e-dropdown__option--content" }, vt = {
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, J) => o && J.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: J, emit: Oe }) {
217
+ const n = o, O = Oe, re = Xe(), b = (e) => !!(re && re[e]), {
218
+ disabled: S,
219
+ limit: Q,
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: X
223
+ } = Ye(n), a = Ze(o, "modelValue"), w = v([]), p = v(), k = v(), Y = v(""), Z = v(!1), se = v(null), I = v(null), F = v([]), _ = v(!0), N = v(!1), q = v(1), _e = [1, 2, 3], ee = v(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 ? N.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 || F.value.length === 0 ? T.value : de(T.value, F.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,484 @@ 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 > Q.value ? n.limitText(Q.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, Y.value)) : z.value), K = (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) => K(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) => K(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();
292
- }, 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();
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();
339
+ }, fe = () => {
340
+ V = !0;
341
+ }, ve = (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
+ }, U = () => {
390
+ I.value && (I.value.disconnect(), I.value = null);
391
+ }, P = () => {
392
+ R = !1, ee.value = null;
393
+ }, We = () => {
394
+ R || n.loading || (R = !0, ee.value = T.value.length, O("loadMore", { page: q.value }), q.value += 1);
395
+ }, Ge = async () => {
396
+ if (D.value && !(N.value || !_.value)) {
397
+ U(), N.value = !0, j(!0);
398
+ try {
399
+ const e = te.value, t = await e(q.value), l = Array.isArray(t) ? t : [];
400
+ if (l.length === 0) {
401
+ _.value = !1;
402
+ return;
403
+ }
404
+ F.value = de(F.value, l), q.value += 1;
405
+ } catch (e) {
406
+ console.warn("[RDSDropdown]: lazy load callback failed.", e);
407
+ } finally {
408
+ N.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 (U(), !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 H(
434
+ () => [g.value, E.value, _.value],
435
+ async ([e, t]) => {
436
+ if (!e || !t) {
437
+ U(), P(), j(!1);
438
+ return;
347
439
  }
348
- }), document.addEventListener("pointerdown", J);
349
- }), $e(() => {
350
- f.value = [], document.removeEventListener("pointerdown", J);
351
- }), _({
440
+ await L(), ye();
441
+ }
442
+ ), H(
443
+ () => ie.value,
444
+ async (e) => {
445
+ await L(), j(e);
446
+ }
447
+ ), H(
448
+ () => n.loading,
449
+ (e, t) => {
450
+ D.value || !R || t && !e && P();
451
+ }
452
+ ), H(
453
+ () => T.value.length,
454
+ (e) => {
455
+ if (D.value || !R) return;
456
+ const t = ee.value;
457
+ t !== null && e !== t && P();
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);
465
+ }
466
+ }), document.addEventListener("pointerdown", me);
467
+ }), tt(() => {
468
+ w.value = [], U(), P(), j(!1), document.removeEventListener("pointerdown", me);
469
+ }), J({
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: W(["rds-e-dropdown", {
480
+ "rds-e-dropdown--text-only": i(X),
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(Q),
501
+ "limit-text": o.limitText
502
+ }, { ...oe.value, ...e.$attrs }, {
503
+ "append-to-body": o.appendToBody,
504
+ "text-only": i(X),
505
+ onOpen: je,
506
+ onClose: Te,
507
+ onSelect: Fe,
508
+ "onUpdate:modelValue": Ne,
509
+ onBlur: u(() => null, ["prevent"])
510
+ }), he({
511
+ selection: y(({ isOpen: l }) => [
512
+ i(X) ? (c(), m("div", {
395
513
  key: 0,
396
- id: `multiselect-dropdown-${l.id}`,
397
- class: T([l.customTriggerClass, "rds-e-dropdown__text-only"]),
514
+ id: `multiselect-dropdown-${o.id}`,
515
+ class: W([o.customTriggerClass, "rds-e-dropdown__text-only"]),
398
516
  role: "combobox",
399
517
  "aria-haspopup": "listbox",
400
- "aria-expanded": h.value ? "true" : "false",
401
- "aria-controls": `listbox-${l.id}`,
518
+ "aria-expanded": g.value ? "true" : "false",
519
+ "aria-controls": `listbox-${o.id}`,
402
520
  tabindex: "0",
403
- onClick: r(ye, ["prevent", "stop"]),
404
- onMousedown: r(z, ["prevent", "stop"]),
405
- onKeydown: G
521
+ onClick: u(Ue, ["prevent", "stop"]),
522
+ onMousedown: u(fe, ["prevent", "stop"]),
523
+ onKeydown: ve
406
524
  }, [
407
- m("span", null, R(I.value || l.label), 1),
408
- S(a(te), {
525
+ f("span", null, G(le.value || o.label), 1),
526
+ B(i(Se), {
409
527
  name: "arrow_down",
410
528
  "aria-hidden": "true",
411
- class: T(["rds-e-dropdown__input-caret", {
412
- "rds-e-dropdown__input-caret--open": o
529
+ class: W(["rds-e-dropdown__input-caret", {
530
+ "rds-e-dropdown__input-caret--open": l
413
531
  }])
414
532
  }, null, 8, ["class"])
415
- ], 42, Ve)) : (c(), b("div", {
533
+ ], 42, it)) : (c(), m("div", {
416
534
  key: 1,
417
535
  class: "rds-e-dropdown__input-wrapper",
418
536
  role: "button",
419
537
  "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
538
+ "aria-expanded": g.value ? "true" : "false",
539
+ "aria-controls": `listbox-${o.id}`,
540
+ onClick: u(Ke, ["prevent"]),
541
+ onMousedown: u(fe, ["prevent"]),
542
+ onKeydown: ve
425
543
  }, [
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),
544
+ B(i($e), {
545
+ id: `multiselect-dropdown-${o.id}`,
546
+ modelValue: le.value,
547
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => le.value = r),
430
548
  class: "rds-e-dropdown__input",
431
- label: l.label,
549
+ label: o.label,
432
550
  "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,
551
+ disabled: i(S),
552
+ error: o.error,
553
+ helper: o.helper,
554
+ "helper-text": o.helperText,
555
+ loading: o.loading,
556
+ compact: o.compact,
439
557
  readonly: ""
440
- }, Y({
441
- "right-icon": d(() => [
442
- S(a(te), {
558
+ }, he({
559
+ "right-icon": y(() => [
560
+ B(i(Se), {
443
561
  name: "arrow_down",
444
562
  "aria-hidden": "true",
445
- class: T(["rds-e-dropdown__input-caret", {
446
- "rds-e-dropdown__input-caret--open": o
563
+ class: W(["rds-e-dropdown__input-caret", {
564
+ "rds-e-dropdown__input-caret--open": l
447
565
  }])
448
566
  }, null, 8, ["class"])
449
567
  ]),
450
568
  _: 2
451
569
  }, [
452
- p("helper-text") ? {
570
+ b("helper-text") ? {
453
571
  name: "helper-text",
454
- fn: d(() => [
455
- v(e.$slots, "helper-text", {}, void 0, !0)
572
+ fn: y(() => [
573
+ h(e.$slots, "helper-text", {}, void 0, !0)
456
574
  ]),
457
575
  key: "0"
458
576
  } : void 0
459
577
  ]), 1032, ["id", "modelValue", "label", "disabled", "error", "helper", "helper-text", "loading", "compact"])
460
- ], 40, Ae))
578
+ ], 40, ut))
461
579
  ]),
462
- option: d(({ option: o, search: y, index: $ }) => [
463
- m("div", Ee, [
464
- m("div", Te, [
465
- m("div", {
580
+ option: y(({ option: l, search: r, index: d }) => [
581
+ f("div", dt, [
582
+ f("div", ct, [
583
+ f("div", {
466
584
  class: "rds-e-dropdown__option--prepend",
467
- onClick: r((Q) => me(o), ["prevent", "stop"])
585
+ onClick: u(($) => qe(l), ["prevent", "stop"])
468
586
  }, [
469
- a(C) ? (c(), Z(a(Ce), {
587
+ i(C) ? (c(), ke(i(nt), {
470
588
  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), {
589
+ id: `${d}-${l.id}`,
590
+ small: o.small,
591
+ "model-value": K(l),
592
+ disabled: i(S) || l?.$isDisabled || !1
593
+ }, null, 8, ["id", "small", "model-value", "disabled"])) : !i(C) && o.showRadio ? (c(), ke(i(at), {
476
594
  key: 1,
477
- modelValue: H.value,
478
- "onUpdate:modelValue": t[1] || (t[1] = (Q) => H.value = Q),
479
- "group-name": `group-${l.id}`
595
+ modelValue: ce.value,
596
+ "onUpdate:modelValue": t[1] || (t[1] = ($) => ce.value = $),
597
+ "group-name": `group-${o.id}`
480
598
  }, {
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
599
+ default: y(() => [
600
+ B(i(rt), {
601
+ id: `${d}-${typeof l == "object" ? l.id : d}`,
602
+ small: o.small,
603
+ option: typeof l == "object" ? l.id : l,
604
+ checked: K(l),
605
+ disabled: i(S) || l?.$isDisabled || !1
488
606
  }, null, 8, ["id", "small", "option", "checked", "disabled"])
489
607
  ]),
490
608
  _: 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))
609
+ }, 1032, ["modelValue", "group-name"])) : x("", !0)
610
+ ], 8, pt),
611
+ f("div", ft, [
612
+ h(e.$slots, "singleLabel", { option: l }, () => [
613
+ oe.value?.label ? (c(), m(Le, { key: 0 }, [
614
+ f("span", null, G(l.label), 1),
615
+ l?.detail ? (c(), m("span", vt, G(l.detail), 1)) : x("", !0)
616
+ ], 64)) : (c(), m("span", mt, G(l), 1))
499
617
  ], !0)
500
618
  ])
501
619
  ]),
502
- p("optionAppend") ? (c(), b("div", Ne, [
503
- v(e.$slots, "optionAppend", {
504
- option: o,
505
- search: y,
506
- index: $
620
+ b("optionAppend") ? (c(), m("div", yt, [
621
+ h(e.$slots, "optionAppend", {
622
+ option: l,
623
+ search: r,
624
+ index: d
507
625
  }, void 0, !0)
508
- ])) : A("", !0)
626
+ ])) : x("", !0)
509
627
  ])
510
628
  ]),
511
629
  _: 2
512
630
  }, [
513
- B.value || p("beforeList") ? {
514
- name: Pe,
515
- fn: d(() => [
516
- B.value ? (c(), b("div", {
631
+ M.value || b("beforeList") ? {
632
+ name: Lt,
633
+ fn: y(() => [
634
+ M.value ? (c(), m("div", {
517
635
  key: 0,
518
636
  class: "rds-e-dropdown__before-list",
519
- onMousedown: t[5] || (t[5] = r(() => {
637
+ onMousedown: t[5] || (t[5] = u(() => {
520
638
  }, ["stop"])),
521
- onClick: r(be, ["stop"]),
522
- onBlur: t[6] || (t[6] = r(() => {
639
+ onClick: u(Pe, ["stop"]),
640
+ onBlur: t[6] || (t[6] = u(() => {
523
641
  }, ["stop"])),
524
- onFocus: t[7] || (t[7] = r(() => {
642
+ onFocus: t[7] || (t[7] = u(() => {
525
643
  }, ["stop"])),
526
- onKeydown: t[8] || (t[8] = r(() => {
644
+ onKeydown: t[8] || (t[8] = u(() => {
527
645
  }, ["stop"])),
528
- onKeyup: t[9] || (t[9] = r(() => {
646
+ onKeyup: t[9] || (t[9] = u(() => {
529
647
  }, ["stop"])),
530
- onKeypress: t[10] || (t[10] = r(() => {
648
+ onKeypress: t[10] || (t[10] = u(() => {
531
649
  }, ["stop"])),
532
- onChange: t[11] || (t[11] = r(() => {
650
+ onChange: t[11] || (t[11] = u(() => {
533
651
  }, ["stop"]))
534
652
  }, [
535
- m("div", Me, [
536
- S(a(oe), X({
653
+ f("div", bt, [
654
+ B(i($e), we({
537
655
  ref_key: "textFieldInput",
538
- ref: g,
539
- modelValue: N.value,
540
- "onUpdate:modelValue": t[2] || (t[2] = (o) => N.value = o)
541
- }, se.value, {
656
+ ref: k,
657
+ modelValue: Y.value,
658
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => Y.value = l)
659
+ }, Ce.value, {
542
660
  "full-width": "",
543
- onMousedown: t[3] || (t[3] = r(() => {
661
+ onMousedown: t[3] || (t[3] = u(() => {
544
662
  }, ["stop", "prevent"])),
545
- onFocus: t[4] || (t[4] = r(() => {
663
+ onFocus: t[4] || (t[4] = u(() => {
546
664
  }, ["stop"]))
547
665
  }), null, 16, ["modelValue"])
548
666
  ])
549
- ], 32)) : A("", !0),
550
- p("beforeList") ? (c(), b("div", Ie, [
551
- m("div", qe, [
552
- v(e.$slots, "beforeList", {}, void 0, !0)
667
+ ], 32)) : x("", !0),
668
+ b("beforeList") ? (c(), m("div", gt, [
669
+ f("div", wt, [
670
+ h(e.$slots, "beforeList", {}, void 0, !0)
553
671
  ])
554
- ])) : A("", !0)
672
+ ])) : x("", !0)
555
673
  ]),
556
674
  key: "0"
557
675
  } : 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)
676
+ De.value ? {
677
+ name: xt,
678
+ fn: y(() => [
679
+ b("afterList") ? (c(), m("div", ht, [
680
+ f("div", kt, [
681
+ h(e.$slots, "afterList", {}, void 0, !0)
564
682
  ])
565
- ])
683
+ ])) : x("", !0),
684
+ ze.value ? (c(), m("li", {
685
+ key: 1,
686
+ ref_key: "lazyLoadSentinelRef",
687
+ ref: se,
688
+ class: "rds-e-dropdown__lazy-sentinel",
689
+ "aria-hidden": "true",
690
+ role: "presentation"
691
+ }, null, 512)) : x("", !0),
692
+ Ae.value ? (c(), m(Le, { key: 2 }, lt(_e, (l) => f("li", {
693
+ key: `skeleton-${l}`,
694
+ class: "rds-e-dropdown__skeleton-element",
695
+ "aria-hidden": "true",
696
+ role: "presentation"
697
+ }, [...t[13] || (t[13] = [
698
+ f("span", {
699
+ class: "multiselect__option rds-e-dropdown__skeleton-item",
700
+ "aria-hidden": "true",
701
+ role: "presentation"
702
+ }, [
703
+ f("span", { class: "rds-e-dropdown__skeleton-line rds-e-dropdown__skeleton-line--primary" }),
704
+ f("span", { class: "rds-e-dropdown__skeleton-line rds-e-dropdown__skeleton-line--secondary" })
705
+ ], -1)
706
+ ])])), 64)) : x("", !0)
566
707
  ]),
567
708
  key: "1"
568
709
  } : void 0,
569
- p("noOptions") ? {
570
- name: ze,
571
- fn: d(() => [
572
- v(e.$slots, "noOptions", {}, void 0, !0)
710
+ b("noOptions") ? {
711
+ name: $t,
712
+ fn: y(() => [
713
+ h(e.$slots, "noOptions", {}, void 0, !0)
573
714
  ]),
574
715
  key: "2"
575
716
  } : void 0,
576
- p("noResult") ? {
577
- name: Ge,
578
- fn: d(({ search: o }) => [
579
- v(e.$slots, "noResult", { search: o }, void 0, !0)
717
+ b("noResult") ? {
718
+ name: Ot,
719
+ fn: y(({ search: l }) => [
720
+ h(e.$slots, "noResult", { search: l }, void 0, !0)
580
721
  ]),
581
722
  key: "3"
582
723
  } : void 0,
583
- p("limit") ? {
584
- name: Je,
585
- fn: d(() => [
586
- v(e.$slots, "limit", {}, void 0, !0)
724
+ b("limit") ? {
725
+ name: _t,
726
+ fn: y(() => [
727
+ h(e.$slots, "limit", {}, void 0, !0)
587
728
  ]),
588
729
  key: "4"
589
730
  } : void 0,
590
- p("maxElements") ? {
591
- name: Qe,
592
- fn: d(() => [
593
- v(e.$slots, "maxElements", {}, void 0, !0)
731
+ b("maxElements") ? {
732
+ name: Et,
733
+ fn: y(() => [
734
+ h(e.$slots, "maxElements", {}, void 0, !0)
594
735
  ]),
595
736
  key: "5"
596
737
  } : void 0,
597
- p("singleLabel") ? {
598
- name: We,
599
- fn: d(({ option: o }) => [
600
- v(e.$slots, "singleLabel", { option: o }, void 0, !0)
738
+ b("singleLabel") ? {
739
+ name: St,
740
+ fn: y(({ option: l }) => [
741
+ h(e.$slots, "singleLabel", { option: l }, void 0, !0)
601
742
  ]),
602
743
  key: "6"
603
744
  } : void 0
604
745
  ]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "open-direction", "limit", "limit-text", "append-to-body", "text-only"])
605
746
  ], 2));
606
747
  }
607
- }), at = /* @__PURE__ */ Le(Xe, [["__scopeId", "data-v-82a10aa1"]]);
748
+ }), jt = /* @__PURE__ */ st(Dt, [["__scopeId", "data-v-59f0ef6b"]]);
608
749
  export {
609
- at as default
750
+ jt as default
610
751
  };