adverich-kun-ui 0.1.75 → 0.1.76
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as c, provide as
|
|
2
|
-
import { useKunList as
|
|
1
|
+
import { ref as c, provide as v, createElementBlock as b, openBlock as h, normalizeClass as k, renderSlot as A } from "vue";
|
|
2
|
+
import { useKunList as B } from "../composables/useKunList.js";
|
|
3
3
|
const K = {
|
|
4
4
|
__name: "KunList",
|
|
5
5
|
props: {
|
|
@@ -9,11 +9,7 @@ const K = {
|
|
|
9
9
|
selectable: {
|
|
10
10
|
type: [Boolean, String],
|
|
11
11
|
default: !1,
|
|
12
|
-
validator: (
|
|
13
|
-
},
|
|
14
|
-
selectedClass: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-300"
|
|
12
|
+
validator: (o) => ["single", "multiple", !0, !1].includes(o)
|
|
17
13
|
},
|
|
18
14
|
bgList: {
|
|
19
15
|
type: String,
|
|
@@ -21,56 +17,56 @@ const K = {
|
|
|
21
17
|
}
|
|
22
18
|
},
|
|
23
19
|
emits: ["keyDown"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const u = c(null),
|
|
20
|
+
setup(o, { expose: d, emit: m }) {
|
|
21
|
+
const g = o, w = m;
|
|
22
|
+
B(g);
|
|
23
|
+
const u = c(null), l = c([]);
|
|
28
24
|
d({
|
|
29
25
|
focusWithKey: (e) => {
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
|
|
26
|
+
var t, r;
|
|
27
|
+
const n = l.value.filter(Boolean);
|
|
28
|
+
n.length !== 0 && (e === "ArrowDown" ? (t = n[0]) == null || t.focus() : e === "ArrowUp" && ((r = n[n.length - 1]) == null || r.focus()));
|
|
33
29
|
},
|
|
34
30
|
focus: () => {
|
|
35
|
-
var e,
|
|
36
|
-
(
|
|
31
|
+
var e, n;
|
|
32
|
+
(n = (e = u.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
37
33
|
}
|
|
38
|
-
}),
|
|
39
|
-
e ?
|
|
34
|
+
}), v("registerListItemRef", (e) => {
|
|
35
|
+
e ? l.value.includes(e) || l.value.push(e) : l.value = l.value.filter((n) => n !== e);
|
|
40
36
|
});
|
|
41
|
-
function
|
|
37
|
+
function p(e) {
|
|
42
38
|
var i, a, f;
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
39
|
+
const n = e.key;
|
|
40
|
+
if (w("keyDown", e), !["ArrowDown", "ArrowUp"].includes(n)) return;
|
|
45
41
|
e.preventDefault();
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const r =
|
|
42
|
+
const t = l.value.filter(Boolean);
|
|
43
|
+
if (t.length === 0) return;
|
|
44
|
+
const r = t.findIndex((y) => y === document.activeElement);
|
|
49
45
|
if (r === -1) {
|
|
50
|
-
|
|
46
|
+
n === "ArrowDown" ? (i = t[0]) == null || i.focus() : n === "ArrowUp" && ((a = t[t.length - 1]) == null || a.focus());
|
|
51
47
|
return;
|
|
52
48
|
}
|
|
53
49
|
let s = r;
|
|
54
|
-
|
|
50
|
+
n === "ArrowDown" ? s = (r + 1) % t.length : n === "ArrowUp" && (s = (r - 1 + t.length) % t.length), (f = t[s]) == null || f.focus();
|
|
55
51
|
}
|
|
56
|
-
return (e,
|
|
52
|
+
return (e, n) => (h(), b("ul", {
|
|
57
53
|
role: "list",
|
|
58
54
|
class: k(["w-full bg-gray-500", [
|
|
59
55
|
"kun-list",
|
|
60
|
-
|
|
56
|
+
o.bgList,
|
|
61
57
|
{
|
|
62
|
-
"space-y-1": !
|
|
63
|
-
"space-y-0.5":
|
|
64
|
-
"pl-4 border-l-2 border-gray-300 dark:border-gray-700":
|
|
65
|
-
"p-2 rounded-md":
|
|
58
|
+
"space-y-1": !o.dense,
|
|
59
|
+
"space-y-0.5": o.dense,
|
|
60
|
+
"pl-4 border-l-2 border-gray-300 dark:border-gray-700": o.sub,
|
|
61
|
+
"p-2 rounded-md": o.nav
|
|
66
62
|
}
|
|
67
63
|
]]),
|
|
68
64
|
ref_key: "ulRef",
|
|
69
65
|
ref: u,
|
|
70
66
|
tabindex: "-1",
|
|
71
|
-
onKeydown:
|
|
67
|
+
onKeydown: p
|
|
72
68
|
}, [
|
|
73
|
-
|
|
69
|
+
A(e.$slots, "default")
|
|
74
70
|
], 34));
|
|
75
71
|
}
|
|
76
72
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,121 +1,124 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import r from "./components/KunAlert/src/components/KunAlert.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import t from "./components/KunAppbar/src/components/KunAppbar.vue.js";
|
|
4
|
+
import o from "./components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js";
|
|
5
5
|
import a from "./components/KunAutocomplete/src/components/KunAutocomplete.vue.js";
|
|
6
6
|
import s from "./components/KunBtn/src/components/KunBtn.vue.js";
|
|
7
7
|
import u from "./components/KunBudge/src/components/KunBudge.vue.js";
|
|
8
8
|
import f from "./components/KunCard/src/components/KunCard.vue.js";
|
|
9
9
|
import K from "./components/KunCardActions/src/components/KunCardActions.vue.js";
|
|
10
10
|
import _ from "./components/KunCardItem/src/components/KunCardItem.vue.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import e from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
|
|
12
|
+
import p from "./components/KunCardText/src/components/KunCardText.vue.js";
|
|
13
|
+
import c from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
|
|
14
14
|
import $ from "./components/KunChip/src/components/KunChip.vue.js";
|
|
15
15
|
import l from "./components/KunCol/src/components/KunCol.vue.js";
|
|
16
16
|
import d from "./components/KunContainer/src/components/KunContainer.vue.js";
|
|
17
17
|
import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
|
|
18
18
|
import L from "./components/KunDivider/src/components/KunDivider.vue.js";
|
|
19
19
|
import I from "./components/KunForm/src/components/KunForm.vue.js";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
20
|
+
import T from "./components/KunIcon/src/components/KunIcon.vue.js";
|
|
21
|
+
import A from "./components/KunList/src/components/KunList.vue.js";
|
|
22
22
|
import b from "./components/KunListGroup/src/components/KunListGroup.vue.js";
|
|
23
23
|
import S from "./components/KunListImg/src/components/KunListImg.vue.js";
|
|
24
24
|
import x from "./components/KunListItem/src/components/KunListItem.vue.js";
|
|
25
25
|
import h from "./components/KunListItemAction/src/components/KunListItemAction.vue.js";
|
|
26
26
|
import g from "./components/KunListItemAvatar/src/components/KunListItemAvatar.vue.js";
|
|
27
27
|
import v from "./components/KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
28
|
-
import w from "./components/
|
|
29
|
-
import B from "./components/
|
|
30
|
-
import F from "./components/
|
|
31
|
-
import y from "./components/
|
|
32
|
-
import D from "./components/
|
|
33
|
-
import G from "./components/
|
|
34
|
-
import R from "./components/
|
|
35
|
-
import j from "./components/
|
|
36
|
-
import k from "./components/
|
|
37
|
-
import q from "./components/
|
|
28
|
+
import w from "./components/KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
29
|
+
import B from "./components/KunListItemText/src/components/KunListItemText.vue.js";
|
|
30
|
+
import F from "./components/KunListSubheader/src/components/KunListSubheader.vue.js";
|
|
31
|
+
import y from "./components/kunMenu/src/components/kunMenu.vue.js";
|
|
32
|
+
import D from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
|
|
33
|
+
import G from "./components/KunRow/src/components/KunRow.vue.js";
|
|
34
|
+
import R from "./components/KunSlider/src/components/KunSlider.vue.js";
|
|
35
|
+
import j from "./components/KunSpacer/src/components/KunSpacer.vue.js";
|
|
36
|
+
import k from "./components/KunSwitch/src/components/KunSwitch.vue.js";
|
|
37
|
+
import q from "./components/KunTextField/src/components/KunTextField.vue.js";
|
|
38
|
+
import z from "./components/KunToolbar/src/components/KunToolbar.vue.js";
|
|
38
39
|
import M from "./components/KunTooltip/src/components/KunTooltip.vue.js";
|
|
39
|
-
const
|
|
40
|
+
const n = {
|
|
40
41
|
KunAlert: r,
|
|
41
|
-
KunAppbar:
|
|
42
|
-
KunAppbarTitle:
|
|
42
|
+
KunAppbar: t,
|
|
43
|
+
KunAppbarTitle: o,
|
|
43
44
|
KunAutocomplete: a,
|
|
44
45
|
KunBtn: s,
|
|
45
46
|
KunBudge: u,
|
|
46
47
|
KunCard: f,
|
|
47
48
|
KunCardActions: K,
|
|
48
49
|
KunCardItem: _,
|
|
49
|
-
KunCardSubtitle:
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
KunCardSubtitle: e,
|
|
51
|
+
KunListItemTitle: w,
|
|
52
|
+
KunCardText: p,
|
|
53
|
+
KunCardTitle: c,
|
|
52
54
|
KunChip: $,
|
|
53
55
|
KunCol: l,
|
|
54
56
|
KunContainer: d,
|
|
55
57
|
KunCurrency: C,
|
|
56
58
|
KunDivider: L,
|
|
57
59
|
KunForm: I,
|
|
58
|
-
KunIcon:
|
|
59
|
-
KunList:
|
|
60
|
+
KunIcon: T,
|
|
61
|
+
KunList: A,
|
|
60
62
|
KunListGroup: b,
|
|
61
63
|
KunListImg: S,
|
|
62
64
|
KunListItem: x,
|
|
63
65
|
KunListItemAction: h,
|
|
64
66
|
KunListItemAvatar: g,
|
|
65
67
|
KunListItemSubtitle: v,
|
|
66
|
-
KunListItemText:
|
|
67
|
-
KunListSubheader:
|
|
68
|
-
KunMenu:
|
|
69
|
-
KunLoaderCircular:
|
|
70
|
-
KunRow:
|
|
71
|
-
KunSlider:
|
|
72
|
-
KunSpacer:
|
|
73
|
-
KunSwitch:
|
|
74
|
-
KunTextField:
|
|
75
|
-
KunToolbar:
|
|
68
|
+
KunListItemText: B,
|
|
69
|
+
KunListSubheader: F,
|
|
70
|
+
KunMenu: y,
|
|
71
|
+
KunLoaderCircular: D,
|
|
72
|
+
KunRow: G,
|
|
73
|
+
KunSlider: R,
|
|
74
|
+
KunSpacer: j,
|
|
75
|
+
KunSwitch: k,
|
|
76
|
+
KunTextField: q,
|
|
77
|
+
KunToolbar: z,
|
|
76
78
|
KunTooltip: M
|
|
77
79
|
};
|
|
78
|
-
function
|
|
79
|
-
for (const
|
|
80
|
-
i.component(
|
|
80
|
+
function hm(i) {
|
|
81
|
+
for (const m in n)
|
|
82
|
+
i.component(m, n[m]);
|
|
81
83
|
}
|
|
82
84
|
export {
|
|
83
85
|
r as KunAlert,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
t as KunAppbar,
|
|
87
|
+
o as KunAppbarTitle,
|
|
86
88
|
a as KunAutocomplete,
|
|
87
89
|
s as KunBtn,
|
|
88
90
|
u as KunBudge,
|
|
89
91
|
f as KunCard,
|
|
90
92
|
K as KunCardActions,
|
|
91
93
|
_ as KunCardItem,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
e as KunCardSubtitle,
|
|
95
|
+
p as KunCardText,
|
|
96
|
+
c as KunCardTitle,
|
|
95
97
|
$ as KunChip,
|
|
96
98
|
l as KunCol,
|
|
97
99
|
d as KunContainer,
|
|
98
100
|
C as KunCurrency,
|
|
99
101
|
L as KunDivider,
|
|
100
102
|
I as KunForm,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
T as KunIcon,
|
|
104
|
+
A as KunList,
|
|
103
105
|
b as KunListGroup,
|
|
104
106
|
S as KunListImg,
|
|
105
107
|
x as KunListItem,
|
|
106
108
|
h as KunListItemAction,
|
|
107
109
|
g as KunListItemAvatar,
|
|
108
110
|
v as KunListItemSubtitle,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
G as
|
|
115
|
-
R as
|
|
116
|
-
j as
|
|
117
|
-
k as
|
|
118
|
-
q as
|
|
111
|
+
B as KunListItemText,
|
|
112
|
+
w as KunListItemTitle,
|
|
113
|
+
F as KunListSubheader,
|
|
114
|
+
D as KunLoaderCircular,
|
|
115
|
+
y as KunMenu,
|
|
116
|
+
G as KunRow,
|
|
117
|
+
R as KunSlider,
|
|
118
|
+
j as KunSpacer,
|
|
119
|
+
k as KunSwitch,
|
|
120
|
+
q as KunTextField,
|
|
121
|
+
z as KunToolbar,
|
|
119
122
|
M as KunTooltip,
|
|
120
|
-
|
|
123
|
+
hm as install
|
|
121
124
|
};
|