@jblehm/super-list 1.0.29 → 1.0.30
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/ListInputComponents/ItemList.vue.d.ts +0 -8
- package/dist/index.css +1 -1
- package/dist/super-list.js +128 -133
- 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/package.json +1 -1
package/dist/super-list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as p, computed as O, createElementBlock as M, openBlock as T, normalizeClass as R, withKeys as b, createElementVNode as
|
|
1
|
+
import { defineComponent as Y, ref as p, computed as O, createElementBlock as M, openBlock as T, normalizeClass as R, withKeys as b, createElementVNode as N, useTemplateRef as Ee, watch as A, Fragment as ce, createCommentVNode as $, renderList as Se, withModifiers as oe, createBlock as fe, toDisplayString as me, useCssVars as Ae, onMounted as Le, onUnmounted as Fe, renderSlot as xe, createVNode as Z, nextTick as Ne, resolveDynamicComponent as Be, withCtx as be } from "vue";
|
|
2
2
|
import './index.css';class He {
|
|
3
3
|
eventsTypes = ["resize", "load", "scroll", "wheel", "touchmove"];
|
|
4
4
|
config = {
|
|
@@ -8,12 +8,12 @@ import './index.css';class He {
|
|
|
8
8
|
};
|
|
9
9
|
mutationObserver;
|
|
10
10
|
callbackFunction;
|
|
11
|
-
constructor(
|
|
12
|
-
this.targetNode = a, this.callbackFunction = (v) =>
|
|
11
|
+
constructor(s, a = document.body) {
|
|
12
|
+
this.targetNode = a, this.callbackFunction = (v) => s(v), this.mutationObserver = new MutationObserver(() => s());
|
|
13
13
|
}
|
|
14
14
|
observe() {
|
|
15
15
|
this.mutationObserver.observe(this.targetNode, this.config);
|
|
16
|
-
for (const
|
|
16
|
+
for (const s of this.eventsTypes) this.addListener(s);
|
|
17
17
|
this.addResizeListener(), this.addTransitionEndListener();
|
|
18
18
|
}
|
|
19
19
|
pauseMutationObserver() {
|
|
@@ -24,14 +24,14 @@ import './index.css';class He {
|
|
|
24
24
|
}
|
|
25
25
|
unobserve() {
|
|
26
26
|
this.mutationObserver.disconnect();
|
|
27
|
-
for (const
|
|
27
|
+
for (const s of this.eventsTypes) this.removeListener(s);
|
|
28
28
|
this.removeResizeListener(), this.removeTransitionEndListener();
|
|
29
29
|
}
|
|
30
|
-
addListener(
|
|
31
|
-
document.addEventListener(
|
|
30
|
+
addListener(s) {
|
|
31
|
+
document.addEventListener(s, this.callbackFunction, !0);
|
|
32
32
|
}
|
|
33
|
-
removeListener(
|
|
34
|
-
document.removeEventListener(
|
|
33
|
+
removeListener(s) {
|
|
34
|
+
document.removeEventListener(s, this.callbackFunction, !0);
|
|
35
35
|
}
|
|
36
36
|
addTransitionEndListener() {
|
|
37
37
|
this.targetNode.addEventListener("transitionend", this.callbackFunction);
|
|
@@ -46,11 +46,11 @@ import './index.css';class He {
|
|
|
46
46
|
window.removeEventListener("resize", this.callbackFunction);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function Re(e,
|
|
50
|
-
return
|
|
49
|
+
function Re(e, s, a, v) {
|
|
50
|
+
return s != null ? s(e) : e == null ? "" : typeof e == "object" ? e[a] : v ? Pe(e, v) : "" + e;
|
|
51
51
|
}
|
|
52
|
-
function Pe(e,
|
|
53
|
-
return
|
|
52
|
+
function Pe(e, s) {
|
|
53
|
+
return s.find((a) => a.type === e)?.label ?? "";
|
|
54
54
|
}
|
|
55
55
|
class qe {
|
|
56
56
|
constructor() {
|
|
@@ -58,25 +58,25 @@ class qe {
|
|
|
58
58
|
}, this.then = () => {
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
async abortablePromise(
|
|
61
|
+
async abortablePromise(s, a, v) {
|
|
62
62
|
const o = await a();
|
|
63
|
-
if (!
|
|
63
|
+
if (!s.aborted)
|
|
64
64
|
return v(o);
|
|
65
65
|
}
|
|
66
|
-
setFunc(
|
|
67
|
-
this.func =
|
|
66
|
+
setFunc(s) {
|
|
67
|
+
this.func = s;
|
|
68
68
|
}
|
|
69
|
-
setThen(
|
|
70
|
-
this.then =
|
|
69
|
+
setThen(s) {
|
|
70
|
+
this.then = s;
|
|
71
71
|
}
|
|
72
72
|
execute() {
|
|
73
73
|
return this.abortablePromise(this.abortController.signal, this.func, this.then);
|
|
74
74
|
}
|
|
75
|
-
abort(
|
|
76
|
-
this.abortController.abort(
|
|
75
|
+
abort(s) {
|
|
76
|
+
this.abortController.abort(s || "Aborted By Controller."), this.abortController = new AbortController();
|
|
77
77
|
}
|
|
78
|
-
resetAndExecute(
|
|
79
|
-
return this.abort("New Request From Controller."), this.setFunc(
|
|
78
|
+
resetAndExecute(s, a) {
|
|
79
|
+
return this.abort("New Request From Controller."), this.setFunc(s), this.setThen(a), this.execute();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
@@ -108,7 +108,7 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
|
108
108
|
"update:query": null,
|
|
109
109
|
"update:press": null
|
|
110
110
|
},
|
|
111
|
-
setup(e, { expose:
|
|
111
|
+
setup(e, { expose: s, emit: a }) {
|
|
112
112
|
const v = a, o = e, d = p(null);
|
|
113
113
|
function w(h) {
|
|
114
114
|
"sourceCapabilities" in h && h.sourceCapabilities == null ? o.parentMethods.closeList() : o.parentMethods.openList();
|
|
@@ -116,13 +116,13 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
|
116
116
|
function t(h) {
|
|
117
117
|
o.parentMethods.unfocus(h);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function i(h) {
|
|
120
120
|
h?.target?.value != null && v("update:query", h.target.value);
|
|
121
121
|
}
|
|
122
122
|
const c = O(() => {
|
|
123
|
-
const h = d?.value ? d.value.length : 0,
|
|
124
|
-
return h > 0 ? h :
|
|
125
|
-
}), r = O(() => o.enableButtonClick === !0 && o.enableTextFilter === !0 ? "" : "click-through"),
|
|
123
|
+
const h = d?.value ? d.value.length : 0, g = o.placeholder?.length || 0;
|
|
124
|
+
return h > 0 ? h : g > 0 ? g : 5;
|
|
125
|
+
}), r = O(() => o.enableButtonClick === !0 && o.enableTextFilter === !0 ? "" : "click-through"), y = O(() => o.showDropDown && !o.enableTextFilter || !o.showDropDown ? "dark-placeholder-text" : "light-placeholder-text");
|
|
126
126
|
function k() {
|
|
127
127
|
if (d?.value) {
|
|
128
128
|
const h = d.value;
|
|
@@ -132,20 +132,20 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
|
132
132
|
function I() {
|
|
133
133
|
d?.value && d.value.focus();
|
|
134
134
|
}
|
|
135
|
-
return
|
|
135
|
+
return s({ blurInput: k, focusInput: I, textInputRef: d }), (h, g) => (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
|
+
g[0] || (g[0] = b((m) => e.parentMethods.press(m), ["enter"])),
|
|
141
|
+
g[1] || (g[1] = b((m) => e.parentMethods.press(), ["space"])),
|
|
142
|
+
g[2] || (g[2] = b((m) => e.parentMethods.press(m), ["esc"])),
|
|
143
|
+
g[3] || (g[3] = b((m) => e.parentMethods.press(m), ["up"])),
|
|
144
|
+
g[4] || (g[4] = b((m) => e.parentMethods.press(m), ["down"]))
|
|
145
145
|
],
|
|
146
|
-
onFocusin:
|
|
147
|
-
onFocusout:
|
|
148
|
-
onInput:
|
|
146
|
+
onFocusin: g[5] || (g[5] = (m) => w(m)),
|
|
147
|
+
onFocusout: g[6] || (g[6] = (m) => t(m)),
|
|
148
|
+
onInput: g[7] || (g[7] = (m) => i(m)),
|
|
149
149
|
type: "text",
|
|
150
150
|
"aria-autocomplete": "none",
|
|
151
151
|
autocomplete: "off",
|
|
@@ -153,14 +153,14 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
|
153
153
|
size: c.value,
|
|
154
154
|
class: R([[
|
|
155
155
|
r.value,
|
|
156
|
-
|
|
156
|
+
y.value,
|
|
157
157
|
{ "text-filter-disabled": !e.enableTextFilter }
|
|
158
158
|
], "list-filter-text-input"])
|
|
159
159
|
}, null, 42, je));
|
|
160
160
|
}
|
|
161
|
-
}), K = (e,
|
|
161
|
+
}), K = (e, s) => {
|
|
162
162
|
const a = e.__vccOpts || e;
|
|
163
|
-
for (const [v, o] of
|
|
163
|
+
for (const [v, o] of s)
|
|
164
164
|
a[v] = o;
|
|
165
165
|
return a;
|
|
166
166
|
}, he = /* @__PURE__ */ K($e, [["__scopeId", "data-v-acc7ac24"]]), Ke = {}, Ve = {
|
|
@@ -170,9 +170,9 @@ const je = ["tabindex", "placeholder", "size"], $e = /* @__PURE__ */ Y({
|
|
|
170
170
|
"data-slot": "icon",
|
|
171
171
|
viewBox: "0 -16 16 17"
|
|
172
172
|
};
|
|
173
|
-
function ze(e,
|
|
174
|
-
return T(), M("svg", Ve,
|
|
175
|
-
|
|
173
|
+
function ze(e, s) {
|
|
174
|
+
return T(), M("svg", Ve, s[0] || (s[0] = [
|
|
175
|
+
N("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)
|
|
@@ -215,32 +215,32 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
217
|
setup(e) {
|
|
218
|
-
const
|
|
218
|
+
const s = e, a = Ee("items"), v = O(() => {
|
|
219
219
|
if (!a?.value) return null;
|
|
220
|
-
const t = (Array.isArray(a.value) ? a.value : [a.value])[
|
|
220
|
+
const t = (Array.isArray(a.value) ? a.value : [a.value])[s.focusedIndex];
|
|
221
221
|
return t && typeof t == "object" && "scrollIntoView" in t && typeof t.scrollIntoView == "function" ? t : null;
|
|
222
222
|
});
|
|
223
223
|
A(
|
|
224
|
-
() =>
|
|
224
|
+
() => s.showDropDown,
|
|
225
225
|
() => o()
|
|
226
226
|
), A(
|
|
227
|
-
() =>
|
|
227
|
+
() => s.listElementOpenAndVisible,
|
|
228
228
|
() => d()
|
|
229
229
|
), A(
|
|
230
230
|
() => v.value,
|
|
231
231
|
() => d()
|
|
232
232
|
);
|
|
233
233
|
function o() {
|
|
234
|
-
!
|
|
234
|
+
!s.showDropDown || !v?.value?.parentElement?.parentElement || (v.value.parentElement.parentElement.scrollTop = v.value.offsetTop);
|
|
235
235
|
}
|
|
236
236
|
function d() {
|
|
237
237
|
const w = v.value, t = w?.parentElement?.parentElement;
|
|
238
|
-
if (!
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
if (!s.showDropDown || !w || !t) return;
|
|
239
|
+
const i = w.offsetTop - t.scrollTop < 0, c = w.offsetTop + w.offsetHeight - t.scrollTop > t.clientHeight;
|
|
240
|
+
i && (t.scrollTop = w.offsetTop), c && (t.scrollTop = w.offsetTop + w.clientHeight - t.clientHeight);
|
|
241
241
|
}
|
|
242
242
|
return (w, t) => (T(), M(ce, null, [
|
|
243
|
-
(T(!0), M(ce, null, Se(e.filteredListItems, (
|
|
243
|
+
(T(!0), M(ce, null, Se(e.filteredListItems, (i, c) => (T(), M("li", {
|
|
244
244
|
key: c,
|
|
245
245
|
ref_for: !0,
|
|
246
246
|
ref: "items",
|
|
@@ -255,7 +255,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
255
255
|
],
|
|
256
256
|
onFocusout: t[5] || (t[5] = (r) => e.parentMethods.unfocus(r)),
|
|
257
257
|
tabindex: "-1",
|
|
258
|
-
onMousedown: oe((r) => e.parentMethods.updatedSelected(
|
|
258
|
+
onMousedown: oe((r) => e.parentMethods.updatedSelected(i), ["left"]),
|
|
259
259
|
class: R([
|
|
260
260
|
{ "list-option-selected": e.selectedIndex === c },
|
|
261
261
|
{
|
|
@@ -264,7 +264,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
264
264
|
"list-option"
|
|
265
265
|
])
|
|
266
266
|
}, [
|
|
267
|
-
|
|
267
|
+
N("span", Je, me(e.parentMethods.getLabel(i)), 1),
|
|
268
268
|
e.selectedIndex === c ? (T(), fe(Xe, {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "list-item-icon",
|
|
@@ -274,38 +274,38 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
274
274
|
e.filteredListItems.length === 0 ? (T(), M("li", {
|
|
275
275
|
key: 0,
|
|
276
276
|
onKeyup: [
|
|
277
|
-
t[6] || (t[6] = b((
|
|
278
|
-
t[7] || (t[7] = b((
|
|
279
|
-
t[8] || (t[8] = b((
|
|
277
|
+
t[6] || (t[6] = b((i) => e.parentMethods.press(i), ["enter"])),
|
|
278
|
+
t[7] || (t[7] = b((i) => e.parentMethods.press(i), ["space"])),
|
|
279
|
+
t[8] || (t[8] = b((i) => e.parentMethods.press(i), ["esc"]))
|
|
280
280
|
],
|
|
281
281
|
onKeydown: [
|
|
282
|
-
t[9] || (t[9] = b((
|
|
283
|
-
t[10] || (t[10] = b((
|
|
282
|
+
t[9] || (t[9] = b((i) => e.parentMethods.press(i), ["up"])),
|
|
283
|
+
t[10] || (t[10] = b((i) => e.parentMethods.press(i), ["down"]))
|
|
284
284
|
],
|
|
285
|
-
onFocusout: t[11] || (t[11] = (
|
|
286
|
-
onMousedown: t[12] || (t[12] = oe((
|
|
285
|
+
onFocusout: t[11] || (t[11] = (i) => e.parentMethods.unfocus(i)),
|
|
286
|
+
onMousedown: t[12] || (t[12] = oe((i) => e.parentMethods.closeList(i), ["left"])),
|
|
287
287
|
tabindex: "-1",
|
|
288
288
|
class: "list-option-message"
|
|
289
289
|
}, t[20] || (t[20] = [
|
|
290
|
-
|
|
290
|
+
N("span", { class: "list-item-span" }, "No Items To Display.", -1)
|
|
291
291
|
]), 32)) : $("", !0),
|
|
292
292
|
e.totalOptionsCount && e.totalOptionsCount > (e.filteredListItems?.length || 0) ? (T(), M("li", {
|
|
293
293
|
key: 1,
|
|
294
294
|
onKeyup: [
|
|
295
|
-
t[13] || (t[13] = b((
|
|
296
|
-
t[14] || (t[14] = b((
|
|
297
|
-
t[15] || (t[15] = b((
|
|
295
|
+
t[13] || (t[13] = b((i) => e.parentMethods.press(i), ["enter"])),
|
|
296
|
+
t[14] || (t[14] = b((i) => e.parentMethods.press(i), ["space"])),
|
|
297
|
+
t[15] || (t[15] = b((i) => e.parentMethods.press(i), ["esc"]))
|
|
298
298
|
],
|
|
299
299
|
onKeydown: [
|
|
300
|
-
t[16] || (t[16] = b((
|
|
301
|
-
t[17] || (t[17] = b((
|
|
300
|
+
t[16] || (t[16] = b((i) => e.parentMethods.press(i), ["up"])),
|
|
301
|
+
t[17] || (t[17] = b((i) => e.parentMethods.press(i), ["down"]))
|
|
302
302
|
],
|
|
303
|
-
onFocusout: t[18] || (t[18] = (
|
|
304
|
-
onMousedown: t[19] || (t[19] = oe((
|
|
303
|
+
onFocusout: t[18] || (t[18] = (i) => e.parentMethods.unfocus(i)),
|
|
304
|
+
onMousedown: t[19] || (t[19] = oe((i) => e.parentMethods.closeList(i), ["left"])),
|
|
305
305
|
tabindex: "-1",
|
|
306
306
|
class: "list-option-message"
|
|
307
307
|
}, [
|
|
308
|
-
|
|
308
|
+
N("span", We, " +" + me(e.totalOptionsCount - e.filteredListItems?.length || 0) + " More Items...", 1)
|
|
309
309
|
], 32)) : $("", !0)
|
|
310
310
|
], 64));
|
|
311
311
|
}
|
|
@@ -355,41 +355,37 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
355
355
|
enableScrollClose: {
|
|
356
356
|
type: Boolean,
|
|
357
357
|
default: !0
|
|
358
|
-
},
|
|
359
|
-
enableTextFilter: {
|
|
360
|
-
type: Boolean,
|
|
361
|
-
required: !0
|
|
362
358
|
}
|
|
363
359
|
},
|
|
364
360
|
emits: ["reverseDropDownList"],
|
|
365
|
-
setup(e, { expose:
|
|
361
|
+
setup(e, { expose: s, emit: a }) {
|
|
366
362
|
Ae((u) => ({
|
|
367
|
-
"
|
|
368
|
-
"
|
|
369
|
-
"
|
|
370
|
-
|
|
371
|
-
"
|
|
363
|
+
"8d801350": k.value,
|
|
364
|
+
"2724698a": F.value,
|
|
365
|
+
"27246d4b": se.value,
|
|
366
|
+
ffcaa9a8: q.value,
|
|
367
|
+
"414dd276": G.value
|
|
372
368
|
}));
|
|
373
|
-
const v = a, o = e, d = p(null), w = p(null), t = p(null),
|
|
369
|
+
const v = a, o = e, d = p(null), w = p(null), t = p(null), i = p(0), c = p(0), r = p(0), y = p(0), k = p("0px"), I = p(!1), h = p([]), g = p(0), m = O(() => !I.value || window?.innerHeight == null ? !1 : X() && le()), V = O(() => o.maxListHeightPX >= g.value);
|
|
374
370
|
A(
|
|
375
371
|
() => m.value,
|
|
376
372
|
(u) => v("reverseDropDownList", u),
|
|
377
373
|
{ immediate: !0 }
|
|
378
374
|
);
|
|
379
|
-
const F = O(() =>
|
|
380
|
-
|
|
375
|
+
const F = O(() => i.value + "px"), se = O(() => y.value + "px");
|
|
376
|
+
s({ listContainerRef: t });
|
|
381
377
|
const P = (u) => {
|
|
382
378
|
u?.key && u.key === " " && u.preventDefault();
|
|
383
379
|
}, ie = (u) => {
|
|
384
380
|
const L = t?.value, x = u.target;
|
|
385
381
|
(!(L && x && L.contains(x)) || L.isEqualNode(x)) && o.parentMethods.focusInput();
|
|
386
382
|
};
|
|
387
|
-
function
|
|
383
|
+
function B() {
|
|
388
384
|
return w?.value ? (w?.value).clientHeight : 0;
|
|
389
385
|
}
|
|
390
386
|
function E() {
|
|
391
|
-
if (!I.value ||
|
|
392
|
-
const u =
|
|
387
|
+
if (!I.value || B() === 0) return o.maxListHeightPX;
|
|
388
|
+
const u = B() === 0 ? o.maxListHeightPX : +B();
|
|
393
389
|
return o.maxListHeightPX && o.maxListHeightPX > u ? u : o.maxListHeightPX;
|
|
394
390
|
}
|
|
395
391
|
function X() {
|
|
@@ -409,7 +405,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
409
405
|
let C = setTimeout(() => {
|
|
410
406
|
}, 0), S = null;
|
|
411
407
|
function j() {
|
|
412
|
-
|
|
408
|
+
g.value = B(), clearTimeout(C), S && S.observe(), I.value = !0, z(void 0);
|
|
413
409
|
}
|
|
414
410
|
function re() {
|
|
415
411
|
clearTimeout(C), C = setTimeout(() => {
|
|
@@ -424,7 +420,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
424
420
|
{ immediate: !0 }
|
|
425
421
|
);
|
|
426
422
|
function z(u) {
|
|
427
|
-
U(),
|
|
423
|
+
U(), Ne(() => U()), ee(u);
|
|
428
424
|
}
|
|
429
425
|
function ee(u) {
|
|
430
426
|
if (!o.enableScrollClose || !o.showDropDown || typeof t?.value?.contains != "function" || u?.target?.nodeType == null || te(u)) return;
|
|
@@ -445,8 +441,8 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
445
441
|
}
|
|
446
442
|
function W() {
|
|
447
443
|
if (d?.value == null || t?.value == null) return;
|
|
448
|
-
const u = ne().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x =
|
|
449
|
-
m.value ?
|
|
444
|
+
const u = ne().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x = y.value, Q = i.value;
|
|
445
|
+
m.value ? y.value = x - (u.top - L.bottom) : y.value = x - (L.top - u.bottom), i.value = Q - (L.left - u.left);
|
|
450
446
|
}
|
|
451
447
|
function ue() {
|
|
452
448
|
return (d?.value).getElementsByTagName("button")[0];
|
|
@@ -459,14 +455,14 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
459
455
|
}), Fe(() => {
|
|
460
456
|
S?.unobserve();
|
|
461
457
|
}), (u, L) => (T(), M(ce, null, [
|
|
462
|
-
|
|
458
|
+
N("div", {
|
|
463
459
|
ref_key: "dropDownButtonContainer",
|
|
464
460
|
ref: d,
|
|
465
461
|
class: "super-list-button-container"
|
|
466
462
|
}, [
|
|
467
463
|
xe(u.$slots, "default", {}, void 0, !0)
|
|
468
464
|
], 512),
|
|
469
|
-
|
|
465
|
+
N("div", {
|
|
470
466
|
id: "super-list-select-list",
|
|
471
467
|
ref_key: "listContainerRef",
|
|
472
468
|
ref: t,
|
|
@@ -483,7 +479,7 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
483
479
|
onKeydown: L[1] || (L[1] = b((x) => P(x), ["space"])),
|
|
484
480
|
onMouseup: L[2] || (L[2] = oe((x) => ie(x), ["left"]))
|
|
485
481
|
}, [
|
|
486
|
-
|
|
482
|
+
N("ul", {
|
|
487
483
|
tabindex: "-1",
|
|
488
484
|
ref_key: "dropDownListUL",
|
|
489
485
|
ref: w,
|
|
@@ -503,22 +499,22 @@ const Xe = /* @__PURE__ */ K(Ke, [["render", ze]]), Ue = ["onMousedown"], Je = {
|
|
|
503
499
|
], 34)
|
|
504
500
|
], 64));
|
|
505
501
|
}
|
|
506
|
-
}),
|
|
502
|
+
}), ge = /* @__PURE__ */ K(Ye, [["__scopeId", "data-v-e58cd48c"]]), Ge = {}, _e = {
|
|
507
503
|
xmlns: "http://www.w3.org/2000/svg",
|
|
508
504
|
fill: "currentColor",
|
|
509
505
|
"aria-hidden": "true",
|
|
510
506
|
"data-slot": "icon",
|
|
511
507
|
viewBox: "0 0 12 6"
|
|
512
508
|
};
|
|
513
|
-
function et(e,
|
|
514
|
-
return T(), M("svg", _e,
|
|
515
|
-
|
|
509
|
+
function et(e, s) {
|
|
510
|
+
return T(), M("svg", _e, s[0] || (s[0] = [
|
|
511
|
+
N("path", {
|
|
516
512
|
"shape-rendering": "geometricPrecision",
|
|
517
513
|
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
514
|
}, null, -1)
|
|
519
515
|
]));
|
|
520
516
|
}
|
|
521
|
-
const
|
|
517
|
+
const ye = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
522
518
|
key: 2,
|
|
523
519
|
class: "list-button-icon custom-icon"
|
|
524
520
|
}, ot = /* @__PURE__ */ Y({
|
|
@@ -546,7 +542,7 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
546
542
|
required: !0
|
|
547
543
|
}
|
|
548
544
|
},
|
|
549
|
-
setup(e, { expose:
|
|
545
|
+
setup(e, { expose: s }) {
|
|
550
546
|
const a = e, v = p(null);
|
|
551
547
|
function o() {
|
|
552
548
|
a.enableTextFilter || a.parentMethods.openList();
|
|
@@ -560,46 +556,46 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
560
556
|
function t() {
|
|
561
557
|
v?.value && v.value.blur();
|
|
562
558
|
}
|
|
563
|
-
function
|
|
559
|
+
function i() {
|
|
564
560
|
v?.value && v.value.focus();
|
|
565
561
|
}
|
|
566
|
-
return
|
|
562
|
+
return s({ blurInput: t, focusInput: i, buttonRef: v }), (c, r) => (T(), M("button", {
|
|
567
563
|
ref_key: "buttonRef",
|
|
568
564
|
ref: v,
|
|
569
565
|
tabindex: e.enableTextFilter ? -1 : 0,
|
|
570
566
|
onKeydown: [
|
|
571
|
-
r[0] || (r[0] = b((
|
|
572
|
-
r[1] || (r[1] = b((
|
|
573
|
-
r[2] || (r[2] = b((
|
|
574
|
-
r[3] || (r[3] = b((
|
|
575
|
-
r[4] || (r[4] = b((
|
|
567
|
+
r[0] || (r[0] = b((y) => d(y), ["enter"])),
|
|
568
|
+
r[1] || (r[1] = b((y) => w(y), ["space"])),
|
|
569
|
+
r[2] || (r[2] = b((y) => e.parentMethods.press(y), ["esc"])),
|
|
570
|
+
r[3] || (r[3] = b((y) => e.parentMethods.press(y), ["up"])),
|
|
571
|
+
r[4] || (r[4] = b((y) => e.parentMethods.press(y), ["down"]))
|
|
576
572
|
],
|
|
577
|
-
onFocusout: r[5] || (r[5] = (
|
|
578
|
-
onClick: r[6] || (r[6] = (
|
|
573
|
+
onFocusout: r[5] || (r[5] = (y) => e.parentMethods.unfocus(y)),
|
|
574
|
+
onClick: r[6] || (r[6] = (y) => o()),
|
|
579
575
|
type: "button",
|
|
580
576
|
class: R([[{ "click-through": a.enableTextFilter || a.showDropDown }], "list-button"])
|
|
581
577
|
}, [
|
|
582
578
|
xe(c.$slots, "default", {}, void 0, !0),
|
|
583
|
-
|
|
579
|
+
N("span", {
|
|
584
580
|
class: R(["list-button-icon-div", { "bigger-gap": a.showDropDown }])
|
|
585
581
|
}, [
|
|
586
582
|
e.customIcon ? $("", !0) : (T(), M("span", {
|
|
587
583
|
key: 0,
|
|
588
584
|
class: R(["list-button-icon", [{ "rotate-180": !a.showDropDown }]])
|
|
589
585
|
}, [
|
|
590
|
-
Z(
|
|
586
|
+
Z(ye, { "aria-hidden": "true" })
|
|
591
587
|
], 2)),
|
|
592
588
|
e.customIcon ? $("", !0) : (T(), M("span", {
|
|
593
589
|
key: 1,
|
|
594
590
|
class: R(["list-button-icon", [{ "rotate-180": a.showDropDown }]])
|
|
595
591
|
}, [
|
|
596
|
-
e.customIcon == null ? (T(), fe(
|
|
592
|
+
e.customIcon == null ? (T(), fe(ye, {
|
|
597
593
|
key: 0,
|
|
598
594
|
"aria-hidden": "true"
|
|
599
595
|
})) : $("", !0)
|
|
600
596
|
], 2)),
|
|
601
597
|
e.customIcon ? (T(), M("span", nt, [
|
|
602
|
-
(T(), fe(
|
|
598
|
+
(T(), fe(Be(e.customIcon), { "aria-hidden": "true" }))
|
|
603
599
|
])) : $("", !0)
|
|
604
600
|
], 2)
|
|
605
601
|
], 42, tt));
|
|
@@ -660,8 +656,8 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
660
656
|
}
|
|
661
657
|
},
|
|
662
658
|
emits: { "update:selected": null },
|
|
663
|
-
setup(e, { expose:
|
|
664
|
-
const v = a, o = e, d = p([]), w = new qe(), t = p(0),
|
|
659
|
+
setup(e, { expose: s, emit: a }) {
|
|
660
|
+
const v = a, o = e, d = p([]), w = new qe(), t = p(0), i = O(() => o.forceTextFilterVisibilityTo != null ? o.forceTextFilterVisibilityTo : t.value > o.maxListOptions), c = p(!1), r = p(!1), y = p(!1), k = p(!0), I = p(!1), h = p(!1), g = p(ge), m = p(he), V = p(we), F = p("");
|
|
665
661
|
A(
|
|
666
662
|
() => F.value,
|
|
667
663
|
(n, l) => {
|
|
@@ -669,10 +665,10 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
669
665
|
}
|
|
670
666
|
);
|
|
671
667
|
const se = () => {
|
|
672
|
-
|
|
668
|
+
i.value && m?.value?.blurInput();
|
|
673
669
|
}, P = () => {
|
|
674
670
|
clearTimeout(W), se(), F.value = "", c.value = !1, k.value = !0;
|
|
675
|
-
}, ie = O(() => h?.value === !0 ? "Error loading data" : I?.value === !0 ? "Loading..." : E(o.selected)),
|
|
671
|
+
}, ie = O(() => h?.value === !0 ? "Error loading data" : I?.value === !0 ? "Loading..." : E(o.selected)), B = (n) => {
|
|
676
672
|
n && v("update:selected", n), P();
|
|
677
673
|
}, E = (n) => Re(
|
|
678
674
|
n,
|
|
@@ -741,7 +737,7 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
741
737
|
I.value || (c.value || (r.value = !1, z(), U(), c.value = !0), q.value = !1, k.value = !1);
|
|
742
738
|
}, U = () => {
|
|
743
739
|
const n = window?.innerWidth != null && window.innerWidth < 640, l = screen?.width != null && screen.width < 640, f = m.value.textInputRef;
|
|
744
|
-
(n || l) &&
|
|
740
|
+
(n || l) && i.value && (ue(), o.scrollTextInputToTopOnMobile && f?.scrollIntoView({ block: "start", inline: "center" }));
|
|
745
741
|
}, J = p(!0);
|
|
746
742
|
let W = setTimeout(() => {
|
|
747
743
|
}, 0);
|
|
@@ -760,14 +756,14 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
760
756
|
}, 100);
|
|
761
757
|
}
|
|
762
758
|
const ne = () => {
|
|
763
|
-
|
|
759
|
+
i?.value == !0 ? m.value.focusInput() : V?.value?.focusInput && V?.value?.focusInput();
|
|
764
760
|
};
|
|
765
761
|
async function u() {
|
|
766
762
|
typeof o.options == "function" ? await x(F.value ? F.value : void 0, !0) : (ve(o.options), t.value = d.value.length), L();
|
|
767
763
|
}
|
|
768
|
-
|
|
764
|
+
s({ initializeOptions: u, getLabel: E });
|
|
769
765
|
function L() {
|
|
770
|
-
ee() == -1 && d.value && !!d.value[0] &&
|
|
766
|
+
ee() == -1 && d.value && !!d.value[0] && B(d.value[0]);
|
|
771
767
|
}
|
|
772
768
|
async function x(n, l = !0) {
|
|
773
769
|
I.value = l;
|
|
@@ -790,7 +786,7 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
790
786
|
const l = n.key || n.code;
|
|
791
787
|
(l === "Tab" || l === "Escape") && P(), l === "ArrowDown" && Oe(n), l === "ArrowUp" && Me(n), (l === "Enter" || l === " ") && De(), n.preventDefault(), n.stopPropagation();
|
|
792
788
|
}, De = () => {
|
|
793
|
-
j.value.length > 0 ? (r.value = !0,
|
|
789
|
+
j.value.length > 0 ? (r.value = !0, B(j.value[C.value])) : P();
|
|
794
790
|
}, Oe = (n) => {
|
|
795
791
|
k.value = !0, C.value < j.value.length - 1 && (n.preventDefault(), q.value = !1, C.value++, pe()?.focus());
|
|
796
792
|
}, Me = (n) => {
|
|
@@ -798,7 +794,7 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
798
794
|
}, Ce = (n) => {
|
|
799
795
|
if (c?.value === !1) return;
|
|
800
796
|
F.value.length > 0 && (r.value = !0);
|
|
801
|
-
const l =
|
|
797
|
+
const l = g?.value?.listContainerRef, f = m?.value?.textInputRef, D = n?.relatedTarget && f?.isEqualNode(n?.relatedTarget), H = n?.relatedTarget && l && l.contains(n?.relatedTarget), de = n?.relatedTarget && l && l.isEqualNode(n?.relatedTarget);
|
|
802
798
|
if (!(H || D)) {
|
|
803
799
|
if (de) {
|
|
804
800
|
ne();
|
|
@@ -822,7 +818,7 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
822
818
|
press: Ie,
|
|
823
819
|
mouseOverList: re,
|
|
824
820
|
getLabel: E,
|
|
825
|
-
updatedSelected:
|
|
821
|
+
updatedSelected: B,
|
|
826
822
|
focusInput: ne,
|
|
827
823
|
closeList: P
|
|
828
824
|
};
|
|
@@ -830,9 +826,9 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
830
826
|
style: { position: "relative" },
|
|
831
827
|
class: R(n.$attrs.class)
|
|
832
828
|
}, [
|
|
833
|
-
Z(
|
|
829
|
+
Z(ge, {
|
|
834
830
|
ref_key: "itemListRef",
|
|
835
|
-
ref:
|
|
831
|
+
ref: g,
|
|
836
832
|
"show-drop-down": c.value,
|
|
837
833
|
filteredListItems: j.value,
|
|
838
834
|
mouseHoveringOnList: q.value,
|
|
@@ -844,9 +840,8 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
844
840
|
blockListChange: r.value,
|
|
845
841
|
"onUpdate:blockListChange": l[1] || (l[1] = (f) => r.value = f),
|
|
846
842
|
"total-options-count": t.value,
|
|
847
|
-
onReverseDropDownList: l[2] || (l[2] = (f) =>
|
|
848
|
-
enableScrollClose: J.value
|
|
849
|
-
"enable-text-filter": s.value
|
|
843
|
+
onReverseDropDownList: l[2] || (l[2] = (f) => y.value = f),
|
|
844
|
+
enableScrollClose: J.value
|
|
850
845
|
}, {
|
|
851
846
|
default: be(() => [
|
|
852
847
|
Z(we, {
|
|
@@ -854,15 +849,15 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
854
849
|
ref: V,
|
|
855
850
|
"parent-methods": ae,
|
|
856
851
|
"show-drop-down": c.value,
|
|
857
|
-
"enable-text-filter":
|
|
852
|
+
"enable-text-filter": i.value,
|
|
858
853
|
"custom-icon": e.customIcon,
|
|
859
|
-
"reverse-drop-down-list":
|
|
854
|
+
"reverse-drop-down-list": y.value
|
|
860
855
|
}, {
|
|
861
856
|
default: be(() => [
|
|
862
857
|
Z(he, {
|
|
863
858
|
ref_key: "dropDownTextInput",
|
|
864
859
|
ref: m,
|
|
865
|
-
"enable-text-filter":
|
|
860
|
+
"enable-text-filter": i.value,
|
|
866
861
|
"show-drop-down": c.value,
|
|
867
862
|
placeholder: ie.value,
|
|
868
863
|
"enable-button-click": k.value,
|
|
@@ -874,10 +869,10 @@ const ge = /* @__PURE__ */ K(Ge, [["render", et]]), tt = ["tabindex"], nt = {
|
|
|
874
869
|
}, 8, ["show-drop-down", "enable-text-filter", "custom-icon", "reverse-drop-down-list"])
|
|
875
870
|
]),
|
|
876
871
|
_: 1
|
|
877
|
-
}, 8, ["show-drop-down", "filteredListItems", "mouseHoveringOnList", "focusedIndex", "selectedIndex", "max-list-height-p-x", "list-animation-duration-ms", "blockListChange", "total-options-count", "enableScrollClose"
|
|
872
|
+
}, 8, ["show-drop-down", "filteredListItems", "mouseHoveringOnList", "focusedIndex", "selectedIndex", "max-list-height-p-x", "list-animation-duration-ms", "blockListChange", "total-options-count", "enableScrollClose"])
|
|
878
873
|
], 2));
|
|
879
874
|
}
|
|
880
|
-
}), lt = /* @__PURE__ */ K(st, [["__scopeId", "data-v-
|
|
875
|
+
}), lt = /* @__PURE__ */ K(st, [["__scopeId", "data-v-6c6e7e6a"]]);
|
|
881
876
|
export {
|
|
882
877
|
lt as default
|
|
883
878
|
};
|