adverich-kun-ui 0.1.282 → 0.1.284
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,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as x, watch as C, onMounted as f, onBeforeUnmount as S, onUnmounted as k, createBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as x, watch as C, onMounted as f, onBeforeUnmount as S, onUnmounted as k, createBlock as m, openBlock as a, Teleport as P, createVNode as o, Transition as u, withCtx as n, createElementBlock as B, createCommentVNode as h, mergeProps as V, renderSlot as E } from "vue";
|
|
2
|
+
import H from "./KunDialogOverlay.vue.js";
|
|
3
|
+
import W from "./KunDialogContent.vue.js";
|
|
4
|
+
const $ = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
5
5
|
__name: "KunDialog",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: Boolean,
|
|
@@ -24,6 +24,7 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
|
24
24
|
},
|
|
25
25
|
contentClass: { type: String, default: "" },
|
|
26
26
|
bgColor: { type: String, default: "bg-slate-100 dark:bg-slate-900" },
|
|
27
|
+
minHeigh: { type: String, default: "h-fit" },
|
|
27
28
|
height: { type: String, default: "h-fit" },
|
|
28
29
|
maxHeigh: { type: String, default: "max-h-[100vh]" },
|
|
29
30
|
minWidth: { type: String, default: "min-w-1/3" },
|
|
@@ -31,8 +32,8 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
|
31
32
|
maxWidth: { type: String, default: "max-w-full" }
|
|
32
33
|
},
|
|
33
34
|
emits: ["update:modelValue"],
|
|
34
|
-
setup(e, { emit:
|
|
35
|
-
const t = e, i =
|
|
35
|
+
setup(e, { emit: y }) {
|
|
36
|
+
const t = e, i = y, g = "justify-" + t.xPosition, p = "items-" + t.yPosition, w = t.yPosition === "top" ? "pt-15" : t.yPosition === "bottom" ? "pb-15" : "", b = [$, t.dialogClass, g, p, w], s = () => {
|
|
36
37
|
t.persistent || i("update:modelValue", !1);
|
|
37
38
|
}, v = () => {
|
|
38
39
|
s();
|
|
@@ -55,22 +56,22 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
|
55
56
|
window.addEventListener("keydown", c);
|
|
56
57
|
}), k(() => {
|
|
57
58
|
window.removeEventListener("keydown", c);
|
|
58
|
-
}), (l,
|
|
59
|
-
|
|
59
|
+
}), (l, D) => (a(), m(P, { to: "body" }, [
|
|
60
|
+
o(u, {
|
|
60
61
|
name: "fade",
|
|
61
62
|
appear: ""
|
|
62
63
|
}, {
|
|
63
64
|
default: n(() => [
|
|
64
|
-
e.modelValue ? (
|
|
65
|
+
e.modelValue ? (a(), B("div", V({
|
|
65
66
|
key: 0,
|
|
66
67
|
class: b
|
|
67
68
|
}, l.$attrs), [
|
|
68
|
-
e.overlay ? (
|
|
69
|
+
e.overlay ? (a(), m(H, {
|
|
69
70
|
key: 0,
|
|
70
71
|
persistent: e.persistent,
|
|
71
72
|
onClick: v
|
|
72
|
-
}, null, 8, ["persistent"])) :
|
|
73
|
-
|
|
73
|
+
}, null, 8, ["persistent"])) : h("", !0),
|
|
74
|
+
o(u, {
|
|
74
75
|
name: "scale",
|
|
75
76
|
"enter-active-class": "transition transform ease-out duration-300",
|
|
76
77
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -80,12 +81,13 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
|
80
81
|
"leave-to-class": "opacity-0 scale-95"
|
|
81
82
|
}, {
|
|
82
83
|
default: n(() => [
|
|
83
|
-
|
|
84
|
+
o(W, {
|
|
84
85
|
fullscreen: e.fullscreen,
|
|
85
86
|
scrollable: e.scrollable,
|
|
86
87
|
"min-width": e.minWidth,
|
|
87
88
|
width: e.width,
|
|
88
89
|
"max-width": e.maxWidth,
|
|
90
|
+
"min-height": e.minHeigh,
|
|
89
91
|
height: e.height,
|
|
90
92
|
"max-height": e.maxHeigh,
|
|
91
93
|
"bg-color": e.bgColor,
|
|
@@ -96,11 +98,11 @@ const D = "fixed inset-0 z-250 flex", T = /* @__PURE__ */ x({
|
|
|
96
98
|
E(l.$slots, "default")
|
|
97
99
|
]),
|
|
98
100
|
_: 3
|
|
99
|
-
}, 8, ["fullscreen", "scrollable", "min-width", "width", "max-width", "height", "max-height", "bg-color", "content-class"])
|
|
101
|
+
}, 8, ["fullscreen", "scrollable", "min-width", "width", "max-width", "min-height", "height", "max-height", "bg-color", "content-class"])
|
|
100
102
|
]),
|
|
101
103
|
_: 3
|
|
102
104
|
})
|
|
103
|
-
], 16)) :
|
|
105
|
+
], 16)) : h("", !0)
|
|
104
106
|
]),
|
|
105
107
|
_: 3
|
|
106
108
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useAttrs as q, computed as
|
|
1
|
+
import { useAttrs as q, computed as r, ref as H, inject as R, onMounted as J, onBeforeUnmount as Q, createBlock as u, openBlock as a, unref as T, withCtx as B, resolveDynamicComponent as v, mergeProps as h, withKeys as L, withModifiers as N, createElementVNode as C, createElementBlock as n, createCommentVNode as s, renderSlot as c, normalizeClass as i, toDisplayString as I } from "vue";
|
|
2
2
|
import P from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
3
3
|
import { RouterLink as W } from "vue-router";
|
|
4
4
|
const X = { class: "flex w-full items-center" }, Y = {
|
|
@@ -10,10 +10,10 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
10
10
|
}, ee = ["src"], te = { class: "flex w-full items-center" }, le = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "shrink-0 flex items-center gap-2 me-2"
|
|
13
|
-
},
|
|
13
|
+
}, ae = ["src"], ne = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "shrink-0 flex items-center gap-2 ms-3"
|
|
16
|
-
}, se = ["src"],
|
|
16
|
+
}, se = ["src"], re = "w-full flex transition duration-150 ease-in-out", oe = {
|
|
17
17
|
__name: "KunListItem",
|
|
18
18
|
props: {
|
|
19
19
|
value: [String, Number, Boolean, Object, Array, null],
|
|
@@ -50,7 +50,7 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
50
50
|
},
|
|
51
51
|
emits: ["click"],
|
|
52
52
|
setup(e, { emit: D }) {
|
|
53
|
-
const $ = q(), x =
|
|
53
|
+
const $ = q(), x = r(() => $.class), j = r(() => {
|
|
54
54
|
const { class: l, ...m } = $;
|
|
55
55
|
return m;
|
|
56
56
|
}), t = e, G = D, f = H(null), y = R("registerListItemRef", null), o = R("kunListContext", null);
|
|
@@ -59,10 +59,10 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
59
59
|
}), Q(() => {
|
|
60
60
|
y && y(null);
|
|
61
61
|
});
|
|
62
|
-
const g = (l) => typeof l == "object" || typeof l == "function", E =
|
|
62
|
+
const g = (l) => typeof l == "object" || typeof l == "function", E = r(() => !!(t.prependIcon || t.prependAvatar)), K = r(() => !!(t.appendIcon || t.appendAvatar)), S = r(() => {
|
|
63
63
|
var l;
|
|
64
64
|
return ((l = o == null ? void 0 : o.isSelected) == null ? void 0 : l.call(o, t.value)) ?? !1;
|
|
65
|
-
}), w =
|
|
65
|
+
}), w = r(() => t.active), M = r(() => !!t.to);
|
|
66
66
|
function b(l, m = null) {
|
|
67
67
|
var p, k;
|
|
68
68
|
if (t.disabled) return;
|
|
@@ -70,8 +70,22 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
70
70
|
const d = ((p = f.value) == null ? void 0 : p.$el) ?? f.value;
|
|
71
71
|
d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("select", { detail: t.value, bubbles: !0 })), o && t.selectable && t.value !== null && ((k = o.toggleItem) == null || k.call(o, t.value), d != null && d.dispatchEvent && d.dispatchEvent(new CustomEvent("selected", { detail: t.value, bubbles: !0 }))), m && m(l);
|
|
72
72
|
}
|
|
73
|
-
const V =
|
|
74
|
-
|
|
73
|
+
const V = r(() => {
|
|
74
|
+
switch (t.variant) {
|
|
75
|
+
case "outlined":
|
|
76
|
+
return "border border-gray-300 dark:border-gray-700";
|
|
77
|
+
case "elevated":
|
|
78
|
+
return "shadow-md";
|
|
79
|
+
case "tonal":
|
|
80
|
+
return "bg-gray-100 dark:bg-gray-800";
|
|
81
|
+
case "flat":
|
|
82
|
+
return "bg-transparent";
|
|
83
|
+
case "plain":
|
|
84
|
+
return "";
|
|
85
|
+
default:
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
88
|
+
}), z = r(() => {
|
|
75
89
|
switch (t.density) {
|
|
76
90
|
case "comfortable":
|
|
77
91
|
return "py-2";
|
|
@@ -80,8 +94,8 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
80
94
|
default:
|
|
81
95
|
return "py-3";
|
|
82
96
|
}
|
|
83
|
-
}), F =
|
|
84
|
-
|
|
97
|
+
}), F = r(() => t.tile ? "rounded-none" : t.rounded === !0 ? "rounded-md" : t.rounded === !1 ? "" : `rounded-${t.rounded}`), U = r(() => t.ripple ? "relative overflow-hidden" : ""), O = r(() => [
|
|
98
|
+
re,
|
|
85
99
|
V.value,
|
|
86
100
|
z.value,
|
|
87
101
|
F.value,
|
|
@@ -97,14 +111,14 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
97
111
|
},
|
|
98
112
|
t.containerClass
|
|
99
113
|
]);
|
|
100
|
-
return (l, m) => M.value ? (
|
|
114
|
+
return (l, m) => M.value ? (a(), u(T(W), {
|
|
101
115
|
key: 0,
|
|
102
116
|
to: e.to,
|
|
103
117
|
replace: e.replace,
|
|
104
118
|
custom: !0
|
|
105
119
|
}, {
|
|
106
120
|
default: B(({ href: d, navigate: p, isActive: k }) => [
|
|
107
|
-
(
|
|
121
|
+
(a(), u(v(e.tag), h({
|
|
108
122
|
ref_key: "liRef",
|
|
109
123
|
ref: f,
|
|
110
124
|
href: d,
|
|
@@ -113,25 +127,24 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
113
127
|
"aria-disabled": e.disabled,
|
|
114
128
|
tabindex: "-1",
|
|
115
129
|
class: O.value,
|
|
116
|
-
1: "",
|
|
117
130
|
onClick: (A) => b(A, p),
|
|
118
131
|
onKeydown: L(N((A) => b(A, p), ["prevent"]), ["enter"])
|
|
119
132
|
}, l.$attrs), {
|
|
120
133
|
default: B(() => [
|
|
121
134
|
C("div", X, [
|
|
122
|
-
E.value || l.$slots.prepend ? (
|
|
135
|
+
E.value || l.$slots.prepend ? (a(), n("div", Y, [
|
|
123
136
|
c(l.$slots, "prepend", {}, () => [
|
|
124
|
-
e.prependAvatar ? (
|
|
137
|
+
e.prependAvatar ? (a(), n("img", {
|
|
125
138
|
key: 0,
|
|
126
139
|
src: e.prependAvatar,
|
|
127
|
-
class:
|
|
128
|
-
}, null, 10, Z)) : g(e.prependIcon) ? (
|
|
140
|
+
class: i(["rounded-full", e.prependClass])
|
|
141
|
+
}, null, 10, Z)) : g(e.prependIcon) ? (a(), u(v(e.prependIcon), {
|
|
129
142
|
key: 1,
|
|
130
|
-
class:
|
|
131
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (
|
|
143
|
+
class: i(e.prependClass)
|
|
144
|
+
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), u(P, {
|
|
132
145
|
key: 2,
|
|
133
146
|
icon: e.prependIcon,
|
|
134
|
-
class:
|
|
147
|
+
class: i(e.prependClass)
|
|
135
148
|
}, null, 8, ["icon", "class"])) : s("", !0)
|
|
136
149
|
])
|
|
137
150
|
])) : s("", !0),
|
|
@@ -140,32 +153,32 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
140
153
|
}, j.value), [
|
|
141
154
|
c(l.$slots, "default", {}, () => [
|
|
142
155
|
c(l.$slots, "title", {}, () => [
|
|
143
|
-
e.title ? (
|
|
156
|
+
e.title ? (a(), n("div", {
|
|
144
157
|
key: 0,
|
|
145
|
-
class:
|
|
158
|
+
class: i(["truncate", e.titleClass])
|
|
146
159
|
}, I(e.title), 3)) : s("", !0)
|
|
147
160
|
]),
|
|
148
161
|
c(l.$slots, "subtitle", {}, () => [
|
|
149
|
-
e.subtitle ? (
|
|
162
|
+
e.subtitle ? (a(), n("div", {
|
|
150
163
|
key: 0,
|
|
151
|
-
class:
|
|
164
|
+
class: i(["truncate", e.subtitleClass])
|
|
152
165
|
}, I(e.subtitle), 3)) : s("", !0)
|
|
153
166
|
])
|
|
154
167
|
])
|
|
155
168
|
], 16),
|
|
156
|
-
K.value ? (
|
|
169
|
+
K.value ? (a(), n("div", _, [
|
|
157
170
|
c(l.$slots, "append", {}, () => [
|
|
158
|
-
e.appendAvatar ? (
|
|
171
|
+
e.appendAvatar ? (a(), n("img", {
|
|
159
172
|
key: 0,
|
|
160
173
|
src: e.appendAvatar,
|
|
161
174
|
class: "w-8 h-8 rounded-full"
|
|
162
175
|
}, null, 8, ee)) : s("", !0),
|
|
163
|
-
g(e.appendIcon) ? (
|
|
176
|
+
g(e.appendIcon) ? (a(), u(v(e.appendIcon), {
|
|
164
177
|
key: 1,
|
|
165
178
|
class: "w-5 h-5"
|
|
166
|
-
})) : e.appendIcon ? (
|
|
179
|
+
})) : e.appendIcon ? (a(), n("i", {
|
|
167
180
|
key: 2,
|
|
168
|
-
class:
|
|
181
|
+
class: i([e.appendClass, "text-xl leading-none"])
|
|
169
182
|
}, null, 2)) : s("", !0)
|
|
170
183
|
])
|
|
171
184
|
])) : s("", !0)
|
|
@@ -175,7 +188,7 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
175
188
|
}, 1040, ["href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
|
|
176
189
|
]),
|
|
177
190
|
_: 3
|
|
178
|
-
}, 8, ["to", "replace"])) : (
|
|
191
|
+
}, 8, ["to", "replace"])) : (a(), u(v(e.tag), h({
|
|
179
192
|
key: 1,
|
|
180
193
|
ref_key: "liRef",
|
|
181
194
|
ref: f,
|
|
@@ -189,19 +202,19 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
189
202
|
}, l.$attrs), {
|
|
190
203
|
default: B(() => [
|
|
191
204
|
C("div", te, [
|
|
192
|
-
E.value || l.$slots.prepend ? (
|
|
205
|
+
E.value || l.$slots.prepend ? (a(), n("div", le, [
|
|
193
206
|
c(l.$slots, "prepend", {}, () => [
|
|
194
|
-
e.prependAvatar ? (
|
|
207
|
+
e.prependAvatar ? (a(), n("img", {
|
|
195
208
|
key: 0,
|
|
196
209
|
src: e.prependAvatar,
|
|
197
|
-
class:
|
|
198
|
-
}, null, 10,
|
|
210
|
+
class: i(["rounded-full", e.prependClass])
|
|
211
|
+
}, null, 10, ae)) : g(e.prependIcon) ? (a(), u(v(e.prependIcon), {
|
|
199
212
|
key: 1,
|
|
200
|
-
class:
|
|
201
|
-
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (
|
|
213
|
+
class: i(e.prependClass)
|
|
214
|
+
}, null, 8, ["class"])) : typeof e.prependIcon == "string" ? (a(), u(P, {
|
|
202
215
|
key: 2,
|
|
203
216
|
icon: e.prependIcon,
|
|
204
|
-
class:
|
|
217
|
+
class: i(e.prependClass)
|
|
205
218
|
}, null, 8, ["icon", "class"])) : s("", !0)
|
|
206
219
|
])
|
|
207
220
|
])) : s("", !0),
|
|
@@ -210,32 +223,32 @@ const X = { class: "flex w-full items-center" }, Y = {
|
|
|
210
223
|
}, j.value), [
|
|
211
224
|
c(l.$slots, "default", {}, () => [
|
|
212
225
|
c(l.$slots, "title", {}, () => [
|
|
213
|
-
e.title ? (
|
|
226
|
+
e.title ? (a(), n("div", {
|
|
214
227
|
key: 0,
|
|
215
|
-
class:
|
|
228
|
+
class: i(["truncate", e.titleClass])
|
|
216
229
|
}, I(e.title), 3)) : s("", !0)
|
|
217
230
|
]),
|
|
218
231
|
c(l.$slots, "subtitle", {}, () => [
|
|
219
|
-
e.subtitle ? (
|
|
232
|
+
e.subtitle ? (a(), n("div", {
|
|
220
233
|
key: 0,
|
|
221
|
-
class:
|
|
234
|
+
class: i(["truncate", e.subtitleClass])
|
|
222
235
|
}, I(e.subtitle), 3)) : s("", !0)
|
|
223
236
|
])
|
|
224
237
|
])
|
|
225
238
|
], 16),
|
|
226
|
-
K.value ? (
|
|
239
|
+
K.value ? (a(), n("div", ne, [
|
|
227
240
|
c(l.$slots, "append", {}, () => [
|
|
228
|
-
e.appendAvatar ? (
|
|
241
|
+
e.appendAvatar ? (a(), n("img", {
|
|
229
242
|
key: 0,
|
|
230
243
|
src: e.appendAvatar,
|
|
231
244
|
class: "w-8 h-8 rounded-full"
|
|
232
245
|
}, null, 8, se)) : s("", !0),
|
|
233
|
-
g(e.appendIcon) ? (
|
|
246
|
+
g(e.appendIcon) ? (a(), u(v(e.appendIcon), {
|
|
234
247
|
key: 1,
|
|
235
248
|
class: "w-5 h-5"
|
|
236
|
-
})) : e.appendIcon ? (
|
|
249
|
+
})) : e.appendIcon ? (a(), n("i", {
|
|
237
250
|
key: 2,
|
|
238
|
-
class:
|
|
251
|
+
class: i([e.appendIcon, "text-xl leading-none"])
|
|
239
252
|
}, null, 2)) : s("", !0)
|
|
240
253
|
])
|
|
241
254
|
])) : s("", !0)
|