adverich-kun-ui 0.1.355 → 0.1.356
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,12 +1,12 @@
|
|
|
1
|
-
import { mergeModels as A, useModel as R, onMounted as ie, ref as $, watch as
|
|
1
|
+
import { mergeModels as A, useModel as R, onMounted as ie, ref as $, watch as re, createElementBlock as k, openBlock as r, createVNode as i, unref as t, isRef as B, createSlots as ae, withCtx as n, createCommentVNode as v, Fragment as se, renderList as ue, createBlock as c, createElementVNode as de, createTextVNode as y, toDisplayString as V, normalizeClass as ce, withModifiers as me } from "vue";
|
|
2
2
|
import { icons as m } from "../../../../icons/index.js";
|
|
3
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 he from "../../../KunList/src/components/KunList.vue.js";
|
|
6
6
|
import T from "../../../KunListItem/src/components/KunListItem.vue.js";
|
|
7
7
|
import x from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import ke from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
9
|
+
import ve from "../../../KunMenu/src/components/KunMenu.vue.js";
|
|
10
10
|
import { useAutocomplete as ye } from "../composables/useAutocomplete.js";
|
|
11
11
|
import { KunAutocompleteProps as be } from "../composables/KunAutocompleteProps.js";
|
|
12
12
|
import ge from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
@@ -18,7 +18,7 @@ const Ve = {
|
|
|
18
18
|
class: "flex justify-center align-center"
|
|
19
19
|
}, Ie = { class: "flex justify-center align-center" }, Se = {
|
|
20
20
|
key: 0,
|
|
21
|
-
class: "p-2"
|
|
21
|
+
class: "sticky top-0 z-10 p-2 border-b"
|
|
22
22
|
}, Ue = {
|
|
23
23
|
__name: "KunAutocomplete",
|
|
24
24
|
props: /* @__PURE__ */ A(be, {
|
|
@@ -29,7 +29,7 @@ const Ve = {
|
|
|
29
29
|
}),
|
|
30
30
|
emits: /* @__PURE__ */ A(["update:modelValue", "selectedItem", "createItem", "validation", "search"], ["update:modelValue", "update:items"]),
|
|
31
31
|
setup(g, { emit: E }) {
|
|
32
|
-
const
|
|
32
|
+
const a = R(g, "modelValue"), I = R(g, "items"), u = g, f = E, {
|
|
33
33
|
textFieldRef: C,
|
|
34
34
|
listRef: S,
|
|
35
35
|
menuModel: s,
|
|
@@ -49,7 +49,7 @@ const Ve = {
|
|
|
49
49
|
checkDisabled: Q,
|
|
50
50
|
itemToString: D,
|
|
51
51
|
placeholder: X
|
|
52
|
-
} = ye(u, f,
|
|
52
|
+
} = ye(u, f, a, I);
|
|
53
53
|
ie(() => {
|
|
54
54
|
u.focusOnRender && C.value.focus();
|
|
55
55
|
});
|
|
@@ -61,7 +61,7 @@ const Ve = {
|
|
|
61
61
|
}
|
|
62
62
|
return p.value = "", f("validation", !0), !0;
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
re(() => a.value, (e, o) => {
|
|
65
65
|
fe(u.rules) && M(e);
|
|
66
66
|
});
|
|
67
67
|
function Y() {
|
|
@@ -81,14 +81,14 @@ const Ve = {
|
|
|
81
81
|
f("search", d);
|
|
82
82
|
}
|
|
83
83
|
function le() {
|
|
84
|
-
M(
|
|
84
|
+
M(a);
|
|
85
85
|
}
|
|
86
86
|
function te(e) {
|
|
87
87
|
j(e);
|
|
88
88
|
}
|
|
89
89
|
function oe() {
|
|
90
90
|
}
|
|
91
|
-
return (e, o) => (
|
|
91
|
+
return (e, o) => (r(), k("div", {
|
|
92
92
|
class: "w-full h-fit",
|
|
93
93
|
ref_key: "parentRef",
|
|
94
94
|
ref: K
|
|
@@ -111,13 +111,13 @@ const Ve = {
|
|
|
111
111
|
rounded: t(s) ? "rounded-t" : "rounded",
|
|
112
112
|
onBlur: oe,
|
|
113
113
|
onKeyDown: Z,
|
|
114
|
-
placeholder: u.multiple && t(F)(
|
|
114
|
+
placeholder: u.multiple && t(F)(a.value) && a.value.length ? "" : t(X),
|
|
115
115
|
error: !!p.value,
|
|
116
116
|
"error-messages": p.value
|
|
117
|
-
},
|
|
117
|
+
}, ae({
|
|
118
118
|
default: n(() => [
|
|
119
|
-
t(F)(
|
|
120
|
-
(
|
|
119
|
+
t(F)(a.value) ? (r(), k("div", Ve, [
|
|
120
|
+
(r(!0), k(se, null, ue(a.value, (l) => (r(), c(we, {
|
|
121
121
|
key: l.id ?? l.name,
|
|
122
122
|
size: "small",
|
|
123
123
|
class: "ml-1"
|
|
@@ -136,8 +136,8 @@ const Ve = {
|
|
|
136
136
|
]),
|
|
137
137
|
_: 2
|
|
138
138
|
}, 1024))), 128))
|
|
139
|
-
])) :
|
|
140
|
-
i(
|
|
139
|
+
])) : v("", !0),
|
|
140
|
+
i(ve, {
|
|
141
141
|
transition: "fade",
|
|
142
142
|
"onClick:outside": t(U),
|
|
143
143
|
modelValue: t(s),
|
|
@@ -154,6 +154,18 @@ const Ve = {
|
|
|
154
154
|
"hide-details": e.hideDetails
|
|
155
155
|
}, {
|
|
156
156
|
default: n(() => [
|
|
157
|
+
e.hasCreateItem ? (r(), k("div", Se, [
|
|
158
|
+
i(Ce, {
|
|
159
|
+
onClick: t(J),
|
|
160
|
+
bgColor: e.btnCreateBg,
|
|
161
|
+
class: ce(e.btnCreateClass)
|
|
162
|
+
}, {
|
|
163
|
+
default: n(() => [
|
|
164
|
+
y(V(e.btnCreateText), 1)
|
|
165
|
+
]),
|
|
166
|
+
_: 1
|
|
167
|
+
}, 8, ["onClick", "bgColor", "class"])
|
|
168
|
+
])) : v("", !0),
|
|
157
169
|
i(he, {
|
|
158
170
|
"onClick:select": t(q),
|
|
159
171
|
ref_key: "listRef",
|
|
@@ -162,18 +174,6 @@ const Ve = {
|
|
|
162
174
|
selectable: !0
|
|
163
175
|
}, {
|
|
164
176
|
default: n(() => [
|
|
165
|
-
e.hasCreateItem ? (a(), v("div", Se, [
|
|
166
|
-
i(Ce, {
|
|
167
|
-
onClick: t(J),
|
|
168
|
-
bgColor: e.btnCreateBg,
|
|
169
|
-
class: ce(e.btnCreateClass)
|
|
170
|
-
}, {
|
|
171
|
-
default: n(() => [
|
|
172
|
-
y(V(e.btnCreateText), 1)
|
|
173
|
-
]),
|
|
174
|
-
_: 1
|
|
175
|
-
}, 8, ["onClick", "bgColor", "class"])
|
|
176
|
-
])) : k("", !0),
|
|
177
177
|
i(pe, {
|
|
178
178
|
items: I.value,
|
|
179
179
|
search: t(d),
|
|
@@ -186,7 +186,7 @@ const Ve = {
|
|
|
186
186
|
default: n(({ item: l, index: h, empty: ne }) => {
|
|
187
187
|
var _, z;
|
|
188
188
|
return [
|
|
189
|
-
!ne && l ? (
|
|
189
|
+
!ne && l ? (r(), c(T, {
|
|
190
190
|
value: l,
|
|
191
191
|
key: ((_ = l.id) == null ? void 0 : _.toString()) ?? l.name,
|
|
192
192
|
disabled: t(Q)(l),
|
|
@@ -204,12 +204,12 @@ const Ve = {
|
|
|
204
204
|
]),
|
|
205
205
|
_: 2
|
|
206
206
|
}, 1024),
|
|
207
|
-
i(
|
|
207
|
+
i(ke, {
|
|
208
208
|
text: e.itemSubtitle ? t(D)(l, e.itemSubtitle) : ""
|
|
209
209
|
}, null, 8, ["text"])
|
|
210
210
|
]),
|
|
211
211
|
_: 2
|
|
212
|
-
}, 1032, ["value", "disabled", "bg-items", "hover-bg", "activeClass", "density", "id"])) : (
|
|
212
|
+
}, 1032, ["value", "disabled", "bg-items", "hover-bg", "activeClass", "density", "id"])) : (r(), c(T, {
|
|
213
213
|
key: 1,
|
|
214
214
|
disabled: ""
|
|
215
215
|
}, {
|
|
@@ -240,14 +240,14 @@ const Ve = {
|
|
|
240
240
|
e.hasIcons ? {
|
|
241
241
|
name: "append-inner",
|
|
242
242
|
fn: n(() => [
|
|
243
|
-
e.clearable &&
|
|
243
|
+
e.clearable && a.value ? (r(), c(b, {
|
|
244
244
|
key: 0,
|
|
245
245
|
onClick: t(L),
|
|
246
246
|
size: "small",
|
|
247
247
|
color: "error",
|
|
248
248
|
icon: t(m).close,
|
|
249
249
|
class: "mr-1 mt-1"
|
|
250
|
-
}, null, 8, ["onClick", "icon"])) :
|
|
250
|
+
}, null, 8, ["onClick", "icon"])) : v("", !0),
|
|
251
251
|
i(b, {
|
|
252
252
|
color: "teal-darken-1",
|
|
253
253
|
size: "large",
|
|
@@ -255,13 +255,13 @@ const Ve = {
|
|
|
255
255
|
icon: t(s) ? t(m).menuUpOutline : t(m).menuDownOutline,
|
|
256
256
|
onClick: me(t(w), ["stop"])
|
|
257
257
|
}, null, 8, ["icon", "onClick"]),
|
|
258
|
-
e.required ? (
|
|
258
|
+
e.required ? (r(), c(b, {
|
|
259
259
|
key: 1,
|
|
260
260
|
color: "teal-darken-1",
|
|
261
261
|
size: "x-small",
|
|
262
262
|
class: "mb-4",
|
|
263
263
|
icon: t(m).asterisk
|
|
264
|
-
}, null, 8, ["icon"])) :
|
|
264
|
+
}, null, 8, ["icon"])) : v("", !0)
|
|
265
265
|
]),
|
|
266
266
|
key: "0"
|
|
267
267
|
} : void 0
|