@jblehm/super-list 1.0.26 → 1.0.28
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/README.md +1 -1
- package/dist/DropDownLibrary.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/super-list.js +175 -171
- package/dist/super-list.js.map +1 -1
- package/dist/super-list.umd.cjs +2 -2
- package/dist/super-list.umd.cjs.map +1 -1
- package/dist/super-list.vue.d.ts +9 -0
- package/package.json +2 -2
package/dist/super-list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, ref as f, computed as O, createElementBlock as M, openBlock as T, normalizeClass as R, withKeys as b, createElementVNode as B, useTemplateRef as Ee, watch as F, Fragment as ce, createCommentVNode as $, renderList as Ae, withModifiers as oe, createBlock as fe, toDisplayString as me, useCssVars as Fe, onMounted as Le, onUnmounted as Se, renderSlot as xe, createVNode as Z, nextTick as Be, resolveDynamicComponent as Ne, withCtx as be } from "vue";
|
|
2
2
|
import './index.css';class He {
|
|
3
3
|
eventsTypes = ["resize", "load", "scroll", "wheel", "touchmove"];
|
|
4
4
|
config = {
|
|
@@ -79,7 +79,7 @@ class qe {
|
|
|
79
79
|
return this.abort("New Request From Controller."), this.setFunc(i), this.setThen(a), this.execute();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */
|
|
82
|
+
const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
83
83
|
__name: "ListTextInput",
|
|
84
84
|
props: {
|
|
85
85
|
enableTextFilter: {
|
|
@@ -110,42 +110,42 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Z({
|
|
|
110
110
|
},
|
|
111
111
|
setup(e, { expose: i, emit: a }) {
|
|
112
112
|
const v = a, o = e, d = f(null);
|
|
113
|
-
function w() {
|
|
114
|
-
o.parentMethods.openList();
|
|
113
|
+
function w(h) {
|
|
114
|
+
"sourceCapabilities" in h && h.sourceCapabilities == null ? o.parentMethods.closeList() : o.parentMethods.openList();
|
|
115
115
|
}
|
|
116
|
-
function t(
|
|
117
|
-
o.parentMethods.unfocus(
|
|
116
|
+
function t(h) {
|
|
117
|
+
o.parentMethods.unfocus(h);
|
|
118
118
|
}
|
|
119
|
-
function s(
|
|
120
|
-
|
|
119
|
+
function s(h) {
|
|
120
|
+
h?.target?.value != null && v("update:query", h.target.value);
|
|
121
121
|
}
|
|
122
122
|
const c = O(() => {
|
|
123
|
-
const
|
|
124
|
-
return
|
|
123
|
+
const h = d?.value ? d.value.length : 0, y = o.placeholder?.length || 0;
|
|
124
|
+
return h > 0 ? h : y > 0 ? y : 5;
|
|
125
125
|
}), l = O(() => o.enableButtonClick === !0 && o.enableTextFilter === !0 ? "" : "click-through"), g = O(() => o.showDropDown && !o.enableTextFilter || !o.showDropDown ? "dark-placeholder-text" : "light-placeholder-text");
|
|
126
126
|
function k() {
|
|
127
127
|
if (d?.value) {
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const h = d.value;
|
|
129
|
+
h.blur(), h.value = "";
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function I() {
|
|
133
133
|
d?.value && d.value.focus();
|
|
134
134
|
}
|
|
135
|
-
return i({ blurInput: k, focusInput:
|
|
135
|
+
return i({ blurInput: k, focusInput: I, textInputRef: d }), (h, y) => (T(), M("input", {
|
|
136
136
|
ref_key: "textInputRef",
|
|
137
137
|
ref: d,
|
|
138
138
|
tabindex: e.enableTextFilter ? 0 : -1,
|
|
139
139
|
onKeydown: [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
y[0] || (y[0] = b((m) => e.parentMethods.press(m), ["enter"])),
|
|
141
|
+
y[1] || (y[1] = b((m) => e.parentMethods.press(), ["space"])),
|
|
142
|
+
y[2] || (y[2] = b((m) => e.parentMethods.press(m), ["esc"])),
|
|
143
|
+
y[3] || (y[3] = b((m) => e.parentMethods.press(m), ["up"])),
|
|
144
|
+
y[4] || (y[4] = b((m) => e.parentMethods.press(m), ["down"]))
|
|
145
145
|
],
|
|
146
|
-
onFocusin:
|
|
147
|
-
onFocusout:
|
|
148
|
-
onInput:
|
|
146
|
+
onFocusin: y[5] || (y[5] = (m) => w(m)),
|
|
147
|
+
onFocusout: y[6] || (y[6] = (m) => t(m)),
|
|
148
|
+
onInput: y[7] || (y[7] = (m) => s(m)),
|
|
149
149
|
type: "text",
|
|
150
150
|
"aria-autocomplete": "none",
|
|
151
151
|
autocomplete: "off",
|
|
@@ -163,7 +163,7 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Z({
|
|
|
163
163
|
for (const [v, o] of i)
|
|
164
164
|
a[v] = o;
|
|
165
165
|
return a;
|
|
166
|
-
}, he = /* @__PURE__ */ K($e, [["__scopeId", "data-v-
|
|
166
|
+
}, he = /* @__PURE__ */ K($e, [["__scopeId", "data-v-acc7ac24"]]), Ke = {}, Ve = {
|
|
167
167
|
xmlns: "http://www.w3.org/2000/svg",
|
|
168
168
|
fill: "currentColor",
|
|
169
169
|
"aria-hidden": "true",
|
|
@@ -171,14 +171,14 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Z({
|
|
|
171
171
|
viewBox: "0 -16 16 17"
|
|
172
172
|
};
|
|
173
173
|
function ze(e, i) {
|
|
174
|
-
return
|
|
175
|
-
|
|
174
|
+
return T(), M("svg", Ve, i[0] || (i[0] = [
|
|
175
|
+
B("path", {
|
|
176
176
|
"shape-rendering": "geometricPrecision",
|
|
177
177
|
d: "M 6 -2.25 L 13.75 -14 A 0.5 0.5 90 0 1 15 -13 L 6.5 -0.5 A 2 1 90 0 1 5.5 -0.5 L 1 -6 A 0.5 0.5 90 0 1 2.25 -7 Z"
|
|
178
178
|
}, null, -1)
|
|
179
179
|
]));
|
|
180
180
|
}
|
|
181
|
-
const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = { class: "list-item-span" }, We = { class: "list-item-span" }, Qe = /* @__PURE__ */
|
|
181
|
+
const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = { class: "list-item-span" }, We = { class: "list-item-span" }, Qe = /* @__PURE__ */ Y({
|
|
182
182
|
__name: "ListItem",
|
|
183
183
|
props: {
|
|
184
184
|
mouseHoveringOnList: {
|
|
@@ -239,19 +239,19 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
239
239
|
const s = w.offsetTop - t.scrollTop < 0, c = w.offsetTop + w.offsetHeight - t.scrollTop > t.clientHeight;
|
|
240
240
|
s && (t.scrollTop = w.offsetTop), c && (t.scrollTop = w.offsetTop + w.clientHeight - t.clientHeight);
|
|
241
241
|
}
|
|
242
|
-
return (w, t) => (
|
|
243
|
-
(
|
|
242
|
+
return (w, t) => (T(), M(ce, null, [
|
|
243
|
+
(T(!0), M(ce, null, Ae(e.filteredListItems, (s, c) => (T(), M("li", {
|
|
244
244
|
key: c,
|
|
245
245
|
ref_for: !0,
|
|
246
246
|
ref: "items",
|
|
247
247
|
onKeyup: [
|
|
248
|
-
t[0] || (t[0] =
|
|
249
|
-
t[1] || (t[1] =
|
|
250
|
-
t[2] || (t[2] =
|
|
248
|
+
t[0] || (t[0] = b((l) => e.parentMethods.press(l), ["enter"])),
|
|
249
|
+
t[1] || (t[1] = b((l) => e.parentMethods.press(l), ["space"])),
|
|
250
|
+
t[2] || (t[2] = b((l) => e.parentMethods.press(l), ["esc"]))
|
|
251
251
|
],
|
|
252
252
|
onKeydown: [
|
|
253
|
-
t[3] || (t[3] =
|
|
254
|
-
t[4] || (t[4] =
|
|
253
|
+
t[3] || (t[3] = b((l) => e.parentMethods.press(l), ["up"])),
|
|
254
|
+
t[4] || (t[4] = b((l) => e.parentMethods.press(l), ["down"]))
|
|
255
255
|
],
|
|
256
256
|
onFocusout: t[5] || (t[5] = (l) => e.parentMethods.unfocus(l)),
|
|
257
257
|
tabindex: "-1",
|
|
@@ -264,52 +264,52 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
264
264
|
"list-option"
|
|
265
265
|
])
|
|
266
266
|
}, [
|
|
267
|
-
|
|
268
|
-
e.selectedIndex === c ? (
|
|
267
|
+
B("span", Je, me(e.parentMethods.getLabel(s)), 1),
|
|
268
|
+
e.selectedIndex === c ? (T(), fe(Xe, {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "list-item-icon",
|
|
271
271
|
"aria-hidden": "true"
|
|
272
272
|
})) : $("", !0)
|
|
273
273
|
], 42, Ue))), 128)),
|
|
274
|
-
e.filteredListItems.length === 0 ? (
|
|
274
|
+
e.filteredListItems.length === 0 ? (T(), M("li", {
|
|
275
275
|
key: 0,
|
|
276
276
|
onKeyup: [
|
|
277
|
-
t[6] || (t[6] =
|
|
278
|
-
t[7] || (t[7] =
|
|
279
|
-
t[8] || (t[8] =
|
|
277
|
+
t[6] || (t[6] = b((s) => e.parentMethods.press(s), ["enter"])),
|
|
278
|
+
t[7] || (t[7] = b((s) => e.parentMethods.press(s), ["space"])),
|
|
279
|
+
t[8] || (t[8] = b((s) => e.parentMethods.press(s), ["esc"]))
|
|
280
280
|
],
|
|
281
281
|
onKeydown: [
|
|
282
|
-
t[9] || (t[9] =
|
|
283
|
-
t[10] || (t[10] =
|
|
282
|
+
t[9] || (t[9] = b((s) => e.parentMethods.press(s), ["up"])),
|
|
283
|
+
t[10] || (t[10] = b((s) => e.parentMethods.press(s), ["down"]))
|
|
284
284
|
],
|
|
285
285
|
onFocusout: t[11] || (t[11] = (s) => e.parentMethods.unfocus(s)),
|
|
286
286
|
onMousedown: t[12] || (t[12] = oe((s) => e.parentMethods.closeList(s), ["left"])),
|
|
287
287
|
tabindex: "-1",
|
|
288
288
|
class: "list-option-message"
|
|
289
289
|
}, t[20] || (t[20] = [
|
|
290
|
-
|
|
290
|
+
B("span", { class: "list-item-span" }, "No Items To Display.", -1)
|
|
291
291
|
]), 32)) : $("", !0),
|
|
292
|
-
e.totalOptionsCount && e.totalOptionsCount > (e.filteredListItems?.length || 0) ? (
|
|
292
|
+
e.totalOptionsCount && e.totalOptionsCount > (e.filteredListItems?.length || 0) ? (T(), M("li", {
|
|
293
293
|
key: 1,
|
|
294
294
|
onKeyup: [
|
|
295
|
-
t[13] || (t[13] =
|
|
296
|
-
t[14] || (t[14] =
|
|
297
|
-
t[15] || (t[15] =
|
|
295
|
+
t[13] || (t[13] = b((s) => e.parentMethods.press(s), ["enter"])),
|
|
296
|
+
t[14] || (t[14] = b((s) => e.parentMethods.press(s), ["space"])),
|
|
297
|
+
t[15] || (t[15] = b((s) => e.parentMethods.press(s), ["esc"]))
|
|
298
298
|
],
|
|
299
299
|
onKeydown: [
|
|
300
|
-
t[16] || (t[16] =
|
|
301
|
-
t[17] || (t[17] =
|
|
300
|
+
t[16] || (t[16] = b((s) => e.parentMethods.press(s), ["up"])),
|
|
301
|
+
t[17] || (t[17] = b((s) => e.parentMethods.press(s), ["down"]))
|
|
302
302
|
],
|
|
303
303
|
onFocusout: t[18] || (t[18] = (s) => e.parentMethods.unfocus(s)),
|
|
304
304
|
onMousedown: t[19] || (t[19] = oe((s) => e.parentMethods.closeList(s), ["left"])),
|
|
305
305
|
tabindex: "-1",
|
|
306
306
|
class: "list-option-message"
|
|
307
307
|
}, [
|
|
308
|
-
|
|
308
|
+
B("span", We, " +" + me(e.totalOptionsCount - e.filteredListItems?.length || 0) + " More Items...", 1)
|
|
309
309
|
], 32)) : $("", !0)
|
|
310
310
|
], 64));
|
|
311
311
|
}
|
|
312
|
-
}), Ze = /* @__PURE__ */ K(Qe, [["__scopeId", "data-v-e4eeb2f7"]]), Ye = /* @__PURE__ */
|
|
312
|
+
}), Ze = /* @__PURE__ */ K(Qe, [["__scopeId", "data-v-e4eeb2f7"]]), Ye = /* @__PURE__ */ Y({
|
|
313
313
|
__name: "ItemList",
|
|
314
314
|
props: {
|
|
315
315
|
mouseHoveringOnList: {
|
|
@@ -364,19 +364,19 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
364
364
|
emits: ["reverseDropDownList"],
|
|
365
365
|
setup(e, { expose: i, emit: a }) {
|
|
366
366
|
Fe((r) => ({
|
|
367
|
-
"
|
|
368
|
-
"
|
|
369
|
-
"
|
|
370
|
-
"
|
|
371
|
-
"
|
|
367
|
+
"220f507e": k.value,
|
|
368
|
+
"935a72a0": S.value,
|
|
369
|
+
"935a6b1e": se.value,
|
|
370
|
+
"4076fb5c": q.value,
|
|
371
|
+
"51ba7f6b": G.value
|
|
372
372
|
}));
|
|
373
|
-
const v = a, o = e, d = f(null), w = f(null), t = f(null), s = f(0), c = f(0), l = f(0), g = f(0), k = f("0px"),
|
|
373
|
+
const v = a, o = e, d = f(null), w = f(null), t = f(null), s = f(0), c = f(0), l = f(0), g = f(0), k = f("0px"), I = f(!1), h = f([]), y = f(0), m = O(() => !I.value || window?.innerHeight == null ? !1 : X() && le()), V = O(() => o.maxListHeightPX >= y.value);
|
|
374
374
|
F(
|
|
375
|
-
() =>
|
|
375
|
+
() => m.value,
|
|
376
376
|
(r) => v("reverseDropDownList", r),
|
|
377
377
|
{ immediate: !0 }
|
|
378
378
|
);
|
|
379
|
-
const
|
|
379
|
+
const S = O(() => s.value + "px"), se = O(() => g.value + "px");
|
|
380
380
|
i({ listContainerRef: t });
|
|
381
381
|
const P = (r) => {
|
|
382
382
|
r?.key && r.key === " " && r.preventDefault();
|
|
@@ -384,12 +384,12 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
384
384
|
const L = t?.value, x = r.target;
|
|
385
385
|
(!(L && x && L.contains(x)) || L.isEqualNode(x)) && o.parentMethods.focusInput();
|
|
386
386
|
};
|
|
387
|
-
function
|
|
387
|
+
function N() {
|
|
388
388
|
return w?.value ? (w?.value).clientHeight : 0;
|
|
389
389
|
}
|
|
390
390
|
function E() {
|
|
391
|
-
if (!
|
|
392
|
-
const r =
|
|
391
|
+
if (!I.value || N() === 0) return o.maxListHeightPX;
|
|
392
|
+
const r = N() === 0 ? o.maxListHeightPX : +N();
|
|
393
393
|
return o.maxListHeightPX && o.maxListHeightPX > r ? r : o.maxListHeightPX;
|
|
394
394
|
}
|
|
395
395
|
function X() {
|
|
@@ -398,55 +398,55 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
398
398
|
function le() {
|
|
399
399
|
return l.value < E();
|
|
400
400
|
}
|
|
401
|
-
const
|
|
401
|
+
const G = O(() => (o.maxListHeightPX || 0) + "px"), q = O(() => (o.listAnimationDurationMs || 0) + "ms"), _ = O(() => o.blockListChange ? h.value : o.filteredListItems);
|
|
402
402
|
F(
|
|
403
|
-
() =>
|
|
403
|
+
() => _,
|
|
404
404
|
(r) => {
|
|
405
|
-
r && (
|
|
405
|
+
r && (h.value = r.value);
|
|
406
406
|
},
|
|
407
407
|
{ immediate: !1, deep: !0 }
|
|
408
408
|
);
|
|
409
409
|
let C = setTimeout(() => {
|
|
410
410
|
}, 0), A = null;
|
|
411
411
|
function j() {
|
|
412
|
-
|
|
412
|
+
y.value = N(), clearTimeout(C), A && A.observe(), I.value = !0, z(void 0);
|
|
413
413
|
}
|
|
414
414
|
function re() {
|
|
415
415
|
clearTimeout(C), C = setTimeout(() => {
|
|
416
|
-
o.showDropDown || (
|
|
416
|
+
o.showDropDown || (I.value = !1, A && A.unobserve());
|
|
417
417
|
}, o.listAnimationDurationMs + 50);
|
|
418
418
|
}
|
|
419
419
|
F(
|
|
420
420
|
() => o.showDropDown,
|
|
421
421
|
(r, L) => {
|
|
422
|
-
r !== L && (r ? j() : re());
|
|
422
|
+
r !== L && (U(), r ? j() : re());
|
|
423
423
|
},
|
|
424
424
|
{ immediate: !0 }
|
|
425
425
|
);
|
|
426
426
|
function z(r) {
|
|
427
|
-
|
|
427
|
+
U(), Be(() => U()), ee(r);
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
if (typeof t?.value?.contains != "function" || r?.target?.nodeType == null ||
|
|
429
|
+
function ee(r) {
|
|
430
|
+
if (!o.enableScrollClose || !o.showDropDown || typeof t?.value?.contains != "function" || r?.target?.nodeType == null || te(r)) return;
|
|
431
431
|
const x = ["scroll", "wheel", "touchmove"].includes(r?.type);
|
|
432
432
|
o.showDropDown && x && o.parentMethods.closeList();
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
const L = !!d.value?.contains(r?.target), x = !!t.value?.contains(r.target),
|
|
436
|
-
return L || x ||
|
|
437
|
-
}
|
|
438
|
-
function te() {
|
|
439
|
-
U(), J();
|
|
434
|
+
function te(r) {
|
|
435
|
+
const L = !!d.value?.contains(r?.target), x = !!t.value?.contains(r.target), Q = [r?.srcElement?.id, r?.target?.id].includes("super-list-select-list");
|
|
436
|
+
return L || x || Q;
|
|
440
437
|
}
|
|
441
438
|
function U() {
|
|
439
|
+
J(), W();
|
|
440
|
+
}
|
|
441
|
+
function J() {
|
|
442
442
|
if (d?.value == null) return;
|
|
443
443
|
const r = d.value.getBoundingClientRect();
|
|
444
444
|
c.value = r.top, l.value = window.innerHeight - r.bottom, k.value = r.width + "px";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function W() {
|
|
447
447
|
if (d?.value == null || t?.value == null) return;
|
|
448
|
-
const r = ne().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x = g.value,
|
|
449
|
-
|
|
448
|
+
const r = ne().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x = g.value, Q = s.value;
|
|
449
|
+
m.value ? g.value = x - (r.top - L.bottom) : g.value = x - (L.top - r.bottom), s.value = Q - (L.left - r.left);
|
|
450
450
|
}
|
|
451
451
|
function ue() {
|
|
452
452
|
return (d?.value).getElementsByTagName("button")[0];
|
|
@@ -456,17 +456,17 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
456
456
|
}
|
|
457
457
|
return Le(() => {
|
|
458
458
|
A = new He(z, ue()), setTimeout(() => z(void 0), 250);
|
|
459
|
-
}),
|
|
459
|
+
}), Se(() => {
|
|
460
460
|
A?.unobserve();
|
|
461
|
-
}), (r, L) => (
|
|
462
|
-
|
|
461
|
+
}), (r, L) => (T(), M(ce, null, [
|
|
462
|
+
B("div", {
|
|
463
463
|
ref_key: "dropDownButtonContainer",
|
|
464
464
|
ref: d,
|
|
465
465
|
class: "super-list-button-container"
|
|
466
466
|
}, [
|
|
467
467
|
xe(r.$slots, "default", {}, void 0, !0)
|
|
468
468
|
], 512),
|
|
469
|
-
|
|
469
|
+
B("div", {
|
|
470
470
|
id: "super-list-select-list",
|
|
471
471
|
ref_key: "listContainerRef",
|
|
472
472
|
ref: t,
|
|
@@ -474,27 +474,27 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
474
474
|
tabindex: "-1",
|
|
475
475
|
class: R([
|
|
476
476
|
"select-list",
|
|
477
|
-
|
|
477
|
+
m.value ? "list-reverse" : "list-normal",
|
|
478
478
|
{ "select-list-open": e.showDropDown },
|
|
479
|
-
{ "no-scroll": V.value &&
|
|
480
|
-
{ "select-list-fixed":
|
|
479
|
+
{ "no-scroll": V.value && I.value },
|
|
480
|
+
{ "select-list-fixed": I.value },
|
|
481
481
|
{ "select-list-scrollable": !V.value }
|
|
482
482
|
]),
|
|
483
|
-
onKeydown: L[1] || (L[1] =
|
|
483
|
+
onKeydown: L[1] || (L[1] = b((x) => P(x), ["space"])),
|
|
484
484
|
onMouseup: L[2] || (L[2] = oe((x) => ie(x), ["left"]))
|
|
485
485
|
}, [
|
|
486
|
-
|
|
486
|
+
B("ul", {
|
|
487
487
|
tabindex: "-1",
|
|
488
488
|
ref_key: "dropDownListUL",
|
|
489
489
|
ref: w,
|
|
490
490
|
class: "list-content"
|
|
491
491
|
}, [
|
|
492
|
-
|
|
493
|
-
filteredListItems:
|
|
492
|
+
Z(Ze, {
|
|
493
|
+
filteredListItems: h.value,
|
|
494
494
|
mouseHoveringOnList: e.mouseHoveringOnList,
|
|
495
495
|
focusedIndex: e.focusedIndex,
|
|
496
496
|
selectedIndex: e.selectedIndex,
|
|
497
|
-
listElementOpenAndVisible:
|
|
497
|
+
listElementOpenAndVisible: I.value,
|
|
498
498
|
"parent-methods": e.parentMethods,
|
|
499
499
|
"show-drop-down": e.showDropDown,
|
|
500
500
|
"total-options-count": e.totalOptionsCount
|
|
@@ -503,7 +503,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
503
503
|
], 34)
|
|
504
504
|
], 64));
|
|
505
505
|
}
|
|
506
|
-
}),
|
|
506
|
+
}), ye = /* @__PURE__ */ K(Ye, [["__scopeId", "data-v-53c634fd"]]), Ge = {}, _e = {
|
|
507
507
|
xmlns: "http://www.w3.org/2000/svg",
|
|
508
508
|
fill: "currentColor",
|
|
509
509
|
"aria-hidden": "true",
|
|
@@ -511,17 +511,17 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
511
511
|
viewBox: "0 0 12 6"
|
|
512
512
|
};
|
|
513
513
|
function et(e, i) {
|
|
514
|
-
return
|
|
515
|
-
|
|
514
|
+
return T(), M("svg", _e, i[0] || (i[0] = [
|
|
515
|
+
B("path", {
|
|
516
516
|
"shape-rendering": "geometricPrecision",
|
|
517
517
|
d: "M 6 4 L 10 0.25 A 0.5 0.5 90 0 1 11 1.25 L 6.5 5.75 A 15 3 90 0 1 5.5 5.75 L 1 1.25 A 0.5 0.5 90 0 1 2 0.25 Z"
|
|
518
518
|
}, null, -1)
|
|
519
519
|
]));
|
|
520
520
|
}
|
|
521
|
-
const
|
|
521
|
+
const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
522
522
|
key: 2,
|
|
523
523
|
class: "list-button-icon custom-icon"
|
|
524
|
-
}, ot = /* @__PURE__ */
|
|
524
|
+
}, ot = /* @__PURE__ */ Y({
|
|
525
525
|
__name: "ListButton",
|
|
526
526
|
props: {
|
|
527
527
|
// eslint-disable-line
|
|
@@ -563,16 +563,16 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
563
563
|
function s() {
|
|
564
564
|
v?.value && v.value.focus();
|
|
565
565
|
}
|
|
566
|
-
return i({ blurInput: t, focusInput: s, buttonRef: v }), (c, l) => (
|
|
566
|
+
return i({ blurInput: t, focusInput: s, buttonRef: v }), (c, l) => (T(), M("button", {
|
|
567
567
|
ref_key: "buttonRef",
|
|
568
568
|
ref: v,
|
|
569
569
|
tabindex: e.enableTextFilter ? -1 : 0,
|
|
570
570
|
onKeydown: [
|
|
571
|
-
l[0] || (l[0] =
|
|
572
|
-
l[1] || (l[1] =
|
|
573
|
-
l[2] || (l[2] =
|
|
574
|
-
l[3] || (l[3] =
|
|
575
|
-
l[4] || (l[4] =
|
|
571
|
+
l[0] || (l[0] = b((g) => d(g), ["enter"])),
|
|
572
|
+
l[1] || (l[1] = b((g) => w(g), ["space"])),
|
|
573
|
+
l[2] || (l[2] = b((g) => e.parentMethods.press(g), ["esc"])),
|
|
574
|
+
l[3] || (l[3] = b((g) => e.parentMethods.press(g), ["up"])),
|
|
575
|
+
l[4] || (l[4] = b((g) => e.parentMethods.press(g), ["down"]))
|
|
576
576
|
],
|
|
577
577
|
onFocusout: l[5] || (l[5] = (g) => e.parentMethods.unfocus(g)),
|
|
578
578
|
onClick: l[6] || (l[6] = (g) => o()),
|
|
@@ -580,31 +580,31 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
580
580
|
class: R([[{ "click-through": a.enableTextFilter || a.showDropDown }], "list-button"])
|
|
581
581
|
}, [
|
|
582
582
|
xe(c.$slots, "default", {}, void 0, !0),
|
|
583
|
-
|
|
583
|
+
B("span", {
|
|
584
584
|
class: R(["list-button-icon-div", { "bigger-gap": a.showDropDown }])
|
|
585
585
|
}, [
|
|
586
|
-
e.customIcon ? $("", !0) : (
|
|
586
|
+
e.customIcon ? $("", !0) : (T(), M("span", {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: R(["list-button-icon", [{ "rotate-180": !a.showDropDown }]])
|
|
589
589
|
}, [
|
|
590
|
-
|
|
590
|
+
Z(ge, { "aria-hidden": "true" })
|
|
591
591
|
], 2)),
|
|
592
|
-
e.customIcon ? $("", !0) : (
|
|
592
|
+
e.customIcon ? $("", !0) : (T(), M("span", {
|
|
593
593
|
key: 1,
|
|
594
594
|
class: R(["list-button-icon", [{ "rotate-180": a.showDropDown }]])
|
|
595
595
|
}, [
|
|
596
|
-
e.customIcon == null ? (
|
|
596
|
+
e.customIcon == null ? (T(), fe(ge, {
|
|
597
597
|
key: 0,
|
|
598
598
|
"aria-hidden": "true"
|
|
599
599
|
})) : $("", !0)
|
|
600
600
|
], 2)),
|
|
601
|
-
e.customIcon ? (
|
|
602
|
-
(
|
|
601
|
+
e.customIcon ? (T(), M("span", nt, [
|
|
602
|
+
(T(), fe(Ne(e.customIcon), { "aria-hidden": "true" }))
|
|
603
603
|
])) : $("", !0)
|
|
604
604
|
], 2)
|
|
605
605
|
], 42, tt));
|
|
606
606
|
}
|
|
607
|
-
}), we = /* @__PURE__ */ K(ot, [["__scopeId", "data-v-01ef8e37"]]), st = /* @__PURE__ */
|
|
607
|
+
}), we = /* @__PURE__ */ K(ot, [["__scopeId", "data-v-01ef8e37"]]), st = /* @__PURE__ */ Y({
|
|
608
608
|
__name: "super-list",
|
|
609
609
|
props: {
|
|
610
610
|
selected: {
|
|
@@ -653,22 +653,26 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
653
653
|
colour: {
|
|
654
654
|
type: String,
|
|
655
655
|
default: "black"
|
|
656
|
+
},
|
|
657
|
+
scrollTextInputToTopOnMobile: {
|
|
658
|
+
type: Boolean,
|
|
659
|
+
default: !0
|
|
656
660
|
}
|
|
657
661
|
},
|
|
658
662
|
emits: { "update:selected": null },
|
|
659
663
|
setup(e, { expose: i, emit: a }) {
|
|
660
|
-
const v = a, o = e, d = f([]), w = new qe(), t = f(0), s = O(() => o.forceTextFilterVisibilityTo != null ? o.forceTextFilterVisibilityTo : t.value > o.maxListOptions), c = f(!1), l = f(!1), g = f(!1), k = f(!0),
|
|
664
|
+
const v = a, o = e, d = f([]), w = new qe(), t = f(0), s = O(() => o.forceTextFilterVisibilityTo != null ? o.forceTextFilterVisibilityTo : t.value > o.maxListOptions), c = f(!1), l = f(!1), g = f(!1), k = f(!0), I = f(!1), h = f(!1), y = f(ye), m = f(he), V = f(we), S = f("");
|
|
661
665
|
F(
|
|
662
|
-
() =>
|
|
666
|
+
() => S.value,
|
|
663
667
|
(n, u) => {
|
|
664
668
|
n !== u && typeof o.options == "function" && x(n);
|
|
665
669
|
}
|
|
666
670
|
);
|
|
667
671
|
const se = () => {
|
|
668
|
-
s.value &&
|
|
672
|
+
s.value && m?.value?.blurInput();
|
|
669
673
|
}, P = () => {
|
|
670
|
-
clearTimeout(
|
|
671
|
-
}, ie = O(() =>
|
|
674
|
+
clearTimeout(W), se(), S.value = "", c.value = !1, k.value = !0;
|
|
675
|
+
}, ie = O(() => h?.value === !0 ? "Error loading data" : I?.value === !0 ? "Loading..." : E(o.selected)), N = (n) => {
|
|
672
676
|
n && v("update:selected", n), P();
|
|
673
677
|
}, E = (n) => Re(
|
|
674
678
|
n,
|
|
@@ -677,18 +681,18 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
677
681
|
o.enumKeyToLabelObjectArray
|
|
678
682
|
);
|
|
679
683
|
function X() {
|
|
680
|
-
throw
|
|
684
|
+
throw I.value = !0, h.value = !0, new Error("Invalid options argument provided to ListInputComponent");
|
|
681
685
|
}
|
|
682
686
|
function le() {
|
|
683
|
-
throw
|
|
687
|
+
throw I.value = !0, h.value = !0, new Error("Invalid response provided to ListInputComponent, no total count key found");
|
|
684
688
|
}
|
|
685
|
-
function
|
|
686
|
-
throw
|
|
689
|
+
function G() {
|
|
690
|
+
throw I.value = !0, h.value = !0, new Error("Invalid objectLabelKeyName for provided Dropdown list value.");
|
|
687
691
|
}
|
|
688
692
|
Le(() => {
|
|
689
693
|
typeof o.options != "function" && !Array.isArray(o.options) ? X() : r();
|
|
690
694
|
});
|
|
691
|
-
const q = f(!1),
|
|
695
|
+
const q = f(!1), _ = f(0), C = f(0), A = f(0);
|
|
692
696
|
F(
|
|
693
697
|
() => C.value,
|
|
694
698
|
(n, u) => {
|
|
@@ -704,7 +708,7 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
704
708
|
);
|
|
705
709
|
const j = O(() => {
|
|
706
710
|
if (typeof o.options == "function" && !Array.isArray(o.options)) return d.value;
|
|
707
|
-
const n =
|
|
711
|
+
const n = S.value, u = d.value;
|
|
708
712
|
return n === "" ? u : u.filter((p) => E(p).toLowerCase().includes(n.toLowerCase()));
|
|
709
713
|
});
|
|
710
714
|
F(
|
|
@@ -717,76 +721,76 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
717
721
|
const re = () => {
|
|
718
722
|
q.value = !0;
|
|
719
723
|
}, z = () => {
|
|
720
|
-
const n =
|
|
721
|
-
|
|
724
|
+
const n = ee();
|
|
725
|
+
_.value = n, C.value = n > -1 ? n : 0;
|
|
722
726
|
};
|
|
723
|
-
function
|
|
727
|
+
function ee() {
|
|
724
728
|
if (o.selected == null) return -1;
|
|
725
729
|
const n = d.value.map((p) => E(p)), u = n.filter((p) => p === E(o.selected));
|
|
726
730
|
if (u.length > 1) {
|
|
727
|
-
const p = u.map((
|
|
728
|
-
for (let
|
|
729
|
-
const H = JSON.stringify(d.value[p[
|
|
730
|
-
if (H === de) return p[
|
|
731
|
+
const p = u.map((D) => n.indexOf(D));
|
|
732
|
+
for (let D = 0; D < p.length; D++) {
|
|
733
|
+
const H = JSON.stringify(d.value[p[D]]), de = JSON.stringify(o.selected);
|
|
734
|
+
if (H === de) return p[D];
|
|
731
735
|
}
|
|
732
736
|
return -1;
|
|
733
737
|
}
|
|
734
738
|
return n.indexOf(E(o.selected));
|
|
735
739
|
}
|
|
736
|
-
const
|
|
737
|
-
|
|
738
|
-
},
|
|
739
|
-
const n = window?.innerWidth != null && window.innerWidth < 640, u = screen?.width != null && screen.width < 640, p =
|
|
740
|
-
(n || u) && s.value && (ue(), p?.scrollIntoView({ block: "start" }));
|
|
741
|
-
},
|
|
742
|
-
let
|
|
740
|
+
const te = () => {
|
|
741
|
+
I.value || (c.value || (l.value = !1, z(), o.scrollTextInputToTopOnMobile && U(), c.value = !0), q.value = !1, k.value = !1);
|
|
742
|
+
}, U = () => {
|
|
743
|
+
const n = window?.innerWidth != null && window.innerWidth < 640, u = screen?.width != null && screen.width < 640, p = m.value.textInputRef;
|
|
744
|
+
(n || u) && s.value && (ue(), p?.scrollIntoView({ block: "start", inline: "center" }));
|
|
745
|
+
}, J = f(!0);
|
|
746
|
+
let W = setTimeout(() => {
|
|
743
747
|
}, 0);
|
|
744
748
|
function ue() {
|
|
745
|
-
|
|
746
|
-
|
|
749
|
+
m.value.textInputRef && (clearTimeout(W), J.value = !1, W = setTimeout(() => {
|
|
750
|
+
J.value = !0;
|
|
747
751
|
}, 300));
|
|
748
752
|
}
|
|
749
753
|
const ne = () => {
|
|
750
|
-
s?.value == !0 ?
|
|
754
|
+
s?.value == !0 ? m.value.focusInput() : V?.value?.focusInput && V?.value?.focusInput();
|
|
751
755
|
};
|
|
752
756
|
async function r() {
|
|
753
|
-
typeof o.options == "function" ? await x(
|
|
757
|
+
typeof o.options == "function" ? await x(S.value ? S.value : void 0, !0) : (ve(o.options), t.value = d.value.length), L();
|
|
754
758
|
}
|
|
755
759
|
i({ initializeOptions: r, getLabel: E });
|
|
756
760
|
function L() {
|
|
757
|
-
|
|
761
|
+
ee() == -1 && d.value && !!d.value[0] && N(d.value[0]);
|
|
758
762
|
}
|
|
759
763
|
async function x(n, u = !0) {
|
|
760
|
-
|
|
761
|
-
const p = async () => o.options(o.maxListOptions, n || ""),
|
|
762
|
-
(!H || !("data" in H)) && X(), ve(H.data),
|
|
763
|
-
|
|
764
|
+
I.value = u;
|
|
765
|
+
const p = async () => o.options(o.maxListOptions, n || ""), D = (H) => {
|
|
766
|
+
(!H || !("data" in H)) && X(), ve(H.data), Q(H?.data?.length ?? 0).then(() => {
|
|
767
|
+
I.value = !1;
|
|
764
768
|
});
|
|
765
769
|
};
|
|
766
|
-
await w.resetAndExecute(p,
|
|
770
|
+
await w.resetAndExecute(p, D);
|
|
767
771
|
}
|
|
768
|
-
async function
|
|
769
|
-
const u = async () => o.options(1, ""), p = (
|
|
770
|
-
(!
|
|
772
|
+
async function Q(n) {
|
|
773
|
+
const u = async () => o.options(1, ""), p = (D) => {
|
|
774
|
+
(!D || !("totalNum" in D)) && le(), t.value = D.totalNum ?? n;
|
|
771
775
|
};
|
|
772
776
|
await w.resetAndExecute(u, p);
|
|
773
777
|
}
|
|
774
|
-
const pe = () =>
|
|
775
|
-
c.value == !1 ?
|
|
776
|
-
},
|
|
778
|
+
const pe = () => m?.value?.textInputRef?.getElementsByTagName("li")[C.value] ?? null, Ie = (n) => {
|
|
779
|
+
c.value == !1 ? te() : n && Te(n);
|
|
780
|
+
}, Te = (n) => {
|
|
777
781
|
const u = n.key || n.code;
|
|
778
|
-
(u === "Tab" || u === "Escape") && P(), u === "ArrowDown" && Oe(n), u === "ArrowUp" && Me(n), (u === "Enter" || u === " ") &&
|
|
779
|
-
},
|
|
780
|
-
j.value.length > 0 ? (l.value = !0,
|
|
782
|
+
(u === "Tab" || u === "Escape") && P(), u === "ArrowDown" && Oe(n), u === "ArrowUp" && Me(n), (u === "Enter" || u === " ") && De(), n.preventDefault(), n.stopPropagation();
|
|
783
|
+
}, De = () => {
|
|
784
|
+
j.value.length > 0 ? (l.value = !0, N(j.value[C.value])) : P();
|
|
781
785
|
}, Oe = (n) => {
|
|
782
786
|
k.value = !0, C.value < j.value.length - 1 && (n.preventDefault(), q.value = !1, C.value++, pe()?.focus());
|
|
783
787
|
}, Me = (n) => {
|
|
784
788
|
k.value = !0, C.value > 0 && (n.preventDefault(), q.value = !1, C.value--, pe()?.focus());
|
|
785
789
|
}, Ce = (n) => {
|
|
786
790
|
if (c?.value === !1) return;
|
|
787
|
-
|
|
788
|
-
const u =
|
|
789
|
-
if (!(H ||
|
|
791
|
+
S.value.length > 0 && (l.value = !0);
|
|
792
|
+
const u = y?.value?.listContainerRef, p = m?.value?.textInputRef, D = n?.relatedTarget && p?.isEqualNode(n?.relatedTarget), H = n?.relatedTarget && u && u.contains(n?.relatedTarget), de = n?.relatedTarget && u && u.isEqualNode(n?.relatedTarget);
|
|
793
|
+
if (!(H || D)) {
|
|
790
794
|
if (de) {
|
|
791
795
|
ne();
|
|
792
796
|
return;
|
|
@@ -798,33 +802,33 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
798
802
|
Array.isArray(n) || X(), n.length > 0 && typeof n[0] == "object" && ke(n), d.value = n;
|
|
799
803
|
}
|
|
800
804
|
function ke(n) {
|
|
801
|
-
(!o.objectLabelKeyName || o.objectLabelKeyName.length === 0) &&
|
|
805
|
+
(!o.objectLabelKeyName || o.objectLabelKeyName.length === 0) && G();
|
|
802
806
|
const u = o.objectLabelKeyName;
|
|
803
807
|
for (let p = 0; p < n.length; p++)
|
|
804
|
-
(typeof n[p] != "object" || !(u in n[p])) &&
|
|
808
|
+
(typeof n[p] != "object" || !(u in n[p])) && G();
|
|
805
809
|
}
|
|
806
810
|
const ae = {
|
|
807
|
-
openList:
|
|
811
|
+
openList: te,
|
|
808
812
|
unfocus: Ce,
|
|
809
813
|
press: Ie,
|
|
810
814
|
mouseOverList: re,
|
|
811
815
|
getLabel: E,
|
|
812
|
-
updatedSelected:
|
|
816
|
+
updatedSelected: N,
|
|
813
817
|
focusInput: ne,
|
|
814
818
|
closeList: P
|
|
815
819
|
};
|
|
816
|
-
return (n, u) => (
|
|
820
|
+
return (n, u) => (T(), M("div", {
|
|
817
821
|
style: { position: "relative" },
|
|
818
822
|
class: R(n.$attrs.class)
|
|
819
823
|
}, [
|
|
820
|
-
|
|
824
|
+
Z(ye, {
|
|
821
825
|
ref_key: "itemListRef",
|
|
822
|
-
ref:
|
|
826
|
+
ref: y,
|
|
823
827
|
"show-drop-down": c.value,
|
|
824
828
|
filteredListItems: j.value,
|
|
825
829
|
mouseHoveringOnList: q.value,
|
|
826
830
|
focusedIndex: A.value,
|
|
827
|
-
selectedIndex:
|
|
831
|
+
selectedIndex: _.value,
|
|
828
832
|
"max-list-height-p-x": e.maxListHeightPX,
|
|
829
833
|
"list-animation-duration-ms": e.listAnimationDurationMs,
|
|
830
834
|
"parent-methods": ae,
|
|
@@ -832,11 +836,11 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
832
836
|
"onUpdate:blockListChange": u[1] || (u[1] = (p) => l.value = p),
|
|
833
837
|
"total-options-count": t.value,
|
|
834
838
|
onReverseDropDownList: u[2] || (u[2] = (p) => g.value = p),
|
|
835
|
-
enableScrollClose:
|
|
839
|
+
enableScrollClose: J.value,
|
|
836
840
|
"enable-text-filter": s.value
|
|
837
841
|
}, {
|
|
838
842
|
default: be(() => [
|
|
839
|
-
|
|
843
|
+
Z(we, {
|
|
840
844
|
ref_key: "dropDownButtonInput",
|
|
841
845
|
ref: V,
|
|
842
846
|
"parent-methods": ae,
|
|
@@ -846,15 +850,15 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
846
850
|
"reverse-drop-down-list": g.value
|
|
847
851
|
}, {
|
|
848
852
|
default: be(() => [
|
|
849
|
-
|
|
853
|
+
Z(he, {
|
|
850
854
|
ref_key: "dropDownTextInput",
|
|
851
|
-
ref:
|
|
855
|
+
ref: m,
|
|
852
856
|
"enable-text-filter": s.value,
|
|
853
857
|
"show-drop-down": c.value,
|
|
854
858
|
placeholder: ie.value,
|
|
855
859
|
"enable-button-click": k.value,
|
|
856
860
|
"parent-methods": ae,
|
|
857
|
-
"onUpdate:query": u[0] || (u[0] = (p) =>
|
|
861
|
+
"onUpdate:query": u[0] || (u[0] = (p) => S.value = p)
|
|
858
862
|
}, null, 8, ["enable-text-filter", "show-drop-down", "placeholder", "enable-button-click"])
|
|
859
863
|
]),
|
|
860
864
|
_: 1
|
|
@@ -864,7 +868,7 @@ const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
864
868
|
}, 8, ["show-drop-down", "filteredListItems", "mouseHoveringOnList", "focusedIndex", "selectedIndex", "max-list-height-p-x", "list-animation-duration-ms", "blockListChange", "total-options-count", "enableScrollClose", "enable-text-filter"])
|
|
865
869
|
], 2));
|
|
866
870
|
}
|
|
867
|
-
}), lt = /* @__PURE__ */ K(st, [["__scopeId", "data-v-
|
|
871
|
+
}), lt = /* @__PURE__ */ K(st, [["__scopeId", "data-v-c65b5182"]]);
|
|
868
872
|
export {
|
|
869
873
|
lt as default
|
|
870
874
|
};
|