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