adverich-kun-ui 0.1.76 → 0.1.77
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/KunAlert/src/components/KunAlert.vue.js +193 -33
- package/dist/components/KunAppbar/src/components/KunAppbar.vue.js +69 -41
- package/dist/components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js +9 -5
- package/dist/components/KunAutocomplete/src/components/KunAutocomplete.vue.js +51 -52
- package/dist/components/KunAutocomplete/src/composables/useAutocomplete.js +1 -1
- package/dist/components/KunBtn/src/components/KunBtn.vue.js +86 -77
- package/dist/components/KunCard/src/components/KunCard.vue.js +38 -32
- package/dist/components/KunCard/src/composables/kunCardProps.js +4 -8
- package/dist/components/KunCardActions/src/components/KunCardActions.vue.js +18 -16
- package/dist/components/KunCardActions/src/composables/kunCardActionsProps.js +0 -8
- package/dist/components/KunCardItem/src/components/KunCardItem.vue.js +17 -16
- package/dist/components/KunCardItem/src/composables/kunCardItemProps.js +0 -8
- package/dist/components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js +16 -17
- package/dist/components/KunCardSubtitle/src/composables/kunCardSubtitleProps.js +1 -9
- package/dist/components/KunCardText/src/components/KunCardText.vue.js +16 -17
- package/dist/components/KunCardText/src/composables/kunCardTextProps.js +1 -9
- package/dist/components/KunCardTitle/src/components/KunCardTitle.vue.js +57 -45
- package/dist/components/KunCardTitle/src/composables/kunCardTitleProps.js +5 -25
- package/dist/components/KunChip/src/components/KunChip.vue.js +63 -47
- package/dist/components/KunChip/src/composables/kunChipProps.js +7 -17
- package/dist/components/KunChip/src/composables/useChip.js +10 -19
- package/dist/components/KunList/src/components/KunList.vue.js +10 -10
- package/dist/components/kunMenu/src/components/kunMenu.vue.js +48 -48
- package/dist/components/kunMenu/src/composables/kunMenuProps.js +0 -4
- package/dist/components/kunMenu/src/composables/useKunMenuStyles.js +31 -14
- package/dist/icons/IconMenuRounded.vue.js +17 -0
- package/dist/index.js +12 -12
- package/package.json +1 -1
- package/dist/components/KunCard/src/composables/useCard.js +0 -17
- package/dist/components/KunCardActions/src/composables/useCardActions.js +0 -19
- package/dist/components/KunCardItem/src/composables/useCardItem.js +0 -17
- package/dist/components/KunCardSubtitle/src/composables/useCardSubtitle.js +0 -15
- package/dist/components/KunCardText/src/composables/useCardText.js +0 -15
- package/dist/components/KunCardTitle/src/composables/useCardTitle.js +0 -25
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mergeModels as
|
|
1
|
+
import { mergeModels as z, useModel as A, onMounted as ne, onUnmounted as ie, ref as R, watch as re, createBlock as c, openBlock as r, unref as e, isRef as U, createSlots as ae, withCtx as i, createElementBlock as B, createCommentVNode as k, createVNode as a, Fragment as se, renderList as ue, createElementVNode as de, createTextVNode as w, toDisplayString as V, normalizeClass as ce, withModifiers as me } from "vue";
|
|
2
2
|
import { icons as p } from "../../../../icons/index.js";
|
|
3
|
-
import { isNotEmpty as fe, isArray as
|
|
3
|
+
import { isNotEmpty as fe, isArray as F } from "../../../../utils/utils.js";
|
|
4
4
|
import pe from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
|
|
5
5
|
import ve from "../../../KunList/src/components/KunList.vue.js";
|
|
6
|
-
import
|
|
6
|
+
import N from "../../../KunListItem/src/components/KunListItem.vue.js";
|
|
7
7
|
import ye from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
8
8
|
import ke from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
9
9
|
import he from "../../../kunMenu/src/components/kunMenu.vue.js";
|
|
@@ -13,48 +13,48 @@ import be from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
|
13
13
|
import we from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
14
14
|
import Ve from "../../../KunChip/src/components/KunChip.vue.js";
|
|
15
15
|
import h from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
16
|
-
const
|
|
16
|
+
const xe = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "flex justify-center align-center"
|
|
19
|
-
},
|
|
19
|
+
}, Ie = { class: "flex justify-center align-center" }, Te = {
|
|
20
20
|
__name: "KunAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */
|
|
21
|
+
props: /* @__PURE__ */ z(Ce, {
|
|
22
22
|
modelValue: { default: null },
|
|
23
23
|
modelModifiers: {},
|
|
24
24
|
items: { default: [], type: Array, required: !0 },
|
|
25
25
|
itemsModifiers: {}
|
|
26
26
|
}),
|
|
27
|
-
emits: /* @__PURE__ */
|
|
28
|
-
setup(g, { emit:
|
|
29
|
-
const u =
|
|
27
|
+
emits: /* @__PURE__ */ z(["createItem", "validation", "search"], ["update:modelValue", "update:items"]),
|
|
28
|
+
setup(g, { emit: T }) {
|
|
29
|
+
const u = A(g, "modelValue"), x = A(g, "items"), n = g, v = T, {
|
|
30
30
|
selectedItem: m,
|
|
31
31
|
textFieldRef: d,
|
|
32
32
|
listRef: C,
|
|
33
33
|
menuModel: s,
|
|
34
34
|
search: f,
|
|
35
|
-
removeItem:
|
|
36
|
-
clearSelection:
|
|
37
|
-
lightReset:
|
|
35
|
+
removeItem: H,
|
|
36
|
+
clearSelection: O,
|
|
37
|
+
lightReset: I,
|
|
38
38
|
openMenu: $,
|
|
39
|
-
onMenuKeydown:
|
|
39
|
+
onMenuKeydown: S,
|
|
40
40
|
getSelectedItem: j,
|
|
41
41
|
textArr: q,
|
|
42
|
-
getItemText:
|
|
43
|
-
createItem:
|
|
44
|
-
checkDisabled:
|
|
45
|
-
itemToString:
|
|
42
|
+
getItemText: P,
|
|
43
|
+
createItem: W,
|
|
44
|
+
checkDisabled: G,
|
|
45
|
+
itemToString: _,
|
|
46
46
|
placeholder: K,
|
|
47
|
-
hasCreateItem:
|
|
48
|
-
} = ge(n, v, u,
|
|
47
|
+
hasCreateItem: J
|
|
48
|
+
} = ge(n, v, u, x);
|
|
49
49
|
ne(() => {
|
|
50
50
|
b(), window.addEventListener("resize", b), n.focusOnRender && d.value.focus();
|
|
51
51
|
}), ie(() => {
|
|
52
52
|
window.removeEventListener("resize", b);
|
|
53
53
|
});
|
|
54
|
-
function
|
|
54
|
+
function Q(t) {
|
|
55
55
|
return u.value === null || u.value === void 0 ? n.bgItemListColor : n.multiple ? u.value.find((o) => o[n.itemValue] === t[n.itemValue]) ? n.selectedColor : n.bgItemListColor : K.value === t[n.itemTitle] ? n.selectedColor : n.bgItemListColor;
|
|
56
56
|
}
|
|
57
|
-
const y =
|
|
57
|
+
const y = R(""), M = (t) => {
|
|
58
58
|
for (const o of n.rules) {
|
|
59
59
|
const l = o(t);
|
|
60
60
|
if (l !== !0)
|
|
@@ -68,15 +68,15 @@ const Se = {
|
|
|
68
68
|
function D() {
|
|
69
69
|
s.value = !1, d.value.$el.focus();
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function X(t) {
|
|
72
72
|
v("search", f);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const Y = R({});
|
|
75
75
|
function b() {
|
|
76
76
|
if (d.value) {
|
|
77
77
|
const t = d.value.$el.getBoundingClientRect();
|
|
78
78
|
let o = t.bottom;
|
|
79
|
-
n.hideDetails || (o = o - 20),
|
|
79
|
+
n.hideDetails || (o = o - 20), Y.value = {
|
|
80
80
|
position: "absolute",
|
|
81
81
|
top: `${o}px`,
|
|
82
82
|
// Posiciona el menú justo debajo
|
|
@@ -101,10 +101,10 @@ const Se = {
|
|
|
101
101
|
C.value.focusWithKey(o);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
S(t);
|
|
105
105
|
}
|
|
106
106
|
function te(t) {
|
|
107
|
-
|
|
107
|
+
S(t);
|
|
108
108
|
}
|
|
109
109
|
function le() {
|
|
110
110
|
s.value = !1;
|
|
@@ -112,8 +112,8 @@ const Se = {
|
|
|
112
112
|
return (t, o) => (r(), c(be, {
|
|
113
113
|
modelValue: e(f),
|
|
114
114
|
"onUpdate:modelValue": [
|
|
115
|
-
o[2] || (o[2] = (l) =>
|
|
116
|
-
|
|
115
|
+
o[2] || (o[2] = (l) => U(f) ? f.value = l : null),
|
|
116
|
+
X
|
|
117
117
|
],
|
|
118
118
|
label: t.label,
|
|
119
119
|
dirty: "",
|
|
@@ -126,26 +126,26 @@ const Se = {
|
|
|
126
126
|
onFocusInput: Z,
|
|
127
127
|
onHandleClick: e($),
|
|
128
128
|
onBlurInput: le,
|
|
129
|
-
placeholder: e(
|
|
129
|
+
placeholder: e(F)(e(m)) && e(m).length ? "" : e(K),
|
|
130
130
|
error: !!y.value,
|
|
131
131
|
"error-messages": y.value
|
|
132
132
|
}, ae({
|
|
133
133
|
default: i(() => [
|
|
134
|
-
e(
|
|
135
|
-
(r(!0),
|
|
134
|
+
e(F)(e(m)) ? (r(), B("div", xe, [
|
|
135
|
+
(r(!0), B(se, null, ue(e(m), (l) => (r(), c(Ve, {
|
|
136
136
|
key: l.id ?? l.name,
|
|
137
137
|
size: "small",
|
|
138
138
|
class: "ml-1"
|
|
139
139
|
}, {
|
|
140
140
|
default: i(() => [
|
|
141
|
-
de("div",
|
|
142
|
-
w(V(e(
|
|
141
|
+
de("div", Ie, [
|
|
142
|
+
w(V(e(P)(l, t.itemTitle)) + " ", 1),
|
|
143
143
|
a(h, {
|
|
144
144
|
color: "error",
|
|
145
145
|
icon: e(p).close,
|
|
146
146
|
size: "small",
|
|
147
147
|
class: "ml-1",
|
|
148
|
-
onClick: (oe) => e(
|
|
148
|
+
onClick: (oe) => e(H)(l)
|
|
149
149
|
}, null, 8, ["icon", "onClick"])
|
|
150
150
|
])
|
|
151
151
|
]),
|
|
@@ -154,29 +154,28 @@ const Se = {
|
|
|
154
154
|
])) : k("", !0),
|
|
155
155
|
a(he, {
|
|
156
156
|
transition: "fade",
|
|
157
|
-
"onClick:outside": e(
|
|
157
|
+
"onClick:outside": e(I),
|
|
158
158
|
modelValue: e(s),
|
|
159
|
-
"onUpdate:modelValue": o[1] || (o[1] = (l) =>
|
|
159
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => U(s) ? s.value = l : null),
|
|
160
160
|
activator: "parent",
|
|
161
161
|
"text-field-ref": e(d),
|
|
162
162
|
onHandleEscape: D,
|
|
163
163
|
"close-on-content-click": t.closeOnSelect,
|
|
164
|
-
"max-height": t.maxHeight
|
|
165
|
-
menuPositionStyle: E.value
|
|
164
|
+
"max-height": t.maxHeight
|
|
166
165
|
}, {
|
|
167
166
|
default: i(() => [
|
|
168
167
|
a(ve, {
|
|
169
168
|
"onUpdate:selected": e(j),
|
|
170
|
-
"onClick:select": o[0] || (o[0] = (l) => e(
|
|
169
|
+
"onClick:select": o[0] || (o[0] = (l) => e(I)()),
|
|
171
170
|
ref_key: "listRef",
|
|
172
171
|
ref: C,
|
|
173
172
|
onKeyDown: te
|
|
174
173
|
}, {
|
|
175
174
|
default: i(() => [
|
|
176
|
-
e(
|
|
175
|
+
e(J) ? (r(), c(N, { key: 0 }, {
|
|
177
176
|
default: i(() => [
|
|
178
177
|
a(we, {
|
|
179
|
-
onClick: e(
|
|
178
|
+
onClick: e(W),
|
|
180
179
|
class: "w-full",
|
|
181
180
|
color: "bg-green-400"
|
|
182
181
|
}, {
|
|
@@ -190,7 +189,7 @@ const Se = {
|
|
|
190
189
|
_: 1
|
|
191
190
|
})) : k("", !0),
|
|
192
191
|
a(pe, {
|
|
193
|
-
items:
|
|
192
|
+
items: x.value,
|
|
194
193
|
search: e(f),
|
|
195
194
|
"searchable-keys": n.searchableKeys,
|
|
196
195
|
"items-per-intersection": 10,
|
|
@@ -199,25 +198,25 @@ const Se = {
|
|
|
199
198
|
"item-height": 48
|
|
200
199
|
}, {
|
|
201
200
|
default: i(({ item: l, index: oe }) => {
|
|
202
|
-
var
|
|
201
|
+
var E, L;
|
|
203
202
|
return [
|
|
204
|
-
(r(), c(
|
|
203
|
+
(r(), c(N, {
|
|
205
204
|
value: l,
|
|
206
|
-
key: ((
|
|
207
|
-
disabled: e(
|
|
208
|
-
class: ce(
|
|
205
|
+
key: ((E = l.id) == null ? void 0 : E.toString()) ?? l.name,
|
|
206
|
+
disabled: e(G)(l),
|
|
207
|
+
class: ce(Q(l)),
|
|
209
208
|
density: t.density,
|
|
210
|
-
id: ((
|
|
209
|
+
id: ((L = l.id) == null ? void 0 : L.toString()) ?? l.name
|
|
211
210
|
}, {
|
|
212
211
|
default: i(() => [
|
|
213
212
|
a(ye, { class: "text-wrap" }, {
|
|
214
213
|
default: i(() => [
|
|
215
|
-
w(V(e(
|
|
214
|
+
w(V(e(_)(l, e(q), "hasDefault")), 1)
|
|
216
215
|
]),
|
|
217
216
|
_: 2
|
|
218
217
|
}, 1024),
|
|
219
218
|
a(ke, {
|
|
220
|
-
textContent: V(t.itemSubtitle ? e(
|
|
219
|
+
textContent: V(t.itemSubtitle ? e(_)(l, t.itemSubtitle) : "")
|
|
221
220
|
}, null, 8, ["textContent"])
|
|
222
221
|
]),
|
|
223
222
|
_: 2
|
|
@@ -231,7 +230,7 @@ const Se = {
|
|
|
231
230
|
}, 8, ["onUpdate:selected"])
|
|
232
231
|
]),
|
|
233
232
|
_: 1
|
|
234
|
-
}, 8, ["onClick:outside", "modelValue", "text-field-ref", "close-on-content-click", "max-height"
|
|
233
|
+
}, 8, ["onClick:outside", "modelValue", "text-field-ref", "close-on-content-click", "max-height"])
|
|
235
234
|
]),
|
|
236
235
|
_: 2
|
|
237
236
|
}, [
|
|
@@ -240,7 +239,7 @@ const Se = {
|
|
|
240
239
|
fn: i(() => [
|
|
241
240
|
t.clearable && e(m) ? (r(), c(h, {
|
|
242
241
|
key: 0,
|
|
243
|
-
onClick: e(
|
|
242
|
+
onClick: e(O),
|
|
244
243
|
size: "small",
|
|
245
244
|
color: "error",
|
|
246
245
|
icon: e(p).close,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { computed as a, createBlock as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
const
|
|
1
|
+
import { useAttrs as h, computed as a, createBlock as y, openBlock as s, resolveDynamicComponent as v, mergeProps as $, unref as k, withCtx as S, renderSlot as o, createElementBlock as i, createCommentVNode as u, createElementVNode as w, createTextVNode as B, toDisplayString as C } from "vue";
|
|
2
|
+
import { RouterLink as A } from "vue-router";
|
|
3
|
+
const W = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "mr-2 flex items-center"
|
|
6
|
-
},
|
|
6
|
+
}, z = {
|
|
7
7
|
key: 2,
|
|
8
8
|
class: "truncate"
|
|
9
|
-
},
|
|
9
|
+
}, N = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "ml-2 flex items-center"
|
|
12
|
-
},
|
|
12
|
+
}, j = {
|
|
13
13
|
__name: "KunBtn",
|
|
14
14
|
props: {
|
|
15
|
-
text:
|
|
15
|
+
text: String,
|
|
16
16
|
size: {
|
|
17
17
|
type: String,
|
|
18
18
|
default: "md",
|
|
19
|
-
validator: (
|
|
19
|
+
validator: (r) => ["xxs", "xs", "sm", "md", "lg", "xl", "xxl"].includes(r)
|
|
20
20
|
},
|
|
21
21
|
minWidth: { type: String, default: "min-w-[6rem]" },
|
|
22
22
|
fontWeight: { type: String, default: "font-medium" },
|
|
@@ -25,105 +25,114 @@ const k = {
|
|
|
25
25
|
variant: {
|
|
26
26
|
type: String,
|
|
27
27
|
default: "default",
|
|
28
|
-
validator: (
|
|
28
|
+
validator: (r) => ["default", "tonal", "plain", "outlined", "soft", "text"].includes(r)
|
|
29
|
+
},
|
|
30
|
+
disabled: Boolean,
|
|
31
|
+
loading: Boolean,
|
|
32
|
+
bgColor: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "bg-slate-200 dark:bg-slate-800"
|
|
35
|
+
},
|
|
36
|
+
textColor: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "text-slate-700 dark:text-slate-300"
|
|
29
39
|
},
|
|
30
|
-
disabled: { type: Boolean, default: !1 },
|
|
31
|
-
loading: { type: Boolean, default: !1 },
|
|
32
|
-
bgColor: { type: String, default: "bg-indigo-600" },
|
|
33
|
-
textColor: { type: String, default: "text-white" },
|
|
34
40
|
to: [String, Object],
|
|
35
41
|
href: String,
|
|
36
|
-
replace:
|
|
37
|
-
target:
|
|
38
|
-
ring:
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: !0
|
|
41
|
-
}
|
|
42
|
+
replace: Boolean,
|
|
43
|
+
target: String,
|
|
44
|
+
ring: Boolean
|
|
42
45
|
},
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
href:
|
|
46
|
-
target:
|
|
47
|
-
rel:
|
|
48
|
-
} :
|
|
49
|
-
to:
|
|
50
|
-
replace:
|
|
46
|
+
setup(r) {
|
|
47
|
+
const e = r, l = h(), d = a(() => !!e.to || !!e.href), c = a(() => !d.value), p = a(() => e.href ? "a" : e.to ? A : "button"), f = a(() => e.href ? {
|
|
48
|
+
href: e.href,
|
|
49
|
+
target: e.target ?? "_self",
|
|
50
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : null
|
|
51
|
+
} : e.to ? {
|
|
52
|
+
to: e.to,
|
|
53
|
+
replace: e.replace
|
|
51
54
|
} : {
|
|
52
55
|
type: "button",
|
|
53
|
-
disabled:
|
|
54
|
-
}), g = (
|
|
55
|
-
switch (
|
|
56
|
+
disabled: e.loading || e.disabled
|
|
57
|
+
}), g = (t) => {
|
|
58
|
+
switch (t) {
|
|
56
59
|
case "xxs":
|
|
57
60
|
return "px-1 py-1 text-xs";
|
|
58
61
|
case "xs":
|
|
59
62
|
return "px-2 py-2 text-xs";
|
|
60
63
|
case "sm":
|
|
61
|
-
return "px-
|
|
64
|
+
return "px-2 py-1 text-sm";
|
|
62
65
|
case "md":
|
|
63
|
-
return "px-
|
|
66
|
+
return "px-3 py-2 text-sm";
|
|
64
67
|
case "lg":
|
|
65
|
-
return "px-
|
|
68
|
+
return "px-4 py-2 text-base";
|
|
66
69
|
case "xl":
|
|
67
|
-
return "px-
|
|
70
|
+
return "px-5 py-3 text-lg";
|
|
68
71
|
case "xxl":
|
|
69
|
-
return "px-
|
|
72
|
+
return "px-6 py-4 text-xl";
|
|
73
|
+
default:
|
|
74
|
+
return "px-3 py-2 text-sm";
|
|
70
75
|
}
|
|
71
|
-
},
|
|
72
|
-
const
|
|
73
|
-
switch (
|
|
76
|
+
}, x = a(() => {
|
|
77
|
+
const t = e.bgColor, n = e.textColor;
|
|
78
|
+
switch (e.variant) {
|
|
74
79
|
case "default":
|
|
75
|
-
return `${
|
|
80
|
+
return `${t} ${n} shadow hover:brightness-95`;
|
|
76
81
|
case "tonal":
|
|
77
|
-
return `${
|
|
78
|
-
case "plain":
|
|
79
|
-
return `bg-transparent ${r} hover:bg-gray-100 transition`;
|
|
80
|
-
case "outline":
|
|
81
|
-
return `bg-transparent border ${n} ${r} border-opacity-80 hover:bg-opacity-10 transition`;
|
|
82
|
+
return `${t} ${n} shadow-sm hover:shadow-md`;
|
|
82
83
|
case "soft":
|
|
83
|
-
return `${
|
|
84
|
+
return `${t} ${n} hover:bg-opacity-30 shadow-sm`;
|
|
85
|
+
case "outlined":
|
|
86
|
+
return `bg-transparent ${n} border ${t} border-opacity-40 hover:bg-black/5`;
|
|
87
|
+
case "plain":
|
|
88
|
+
return `bg-transparent ${n} hover:bg-transparent active:bg-black/10`;
|
|
89
|
+
case "text":
|
|
90
|
+
return `${t} ${n} hover:bg-opacity-10 active:bg-black/5`;
|
|
84
91
|
default:
|
|
85
|
-
return `${
|
|
92
|
+
return `${t} ${n}`;
|
|
86
93
|
}
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
e.minWidth,
|
|
94
|
+
}), m = a(() => !!e.text), b = a(() => {
|
|
95
|
+
const t = [
|
|
96
|
+
"inline-flex items-center justify-center break-keep transition-all whitespace-nowrap",
|
|
91
97
|
g(e.size),
|
|
92
98
|
e.fontWeight,
|
|
93
|
-
p.value,
|
|
94
99
|
e.rounded,
|
|
95
100
|
e.textAlign,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
x.value
|
|
102
|
+
];
|
|
103
|
+
return !e.loading && !e.disabled ? t.push(
|
|
104
|
+
"hover:opacity-90",
|
|
105
|
+
"focus:outline-none",
|
|
106
|
+
e.ring ? "focus:ring-2 focus:ring-offset-2" : "",
|
|
107
|
+
"active:scale-[.98]",
|
|
108
|
+
"transition duration-100 ease-in-out",
|
|
109
|
+
"cursor-pointer"
|
|
110
|
+
) : t.push("opacity-50 cursor-not-allowed"), m.value && t.push(e.minWidth), l.class && t.push(l.class), t.filter(Boolean);
|
|
111
|
+
});
|
|
112
|
+
return (t, n) => (s(), y(v(p.value), $(f.value, {
|
|
113
|
+
class: b.value,
|
|
114
|
+
style: k(l).style,
|
|
115
|
+
disabled: c.value && (r.loading || r.disabled)
|
|
107
116
|
}), {
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
]) :
|
|
112
|
-
|
|
113
|
-
])) :
|
|
114
|
-
!
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
default: S(() => [
|
|
118
|
+
r.loading ? o(t.$slots, "loader", { key: 0 }, () => [
|
|
119
|
+
n[0] || (n[0] = w("span", { class: "mr-2 h-5 w-5 border-[3px] border-current border-t-transparent rounded-full animate-spin" }, null, -1))
|
|
120
|
+
]) : t.$slots.prepend ? (s(), i("span", W, [
|
|
121
|
+
o(t.$slots, "prepend")
|
|
122
|
+
])) : u("", !0),
|
|
123
|
+
!r.loading && (r.text || t.$slots.default) ? (s(), i("span", z, [
|
|
124
|
+
o(t.$slots, "default", {}, () => [
|
|
125
|
+
B(C(r.text), 1)
|
|
117
126
|
])
|
|
118
|
-
])) :
|
|
119
|
-
!
|
|
120
|
-
|
|
121
|
-
])) :
|
|
127
|
+
])) : u("", !0),
|
|
128
|
+
!r.loading && t.$slots.append ? (s(), i("span", N, [
|
|
129
|
+
o(t.$slots, "append")
|
|
130
|
+
])) : u("", !0)
|
|
122
131
|
]),
|
|
123
132
|
_: 3
|
|
124
|
-
}, 16, ["class", "disabled"]));
|
|
133
|
+
}, 16, ["class", "style", "disabled"]));
|
|
125
134
|
}
|
|
126
135
|
};
|
|
127
136
|
export {
|
|
128
|
-
|
|
137
|
+
j as default
|
|
129
138
|
};
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCard as k } from "../composables/useCard.js";
|
|
1
|
+
import { useAttrs as f, computed as c, createElementBlock as s, openBlock as o, normalizeClass as p, createCommentVNode as r, createVNode as l, withCtx as n, createBlock as C, renderSlot as a } from "vue";
|
|
3
2
|
import { kunCardProps as $ } from "../composables/kunCardProps.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
3
|
+
import i from "../../../KunCardItem/src/components/KunCardItem.vue.js";
|
|
4
|
+
import k from "../../../KunCardTitle/src/components/KunCardTitle.vue.js";
|
|
5
|
+
import _ from "../../../KunCardText/src/components/KunCardText.vue.js";
|
|
6
|
+
import b from "../../../KunCardActions/src/components/KunCardActions.vue.js";
|
|
7
|
+
const h = { key: 0 }, v = { key: 1 }, y = { key: 2 }, V = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
9
8
|
__name: "KunCard",
|
|
10
9
|
props: $,
|
|
11
|
-
setup(
|
|
12
|
-
const u =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
setup(d) {
|
|
11
|
+
const e = d, u = f(), m = c(() => {
|
|
12
|
+
const t = u.class || "";
|
|
13
|
+
return [
|
|
14
|
+
"w-full",
|
|
15
|
+
e.bgColor,
|
|
16
|
+
e.textColor || "text-black",
|
|
17
|
+
e.outlined ? `border ${e.outlineColor}` : "",
|
|
18
|
+
e.rounded === !0 ? "rounded-lg" : e.rounded ? `rounded-${e.rounded}` : "",
|
|
19
|
+
e.flat ? "shadow-none" : `shadow-${e.elevation}`,
|
|
20
|
+
t
|
|
21
|
+
].filter(Boolean).join(" ");
|
|
22
|
+
});
|
|
23
|
+
return (t, w) => (o(), s("div", {
|
|
24
|
+
class: p(m.value)
|
|
19
25
|
}, [
|
|
20
|
-
t.$slots.title || t.title ? (
|
|
21
|
-
|
|
22
|
-
default:
|
|
23
|
-
|
|
26
|
+
t.$slots.title || t.title || t.subtitle ? (o(), s("div", h, [
|
|
27
|
+
l(i, { dense: "" }, {
|
|
28
|
+
default: n(() => [
|
|
29
|
+
l(k, {
|
|
24
30
|
title: t.title,
|
|
25
31
|
subtitle: t.subtitle
|
|
26
32
|
}, null, 8, ["title", "subtitle"])
|
|
27
33
|
]),
|
|
28
34
|
_: 1
|
|
29
35
|
})
|
|
30
|
-
])) :
|
|
31
|
-
t.$slots.default || t.text ? (
|
|
32
|
-
t.text ? (
|
|
33
|
-
default:
|
|
34
|
-
|
|
36
|
+
])) : r("", !0),
|
|
37
|
+
t.$slots.default || t.text ? (o(), s("div", v, [
|
|
38
|
+
t.text ? (o(), C(i, { key: 0 }, {
|
|
39
|
+
default: n(() => [
|
|
40
|
+
l(_, { text: t.text }, null, 8, ["text"])
|
|
35
41
|
]),
|
|
36
42
|
_: 1
|
|
37
43
|
})) : a(t.$slots, "default", { key: 1 })
|
|
38
|
-
])) :
|
|
39
|
-
t.$slots.actions ? (
|
|
40
|
-
|
|
41
|
-
default:
|
|
44
|
+
])) : r("", !0),
|
|
45
|
+
t.$slots.actions ? (o(), s("div", y, [
|
|
46
|
+
l(b, null, {
|
|
47
|
+
default: n(() => [
|
|
42
48
|
a(t.$slots, "actions")
|
|
43
49
|
]),
|
|
44
50
|
_: 3
|
|
45
51
|
})
|
|
46
|
-
])) :
|
|
47
|
-
],
|
|
52
|
+
])) : r("", !0)
|
|
53
|
+
], 2));
|
|
48
54
|
}
|
|
49
|
-
};
|
|
55
|
+
});
|
|
50
56
|
export {
|
|
51
|
-
|
|
57
|
+
V as default
|
|
52
58
|
};
|
|
@@ -11,6 +11,10 @@ const e = {
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: null
|
|
13
13
|
},
|
|
14
|
+
textColor: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "text-black dark:text-white"
|
|
17
|
+
},
|
|
14
18
|
bgColor: {
|
|
15
19
|
type: String,
|
|
16
20
|
default: "bg-transparent"
|
|
@@ -36,14 +40,6 @@ const e = {
|
|
|
36
40
|
type: [String, Number],
|
|
37
41
|
default: 1,
|
|
38
42
|
validator: (t) => ["0", "1", "2", "3", "4", "5", "", 0, 1, 2, 3, 4, 5].includes(t)
|
|
39
|
-
},
|
|
40
|
-
class: {
|
|
41
|
-
type: [String, Array, Object],
|
|
42
|
-
default: null
|
|
43
|
-
},
|
|
44
|
-
style: {
|
|
45
|
-
type: Object,
|
|
46
|
-
default: null
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
45
|
export {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const k = {
|
|
1
|
+
import { useAttrs as a, computed as l, createElementBlock as n, openBlock as p, normalizeClass as c, renderSlot as u } from "vue";
|
|
2
|
+
import { kunCardActionsProps as f } from "../composables/kunCardActionsProps.js";
|
|
3
|
+
const x = {
|
|
5
4
|
__name: "KunCardActions",
|
|
6
|
-
props:
|
|
7
|
-
setup(
|
|
8
|
-
const e =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
props: f,
|
|
6
|
+
setup(s) {
|
|
7
|
+
const e = s, t = a(), o = l(() => [
|
|
8
|
+
e.wrap ? "flex-wrap" : "flex-nowrap",
|
|
9
|
+
e.justify,
|
|
10
|
+
e.align,
|
|
11
|
+
e.gap,
|
|
12
|
+
e.dense ? "py-1 px-2" : "py-3 px-4",
|
|
13
|
+
t.class
|
|
14
|
+
].filter(Boolean));
|
|
15
|
+
return (r, i) => (p(), n("div", {
|
|
16
|
+
class: c(["w-full flex", o.value])
|
|
15
17
|
}, [
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
+
u(r.$slots, "default")
|
|
19
|
+
], 2));
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
x as default
|
|
22
24
|
};
|