@jblehm/super-list 1.0.33 → 1.0.35
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 +2 -1
- package/dist/demo-app.vue.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/super-list.js +291 -288
- 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 +5 -14
package/dist/super-list.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as G, ref as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as G, ref as p, computed as O, createElementBlock as M, openBlock as T, withModifiers as Z, createElementVNode as N, normalizeClass as q, withKeys as b, useTemplateRef as ke, watch as F, Fragment as ce, createCommentVNode as K, renderList as Ee, createBlock as fe, toDisplayString as ve, useCssVars as Se, onMounted as we, onUnmounted as Ae, renderSlot as Le, createVNode as Y, nextTick as Fe, resolveDynamicComponent as Ne, withCtx as me } from "vue";
|
|
2
|
+
class Be {
|
|
3
3
|
eventsTypes = ["resize", "load", "scroll", "wheel", "touchmove"];
|
|
4
4
|
config = {
|
|
5
5
|
attributes: !0,
|
|
@@ -8,12 +8,12 @@ import './index.css';class Be {
|
|
|
8
8
|
};
|
|
9
9
|
mutationObserver;
|
|
10
10
|
callbackFunction;
|
|
11
|
-
constructor(
|
|
12
|
-
this.targetNode =
|
|
11
|
+
constructor(i, d = document.body) {
|
|
12
|
+
this.targetNode = d, this.callbackFunction = (m) => i(m), this.mutationObserver = new MutationObserver(() => i());
|
|
13
13
|
}
|
|
14
14
|
observe() {
|
|
15
15
|
this.mutationObserver.observe(this.targetNode, this.config);
|
|
16
|
-
for (const
|
|
16
|
+
for (const i of this.eventsTypes) this.addListener(i);
|
|
17
17
|
this.addResizeListener(), this.addTransitionEndListener();
|
|
18
18
|
}
|
|
19
19
|
pauseMutationObserver() {
|
|
@@ -24,14 +24,14 @@ import './index.css';class Be {
|
|
|
24
24
|
}
|
|
25
25
|
unobserve() {
|
|
26
26
|
this.mutationObserver.disconnect();
|
|
27
|
-
for (const
|
|
27
|
+
for (const i of this.eventsTypes) this.removeListener(i);
|
|
28
28
|
this.removeResizeListener(), this.removeTransitionEndListener();
|
|
29
29
|
}
|
|
30
|
-
addListener(
|
|
31
|
-
document.addEventListener(
|
|
30
|
+
addListener(i) {
|
|
31
|
+
document.addEventListener(i, this.callbackFunction, !0);
|
|
32
32
|
}
|
|
33
|
-
removeListener(
|
|
34
|
-
document.removeEventListener(
|
|
33
|
+
removeListener(i) {
|
|
34
|
+
document.removeEventListener(i, this.callbackFunction, !0);
|
|
35
35
|
}
|
|
36
36
|
addTransitionEndListener() {
|
|
37
37
|
this.targetNode.addEventListener("transitionend", this.callbackFunction);
|
|
@@ -46,37 +46,37 @@ import './index.css';class Be {
|
|
|
46
46
|
window.removeEventListener("resize", this.callbackFunction);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function He(e,
|
|
50
|
-
return
|
|
49
|
+
function He(e, i, d, m) {
|
|
50
|
+
return i != null ? i(e) : e == null ? "" : typeof e == "object" ? e[d] : m ? Pe(e, m) : "" + e;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
52
|
+
function Pe(e, i) {
|
|
53
|
+
return i.find((d) => d.type === e)?.label ?? "";
|
|
54
54
|
}
|
|
55
|
-
class
|
|
55
|
+
class Re {
|
|
56
56
|
constructor() {
|
|
57
57
|
this.abortController = new AbortController(), this.func = () => {
|
|
58
58
|
}, this.then = () => {
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
async abortablePromise(
|
|
62
|
-
const o = await
|
|
63
|
-
if (!
|
|
64
|
-
return
|
|
61
|
+
async abortablePromise(i, d, m) {
|
|
62
|
+
const o = await d();
|
|
63
|
+
if (!i.aborted)
|
|
64
|
+
return m(o);
|
|
65
65
|
}
|
|
66
|
-
setFunc(
|
|
67
|
-
this.func =
|
|
66
|
+
setFunc(i) {
|
|
67
|
+
this.func = i;
|
|
68
68
|
}
|
|
69
|
-
setThen(
|
|
70
|
-
this.then =
|
|
69
|
+
setThen(i) {
|
|
70
|
+
this.then = i;
|
|
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(i) {
|
|
76
|
+
this.abortController.abort(i || "Aborted By Controller."), this.abortController = new AbortController();
|
|
77
77
|
}
|
|
78
|
-
resetAndExecute(
|
|
79
|
-
return this.abort("New Request From Controller."), this.setFunc(
|
|
78
|
+
resetAndExecute(i, d) {
|
|
79
|
+
return this.abort("New Request From Controller."), this.setFunc(i), this.setThen(d), this.execute();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const qe = ["tabindex", "placeholder", "size"], je = /* @__PURE__ */ G({
|
|
@@ -108,83 +108,86 @@ const qe = ["tabindex", "placeholder", "size"], je = /* @__PURE__ */ G({
|
|
|
108
108
|
"update:query": null,
|
|
109
109
|
"update:press": null
|
|
110
110
|
},
|
|
111
|
-
setup(e, { expose:
|
|
112
|
-
const
|
|
113
|
-
function w(
|
|
114
|
-
"sourceCapabilities" in
|
|
115
|
-
}
|
|
116
|
-
function t(
|
|
117
|
-
o.parentMethods.unfocus(
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
111
|
+
setup(e, { expose: i, emit: d }) {
|
|
112
|
+
const m = d, o = e, v = p(null);
|
|
113
|
+
function w(g) {
|
|
114
|
+
"sourceCapabilities" in g && g.sourceCapabilities == null ? o.parentMethods.closeList() : o.parentMethods.openList();
|
|
115
|
+
}
|
|
116
|
+
function t(g) {
|
|
117
|
+
o.parentMethods.unfocus(g);
|
|
118
|
+
}
|
|
119
|
+
let s = "";
|
|
120
|
+
function c(g) {
|
|
121
|
+
g?.target?.value != null && g?.target?.value !== s && m("update:query", g.target.value), s = g?.target?.value ?? "";
|
|
122
|
+
}
|
|
123
|
+
const r = O(() => {
|
|
124
|
+
const g = v?.value ? v.value.length : 0, a = o.placeholder?.length || 0;
|
|
125
|
+
return g > 0 ? g : a > 0 ? a : 5;
|
|
126
|
+
}), y = O(() => o.enableButtonClick === !0 && o.enableTextFilter === !0 ? "" : "click-through"), k = O(() => o.showDropDown && !o.enableTextFilter || !o.showDropDown ? "dark-placeholder-text" : "light-placeholder-text");
|
|
127
|
+
function I() {
|
|
128
|
+
if (v?.value) {
|
|
129
|
+
const g = v.value;
|
|
130
|
+
g.blur(), g.value = "";
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
133
|
+
function E() {
|
|
134
|
+
v?.value && v.value.focus();
|
|
134
135
|
}
|
|
135
|
-
return
|
|
136
|
-
onSubmit:
|
|
136
|
+
return i({ blurInput: I, focusInput: E, textInputRef: v }), (g, a) => (T(), M("form", {
|
|
137
|
+
onSubmit: a[10] || (a[10] = Z(() => {
|
|
137
138
|
}, ["prevent"])),
|
|
138
139
|
style: { display: "contents !important" }
|
|
139
140
|
}, [
|
|
140
|
-
|
|
141
|
+
N("input", {
|
|
141
142
|
ref_key: "textInputRef",
|
|
142
|
-
ref:
|
|
143
|
+
ref: v,
|
|
143
144
|
tabindex: e.enableTextFilter ? 0 : -1,
|
|
144
145
|
onKeydown: [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
a[0] || (a[0] = b((h) => e.parentMethods.press(h), ["enter"])),
|
|
147
|
+
a[1] || (a[1] = b((h) => e.parentMethods.press(), ["space"])),
|
|
148
|
+
a[2] || (a[2] = b((h) => e.parentMethods.press(h), ["esc"])),
|
|
149
|
+
a[3] || (a[3] = b((h) => e.parentMethods.press(h), ["up"])),
|
|
150
|
+
a[4] || (a[4] = b((h) => e.parentMethods.press(h), ["down"]))
|
|
150
151
|
],
|
|
151
|
-
onFocusin:
|
|
152
|
-
onFocusout:
|
|
153
|
-
onInput:
|
|
152
|
+
onFocusin: a[5] || (a[5] = (h) => w(h)),
|
|
153
|
+
onFocusout: a[6] || (a[6] = (h) => t(h)),
|
|
154
|
+
onInput: a[7] || (a[7] = (h) => c(h)),
|
|
155
|
+
onChange: a[8] || (a[8] = (h) => c(h)),
|
|
156
|
+
onPaste: a[9] || (a[9] = (h) => c(h)),
|
|
154
157
|
type: "text",
|
|
155
158
|
"aria-autocomplete": "none",
|
|
156
159
|
autocomplete: "off",
|
|
157
160
|
placeholder: e.placeholder,
|
|
158
|
-
size:
|
|
159
|
-
class:
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
size: r.value,
|
|
162
|
+
class: q([[
|
|
163
|
+
y.value,
|
|
164
|
+
k.value,
|
|
162
165
|
{ "text-filter-disabled": !e.enableTextFilter }
|
|
163
166
|
], "list-filter-text-input"])
|
|
164
167
|
}, null, 42, qe)
|
|
165
168
|
], 32));
|
|
166
169
|
}
|
|
167
|
-
}),
|
|
168
|
-
const
|
|
169
|
-
for (const [
|
|
170
|
-
|
|
171
|
-
return
|
|
172
|
-
}, be = /* @__PURE__ */
|
|
170
|
+
}), V = (e, i) => {
|
|
171
|
+
const d = e.__vccOpts || e;
|
|
172
|
+
for (const [m, o] of i)
|
|
173
|
+
d[m] = o;
|
|
174
|
+
return d;
|
|
175
|
+
}, be = /* @__PURE__ */ V(je, [["__scopeId", "data-v-6b9f6134"]]), $e = {}, Ke = {
|
|
173
176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
174
177
|
fill: "currentColor",
|
|
175
178
|
"aria-hidden": "true",
|
|
176
179
|
"data-slot": "icon",
|
|
177
180
|
viewBox: "0 -16 16 17"
|
|
178
181
|
};
|
|
179
|
-
function Ve(e,
|
|
180
|
-
return T(), M("svg", Ke,
|
|
181
|
-
|
|
182
|
+
function Ve(e, i) {
|
|
183
|
+
return T(), M("svg", Ke, i[0] || (i[0] = [
|
|
184
|
+
N("path", {
|
|
182
185
|
"shape-rendering": "geometricPrecision",
|
|
183
186
|
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"
|
|
184
187
|
}, null, -1)
|
|
185
188
|
]));
|
|
186
189
|
}
|
|
187
|
-
const ze = /* @__PURE__ */
|
|
190
|
+
const ze = /* @__PURE__ */ V($e, [["render", Ve]]), Xe = ["onMousedown"], Ue = { class: "list-item-span" }, Je = { class: "list-item-span" }, We = /* @__PURE__ */ G({
|
|
188
191
|
__name: "ListItem",
|
|
189
192
|
props: {
|
|
190
193
|
mouseHoveringOnList: {
|
|
@@ -221,101 +224,101 @@ const ze = /* @__PURE__ */ K($e, [["render", Ve]]), Xe = ["onMousedown"], Ue = {
|
|
|
221
224
|
}
|
|
222
225
|
},
|
|
223
226
|
setup(e) {
|
|
224
|
-
const
|
|
225
|
-
if (!
|
|
226
|
-
const t = (Array.isArray(
|
|
227
|
+
const i = e, d = ke("items"), m = O(() => {
|
|
228
|
+
if (!d?.value) return null;
|
|
229
|
+
const t = (Array.isArray(d.value) ? d.value : [d.value])[i.focusedIndex];
|
|
227
230
|
return t && typeof t == "object" && "scrollIntoView" in t && typeof t.scrollIntoView == "function" ? t : null;
|
|
228
231
|
});
|
|
229
|
-
|
|
230
|
-
() =>
|
|
232
|
+
F(
|
|
233
|
+
() => i.showDropDown,
|
|
231
234
|
() => o()
|
|
232
|
-
),
|
|
233
|
-
() =>
|
|
234
|
-
() =>
|
|
235
|
-
),
|
|
236
|
-
() =>
|
|
237
|
-
() =>
|
|
235
|
+
), F(
|
|
236
|
+
() => i.listElementOpenAndVisible,
|
|
237
|
+
() => v()
|
|
238
|
+
), F(
|
|
239
|
+
() => m.value,
|
|
240
|
+
() => v()
|
|
238
241
|
);
|
|
239
242
|
function o() {
|
|
240
|
-
!
|
|
243
|
+
!i.showDropDown || !m?.value?.parentElement?.parentElement || (m.value.parentElement.parentElement.scrollTop = m.value.offsetTop);
|
|
241
244
|
}
|
|
242
|
-
function
|
|
243
|
-
const w =
|
|
244
|
-
if (!
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
function v() {
|
|
246
|
+
const w = m.value, t = w?.parentElement?.parentElement;
|
|
247
|
+
if (!i.showDropDown || !w || !t) return;
|
|
248
|
+
const s = w.offsetTop - t.scrollTop < 0, c = w.offsetTop + w.offsetHeight - t.scrollTop > t.clientHeight;
|
|
249
|
+
s && (t.scrollTop = w.offsetTop), c && (t.scrollTop = w.offsetTop + w.clientHeight - t.clientHeight);
|
|
247
250
|
}
|
|
248
251
|
return (w, t) => (T(), M(ce, null, [
|
|
249
|
-
(T(!0), M(ce, null, Ee(e.filteredListItems, (
|
|
250
|
-
key:
|
|
252
|
+
(T(!0), M(ce, null, Ee(e.filteredListItems, (s, c) => (T(), M("li", {
|
|
253
|
+
key: c,
|
|
251
254
|
ref_for: !0,
|
|
252
255
|
ref: "items",
|
|
253
256
|
onKeyup: [
|
|
254
|
-
t[0] || (t[0] =
|
|
255
|
-
t[1] || (t[1] =
|
|
256
|
-
t[2] || (t[2] =
|
|
257
|
+
t[0] || (t[0] = b((r) => e.parentMethods.press(r), ["enter"])),
|
|
258
|
+
t[1] || (t[1] = b((r) => e.parentMethods.press(r), ["space"])),
|
|
259
|
+
t[2] || (t[2] = b((r) => e.parentMethods.press(r), ["esc"]))
|
|
257
260
|
],
|
|
258
261
|
onKeydown: [
|
|
259
|
-
t[3] || (t[3] =
|
|
260
|
-
t[4] || (t[4] =
|
|
262
|
+
t[3] || (t[3] = b((r) => e.parentMethods.press(r), ["up"])),
|
|
263
|
+
t[4] || (t[4] = b((r) => e.parentMethods.press(r), ["down"]))
|
|
261
264
|
],
|
|
262
265
|
onFocusout: t[5] || (t[5] = (r) => e.parentMethods.unfocus(r)),
|
|
263
266
|
tabindex: "-1",
|
|
264
|
-
onMousedown: Z((r) => e.parentMethods.updatedSelected(
|
|
265
|
-
class:
|
|
266
|
-
{ "list-option-selected": e.selectedIndex ===
|
|
267
|
+
onMousedown: Z((r) => e.parentMethods.updatedSelected(s), ["left"]),
|
|
268
|
+
class: q([
|
|
269
|
+
{ "list-option-selected": e.selectedIndex === c },
|
|
267
270
|
{
|
|
268
|
-
"list-option-active": e.filteredListItems.length === 1 || e.focusedIndex ===
|
|
271
|
+
"list-option-active": e.filteredListItems.length === 1 || e.focusedIndex === c && !e.mouseHoveringOnList
|
|
269
272
|
},
|
|
270
273
|
"list-option"
|
|
271
274
|
])
|
|
272
275
|
}, [
|
|
273
|
-
|
|
274
|
-
e.selectedIndex ===
|
|
276
|
+
N("span", Ue, ve(e.parentMethods.getLabel(s)), 1),
|
|
277
|
+
e.selectedIndex === c ? (T(), fe(ze, {
|
|
275
278
|
key: 0,
|
|
276
279
|
class: "list-item-icon",
|
|
277
280
|
"aria-hidden": "true"
|
|
278
|
-
})) :
|
|
281
|
+
})) : K("", !0)
|
|
279
282
|
], 42, Xe))), 128)),
|
|
280
283
|
e.filteredListItems.length === 0 ? (T(), M("li", {
|
|
281
284
|
key: 0,
|
|
282
285
|
onKeyup: [
|
|
283
|
-
t[6] || (t[6] =
|
|
284
|
-
t[7] || (t[7] =
|
|
285
|
-
t[8] || (t[8] =
|
|
286
|
+
t[6] || (t[6] = b((s) => e.parentMethods.press(s), ["enter"])),
|
|
287
|
+
t[7] || (t[7] = b((s) => e.parentMethods.press(s), ["space"])),
|
|
288
|
+
t[8] || (t[8] = b((s) => e.parentMethods.press(s), ["esc"]))
|
|
286
289
|
],
|
|
287
290
|
onKeydown: [
|
|
288
|
-
t[9] || (t[9] =
|
|
289
|
-
t[10] || (t[10] =
|
|
291
|
+
t[9] || (t[9] = b((s) => e.parentMethods.press(s), ["up"])),
|
|
292
|
+
t[10] || (t[10] = b((s) => e.parentMethods.press(s), ["down"]))
|
|
290
293
|
],
|
|
291
|
-
onFocusout: t[11] || (t[11] = (
|
|
292
|
-
onMousedown: t[12] || (t[12] = Z((
|
|
294
|
+
onFocusout: t[11] || (t[11] = (s) => e.parentMethods.unfocus(s)),
|
|
295
|
+
onMousedown: t[12] || (t[12] = Z((s) => e.parentMethods.closeList(s), ["left"])),
|
|
293
296
|
tabindex: "-1",
|
|
294
297
|
class: "list-option-message"
|
|
295
298
|
}, t[20] || (t[20] = [
|
|
296
|
-
|
|
297
|
-
]), 32)) :
|
|
299
|
+
N("span", { class: "list-item-span" }, "No Items To Display.", -1)
|
|
300
|
+
]), 32)) : K("", !0),
|
|
298
301
|
e.totalOptionsCount && e.totalOptionsCount > (e.filteredListItems?.length || 0) ? (T(), M("li", {
|
|
299
302
|
key: 1,
|
|
300
303
|
onKeyup: [
|
|
301
|
-
t[13] || (t[13] =
|
|
302
|
-
t[14] || (t[14] =
|
|
303
|
-
t[15] || (t[15] =
|
|
304
|
+
t[13] || (t[13] = b((s) => e.parentMethods.press(s), ["enter"])),
|
|
305
|
+
t[14] || (t[14] = b((s) => e.parentMethods.press(s), ["space"])),
|
|
306
|
+
t[15] || (t[15] = b((s) => e.parentMethods.press(s), ["esc"]))
|
|
304
307
|
],
|
|
305
308
|
onKeydown: [
|
|
306
|
-
t[16] || (t[16] =
|
|
307
|
-
t[17] || (t[17] =
|
|
309
|
+
t[16] || (t[16] = b((s) => e.parentMethods.press(s), ["up"])),
|
|
310
|
+
t[17] || (t[17] = b((s) => e.parentMethods.press(s), ["down"]))
|
|
308
311
|
],
|
|
309
|
-
onFocusout: t[18] || (t[18] = (
|
|
310
|
-
onMousedown: t[19] || (t[19] = Z((
|
|
312
|
+
onFocusout: t[18] || (t[18] = (s) => e.parentMethods.unfocus(s)),
|
|
313
|
+
onMousedown: t[19] || (t[19] = Z((s) => e.parentMethods.closeList(s), ["left"])),
|
|
311
314
|
tabindex: "-1",
|
|
312
315
|
class: "list-option-message"
|
|
313
316
|
}, [
|
|
314
|
-
|
|
315
|
-
], 32)) :
|
|
317
|
+
N("span", Je, " +" + ve(e.totalOptionsCount - e.filteredListItems?.length || 0) + " More Items...", 1)
|
|
318
|
+
], 32)) : K("", !0)
|
|
316
319
|
], 64));
|
|
317
320
|
}
|
|
318
|
-
}), Qe = /* @__PURE__ */
|
|
321
|
+
}), Qe = /* @__PURE__ */ V(We, [["__scopeId", "data-v-e4eeb2f7"]]), Ze = /* @__PURE__ */ G({
|
|
319
322
|
__name: "ItemList",
|
|
320
323
|
props: {
|
|
321
324
|
mouseHoveringOnList: {
|
|
@@ -364,64 +367,64 @@ const ze = /* @__PURE__ */ K($e, [["render", Ve]]), Xe = ["onMousedown"], Ue = {
|
|
|
364
367
|
}
|
|
365
368
|
},
|
|
366
369
|
emits: ["reverseDropDownList"],
|
|
367
|
-
setup(e, { expose:
|
|
370
|
+
setup(e, { expose: i, emit: d }) {
|
|
368
371
|
Se((u) => ({
|
|
369
372
|
"8d801350": k.value,
|
|
370
|
-
"2724698a":
|
|
373
|
+
"2724698a": B.value,
|
|
371
374
|
"27246d4b": se.value,
|
|
372
|
-
ffcaa9a8:
|
|
375
|
+
ffcaa9a8: $.value,
|
|
373
376
|
"414dd276": _.value
|
|
374
377
|
}));
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
() =>
|
|
378
|
-
(u) =>
|
|
378
|
+
const m = d, o = e, v = p(null), w = p(null), t = p(null), s = p(0), c = p(0), r = p(0), y = p(0), k = p("0px"), I = p(!1), E = p([]), g = p(0), a = O(() => !I.value || window?.innerHeight == null ? !1 : U() && le()), h = O(() => o.maxListHeightPX >= g.value);
|
|
379
|
+
F(
|
|
380
|
+
() => a.value,
|
|
381
|
+
(u) => m("reverseDropDownList", u),
|
|
379
382
|
{ immediate: !0 }
|
|
380
383
|
);
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
+
const B = O(() => s.value + "px"), se = O(() => y.value + "px");
|
|
385
|
+
i({ listContainerRef: t });
|
|
386
|
+
const j = (u) => {
|
|
384
387
|
u?.key && u.key === " " && u.preventDefault();
|
|
385
388
|
}, ie = (u) => {
|
|
386
389
|
const L = t?.value, x = u.target;
|
|
387
390
|
(!(L && x && L.contains(x)) || L.isEqualNode(x)) && o.parentMethods.focusInput();
|
|
388
391
|
};
|
|
389
|
-
function
|
|
392
|
+
function P() {
|
|
390
393
|
return w?.value ? (w?.value).clientHeight : 0;
|
|
391
394
|
}
|
|
392
|
-
function
|
|
393
|
-
if (!I.value ||
|
|
394
|
-
const u =
|
|
395
|
+
function S() {
|
|
396
|
+
if (!I.value || P() === 0) return o.maxListHeightPX;
|
|
397
|
+
const u = P() === 0 ? o.maxListHeightPX : +P();
|
|
395
398
|
return o.maxListHeightPX && o.maxListHeightPX > u ? u : o.maxListHeightPX;
|
|
396
399
|
}
|
|
397
400
|
function U() {
|
|
398
|
-
return
|
|
401
|
+
return c.value > S();
|
|
399
402
|
}
|
|
400
403
|
function le() {
|
|
401
|
-
return r.value <
|
|
404
|
+
return r.value < S();
|
|
402
405
|
}
|
|
403
|
-
const _ = O(() => (o.maxListHeightPX || 0) + "px"),
|
|
404
|
-
|
|
406
|
+
const _ = O(() => (o.maxListHeightPX || 0) + "px"), $ = O(() => (o.listAnimationDurationMs || 0) + "ms"), ee = O(() => o.blockListChange ? E.value : o.filteredListItems);
|
|
407
|
+
F(
|
|
405
408
|
() => ee,
|
|
406
409
|
(u) => {
|
|
407
|
-
u && (
|
|
410
|
+
u && (E.value = u.value);
|
|
408
411
|
},
|
|
409
412
|
{ immediate: !1, deep: !0 }
|
|
410
413
|
);
|
|
411
414
|
let C = setTimeout(() => {
|
|
412
|
-
}, 0),
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
+
}, 0), A = null;
|
|
416
|
+
function H() {
|
|
417
|
+
g.value = P(), clearTimeout(C), A && A.observe(), I.value = !0, z(void 0);
|
|
415
418
|
}
|
|
416
419
|
function re() {
|
|
417
420
|
clearTimeout(C), C = setTimeout(() => {
|
|
418
|
-
o.showDropDown || (I.value = !1,
|
|
421
|
+
o.showDropDown || (I.value = !1, A && A.unobserve());
|
|
419
422
|
}, o.listAnimationDurationMs + 50);
|
|
420
423
|
}
|
|
421
|
-
|
|
424
|
+
F(
|
|
422
425
|
() => o.showDropDown,
|
|
423
426
|
(u, L) => {
|
|
424
|
-
u !== L && (J(), u ?
|
|
427
|
+
u !== L && (J(), u ? H() : re());
|
|
425
428
|
},
|
|
426
429
|
{ immediate: !0 }
|
|
427
430
|
);
|
|
@@ -434,65 +437,65 @@ const ze = /* @__PURE__ */ K($e, [["render", Ve]]), Xe = ["onMousedown"], Ue = {
|
|
|
434
437
|
o.showDropDown && x && o.parentMethods.closeList();
|
|
435
438
|
}
|
|
436
439
|
function ne(u) {
|
|
437
|
-
const L = !!
|
|
440
|
+
const L = !!v.value?.contains(u?.target), x = !!t.value?.contains(u.target), X = [u?.srcElement?.id, u?.target?.id].includes("super-list-select-list");
|
|
438
441
|
return L || x || X;
|
|
439
442
|
}
|
|
440
443
|
function J() {
|
|
441
444
|
W(), Q();
|
|
442
445
|
}
|
|
443
446
|
function W() {
|
|
444
|
-
if (
|
|
445
|
-
const u =
|
|
446
|
-
|
|
447
|
+
if (v?.value == null) return;
|
|
448
|
+
const u = v.value.getBoundingClientRect();
|
|
449
|
+
c.value = u.top, r.value = window.innerHeight - u.bottom, k.value = u.width + "px";
|
|
447
450
|
}
|
|
448
451
|
function Q() {
|
|
449
|
-
if (
|
|
450
|
-
const u = oe().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x =
|
|
451
|
-
|
|
452
|
+
if (v?.value == null || t?.value == null) return;
|
|
453
|
+
const u = oe().getBoundingClientRect(), L = t.value.getBoundingClientRect(), x = y.value, X = s.value;
|
|
454
|
+
a.value ? y.value = x - (u.top - L.bottom) : y.value = x - (L.top - u.bottom), s.value = X - (L.left - u.left);
|
|
452
455
|
}
|
|
453
456
|
function ue() {
|
|
454
|
-
return (
|
|
457
|
+
return (v?.value).getElementsByTagName("button")[0];
|
|
455
458
|
}
|
|
456
459
|
function oe() {
|
|
457
|
-
return
|
|
460
|
+
return v?.value;
|
|
458
461
|
}
|
|
459
462
|
return we(() => {
|
|
460
|
-
|
|
463
|
+
A = new Be(z, ue()), setTimeout(() => z(void 0), 250);
|
|
461
464
|
}), Ae(() => {
|
|
462
|
-
|
|
465
|
+
A?.unobserve();
|
|
463
466
|
}), (u, L) => (T(), M(ce, null, [
|
|
464
|
-
|
|
467
|
+
N("div", {
|
|
465
468
|
ref_key: "dropDownButtonContainer",
|
|
466
|
-
ref:
|
|
469
|
+
ref: v,
|
|
467
470
|
class: "super-list-button-container"
|
|
468
471
|
}, [
|
|
469
472
|
Le(u.$slots, "default", {}, void 0, !0)
|
|
470
473
|
], 512),
|
|
471
|
-
|
|
474
|
+
N("div", {
|
|
472
475
|
id: "super-list-select-list",
|
|
473
476
|
ref_key: "listContainerRef",
|
|
474
477
|
ref: t,
|
|
475
478
|
onMouseenter: L[0] || (L[0] = (x) => e.parentMethods.mouseOverList()),
|
|
476
479
|
tabindex: "-1",
|
|
477
|
-
class:
|
|
480
|
+
class: q([
|
|
478
481
|
"select-list",
|
|
479
|
-
|
|
482
|
+
a.value ? "list-reverse" : "list-normal",
|
|
480
483
|
{ "select-list-open": e.showDropDown },
|
|
481
|
-
{ "no-scroll":
|
|
484
|
+
{ "no-scroll": h.value && I.value },
|
|
482
485
|
{ "select-list-fixed": I.value },
|
|
483
|
-
{ "select-list-scrollable": !
|
|
486
|
+
{ "select-list-scrollable": !h.value }
|
|
484
487
|
]),
|
|
485
|
-
onKeydown: L[1] || (L[1] =
|
|
488
|
+
onKeydown: L[1] || (L[1] = b((x) => j(x), ["space"])),
|
|
486
489
|
onMouseup: L[2] || (L[2] = Z((x) => ie(x), ["left"]))
|
|
487
490
|
}, [
|
|
488
|
-
|
|
491
|
+
N("ul", {
|
|
489
492
|
tabindex: "-1",
|
|
490
493
|
ref_key: "dropDownListUL",
|
|
491
494
|
ref: w,
|
|
492
495
|
class: "list-content"
|
|
493
496
|
}, [
|
|
494
497
|
Y(Qe, {
|
|
495
|
-
filteredListItems:
|
|
498
|
+
filteredListItems: E.value,
|
|
496
499
|
mouseHoveringOnList: e.mouseHoveringOnList,
|
|
497
500
|
focusedIndex: e.focusedIndex,
|
|
498
501
|
selectedIndex: e.selectedIndex,
|
|
@@ -505,22 +508,22 @@ const ze = /* @__PURE__ */ K($e, [["render", Ve]]), Xe = ["onMousedown"], Ue = {
|
|
|
505
508
|
], 34)
|
|
506
509
|
], 64));
|
|
507
510
|
}
|
|
508
|
-
}), he = /* @__PURE__ */
|
|
511
|
+
}), he = /* @__PURE__ */ V(Ze, [["__scopeId", "data-v-e58cd48c"]]), Ye = {}, Ge = {
|
|
509
512
|
xmlns: "http://www.w3.org/2000/svg",
|
|
510
513
|
fill: "currentColor",
|
|
511
514
|
"aria-hidden": "true",
|
|
512
515
|
"data-slot": "icon",
|
|
513
516
|
viewBox: "0 0 12 6"
|
|
514
517
|
};
|
|
515
|
-
function _e(e,
|
|
516
|
-
return T(), M("svg", Ge,
|
|
517
|
-
|
|
518
|
+
function _e(e, i) {
|
|
519
|
+
return T(), M("svg", Ge, i[0] || (i[0] = [
|
|
520
|
+
N("path", {
|
|
518
521
|
"shape-rendering": "geometricPrecision",
|
|
519
522
|
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"
|
|
520
523
|
}, null, -1)
|
|
521
524
|
]));
|
|
522
525
|
}
|
|
523
|
-
const
|
|
526
|
+
const ge = /* @__PURE__ */ V(Ye, [["render", _e]]), et = ["tabindex"], tt = {
|
|
524
527
|
key: 2,
|
|
525
528
|
class: "list-button-icon custom-icon"
|
|
526
529
|
}, nt = /* @__PURE__ */ G({
|
|
@@ -548,65 +551,65 @@ const ye = /* @__PURE__ */ K(Ye, [["render", _e]]), et = ["tabindex"], tt = {
|
|
|
548
551
|
required: !0
|
|
549
552
|
}
|
|
550
553
|
},
|
|
551
|
-
setup(e, { expose:
|
|
552
|
-
const
|
|
554
|
+
setup(e, { expose: i }) {
|
|
555
|
+
const d = e, m = p(null);
|
|
553
556
|
function o() {
|
|
554
|
-
|
|
557
|
+
d.enableTextFilter || d.parentMethods.openList();
|
|
555
558
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
559
|
+
function v(c) {
|
|
560
|
+
d.enableTextFilter ? (d.parentMethods.focusInput(), c.stopPropagation(), c.preventDefault()) : d.parentMethods.press(c);
|
|
558
561
|
}
|
|
559
|
-
function w(
|
|
560
|
-
|
|
562
|
+
function w(c) {
|
|
563
|
+
d.enableTextFilter || d.parentMethods.press(c);
|
|
561
564
|
}
|
|
562
565
|
function t() {
|
|
563
|
-
|
|
566
|
+
m?.value && m.value.blur();
|
|
564
567
|
}
|
|
565
|
-
function
|
|
566
|
-
|
|
568
|
+
function s() {
|
|
569
|
+
m?.value && m.value.focus();
|
|
567
570
|
}
|
|
568
|
-
return
|
|
571
|
+
return i({ blurInput: t, focusInput: s, buttonRef: m }), (c, r) => (T(), M("button", {
|
|
569
572
|
ref_key: "buttonRef",
|
|
570
|
-
ref:
|
|
573
|
+
ref: m,
|
|
571
574
|
tabindex: e.enableTextFilter ? -1 : 0,
|
|
572
575
|
onKeydown: [
|
|
573
|
-
r[0] || (r[0] =
|
|
574
|
-
r[1] || (r[1] =
|
|
575
|
-
r[2] || (r[2] =
|
|
576
|
-
r[3] || (r[3] =
|
|
577
|
-
r[4] || (r[4] =
|
|
576
|
+
r[0] || (r[0] = b((y) => v(y), ["enter"])),
|
|
577
|
+
r[1] || (r[1] = b((y) => w(y), ["space"])),
|
|
578
|
+
r[2] || (r[2] = b((y) => e.parentMethods.press(y), ["esc"])),
|
|
579
|
+
r[3] || (r[3] = b((y) => e.parentMethods.press(y), ["up"])),
|
|
580
|
+
r[4] || (r[4] = b((y) => e.parentMethods.press(y), ["down"]))
|
|
578
581
|
],
|
|
579
|
-
onFocusout: r[5] || (r[5] = (
|
|
580
|
-
onClick: r[6] || (r[6] = (
|
|
582
|
+
onFocusout: r[5] || (r[5] = (y) => e.parentMethods.unfocus(y)),
|
|
583
|
+
onClick: r[6] || (r[6] = (y) => o()),
|
|
581
584
|
type: "button",
|
|
582
|
-
class:
|
|
585
|
+
class: q([[{ "click-through": d.enableTextFilter || d.showDropDown }], "list-button"])
|
|
583
586
|
}, [
|
|
584
|
-
Le(
|
|
585
|
-
|
|
586
|
-
class:
|
|
587
|
+
Le(c.$slots, "default", {}, void 0, !0),
|
|
588
|
+
N("span", {
|
|
589
|
+
class: q(["list-button-icon-div", { "bigger-gap": d.showDropDown }])
|
|
587
590
|
}, [
|
|
588
|
-
e.customIcon ?
|
|
591
|
+
e.customIcon ? K("", !0) : (T(), M("span", {
|
|
589
592
|
key: 0,
|
|
590
|
-
class:
|
|
593
|
+
class: q(["list-button-icon", [{ "rotate-180": !d.showDropDown }]])
|
|
591
594
|
}, [
|
|
592
|
-
Y(
|
|
595
|
+
Y(ge, { "aria-hidden": "true" })
|
|
593
596
|
], 2)),
|
|
594
|
-
e.customIcon ?
|
|
597
|
+
e.customIcon ? K("", !0) : (T(), M("span", {
|
|
595
598
|
key: 1,
|
|
596
|
-
class:
|
|
599
|
+
class: q(["list-button-icon", [{ "rotate-180": d.showDropDown }]])
|
|
597
600
|
}, [
|
|
598
|
-
e.customIcon == null ? (T(), fe(
|
|
601
|
+
e.customIcon == null ? (T(), fe(ge, {
|
|
599
602
|
key: 0,
|
|
600
603
|
"aria-hidden": "true"
|
|
601
|
-
})) :
|
|
604
|
+
})) : K("", !0)
|
|
602
605
|
], 2)),
|
|
603
606
|
e.customIcon ? (T(), M("span", tt, [
|
|
604
607
|
(T(), fe(Ne(e.customIcon), { "aria-hidden": "true" }))
|
|
605
|
-
])) :
|
|
608
|
+
])) : K("", !0)
|
|
606
609
|
], 2)
|
|
607
610
|
], 42, et));
|
|
608
611
|
}
|
|
609
|
-
}),
|
|
612
|
+
}), ye = /* @__PURE__ */ V(nt, [["__scopeId", "data-v-01ef8e37"]]), ot = /* @__PURE__ */ G({
|
|
610
613
|
__name: "super-list",
|
|
611
614
|
props: {
|
|
612
615
|
selected: {
|
|
@@ -662,214 +665,214 @@ const ye = /* @__PURE__ */ K(Ye, [["render", _e]]), et = ["tabindex"], tt = {
|
|
|
662
665
|
}
|
|
663
666
|
},
|
|
664
667
|
emits: { "update:selected": null },
|
|
665
|
-
setup(e, { expose:
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
() =>
|
|
668
|
+
setup(e, { expose: i, emit: d }) {
|
|
669
|
+
const m = d, o = e, v = p([]), w = new Re(), t = p(0), s = 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), E = p(!1), g = p(he), a = p(be), h = p(ye), B = p("");
|
|
670
|
+
F(
|
|
671
|
+
() => B.value,
|
|
669
672
|
(n, l) => {
|
|
670
673
|
n !== l && typeof o.options == "function" && x(n);
|
|
671
674
|
}
|
|
672
675
|
);
|
|
673
676
|
const se = () => {
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
clearTimeout(Q), se(),
|
|
677
|
-
}, ie = O(() =>
|
|
678
|
-
n &&
|
|
679
|
-
},
|
|
677
|
+
s.value && a?.value?.blurInput();
|
|
678
|
+
}, j = () => {
|
|
679
|
+
clearTimeout(Q), se(), B.value = "", c.value = !1, k.value = !0;
|
|
680
|
+
}, ie = O(() => E?.value === !0 ? "Error loading data" : I?.value === !0 ? "Loading..." : S(o.selected)), P = (n) => {
|
|
681
|
+
n && m("update:selected", n), j();
|
|
682
|
+
}, S = (n) => He(
|
|
680
683
|
n,
|
|
681
684
|
o.customPlaceHolderFunction,
|
|
682
685
|
o.objectLabelKeyName,
|
|
683
686
|
o.enumKeyToLabelObjectArray
|
|
684
687
|
);
|
|
685
688
|
function U() {
|
|
686
|
-
throw I.value = !0,
|
|
689
|
+
throw I.value = !0, E.value = !0, new Error("Invalid options argument provided to ListInputComponent");
|
|
687
690
|
}
|
|
688
691
|
function le() {
|
|
689
|
-
throw I.value = !0,
|
|
692
|
+
throw I.value = !0, E.value = !0, new Error("Invalid response provided to ListInputComponent, no total count key found");
|
|
690
693
|
}
|
|
691
694
|
function _() {
|
|
692
|
-
throw I.value = !0,
|
|
695
|
+
throw I.value = !0, E.value = !0, new Error("Invalid objectLabelKeyName for provided Dropdown list value.");
|
|
693
696
|
}
|
|
694
697
|
we(() => {
|
|
695
698
|
typeof o.options != "function" && !Array.isArray(o.options) ? U() : u();
|
|
696
699
|
});
|
|
697
|
-
const
|
|
698
|
-
|
|
700
|
+
const $ = p(!1), ee = p(0), C = p(0), A = p(0);
|
|
701
|
+
F(
|
|
699
702
|
() => C.value,
|
|
700
703
|
(n, l) => {
|
|
701
|
-
n != l && !r.value && (
|
|
704
|
+
n != l && !r.value && (A.value = n);
|
|
702
705
|
},
|
|
703
706
|
{ immediate: !0 }
|
|
704
|
-
),
|
|
707
|
+
), F(
|
|
705
708
|
() => r.value,
|
|
706
709
|
(n) => {
|
|
707
|
-
n || (
|
|
710
|
+
n || (A.value = C.value);
|
|
708
711
|
},
|
|
709
712
|
{ immediate: !0 }
|
|
710
713
|
);
|
|
711
|
-
const
|
|
712
|
-
if (typeof o.options == "function" && !Array.isArray(o.options)) return
|
|
713
|
-
const n =
|
|
714
|
-
return n === "" ? l : l.filter((
|
|
714
|
+
const H = O(() => {
|
|
715
|
+
if (typeof o.options == "function" && !Array.isArray(o.options)) return v.value;
|
|
716
|
+
const n = B.value, l = v.value;
|
|
717
|
+
return n === "" ? l : l.filter((f) => S(f).toLowerCase().includes(n.toLowerCase()));
|
|
715
718
|
});
|
|
716
|
-
|
|
717
|
-
() =>
|
|
719
|
+
F(
|
|
720
|
+
() => H.value,
|
|
718
721
|
(n, l) => {
|
|
719
722
|
JSON.stringify(n) !== JSON.stringify(l) && z();
|
|
720
723
|
},
|
|
721
724
|
{ immediate: !1, deep: !0 }
|
|
722
725
|
);
|
|
723
726
|
const re = () => {
|
|
724
|
-
|
|
727
|
+
$.value = !0;
|
|
725
728
|
}, z = () => {
|
|
726
729
|
const n = te();
|
|
727
730
|
ee.value = n, C.value = n > -1 ? n : 0;
|
|
728
731
|
};
|
|
729
732
|
function te() {
|
|
730
733
|
if (o.selected == null) return -1;
|
|
731
|
-
const n =
|
|
734
|
+
const n = H.value.map((f) => S(f)), l = n.filter((f) => f === S(o.selected));
|
|
732
735
|
if (l.length > 1) {
|
|
733
|
-
const
|
|
734
|
-
for (let D = 0; D <
|
|
736
|
+
const f = l.map((D) => n.indexOf(D));
|
|
737
|
+
for (let D = 0; D < f.length; D++) {
|
|
735
738
|
const R = JSON.stringify(
|
|
736
|
-
|
|
739
|
+
H.value[f[D]]
|
|
737
740
|
), de = JSON.stringify(o.selected);
|
|
738
|
-
if (R === de) return
|
|
741
|
+
if (R === de) return f[D];
|
|
739
742
|
}
|
|
740
743
|
return -1;
|
|
741
744
|
}
|
|
742
|
-
return n.indexOf(
|
|
745
|
+
return n.indexOf(S(o.selected));
|
|
743
746
|
}
|
|
744
747
|
const ne = () => {
|
|
745
|
-
I.value || (
|
|
748
|
+
I.value || (c.value || (r.value = !1, z(), J(), c.value = !0), $.value = !1, k.value = !1);
|
|
746
749
|
}, J = () => {
|
|
747
|
-
const n = window?.innerWidth != null && window.innerWidth < 640, l = screen?.width != null && screen.width < 640,
|
|
748
|
-
(n || l) &&
|
|
749
|
-
}, W =
|
|
750
|
+
const n = window?.innerWidth != null && window.innerWidth < 640, l = screen?.width != null && screen.width < 640, f = a.value.textInputRef;
|
|
751
|
+
(n || l) && s.value && (ue(), o.scrollTextInputToTopOnMobile && f?.scrollIntoView({ block: "start", inline: "center" }));
|
|
752
|
+
}, W = p(!0);
|
|
750
753
|
let Q = setTimeout(() => {
|
|
751
754
|
}, 0);
|
|
752
755
|
function ue() {
|
|
753
|
-
const n =
|
|
756
|
+
const n = a.value.textInputRef;
|
|
754
757
|
if (!n) return;
|
|
755
758
|
W.value = !1;
|
|
756
759
|
let l = null;
|
|
757
|
-
const
|
|
760
|
+
const f = () => {
|
|
758
761
|
l && clearInterval(l), clearTimeout(Q), setTimeout(() => {
|
|
759
762
|
W.value = !0;
|
|
760
763
|
}, 100);
|
|
761
764
|
};
|
|
762
|
-
Q = setTimeout(
|
|
763
|
-
(
|
|
765
|
+
Q = setTimeout(f, 5e3), l = setInterval(() => {
|
|
766
|
+
(c.value === !1 || n?.scrollTop === 0 && document.readyState === "complete") && f();
|
|
764
767
|
}, 100);
|
|
765
768
|
}
|
|
766
769
|
const oe = () => {
|
|
767
|
-
|
|
770
|
+
s?.value == !0 ? a.value.focusInput() : h?.value?.focusInput && h?.value?.focusInput();
|
|
768
771
|
};
|
|
769
772
|
async function u() {
|
|
770
|
-
typeof o.options == "function" ? await x(
|
|
773
|
+
typeof o.options == "function" ? await x(B.value ? B.value : void 0, !0) : (X(o.options), t.value = v.value.length), L();
|
|
771
774
|
}
|
|
772
|
-
|
|
775
|
+
i({ initializeOptions: u, getLabel: S });
|
|
773
776
|
function L() {
|
|
774
|
-
te() == -1 &&
|
|
777
|
+
te() == -1 && v.value && !!v.value[0] && P(v.value[0]);
|
|
775
778
|
}
|
|
776
779
|
async function x(n, l = !0) {
|
|
777
780
|
I.value = l;
|
|
778
|
-
const
|
|
781
|
+
const f = async () => o.options(o.maxListOptions, n || ""), D = (R) => {
|
|
779
782
|
(!R || !("data" in R)) && U(), X(R.data), Ie(R?.data?.length ?? 0).then(() => {
|
|
780
783
|
I.value = !1;
|
|
781
784
|
});
|
|
782
785
|
};
|
|
783
|
-
await w.resetAndExecute(
|
|
786
|
+
await w.resetAndExecute(f, D);
|
|
784
787
|
}
|
|
785
788
|
function X(n) {
|
|
786
|
-
Array.isArray(n) || U(), n.length > 0 && typeof n[0] == "object" && xe(n),
|
|
789
|
+
Array.isArray(n) || U(), n.length > 0 && typeof n[0] == "object" && xe(n), v.value = n;
|
|
787
790
|
}
|
|
788
791
|
function xe(n) {
|
|
789
792
|
(!o.objectLabelKeyName || o.objectLabelKeyName.length === 0) && _();
|
|
790
793
|
const l = o.objectLabelKeyName;
|
|
791
|
-
for (let
|
|
792
|
-
(typeof n[
|
|
794
|
+
for (let f = 0; f < n.length; f++)
|
|
795
|
+
(typeof n[f] != "object" || !(l in n[f])) && _();
|
|
793
796
|
}
|
|
794
797
|
async function Ie(n) {
|
|
795
|
-
const l = async () => o.options(1, ""),
|
|
798
|
+
const l = async () => o.options(1, ""), f = (D) => {
|
|
796
799
|
(!D || !("totalNum" in D)) && le(), t.value = D.totalNum ?? n;
|
|
797
800
|
};
|
|
798
|
-
await w.resetAndExecute(l,
|
|
801
|
+
await w.resetAndExecute(l, f);
|
|
799
802
|
}
|
|
800
|
-
const pe = () =>
|
|
801
|
-
|
|
803
|
+
const pe = () => a?.value?.textInputRef?.getElementsByTagName("li")[C.value] ?? null, Te = (n) => {
|
|
804
|
+
c.value == !1 ? ne() : n && De(n);
|
|
802
805
|
}, De = (n) => {
|
|
803
806
|
const l = n.key || n.code;
|
|
804
|
-
(l === "Tab" || l === "Escape") &&
|
|
807
|
+
(l === "Tab" || l === "Escape") && j(), l === "ArrowDown" && Me(n), l === "ArrowUp" && Ce(n), (l === "Enter" || l === " ") && Oe(), n.preventDefault(), n.stopPropagation();
|
|
805
808
|
}, Oe = () => {
|
|
806
|
-
|
|
809
|
+
H.value.length > 0 ? (r.value = !0, P(H.value[C.value])) : j();
|
|
807
810
|
}, Me = (n) => {
|
|
808
|
-
k.value = !0, C.value <
|
|
811
|
+
k.value = !0, C.value < H.value.length - 1 && (n.preventDefault(), $.value = !1, C.value++, pe()?.focus());
|
|
809
812
|
}, Ce = (n) => {
|
|
810
|
-
k.value = !0, C.value > 0 && (n.preventDefault(),
|
|
813
|
+
k.value = !0, C.value > 0 && (n.preventDefault(), $.value = !1, C.value--, pe()?.focus());
|
|
811
814
|
}, ae = {
|
|
812
815
|
openList: ne,
|
|
813
816
|
unfocus: (n) => {
|
|
814
|
-
if (
|
|
815
|
-
|
|
816
|
-
const l =
|
|
817
|
+
if (c?.value === !1) return;
|
|
818
|
+
B.value.length > 0 && (r.value = !0);
|
|
819
|
+
const l = g?.value?.listContainerRef, f = a?.value?.textInputRef, D = n?.relatedTarget && f?.isEqualNode(n?.relatedTarget), R = n?.relatedTarget && l && l.contains(n?.relatedTarget), de = n?.relatedTarget && l && l.isEqualNode(n?.relatedTarget);
|
|
817
820
|
if (!(R || D)) {
|
|
818
821
|
if (de) {
|
|
819
822
|
oe();
|
|
820
823
|
return;
|
|
821
824
|
}
|
|
822
|
-
|
|
825
|
+
j();
|
|
823
826
|
}
|
|
824
827
|
},
|
|
825
828
|
press: Te,
|
|
826
829
|
mouseOverList: re,
|
|
827
|
-
getLabel:
|
|
828
|
-
updatedSelected:
|
|
830
|
+
getLabel: S,
|
|
831
|
+
updatedSelected: P,
|
|
829
832
|
focusInput: oe,
|
|
830
|
-
closeList:
|
|
833
|
+
closeList: j
|
|
831
834
|
};
|
|
832
835
|
return (n, l) => (T(), M("div", {
|
|
833
836
|
style: { position: "relative" },
|
|
834
|
-
class:
|
|
837
|
+
class: q(n.$attrs.class)
|
|
835
838
|
}, [
|
|
836
839
|
Y(he, {
|
|
837
840
|
ref_key: "itemListRef",
|
|
838
|
-
ref:
|
|
839
|
-
"show-drop-down":
|
|
840
|
-
filteredListItems:
|
|
841
|
-
mouseHoveringOnList:
|
|
842
|
-
focusedIndex:
|
|
841
|
+
ref: g,
|
|
842
|
+
"show-drop-down": c.value,
|
|
843
|
+
filteredListItems: H.value,
|
|
844
|
+
mouseHoveringOnList: $.value,
|
|
845
|
+
focusedIndex: A.value,
|
|
843
846
|
selectedIndex: ee.value,
|
|
844
847
|
"max-list-height-p-x": e.maxListHeightPX,
|
|
845
848
|
"list-animation-duration-ms": e.listAnimationDurationMs,
|
|
846
849
|
"parent-methods": ae,
|
|
847
850
|
blockListChange: r.value,
|
|
848
|
-
"onUpdate:blockListChange": l[1] || (l[1] = (
|
|
851
|
+
"onUpdate:blockListChange": l[1] || (l[1] = (f) => r.value = f),
|
|
849
852
|
"total-options-count": t.value,
|
|
850
|
-
onReverseDropDownList: l[2] || (l[2] = (
|
|
853
|
+
onReverseDropDownList: l[2] || (l[2] = (f) => y.value = f),
|
|
851
854
|
enableScrollClose: W.value
|
|
852
855
|
}, {
|
|
853
856
|
default: me(() => [
|
|
854
|
-
Y(
|
|
857
|
+
Y(ye, {
|
|
855
858
|
ref_key: "dropDownButtonInput",
|
|
856
|
-
ref:
|
|
859
|
+
ref: h,
|
|
857
860
|
"parent-methods": ae,
|
|
858
|
-
"show-drop-down":
|
|
859
|
-
"enable-text-filter":
|
|
861
|
+
"show-drop-down": c.value,
|
|
862
|
+
"enable-text-filter": s.value,
|
|
860
863
|
"custom-icon": e.customIcon,
|
|
861
|
-
"reverse-drop-down-list":
|
|
864
|
+
"reverse-drop-down-list": y.value
|
|
862
865
|
}, {
|
|
863
866
|
default: me(() => [
|
|
864
867
|
Y(be, {
|
|
865
868
|
ref_key: "dropDownTextInput",
|
|
866
|
-
ref:
|
|
867
|
-
"enable-text-filter":
|
|
868
|
-
"show-drop-down":
|
|
869
|
+
ref: a,
|
|
870
|
+
"enable-text-filter": s.value,
|
|
871
|
+
"show-drop-down": c.value,
|
|
869
872
|
placeholder: ie.value,
|
|
870
873
|
"enable-button-click": k.value,
|
|
871
874
|
"parent-methods": ae,
|
|
872
|
-
"onUpdate:query": l[0] || (l[0] = (
|
|
875
|
+
"onUpdate:query": l[0] || (l[0] = (f) => B.value = f)
|
|
873
876
|
}, null, 8, ["enable-text-filter", "show-drop-down", "placeholder", "enable-button-click"])
|
|
874
877
|
]),
|
|
875
878
|
_: 1
|
|
@@ -879,7 +882,7 @@ const ye = /* @__PURE__ */ K(Ye, [["render", _e]]), et = ["tabindex"], tt = {
|
|
|
879
882
|
}, 8, ["show-drop-down", "filteredListItems", "mouseHoveringOnList", "focusedIndex", "selectedIndex", "max-list-height-p-x", "list-animation-duration-ms", "blockListChange", "total-options-count", "enableScrollClose"])
|
|
880
883
|
], 2));
|
|
881
884
|
}
|
|
882
|
-
}), lt = /* @__PURE__ */
|
|
885
|
+
}), lt = /* @__PURE__ */ V(ot, [["__scopeId", "data-v-cc38ced5"]]);
|
|
883
886
|
export {
|
|
884
887
|
lt as default
|
|
885
888
|
};
|