adverich-kun-ui 0.1.126 → 0.1.128
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/KunDialog/src/components/KunDialog.vue.js +102 -0
- package/dist/components/KunDialog/src/components/KunDialog.vue2.js +4 -0
- package/dist/components/KunDialog/src/components/KunDialogContent.vue.js +23 -0
- package/dist/components/KunDialog/src/components/KunDialogContent.vue2.js +4 -0
- package/dist/components/KunDialog/src/components/KunDialogOverlay.vue.js +20 -0
- package/dist/components/KunDialog/src/components/KunDialogOverlay.vue2.js +4 -0
- package/dist/components/KunTable/src/components/KunTable.vue.js +150 -0
- package/dist/components/KunTable/src/components/KunTableFilter.vue.js +108 -0
- package/dist/components/KunTable/src/components/KunTableFooter.vue.js +53 -0
- package/dist/components/KunTable/src/components/KunTableHeaders.vue.js +86 -0
- package/dist/components/KunTable/src/components/KunTableRow.vue.js +88 -0
- package/dist/components/KunTable/src/components/KunTableRows.vue.js +77 -0
- package/dist/components/KunTable/src/composables/KunTableProps.js +84 -0
- package/dist/components/KunTable/src/composables/useExpand.js +21 -0
- package/dist/components/KunTable/src/composables/useFilter.js +43 -0
- package/dist/components/KunTable/src/composables/useOptions.js +29 -0
- package/dist/components/KunTable/src/composables/useSelect.js +30 -0
- package/dist/components/KunTooltip/src/components/KunTooltip.vue.js +100 -81
- package/dist/index.js +26 -23
- package/package.json +1 -1
- package/dist/components/KunTooltip/src/composables/useTooltip.js +0 -93
|
@@ -1,97 +1,116 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ref as c, computed as $, onMounted as R, onBeforeUnmount as B, createElementBlock as E, openBlock as x, Fragment as O, createElementVNode as b, createBlock as C, mergeProps as z, renderSlot as T, Teleport as L, createVNode as N, Transition as V, withCtx as _, withDirectives as D, normalizeStyle as M, normalizeClass as P, createTextVNode as F, toDisplayString as K, vShow as j, nextTick as A } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import I from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const U = {
|
|
4
5
|
__name: "KunTooltip",
|
|
5
6
|
props: {
|
|
6
|
-
text:
|
|
7
|
-
type: String,
|
|
8
|
-
default: ""
|
|
9
|
-
},
|
|
7
|
+
text: String,
|
|
10
8
|
location: {
|
|
11
9
|
type: String,
|
|
12
|
-
default: "top"
|
|
13
|
-
validator: (e) => ["top", "bottom", "left", "right"].includes(e)
|
|
10
|
+
default: "top"
|
|
14
11
|
},
|
|
15
12
|
openOn: {
|
|
16
13
|
type: String,
|
|
17
|
-
default: "hover"
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
disabled: Boolean,
|
|
21
|
-
contentClass: {
|
|
22
|
-
type: [String, Object, Array],
|
|
23
|
-
default: null
|
|
24
|
-
},
|
|
25
|
-
delay: {
|
|
26
|
-
type: [String, Number],
|
|
27
|
-
default: 0,
|
|
28
|
-
validator: (e) => !isNaN(parseInt(e))
|
|
29
|
-
},
|
|
30
|
-
closeOnClick: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
14
|
+
default: "hover"
|
|
15
|
+
// 'click' | 'hover' | 'focus'
|
|
33
16
|
},
|
|
34
17
|
transition: {
|
|
35
18
|
type: String,
|
|
36
19
|
default: "fade"
|
|
20
|
+
},
|
|
21
|
+
contentClass: [String, Array, Object],
|
|
22
|
+
disabled: Boolean,
|
|
23
|
+
delay: {
|
|
24
|
+
type: [Number, String],
|
|
25
|
+
default: 0
|
|
26
|
+
},
|
|
27
|
+
closeDelay: {
|
|
28
|
+
type: [Number, String],
|
|
29
|
+
default: 100
|
|
37
30
|
}
|
|
38
31
|
},
|
|
39
|
-
setup(
|
|
40
|
-
const o =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
32
|
+
setup(l) {
|
|
33
|
+
const o = l, i = c(!1), v = c(null), g = c(null), h = c({});
|
|
34
|
+
let u = null, d = null;
|
|
35
|
+
function p() {
|
|
36
|
+
o.disabled || (clearTimeout(d), u = setTimeout(async () => {
|
|
37
|
+
i.value = !0, await A(), y();
|
|
38
|
+
}, +o.delay));
|
|
39
|
+
}
|
|
40
|
+
function f() {
|
|
41
|
+
clearTimeout(u), d = setTimeout(() => {
|
|
42
|
+
i.value = !1;
|
|
43
|
+
}, +o.closeDelay);
|
|
44
|
+
}
|
|
45
|
+
function S() {
|
|
46
|
+
i.value ? f() : p();
|
|
47
|
+
}
|
|
48
|
+
const w = $(() => {
|
|
49
|
+
if (o.disabled) return {};
|
|
50
|
+
const e = {};
|
|
51
|
+
return o.openOn === "hover" && (e.onMouseenter = p, e.onMouseleave = f), o.openOn === "click" && (e.onClick = S), o.openOn === "focus" && (e.onFocus = p, e.onBlur = f), e;
|
|
52
|
+
});
|
|
53
|
+
function y() {
|
|
54
|
+
const e = v.value, m = g.value;
|
|
55
|
+
if (!e || !m) return;
|
|
56
|
+
const t = e.getBoundingClientRect(), n = m.getBoundingClientRect(), a = window.pageYOffset || document.documentElement.scrollTop, s = window.pageXOffset || document.documentElement.scrollLeft, k = {
|
|
57
|
+
top: {
|
|
58
|
+
top: `${t.top + a - n.height - 16}px`,
|
|
59
|
+
left: `${t.left + s + t.width / 2 - n.width / 2}px`
|
|
60
|
+
},
|
|
61
|
+
bottom: {
|
|
62
|
+
top: `${t.bottom + a + 8}px`,
|
|
63
|
+
left: `${t.left + s + t.width / 2 - n.width / 2}px`
|
|
64
|
+
},
|
|
65
|
+
left: {
|
|
66
|
+
top: `${t.top + a + t.height / 2 - n.height / 2}px`,
|
|
67
|
+
left: `${t.left + s - n.width - 8}px`
|
|
68
|
+
},
|
|
69
|
+
right: {
|
|
70
|
+
top: `${t.top + a + t.height / 2 - n.height / 2}px`,
|
|
71
|
+
left: `${t.right + s + 8}px`
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
h.value = k[o.location];
|
|
75
|
+
}
|
|
76
|
+
const r = () => {
|
|
77
|
+
i.value && y();
|
|
78
|
+
};
|
|
79
|
+
return R(() => {
|
|
80
|
+
window.addEventListener("scroll", r), window.addEventListener("resize", r);
|
|
81
|
+
}), B(() => {
|
|
82
|
+
clearTimeout(u), clearTimeout(d), window.removeEventListener("scroll", r), window.removeEventListener("resize", r);
|
|
83
|
+
}), (e, m) => (x(), E(O, null, [
|
|
84
|
+
b("span", z({
|
|
85
|
+
ref_key: "activatorRef",
|
|
86
|
+
ref: v
|
|
87
|
+
}, w.value), [
|
|
88
|
+
T(e.$slots, "activator", { props: w.value }, void 0, !0)
|
|
89
|
+
], 16),
|
|
90
|
+
(x(), C(L, { to: "body" }, [
|
|
91
|
+
N(V, { name: l.transition }, {
|
|
92
|
+
default: _(() => [
|
|
93
|
+
D(b("div", {
|
|
94
|
+
ref_key: "tooltipRef",
|
|
95
|
+
ref: g,
|
|
96
|
+
class: P(["absolute px-3 py-2 text-sm rounded shadow text-black dark:text-white bg-gray-600:75 dark:bg-gray-700/75", l.contentClass]),
|
|
97
|
+
style: M([h.value, { "z-index": "9999" }]),
|
|
98
|
+
role: "tooltip",
|
|
99
|
+
"aria-hidden": "!isVisible"
|
|
100
|
+
}, [
|
|
101
|
+
T(e.$slots, "default", {}, () => [
|
|
102
|
+
F(K(l.text), 1)
|
|
103
|
+
], !0)
|
|
104
|
+
], 6), [
|
|
105
|
+
[j, i.value]
|
|
106
|
+
])
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 8, ["name"])
|
|
110
|
+
]))
|
|
111
|
+
], 64));
|
|
93
112
|
}
|
|
94
|
-
};
|
|
113
|
+
}, G = /* @__PURE__ */ I(U, [["__scopeId", "data-v-b846040c"]]);
|
|
95
114
|
export {
|
|
96
|
-
|
|
115
|
+
G as default
|
|
97
116
|
};
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import u from "./components/KunBtn/src/components/KunBtn.vue.js";
|
|
|
8
8
|
import f from "./components/KunBudge/src/components/KunBudge.vue.js";
|
|
9
9
|
import K from "./components/KunCard/src/components/KunCard.vue.js";
|
|
10
10
|
import _ from "./components/KunCardActions/src/components/KunCardActions.vue.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import e from "./components/KunCardItem/src/components/KunCardItem.vue.js";
|
|
12
|
+
import p from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
|
|
13
13
|
import c from "./components/KunCardText/src/components/KunCardText.vue.js";
|
|
14
14
|
import $ from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
|
|
15
15
|
import l from "./components/KunChip/src/components/KunChip.vue.js";
|
|
@@ -17,9 +17,9 @@ import d from "./components/KunCol/src/components/KunCol.vue.js";
|
|
|
17
17
|
import L from "./components/KunContainer/src/components/KunContainer.vue.js";
|
|
18
18
|
import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
|
|
19
19
|
import I from "./components/KunDivider/src/components/KunDivider.vue.js";
|
|
20
|
-
import
|
|
20
|
+
import b from "./components/KunForm/src/components/KunForm.vue.js";
|
|
21
21
|
import T from "./components/KunIcon/src/components/KunIcon.vue.js";
|
|
22
|
-
import
|
|
22
|
+
import A from "./components/KunList/src/components/KunList.vue.js";
|
|
23
23
|
import S from "./components/KunListGroup/src/components/KunListGroup.vue.js";
|
|
24
24
|
import x from "./components/KunListImg/src/components/KunListImg.vue.js";
|
|
25
25
|
import h from "./components/KunListItem/src/components/KunListItem.vue.js";
|
|
@@ -36,9 +36,10 @@ import j from "./components/KunRow/src/components/KunRow.vue.js";
|
|
|
36
36
|
import k from "./components/KunSlider/src/components/KunSlider.vue.js";
|
|
37
37
|
import q from "./components/KunSpacer/src/components/KunSpacer.vue.js";
|
|
38
38
|
import M from "./components/KunSwitch/src/components/KunSwitch.vue.js";
|
|
39
|
-
import N from "./components/
|
|
40
|
-
import z from "./components/
|
|
41
|
-
import E from "./components/
|
|
39
|
+
import N from "./components/KunTable/src/components/KunTable.vue.js";
|
|
40
|
+
import z from "./components/KunTextField/src/components/KunTextField.vue.js";
|
|
41
|
+
import E from "./components/KunToolbar/src/components/KunToolbar.vue.js";
|
|
42
|
+
import H from "./components/KunTooltip/src/components/KunTooltip.vue.js";
|
|
42
43
|
const n = {
|
|
43
44
|
KunAlert: i,
|
|
44
45
|
KunAppbar: o,
|
|
@@ -49,8 +50,8 @@ const n = {
|
|
|
49
50
|
KunBudge: f,
|
|
50
51
|
KunCard: K,
|
|
51
52
|
KunCardActions: _,
|
|
52
|
-
KunCardItem:
|
|
53
|
-
KunCardSubtitle:
|
|
53
|
+
KunCardItem: e,
|
|
54
|
+
KunCardSubtitle: p,
|
|
54
55
|
KunListItemTitle: F,
|
|
55
56
|
KunCardText: c,
|
|
56
57
|
KunCardTitle: $,
|
|
@@ -59,9 +60,9 @@ const n = {
|
|
|
59
60
|
KunContainer: L,
|
|
60
61
|
KunCurrency: C,
|
|
61
62
|
KunDivider: I,
|
|
62
|
-
KunForm:
|
|
63
|
+
KunForm: b,
|
|
63
64
|
KunIcon: T,
|
|
64
|
-
KunList:
|
|
65
|
+
KunList: A,
|
|
65
66
|
KunListGroup: S,
|
|
66
67
|
KunListImg: x,
|
|
67
68
|
KunListItem: h,
|
|
@@ -77,11 +78,12 @@ const n = {
|
|
|
77
78
|
KunSlider: k,
|
|
78
79
|
KunSpacer: q,
|
|
79
80
|
KunSwitch: M,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
KunTable: N,
|
|
82
|
+
KunTextField: z,
|
|
83
|
+
KunToolbar: E,
|
|
84
|
+
KunTooltip: H
|
|
83
85
|
};
|
|
84
|
-
function
|
|
86
|
+
function ym(r) {
|
|
85
87
|
for (const m in n)
|
|
86
88
|
r.component(m, n[m]);
|
|
87
89
|
}
|
|
@@ -95,8 +97,8 @@ export {
|
|
|
95
97
|
f as KunBudge,
|
|
96
98
|
K as KunCard,
|
|
97
99
|
_ as KunCardActions,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
e as KunCardItem,
|
|
101
|
+
p as KunCardSubtitle,
|
|
100
102
|
c as KunCardText,
|
|
101
103
|
$ as KunCardTitle,
|
|
102
104
|
l as KunChip,
|
|
@@ -104,9 +106,9 @@ export {
|
|
|
104
106
|
L as KunContainer,
|
|
105
107
|
C as KunCurrency,
|
|
106
108
|
I as KunDivider,
|
|
107
|
-
|
|
109
|
+
b as KunForm,
|
|
108
110
|
T as KunIcon,
|
|
109
|
-
|
|
111
|
+
A as KunList,
|
|
110
112
|
S as KunListGroup,
|
|
111
113
|
x as KunListImg,
|
|
112
114
|
h as KunListItem,
|
|
@@ -122,8 +124,9 @@ export {
|
|
|
122
124
|
k as KunSlider,
|
|
123
125
|
q as KunSpacer,
|
|
124
126
|
M as KunSwitch,
|
|
125
|
-
N as
|
|
126
|
-
z as
|
|
127
|
-
E as
|
|
128
|
-
|
|
127
|
+
N as KunTable,
|
|
128
|
+
z as KunTextField,
|
|
129
|
+
E as KunToolbar,
|
|
130
|
+
H as KunTooltip,
|
|
131
|
+
ym as install
|
|
129
132
|
};
|
package/package.json
CHANGED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { ref as l, computed as i } from "vue";
|
|
2
|
-
function x(e) {
|
|
3
|
-
const o = l(!1);
|
|
4
|
-
let c = null, s = null;
|
|
5
|
-
const w = i(() => {
|
|
6
|
-
switch (e.location) {
|
|
7
|
-
case "top":
|
|
8
|
-
return "mb-2";
|
|
9
|
-
case "bottom":
|
|
10
|
-
return "mt-2";
|
|
11
|
-
case "left":
|
|
12
|
-
return "mr-2";
|
|
13
|
-
case "right":
|
|
14
|
-
return "ml-2";
|
|
15
|
-
default:
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
}), h = i(() => {
|
|
19
|
-
switch (e.location) {
|
|
20
|
-
case "top":
|
|
21
|
-
return "border-b border-l border-gray-800 dark:border-gray-700";
|
|
22
|
-
case "bottom":
|
|
23
|
-
return "border-t border-l border-gray-800 dark:border-gray-700";
|
|
24
|
-
case "left":
|
|
25
|
-
return "border-r border-t border-gray-800 dark:border-gray-700";
|
|
26
|
-
case "right":
|
|
27
|
-
return "border-l border-t border-gray-800 dark:border-gray-700";
|
|
28
|
-
default:
|
|
29
|
-
return "";
|
|
30
|
-
}
|
|
31
|
-
}), g = i(() => {
|
|
32
|
-
let t = {};
|
|
33
|
-
switch (e.location) {
|
|
34
|
-
case "top":
|
|
35
|
-
case "bottom":
|
|
36
|
-
t.left = "50%", t.transform = "translateX(-50%)";
|
|
37
|
-
break;
|
|
38
|
-
case "left":
|
|
39
|
-
case "right":
|
|
40
|
-
t.top = "50%", t.transform = "translateY(-50%)";
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
}), u = l({}), d = () => {
|
|
45
|
-
if (!n.value || !a.value) return;
|
|
46
|
-
const t = n.value.getBoundingClientRect(), f = a.value.getBoundingClientRect();
|
|
47
|
-
let r = {};
|
|
48
|
-
switch (e.location) {
|
|
49
|
-
case "top":
|
|
50
|
-
r.top = `${t.top + window.scrollY - f.height}px`, r.left = `${t.left + window.scrollX + t.width / 2}px`;
|
|
51
|
-
break;
|
|
52
|
-
case "bottom":
|
|
53
|
-
r.top = `${t.bottom + window.scrollY}px`, r.left = `${t.left + window.scrollX + t.width / 2}px`;
|
|
54
|
-
break;
|
|
55
|
-
case "left":
|
|
56
|
-
r.top = `${t.top + window.scrollY + t.height / 2}px`, r.left = `${t.left + window.scrollX - f.width}px`;
|
|
57
|
-
break;
|
|
58
|
-
case "right":
|
|
59
|
-
r.top = `${t.top + window.scrollY + t.height / 2}px`, r.left = `${t.right + window.scrollX}px`;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
u.value = r;
|
|
63
|
-
}, n = l(null), a = l(null), m = () => {
|
|
64
|
-
e.disabled || (clearTimeout(s), c = setTimeout(() => {
|
|
65
|
-
o.value = !0, d();
|
|
66
|
-
}, parseInt(e.delay)));
|
|
67
|
-
}, b = () => {
|
|
68
|
-
e.disabled || (clearTimeout(c), s = setTimeout(() => {
|
|
69
|
-
o.value = !1;
|
|
70
|
-
}, 100));
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
isVisible: o,
|
|
74
|
-
positionClass: w,
|
|
75
|
-
arrowClass: h,
|
|
76
|
-
positionStyle: u,
|
|
77
|
-
arrowStyle: g,
|
|
78
|
-
onEnter: () => {
|
|
79
|
-
e.openOn === "hover" && m();
|
|
80
|
-
},
|
|
81
|
-
onLeave: () => {
|
|
82
|
-
e.openOn === "hover" && b();
|
|
83
|
-
},
|
|
84
|
-
onClick: () => {
|
|
85
|
-
e.openOn === "click" && (o.value = !o.value, o.value && d()), e.closeOnClick && b();
|
|
86
|
-
},
|
|
87
|
-
activator: n,
|
|
88
|
-
tooltip: a
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
export {
|
|
92
|
-
x as useTooltip
|
|
93
|
-
};
|