adverich-kun-ui 0.1.55 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adverich-kun-ui.css +1 -1
- package/dist/components/KunAutocomplete/src/components/KunAutocomplete.vue.js +241 -204
- package/dist/components/KunAutocomplete/src/composables/KunAutocompleteProps.js +4 -1
- package/dist/components/KunAutocomplete/src/composables/useAutocomplete.js +82 -96
- package/dist/components/KunAutocomplete/src/utils/helpers.js +9 -1
- package/dist/components/KunBudge/src/components/KunBudge.vue.js +30 -38
- package/dist/components/KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js +87 -0
- package/dist/components/KunInfiniteScroll/src/composables/useIntersectionObserver.js +51 -0
- package/dist/components/KunInfiniteScroll/src/composables/useKunInfiniteScroll.js +61 -0
- package/dist/components/KunList/src/components/KunList.vue.js +51 -15
- package/dist/components/KunListItem/src/components/KunListItem.vue.js +32 -15
- package/dist/components/KunListItemText/src/components/KunListItemText.vue.js +16 -7
- package/dist/components/KunListItemTitle/src/components/KunListItemTitle.vue.js +40 -0
- package/dist/components/KunTextField/src/components/KunTextField.vue.js +88 -62
- package/dist/components/KunVirtualScroller/src/components/KunVirtualScroller.vue.js +78 -0
- package/dist/components/kunMenu/src/components/kunMenu.vue.js +56 -145
- package/dist/components/kunMenu/src/composables/kunMenuProps.js +42 -23
- package/dist/components/kunMenu/src/composables/useKunMenu.js +42 -153
- package/dist/components/kunMenu/src/composables/useKunMenuStyles.js +29 -0
- package/dist/icons/IconAsterisk.vue.js +20 -0
- package/dist/icons/IconCheck.vue.js +20 -0
- package/dist/icons/IconClose.vue.js +16 -0
- package/dist/icons/IconDelete.vue.js +16 -0
- package/dist/icons/IconEdit.vue.js +16 -0
- package/dist/icons/IconMenuDownOutline.vue.js +20 -0
- package/dist/icons/IconMenuUpOutline.vue.js +20 -0
- package/dist/icons/IconSearch.vue.js +16 -0
- package/dist/icons/IconStar.vue.js +16 -0
- package/dist/icons/index.js +23 -0
- package/dist/index.js +33 -33
- package/package.json +7 -6
- package/dist/components/KunAutocomplete/src/composables/useIntersect.js +0 -23
- package/dist/components/kunMenu/src/composables/useKunMenuComposable.js +0 -25
- package/dist/components/kunMenu/src/composables/useKunScrollStrategy.js +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as i, inject as o, createElementBlock as
|
|
2
|
-
const
|
|
1
|
+
import { ref as i, inject as o, onMounted as d, onBeforeUnmount as f, watch as m, computed as v, createElementBlock as b, openBlock as g, normalizeClass as k, renderSlot as y } from "vue";
|
|
2
|
+
const B = {
|
|
3
3
|
__name: "KunListItem",
|
|
4
4
|
props: {
|
|
5
5
|
value: {
|
|
@@ -8,32 +8,49 @@ const m = {
|
|
|
8
8
|
},
|
|
9
9
|
disabled: Boolean,
|
|
10
10
|
active: Boolean,
|
|
11
|
+
// usado si se controla desde afuera
|
|
11
12
|
activeClass: {
|
|
12
13
|
type: String,
|
|
13
14
|
default: "bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-300"
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
setup(a) {
|
|
18
|
+
const l = a, n = i(null), r = o("registerListItemRef", null), e = o("kun-list", null);
|
|
19
|
+
d(() => {
|
|
20
|
+
r && n.value && r(n.value);
|
|
21
|
+
}), f(() => {
|
|
22
|
+
r && r(null);
|
|
23
|
+
});
|
|
24
|
+
const u = i(l.active);
|
|
25
|
+
m(() => l.active, (t) => {
|
|
26
|
+
u.value = t;
|
|
27
|
+
});
|
|
28
|
+
const s = v(() => {
|
|
29
|
+
var t;
|
|
30
|
+
return ((t = e == null ? void 0 : e.isSelected) == null ? void 0 : t.call(e, l.value)) ?? !1;
|
|
31
|
+
});
|
|
32
|
+
function c() {
|
|
33
|
+
l.disabled || e && l.value !== null && e.toggleItem(l.value);
|
|
20
34
|
}
|
|
21
|
-
return (
|
|
35
|
+
return (t, p) => (g(), b("li", {
|
|
36
|
+
ref_key: "liRef",
|
|
37
|
+
ref: n,
|
|
22
38
|
role: "listitem",
|
|
23
|
-
|
|
39
|
+
tabindex: "-1",
|
|
40
|
+
class: k(["w-full flex flex-col items-start", [
|
|
24
41
|
"kun-list-item",
|
|
25
42
|
{
|
|
26
|
-
"px-4 py-2 rounded-md cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700
|
|
27
|
-
"text-gray-500 dark:text-gray-400 cursor-not-allowed":
|
|
28
|
-
[
|
|
43
|
+
"px-4 py-2 rounded-md cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700": !a.disabled,
|
|
44
|
+
"text-gray-500 dark:text-gray-400 cursor-not-allowed": a.disabled,
|
|
45
|
+
[a.activeClass]: s.value || u.value
|
|
29
46
|
}
|
|
30
|
-
]),
|
|
31
|
-
onClick:
|
|
47
|
+
]]),
|
|
48
|
+
onClick: c
|
|
32
49
|
}, [
|
|
33
|
-
|
|
50
|
+
y(t.$slots, "default")
|
|
34
51
|
], 2));
|
|
35
52
|
}
|
|
36
53
|
};
|
|
37
54
|
export {
|
|
38
|
-
|
|
55
|
+
B as default
|
|
39
56
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as r, openBlock as a, normalizeClass as l, renderSlot as s, createTextVNode as o, toDisplayString as i } from "vue";
|
|
2
2
|
const p = {
|
|
3
3
|
__name: "KunListItemText",
|
|
4
4
|
props: {
|
|
@@ -6,6 +6,14 @@ const p = {
|
|
|
6
6
|
type: [String, Number],
|
|
7
7
|
default: null
|
|
8
8
|
},
|
|
9
|
+
fontSize: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "text-sm"
|
|
12
|
+
},
|
|
13
|
+
fontWeight: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "font-medium"
|
|
16
|
+
},
|
|
9
17
|
class: {
|
|
10
18
|
type: [String, Object, Array],
|
|
11
19
|
default: null
|
|
@@ -13,15 +21,16 @@ const p = {
|
|
|
13
21
|
},
|
|
14
22
|
setup(e) {
|
|
15
23
|
const t = e;
|
|
16
|
-
return (
|
|
24
|
+
return (n, u) => (a(), r("span", {
|
|
17
25
|
class: l([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
t.class
|
|
26
|
+
t.fontSize,
|
|
27
|
+
t.fontWeight,
|
|
28
|
+
t.class,
|
|
29
|
+
"truncate"
|
|
21
30
|
])
|
|
22
31
|
}, [
|
|
23
|
-
n
|
|
24
|
-
o(
|
|
32
|
+
s(n.$slots, "default", {}, () => [
|
|
33
|
+
o(i(t.text), 1)
|
|
25
34
|
])
|
|
26
35
|
], 2));
|
|
27
36
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createElementBlock as n, openBlock as r, normalizeClass as a, renderSlot as o, createTextVNode as s, toDisplayString as i } from "vue";
|
|
2
|
+
const p = {
|
|
3
|
+
__name: "KunListItemTitle",
|
|
4
|
+
props: {
|
|
5
|
+
title: {
|
|
6
|
+
type: [String, Number],
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
fontSize: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "text-lg"
|
|
12
|
+
},
|
|
13
|
+
fontWeight: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "font-medium"
|
|
16
|
+
},
|
|
17
|
+
class: {
|
|
18
|
+
type: [String, Object, Array],
|
|
19
|
+
default: null
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const t = e;
|
|
24
|
+
return (l, u) => (r(), n("span", {
|
|
25
|
+
class: a([
|
|
26
|
+
"truncate",
|
|
27
|
+
t.fontSize,
|
|
28
|
+
t.fontWeight,
|
|
29
|
+
t.class
|
|
30
|
+
])
|
|
31
|
+
}, [
|
|
32
|
+
o(l.$slots, "default", {}, () => [
|
|
33
|
+
s(i(t.title), 1)
|
|
34
|
+
])
|
|
35
|
+
], 2));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
p as default
|
|
40
|
+
};
|
|
@@ -1,89 +1,115 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as x, ref as o, watch as F, computed as j, onUnmounted as N, createElementBlock as i, openBlock as d, normalizeClass as I, createElementVNode as T, createCommentVNode as y, renderSlot as w, toDisplayString as b, withModifiers as P } from "vue";
|
|
2
2
|
import S from "../composables/KunTextFieldProps.js";
|
|
3
|
-
const
|
|
4
|
-
class: "w-full flex justify-center my-2",
|
|
5
|
-
style: { cursor: "text" }
|
|
6
|
-
}, $ = {
|
|
3
|
+
const z = {
|
|
7
4
|
key: 0,
|
|
8
5
|
class: "mr-2"
|
|
9
|
-
},
|
|
6
|
+
}, M = ["type", "value", "placeholder"], q = {
|
|
10
7
|
key: 1,
|
|
11
8
|
class: "ml-2"
|
|
12
|
-
}, M = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "text-red-500 text-sm mt-1 w-full text-left pl-1"
|
|
15
9
|
}, A = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "text-red-500 text-sm mt-1 w-full text-center pl-1"
|
|
12
|
+
}, J = {
|
|
16
13
|
__name: "KunTextField",
|
|
17
14
|
props: { ...S },
|
|
18
|
-
emits: ["update:modelValue", "focusInput", "blurInput", "
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
async function c() {
|
|
28
|
-
for (const e of t.rules) {
|
|
29
|
-
const r = await Promise.resolve(e(l.value));
|
|
30
|
-
if (r !== !0) return r;
|
|
15
|
+
emits: ["update:modelValue", "focusInput", "blurInput", "handleClick", "keyDown", "keyUp"],
|
|
16
|
+
setup(C, { expose: B, emit: E }) {
|
|
17
|
+
const a = C, u = E, g = x("registerField", null), h = x("unregisterField", null), t = o(a.modelValue), r = o(!1), n = o("");
|
|
18
|
+
let f = !1;
|
|
19
|
+
const c = o(!1);
|
|
20
|
+
async function p() {
|
|
21
|
+
for (const e of a.rules) {
|
|
22
|
+
const l = await Promise.resolve(e(t.value));
|
|
23
|
+
if (l !== !0) return l;
|
|
31
24
|
}
|
|
32
25
|
return !0;
|
|
33
26
|
}
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
F(() => a.modelValue, (e) => {
|
|
28
|
+
e !== t.value && (f = !0, t.value = e);
|
|
29
|
+
}), F(t, () => {
|
|
30
|
+
if (f) {
|
|
31
|
+
f = !1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
r.value = !0, u("update:modelValue", t.value), clearTimeout(m.value), m.value = setTimeout(async () => {
|
|
35
|
+
const e = await p();
|
|
36
|
+
n.value = e === !0 ? "" : e;
|
|
37
|
+
}, 300);
|
|
38
|
+
});
|
|
39
|
+
const k = j(
|
|
40
|
+
() => a.error || !!n.value && r.value
|
|
36
41
|
);
|
|
37
|
-
function
|
|
38
|
-
|
|
42
|
+
function $() {
|
|
43
|
+
c.value = !0, u("focusInput");
|
|
44
|
+
}
|
|
45
|
+
function D(e) {
|
|
46
|
+
t.value = e.target.value, r.value = !0, u("update:modelValue", t.value);
|
|
39
47
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
48
|
+
async function K() {
|
|
49
|
+
r.value = !0, c.value = !1;
|
|
50
|
+
const e = await p();
|
|
51
|
+
n.value = e === !0 ? "" : e, u("blurInput");
|
|
42
52
|
}
|
|
43
|
-
async function
|
|
44
|
-
|
|
53
|
+
async function v() {
|
|
54
|
+
r.value = !0;
|
|
55
|
+
const e = await p();
|
|
56
|
+
return n.value = e === !0 ? "" : e, e === !0;
|
|
45
57
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
58
|
+
function U() {
|
|
59
|
+
t.value = a.modelValue, r.value = !1, n.value = "";
|
|
48
60
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
61
|
+
function _() {
|
|
62
|
+
r.value = !1, n.value = "";
|
|
51
63
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
g && g({ validate: v }), N(() => {
|
|
65
|
+
h && h({ validate: v }), clearTimeout(m.value);
|
|
66
|
+
});
|
|
67
|
+
const V = o(null);
|
|
68
|
+
B({
|
|
69
|
+
validate: v,
|
|
70
|
+
reset: U,
|
|
71
|
+
resetValidation: _,
|
|
72
|
+
inputField: V
|
|
73
|
+
});
|
|
74
|
+
const m = o(null);
|
|
75
|
+
return (e, l) => (d(), i("div", {
|
|
76
|
+
class: I(["w-full flex flex-col justify-center relative rounded-t-md border", c.value ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : "border-gray-900"]),
|
|
77
|
+
style: { cursor: "text" }
|
|
78
|
+
}, [
|
|
79
|
+
T("div", {
|
|
80
|
+
class: I([
|
|
81
|
+
"w-full h-full text-field-style flex flex-row items-center p-2 bg-gray-800",
|
|
62
82
|
e.rounded ? "rounded" : "",
|
|
63
|
-
|
|
83
|
+
k.value ? "border border-red-500 bg-red-50" : ""
|
|
64
84
|
])
|
|
65
85
|
}, [
|
|
66
|
-
e.prefix ? (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
e.prefix ? (d(), i("div", z, b(e.prefix), 1)) : y("", !0),
|
|
87
|
+
w(e.$slots, "prepend-inner"),
|
|
88
|
+
T("input", {
|
|
89
|
+
ref_key: "inputField",
|
|
90
|
+
ref: V,
|
|
70
91
|
type: e.type,
|
|
71
|
-
value:
|
|
92
|
+
value: t.value,
|
|
72
93
|
autocomplete: "off",
|
|
73
|
-
class: "h-full w-full bg-transparent focus:outline-none text-center",
|
|
74
|
-
placeholder: e.
|
|
75
|
-
onInput:
|
|
76
|
-
onBlur:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
class: "h-full w-full bg-transparent rounded focus:outline-none text-center",
|
|
95
|
+
placeholder: e.placeholder,
|
|
96
|
+
onInput: D,
|
|
97
|
+
onBlur: K,
|
|
98
|
+
onClick: l[0] || (l[0] = P((s) => {
|
|
99
|
+
u("handleClick");
|
|
100
|
+
}, ["stop"])),
|
|
101
|
+
onFocus: $,
|
|
102
|
+
onKeydown: l[1] || (l[1] = (s) => u("keyDown", s)),
|
|
103
|
+
onKeyup: l[2] || (l[2] = (s) => u("keyUp", s))
|
|
104
|
+
}, null, 40, M),
|
|
105
|
+
w(e.$slots, "default"),
|
|
106
|
+
w(e.$slots, "append-inner"),
|
|
107
|
+
e.suffix ? (d(), i("div", q, b(e.suffix), 1)) : y("", !0)
|
|
82
108
|
], 2),
|
|
83
|
-
|
|
84
|
-
]));
|
|
109
|
+
k.value ? (d(), i("div", A, b(n.value), 1)) : y("", !0)
|
|
110
|
+
], 2));
|
|
85
111
|
}
|
|
86
112
|
};
|
|
87
113
|
export {
|
|
88
|
-
|
|
114
|
+
J as default
|
|
89
115
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ref as s, computed as r, watch as H, nextTick as w, onMounted as x, createElementBlock as i, openBlock as u, createElementVNode as m, normalizeStyle as d, Fragment as T, renderList as _, renderSlot as k } from "vue";
|
|
2
|
+
const O = {
|
|
3
|
+
__name: "KunVirtualScroller",
|
|
4
|
+
props: {
|
|
5
|
+
items: {
|
|
6
|
+
type: Array,
|
|
7
|
+
required: !0
|
|
8
|
+
},
|
|
9
|
+
estimatedItemHeight: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 48
|
|
12
|
+
},
|
|
13
|
+
buffer: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 5
|
|
16
|
+
},
|
|
17
|
+
scrollToIndex: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: null
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(p) {
|
|
23
|
+
const e = p, t = s(null), n = s(0), c = s(0), h = r(() => e.items.length * e.estimatedItemHeight), a = r(
|
|
24
|
+
() => Math.max(0, Math.floor(n.value / e.estimatedItemHeight) - e.buffer)
|
|
25
|
+
), g = r(
|
|
26
|
+
() => Math.min(
|
|
27
|
+
e.items.length,
|
|
28
|
+
Math.ceil((n.value + c.value) / e.estimatedItemHeight) + e.buffer
|
|
29
|
+
)
|
|
30
|
+
), b = r(
|
|
31
|
+
() => e.items.slice(a.value, g.value)
|
|
32
|
+
), y = r(() => a.value * e.estimatedItemHeight);
|
|
33
|
+
function I() {
|
|
34
|
+
t.value && (n.value = t.value.scrollTop);
|
|
35
|
+
}
|
|
36
|
+
function f() {
|
|
37
|
+
t.value && (c.value = t.value.clientHeight);
|
|
38
|
+
}
|
|
39
|
+
return H(
|
|
40
|
+
() => e.scrollToIndex,
|
|
41
|
+
async (l) => {
|
|
42
|
+
l !== null && typeof l == "number" && l >= 0 && l < e.items.length && t.value && (await w(), t.value.scrollTop = l * e.estimatedItemHeight);
|
|
43
|
+
},
|
|
44
|
+
{ immediate: !0 }
|
|
45
|
+
), x(() => {
|
|
46
|
+
f(), typeof ResizeObserver < "u" && new ResizeObserver(f).observe(t.value);
|
|
47
|
+
}), (l, z) => (u(), i("div", {
|
|
48
|
+
ref_key: "containerRef",
|
|
49
|
+
ref: t,
|
|
50
|
+
class: "w-full h-full overflow-y-auto relative",
|
|
51
|
+
onScroll: I
|
|
52
|
+
}, [
|
|
53
|
+
m("div", {
|
|
54
|
+
style: d({ height: h.value + "px", position: "relative" })
|
|
55
|
+
}, [
|
|
56
|
+
m("div", {
|
|
57
|
+
style: d({
|
|
58
|
+
transform: `translateY(${y.value}px)`,
|
|
59
|
+
position: "absolute",
|
|
60
|
+
width: "100%"
|
|
61
|
+
})
|
|
62
|
+
}, [
|
|
63
|
+
(u(!0), i(T, null, _(b.value, (o, v) => (u(), i("div", {
|
|
64
|
+
key: (o == null ? void 0 : o.id) ?? a.value + v
|
|
65
|
+
}, [
|
|
66
|
+
k(l.$slots, "default", {
|
|
67
|
+
item: o,
|
|
68
|
+
index: a.value + v
|
|
69
|
+
})
|
|
70
|
+
]))), 128))
|
|
71
|
+
], 4)
|
|
72
|
+
], 4)
|
|
73
|
+
], 544));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
O as default
|
|
78
|
+
};
|
|
@@ -1,150 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useKunMenu as
|
|
3
|
-
import { kunMenuProps as
|
|
1
|
+
import { onMounted as v, createBlock as M, createCommentVNode as H, openBlock as C, Teleport as E, createVNode as b, Transition as K, withCtx as P, withDirectives as V, createElementVNode as S, mergeProps as I, unref as t, withKeys as u, withModifiers as m, renderSlot as N, vShow as B } from "vue";
|
|
2
|
+
import { useKunMenu as T } from "../composables/useKunMenu.js";
|
|
3
|
+
import { kunMenuProps as W } from "../composables/kunMenuProps.js";
|
|
4
|
+
import { useKunMenuStyles as z } from "../composables/useKunMenuStyles.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
|
|
6
|
+
import A from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const D = {
|
|
6
8
|
__name: "kunMenu",
|
|
7
|
-
props:
|
|
8
|
-
emits: ["update:modelValue"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
menuVisible:
|
|
12
|
-
activatorEl:
|
|
13
|
-
contentEl:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
width: e(W),
|
|
56
|
-
minWidth: e(w),
|
|
57
|
-
maxWidth: e(M),
|
|
58
|
-
minHeight: e(C),
|
|
59
|
-
maxHeight: e(z),
|
|
60
|
-
height: e(k),
|
|
61
|
-
zIndex: o.zIndex,
|
|
62
|
-
opacity: o.scrim && typeof o.scrim == "string" ? l.opacity : void 0
|
|
63
|
-
}
|
|
64
|
-
}, o.contentProps, {
|
|
65
|
-
onClick: t[0] || (t[0] = s((...n) => e(u) && e(u)(...n), ["stop"])),
|
|
66
|
-
onKeydown: [
|
|
67
|
-
t[1] || (t[1] = r(s((...n) => e(m) && e(m)(...n), ["stop", "prevent"]), ["down"])),
|
|
68
|
-
t[2] || (t[2] = r(s((...n) => e(v) && e(v)(...n), ["stop", "prevent"]), ["up"])),
|
|
69
|
-
t[3] || (t[3] = r(s((...n) => e(f) && e(f)(...n), ["stop"]), ["enter"])),
|
|
70
|
-
t[4] || (t[4] = r((...n) => e(p) && e(p)(...n), ["escape"]))
|
|
71
|
-
]
|
|
72
|
-
}), [
|
|
73
|
-
a("div", Z, [
|
|
74
|
-
b(o.$slots, "default")
|
|
75
|
-
])
|
|
76
|
-
], 16, Y), [
|
|
77
|
-
[c, e(d)]
|
|
78
|
-
])
|
|
79
|
-
];
|
|
80
|
-
}),
|
|
81
|
-
_: 3
|
|
82
|
-
})) : (y(), g(G, {
|
|
83
|
-
key: 1,
|
|
84
|
-
name: e(x)
|
|
85
|
-
}, {
|
|
86
|
-
default: $(() => {
|
|
87
|
-
var i;
|
|
88
|
-
return [
|
|
89
|
-
K(a("div", V({
|
|
90
|
-
ref_key: "contentEl",
|
|
91
|
-
ref: h,
|
|
92
|
-
role: "menu",
|
|
93
|
-
"aria-label": o.label,
|
|
94
|
-
tabindex: "-1",
|
|
95
|
-
class: ["absolute bg-white dark:bg-gray-800 rounded shadow-lg z-[var(--zIndex,2000)] overflow-hidden focus:outline-none", [
|
|
96
|
-
o.contentClass,
|
|
97
|
-
((i = e(I)[o.location]) == null ? void 0 : i.class) || ""
|
|
98
|
-
]],
|
|
99
|
-
style: {
|
|
100
|
-
width: e(W),
|
|
101
|
-
minWidth: e(w),
|
|
102
|
-
maxWidth: e(M),
|
|
103
|
-
minHeight: e(C),
|
|
104
|
-
maxHeight: e(z),
|
|
105
|
-
height: e(k),
|
|
106
|
-
zIndex: o.zIndex,
|
|
107
|
-
opacity: o.scrim && typeof o.scrim == "string" ? l.opacity : void 0
|
|
108
|
-
}
|
|
109
|
-
}, o.contentProps, {
|
|
110
|
-
onClick: t[5] || (t[5] = s((...n) => e(u) && e(u)(...n), ["stop"])),
|
|
111
|
-
onKeydown: [
|
|
112
|
-
t[6] || (t[6] = r(s((...n) => e(m) && e(m)(...n), ["stop", "prevent"]), ["down"])),
|
|
113
|
-
t[7] || (t[7] = r(s((...n) => e(v) && e(v)(...n), ["stop", "prevent"]), ["up"])),
|
|
114
|
-
t[8] || (t[8] = r(s((...n) => e(f) && e(f)(...n), ["stop"]), ["enter"])),
|
|
115
|
-
t[9] || (t[9] = r((...n) => e(p) && e(p)(...n), ["escape"]))
|
|
116
|
-
]
|
|
117
|
-
}), [
|
|
118
|
-
a("div", ee, [
|
|
119
|
-
b(o.$slots, "default")
|
|
120
|
-
])
|
|
121
|
-
], 16, _), [
|
|
122
|
-
[c, e(d)]
|
|
123
|
-
])
|
|
124
|
-
];
|
|
125
|
-
}),
|
|
126
|
-
_: 3
|
|
127
|
-
}, 8, ["name"]))
|
|
128
|
-
], 8, ["to"])) : j("", !0),
|
|
129
|
-
a("div", {
|
|
130
|
-
ref_key: "activatorEl",
|
|
131
|
-
ref: S,
|
|
132
|
-
class: L(["inline-block relative", [o.activatorProps.class]]),
|
|
133
|
-
style: J([o.activatorProps.style]),
|
|
134
|
-
onClick: t[10] || (t[10] = s((...i) => e(P) && e(P)(...i), ["stop"])),
|
|
135
|
-
onMouseenter: t[11] || (t[11] = (i) => e(H)("enter")),
|
|
136
|
-
onMouseleave: t[12] || (t[12] = (i) => e(H)("leave")),
|
|
137
|
-
onFocus: t[13] || (t[13] = (...i) => e(E) && e(E)(...i)),
|
|
138
|
-
role: "button",
|
|
139
|
-
"aria-haspopup": !0,
|
|
140
|
-
"aria-expanded": e(d),
|
|
141
|
-
tabindex: "0"
|
|
142
|
-
}, [
|
|
143
|
-
b(o.$slots, "activator", O(Q({ isActive: e(d) })))
|
|
144
|
-
], 46, te)
|
|
145
|
-
], 64));
|
|
9
|
+
props: W,
|
|
10
|
+
emits: ["update:modelValue", "click:outside", "handleEscape"],
|
|
11
|
+
setup(d, { emit: l }) {
|
|
12
|
+
const r = d, p = l, {
|
|
13
|
+
menuVisible: h,
|
|
14
|
+
activatorEl: f,
|
|
15
|
+
contentEl: i,
|
|
16
|
+
handleActivatorClick: c,
|
|
17
|
+
handleHover: g,
|
|
18
|
+
handleFocus: y,
|
|
19
|
+
focusCurrentItem: s,
|
|
20
|
+
handleEscape: a
|
|
21
|
+
} = T(r, p), {
|
|
22
|
+
originClass: w,
|
|
23
|
+
setMenuPosition: k
|
|
24
|
+
} = z(r, i, f, c, g, y);
|
|
25
|
+
return v(() => {
|
|
26
|
+
k();
|
|
27
|
+
}), (e, o) => e.attach !== !0 ? (C(), M(E, {
|
|
28
|
+
key: 0,
|
|
29
|
+
to: e.attach || "body"
|
|
30
|
+
}, [
|
|
31
|
+
b(K, { name: e.transition }, {
|
|
32
|
+
default: P(() => [
|
|
33
|
+
V(S("div", I({
|
|
34
|
+
ref_key: "contentEl",
|
|
35
|
+
ref: i,
|
|
36
|
+
role: "menu",
|
|
37
|
+
tabindex: "-1",
|
|
38
|
+
class: ["bg-gray-100 rounded shadow-lg overflow-y-auto focus:outline-none mt-0.5", [e.contentClass, t(w), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]],
|
|
39
|
+
style: {
|
|
40
|
+
...e.menuPositionStyle,
|
|
41
|
+
maxHeight: typeof e.maxHeight == "number" ? e.maxHeight + "px" : e.maxHeight
|
|
42
|
+
}
|
|
43
|
+
}, e.contentProps, {
|
|
44
|
+
onKeydown: [
|
|
45
|
+
o[0] || (o[0] = u(m((...n) => t(s) && t(s)(...n), ["stop"]), ["enter"])),
|
|
46
|
+
o[1] || (o[1] = u(m((...n) => t(a) && t(a)(...n), ["stop"]), ["escape"]))
|
|
47
|
+
]
|
|
48
|
+
}), [
|
|
49
|
+
N(e.$slots, "default", {}, void 0, !0)
|
|
50
|
+
], 16), [
|
|
51
|
+
[B, t(h)]
|
|
52
|
+
])
|
|
53
|
+
]),
|
|
54
|
+
_: 3
|
|
55
|
+
}, 8, ["name"])
|
|
56
|
+
], 8, ["to"])) : H("", !0);
|
|
146
57
|
}
|
|
147
|
-
};
|
|
58
|
+
}, L = /* @__PURE__ */ A(D, [["__scopeId", "data-v-6c2e939f"]]);
|
|
148
59
|
export {
|
|
149
|
-
|
|
60
|
+
L as default
|
|
150
61
|
};
|