energy-components 2.5.1 → 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.
- package/dist/components/dragAndDrop.es.js +93 -75
- package/dist/components/dropdown.es.js +414 -272
- package/dist/components/radioButton.es.js +51 -37
- package/dist/components/sidebar.es.js +18 -19
- package/dist/components/sidedrawer.es.js +49 -39
- package/dist/components/style/dragAndDrop.css +1 -1
- package/dist/components/style/dropdown.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/radioButton.css +1 -1
- package/dist/components/style/sidebar.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/table.css +1 -1
- package/dist/components/style/tableRenderer.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/table.es.js +59 -55
- package/dist/components/tableRenderer.es.js +131 -126
- package/dist/components/textField.es.js +84 -60
- package/dist/energy-components.css +1 -1
- package/dist/energy-components.es.js +5151 -4936
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/content/table/table-renderer.vue.d.ts +2 -0
- package/dist/types/src/components/content/table/table.vue.d.ts +9 -0
- package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +15 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +25 -0
- package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +15 -0
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +49 -2
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +15 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/llms/rdsdrag-and-drop.md +1 -0
- package/llms/rdsdropdown.md +2 -0
- package/llms/rdsradio-button.md +1 -0
- package/llms/rdssidedrawer.md +1 -0
- package/llms/rdstable.md +2 -0
- package/llms/rdstext-field.md +3 -1
- package/package.json +1 -1
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
import
|
|
6
|
-
import { R as
|
|
7
|
-
import
|
|
8
|
-
import { _ as
|
|
9
|
-
import './style/dropdown.css';const
|
|
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
|
-
},
|
|
12
|
+
}, mt = { key: 1 }, yt = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "rds-e-dropdown__option--append"
|
|
15
|
-
},
|
|
15
|
+
}, bt = { class: "rds-e-dropdown__before-list-container" }, gt = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "rds-e-dropdown__before-list"
|
|
18
|
-
},
|
|
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__ */
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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(
|
|
151
|
-
return ["auto", "above", "below"].includes(
|
|
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__ */
|
|
205
|
-
setup(
|
|
206
|
-
const n =
|
|
207
|
-
disabled:
|
|
208
|
-
limit:
|
|
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:
|
|
211
|
-
textOnly:
|
|
212
|
-
} =
|
|
213
|
-
let
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
},
|
|
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,385 +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
|
-
|
|
229
|
-
e && !
|
|
230
|
-
}),
|
|
231
|
-
const t =
|
|
232
|
-
t > -1 &&
|
|
233
|
-
}),
|
|
234
|
-
const t =
|
|
235
|
-
return t ||
|
|
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
|
|
238
|
-
get: () =>
|
|
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 =
|
|
241
|
-
|
|
283
|
+
const t = z.value.find((l) => typeof l == "object" ? l.id === e : l === e);
|
|
284
|
+
a.value = t || null;
|
|
242
285
|
}
|
|
243
|
-
}),
|
|
244
|
-
get: () =>
|
|
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
|
-
}),
|
|
289
|
+
}), Re = s(() => ({
|
|
247
290
|
"rds-e-dropdown-input": !0,
|
|
248
|
-
"rds-e-dropdown--disabled":
|
|
291
|
+
"rds-e-dropdown--disabled": S.value,
|
|
249
292
|
"rds-e-dropdown--small": n.small
|
|
250
|
-
})),
|
|
293
|
+
})), Ve = s(() => n.openDirection !== "auto" ? n.openDirection : "auto"), oe = s(() => {
|
|
251
294
|
const e = {};
|
|
252
|
-
return
|
|
295
|
+
return Ie.value && Object.assign(e, {
|
|
253
296
|
"track-by": "id",
|
|
254
297
|
label: "label"
|
|
255
298
|
}), e;
|
|
256
|
-
}),
|
|
257
|
-
if (
|
|
258
|
-
if (Array.isArray(
|
|
259
|
-
if (typeof e == "string") return
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
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
|
-
},
|
|
265
|
-
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
},
|
|
273
|
-
|
|
315
|
+
}, Ne = () => {
|
|
316
|
+
L(() => {
|
|
274
317
|
if (C.value) {
|
|
275
|
-
const e =
|
|
276
|
-
(t) =>
|
|
318
|
+
const e = z.value.filter(
|
|
319
|
+
(t) => K(t)
|
|
277
320
|
) || [];
|
|
278
|
-
|
|
321
|
+
O("change", e);
|
|
279
322
|
} else {
|
|
280
|
-
const e =
|
|
281
|
-
(t) =>
|
|
323
|
+
const e = z.value.find(
|
|
324
|
+
(t) => K(t)
|
|
282
325
|
);
|
|
283
|
-
|
|
326
|
+
O("change", [e]);
|
|
284
327
|
}
|
|
285
328
|
});
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
if (!
|
|
300
|
-
if (!
|
|
301
|
-
e.preventDefault(),
|
|
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 (!
|
|
305
|
-
e.preventDefault(),
|
|
347
|
+
if (!g.value && e.key === "ArrowDown") {
|
|
348
|
+
e.preventDefault(), p.value?.toggle(), L(() => {
|
|
306
349
|
try {
|
|
307
|
-
|
|
350
|
+
p.value?.pointerForward?.();
|
|
308
351
|
} catch {
|
|
309
352
|
}
|
|
310
353
|
});
|
|
311
354
|
return;
|
|
312
355
|
}
|
|
313
|
-
if (
|
|
314
|
-
e.preventDefault(),
|
|
356
|
+
if (g.value && e.key === "Escape") {
|
|
357
|
+
e.preventDefault(), A();
|
|
315
358
|
return;
|
|
316
359
|
}
|
|
317
|
-
if (
|
|
360
|
+
if (g.value && (e.key === "Enter" || e.key === " ")) {
|
|
318
361
|
e.preventDefault();
|
|
319
362
|
try {
|
|
320
|
-
|
|
363
|
+
p.value?.addPointerElement?.({ key: e.key });
|
|
321
364
|
} catch {
|
|
322
365
|
}
|
|
323
|
-
|
|
366
|
+
pe.value && A();
|
|
324
367
|
}
|
|
325
368
|
}
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
|
|
369
|
+
}, Pe = () => {
|
|
370
|
+
M.value && k.value && (Ee(), ne(), L(() => {
|
|
371
|
+
k.value.focus();
|
|
329
372
|
}));
|
|
330
|
-
},
|
|
331
|
-
if (
|
|
332
|
-
|
|
373
|
+
}, me = (e) => {
|
|
374
|
+
if (V) {
|
|
375
|
+
V = !1;
|
|
333
376
|
return;
|
|
334
377
|
}
|
|
335
|
-
const t = e.target,
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
} else
|
|
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
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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:
|
|
473
|
+
activate: ne,
|
|
356
474
|
/**
|
|
357
475
|
* Cierra el dropdown
|
|
358
476
|
*/
|
|
359
|
-
deactivate:
|
|
360
|
-
}), (e, t) => (c(),
|
|
361
|
-
class:
|
|
362
|
-
"rds-e-dropdown--text-only":
|
|
363
|
-
"rds-e-dropdown--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
|
-
|
|
484
|
+
B(ot, we({
|
|
367
485
|
ref_key: "multiselect",
|
|
368
|
-
ref:
|
|
369
|
-
modelValue:
|
|
370
|
-
"onUpdate:modelValue": t[12] || (t[12] = (
|
|
371
|
-
class:
|
|
372
|
-
options:
|
|
373
|
-
"close-on-select":
|
|
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:
|
|
376
|
-
multiple:
|
|
377
|
-
"max-height":
|
|
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:
|
|
381
|
-
"open-direction":
|
|
382
|
-
limit:
|
|
383
|
-
"limit-text":
|
|
384
|
-
}, { ...
|
|
385
|
-
"append-to-body":
|
|
386
|
-
"text-only":
|
|
387
|
-
onOpen:
|
|
388
|
-
onClose:
|
|
389
|
-
onSelect:
|
|
390
|
-
"onUpdate:modelValue":
|
|
391
|
-
onBlur:
|
|
392
|
-
}),
|
|
393
|
-
selection:
|
|
394
|
-
|
|
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-${
|
|
397
|
-
class:
|
|
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":
|
|
401
|
-
"aria-controls": `listbox-${
|
|
518
|
+
"aria-expanded": g.value ? "true" : "false",
|
|
519
|
+
"aria-controls": `listbox-${o.id}`,
|
|
402
520
|
tabindex: "0",
|
|
403
|
-
onClick:
|
|
404
|
-
onMousedown:
|
|
405
|
-
onKeydown:
|
|
521
|
+
onClick: u(Ue, ["prevent", "stop"]),
|
|
522
|
+
onMousedown: u(fe, ["prevent", "stop"]),
|
|
523
|
+
onKeydown: ve
|
|
406
524
|
}, [
|
|
407
|
-
|
|
408
|
-
|
|
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:
|
|
412
|
-
"rds-e-dropdown__input-caret--open":
|
|
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,
|
|
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":
|
|
421
|
-
"aria-controls": `listbox-${
|
|
422
|
-
onClick:
|
|
423
|
-
onMousedown:
|
|
424
|
-
onKeydown:
|
|
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
|
-
|
|
427
|
-
id: `multiselect-dropdown-${
|
|
428
|
-
modelValue:
|
|
429
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
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:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
549
|
+
label: o.label,
|
|
550
|
+
"input-tabindex": -1,
|
|
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,
|
|
438
557
|
readonly: ""
|
|
439
|
-
},
|
|
440
|
-
"right-icon":
|
|
441
|
-
|
|
558
|
+
}, he({
|
|
559
|
+
"right-icon": y(() => [
|
|
560
|
+
B(i(Se), {
|
|
442
561
|
name: "arrow_down",
|
|
443
562
|
"aria-hidden": "true",
|
|
444
|
-
class:
|
|
445
|
-
"rds-e-dropdown__input-caret--open":
|
|
563
|
+
class: W(["rds-e-dropdown__input-caret", {
|
|
564
|
+
"rds-e-dropdown__input-caret--open": l
|
|
446
565
|
}])
|
|
447
566
|
}, null, 8, ["class"])
|
|
448
567
|
]),
|
|
449
568
|
_: 2
|
|
450
569
|
}, [
|
|
451
|
-
|
|
570
|
+
b("helper-text") ? {
|
|
452
571
|
name: "helper-text",
|
|
453
|
-
fn:
|
|
454
|
-
|
|
572
|
+
fn: y(() => [
|
|
573
|
+
h(e.$slots, "helper-text", {}, void 0, !0)
|
|
455
574
|
]),
|
|
456
575
|
key: "0"
|
|
457
576
|
} : void 0
|
|
458
577
|
]), 1032, ["id", "modelValue", "label", "disabled", "error", "helper", "helper-text", "loading", "compact"])
|
|
459
|
-
], 40,
|
|
578
|
+
], 40, ut))
|
|
460
579
|
]),
|
|
461
|
-
option:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
580
|
+
option: y(({ option: l, search: r, index: d }) => [
|
|
581
|
+
f("div", dt, [
|
|
582
|
+
f("div", ct, [
|
|
583
|
+
f("div", {
|
|
465
584
|
class: "rds-e-dropdown__option--prepend",
|
|
466
|
-
onClick:
|
|
585
|
+
onClick: u(($) => qe(l), ["prevent", "stop"])
|
|
467
586
|
}, [
|
|
468
|
-
|
|
587
|
+
i(C) ? (c(), ke(i(nt), {
|
|
469
588
|
key: 0,
|
|
470
|
-
id: `${
|
|
471
|
-
small:
|
|
472
|
-
"model-value":
|
|
473
|
-
disabled:
|
|
474
|
-
}, null, 8, ["id", "small", "model-value", "disabled"])) : !
|
|
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), {
|
|
475
594
|
key: 1,
|
|
476
|
-
modelValue:
|
|
477
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
478
|
-
"group-name": `group-${
|
|
595
|
+
modelValue: ce.value,
|
|
596
|
+
"onUpdate:modelValue": t[1] || (t[1] = ($) => ce.value = $),
|
|
597
|
+
"group-name": `group-${o.id}`
|
|
479
598
|
}, {
|
|
480
|
-
default:
|
|
481
|
-
|
|
482
|
-
id: `${
|
|
483
|
-
small:
|
|
484
|
-
option: typeof
|
|
485
|
-
checked:
|
|
486
|
-
disabled:
|
|
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
|
|
487
606
|
}, null, 8, ["id", "small", "option", "checked", "disabled"])
|
|
488
607
|
]),
|
|
489
608
|
_: 2
|
|
490
|
-
}, 1032, ["modelValue", "group-name"])) :
|
|
491
|
-
], 8,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
], 64)) : (c(),
|
|
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))
|
|
498
617
|
], !0)
|
|
499
618
|
])
|
|
500
619
|
]),
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
option:
|
|
504
|
-
search:
|
|
505
|
-
index:
|
|
620
|
+
b("optionAppend") ? (c(), m("div", yt, [
|
|
621
|
+
h(e.$slots, "optionAppend", {
|
|
622
|
+
option: l,
|
|
623
|
+
search: r,
|
|
624
|
+
index: d
|
|
506
625
|
}, void 0, !0)
|
|
507
|
-
])) :
|
|
626
|
+
])) : x("", !0)
|
|
508
627
|
])
|
|
509
628
|
]),
|
|
510
629
|
_: 2
|
|
511
630
|
}, [
|
|
512
|
-
|
|
513
|
-
name:
|
|
514
|
-
fn:
|
|
515
|
-
|
|
631
|
+
M.value || b("beforeList") ? {
|
|
632
|
+
name: Lt,
|
|
633
|
+
fn: y(() => [
|
|
634
|
+
M.value ? (c(), m("div", {
|
|
516
635
|
key: 0,
|
|
517
636
|
class: "rds-e-dropdown__before-list",
|
|
518
|
-
onMousedown: t[5] || (t[5] =
|
|
637
|
+
onMousedown: t[5] || (t[5] = u(() => {
|
|
519
638
|
}, ["stop"])),
|
|
520
|
-
onClick:
|
|
521
|
-
onBlur: t[6] || (t[6] =
|
|
639
|
+
onClick: u(Pe, ["stop"]),
|
|
640
|
+
onBlur: t[6] || (t[6] = u(() => {
|
|
522
641
|
}, ["stop"])),
|
|
523
|
-
onFocus: t[7] || (t[7] =
|
|
642
|
+
onFocus: t[7] || (t[7] = u(() => {
|
|
524
643
|
}, ["stop"])),
|
|
525
|
-
onKeydown: t[8] || (t[8] =
|
|
644
|
+
onKeydown: t[8] || (t[8] = u(() => {
|
|
526
645
|
}, ["stop"])),
|
|
527
|
-
onKeyup: t[9] || (t[9] =
|
|
646
|
+
onKeyup: t[9] || (t[9] = u(() => {
|
|
528
647
|
}, ["stop"])),
|
|
529
|
-
onKeypress: t[10] || (t[10] =
|
|
648
|
+
onKeypress: t[10] || (t[10] = u(() => {
|
|
530
649
|
}, ["stop"])),
|
|
531
|
-
onChange: t[11] || (t[11] =
|
|
650
|
+
onChange: t[11] || (t[11] = u(() => {
|
|
532
651
|
}, ["stop"]))
|
|
533
652
|
}, [
|
|
534
|
-
|
|
535
|
-
|
|
653
|
+
f("div", bt, [
|
|
654
|
+
B(i($e), we({
|
|
536
655
|
ref_key: "textFieldInput",
|
|
537
|
-
ref:
|
|
538
|
-
modelValue:
|
|
539
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
540
|
-
},
|
|
656
|
+
ref: k,
|
|
657
|
+
modelValue: Y.value,
|
|
658
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => Y.value = l)
|
|
659
|
+
}, Ce.value, {
|
|
541
660
|
"full-width": "",
|
|
542
|
-
onMousedown: t[3] || (t[3] =
|
|
661
|
+
onMousedown: t[3] || (t[3] = u(() => {
|
|
543
662
|
}, ["stop", "prevent"])),
|
|
544
|
-
onFocus: t[4] || (t[4] =
|
|
663
|
+
onFocus: t[4] || (t[4] = u(() => {
|
|
545
664
|
}, ["stop"]))
|
|
546
665
|
}), null, 16, ["modelValue"])
|
|
547
666
|
])
|
|
548
|
-
], 32)) :
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
667
|
+
], 32)) : x("", !0),
|
|
668
|
+
b("beforeList") ? (c(), m("div", gt, [
|
|
669
|
+
f("div", wt, [
|
|
670
|
+
h(e.$slots, "beforeList", {}, void 0, !0)
|
|
552
671
|
])
|
|
553
|
-
])) :
|
|
672
|
+
])) : x("", !0)
|
|
554
673
|
]),
|
|
555
674
|
key: "0"
|
|
556
675
|
} : void 0,
|
|
557
|
-
|
|
558
|
-
name:
|
|
559
|
-
fn:
|
|
560
|
-
m("div",
|
|
561
|
-
|
|
562
|
-
|
|
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)
|
|
563
682
|
])
|
|
564
|
-
])
|
|
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)
|
|
565
707
|
]),
|
|
566
708
|
key: "1"
|
|
567
709
|
} : void 0,
|
|
568
|
-
|
|
569
|
-
name:
|
|
570
|
-
fn:
|
|
571
|
-
|
|
710
|
+
b("noOptions") ? {
|
|
711
|
+
name: $t,
|
|
712
|
+
fn: y(() => [
|
|
713
|
+
h(e.$slots, "noOptions", {}, void 0, !0)
|
|
572
714
|
]),
|
|
573
715
|
key: "2"
|
|
574
716
|
} : void 0,
|
|
575
|
-
|
|
576
|
-
name:
|
|
577
|
-
fn:
|
|
578
|
-
|
|
717
|
+
b("noResult") ? {
|
|
718
|
+
name: Ot,
|
|
719
|
+
fn: y(({ search: l }) => [
|
|
720
|
+
h(e.$slots, "noResult", { search: l }, void 0, !0)
|
|
579
721
|
]),
|
|
580
722
|
key: "3"
|
|
581
723
|
} : void 0,
|
|
582
|
-
|
|
583
|
-
name:
|
|
584
|
-
fn:
|
|
585
|
-
|
|
724
|
+
b("limit") ? {
|
|
725
|
+
name: _t,
|
|
726
|
+
fn: y(() => [
|
|
727
|
+
h(e.$slots, "limit", {}, void 0, !0)
|
|
586
728
|
]),
|
|
587
729
|
key: "4"
|
|
588
730
|
} : void 0,
|
|
589
|
-
|
|
590
|
-
name:
|
|
591
|
-
fn:
|
|
592
|
-
|
|
731
|
+
b("maxElements") ? {
|
|
732
|
+
name: Et,
|
|
733
|
+
fn: y(() => [
|
|
734
|
+
h(e.$slots, "maxElements", {}, void 0, !0)
|
|
593
735
|
]),
|
|
594
736
|
key: "5"
|
|
595
737
|
} : void 0,
|
|
596
|
-
|
|
597
|
-
name:
|
|
598
|
-
fn:
|
|
599
|
-
|
|
738
|
+
b("singleLabel") ? {
|
|
739
|
+
name: St,
|
|
740
|
+
fn: y(({ option: l }) => [
|
|
741
|
+
h(e.$slots, "singleLabel", { option: l }, void 0, !0)
|
|
600
742
|
]),
|
|
601
743
|
key: "6"
|
|
602
744
|
} : void 0
|
|
603
745
|
]), 1040, ["modelValue", "class", "options", "close-on-select", "disabled", "multiple", "max-height", "small", "open-direction", "limit", "limit-text", "append-to-body", "text-only"])
|
|
604
746
|
], 2));
|
|
605
747
|
}
|
|
606
|
-
}),
|
|
748
|
+
}), jt = /* @__PURE__ */ st(Dt, [["__scopeId", "data-v-59f0ef6b"]]);
|
|
607
749
|
export {
|
|
608
|
-
|
|
750
|
+
jt as default
|
|
609
751
|
};
|