adverich-kun-ui 0.1.426 → 0.1.427
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,4 +1,4 @@
|
|
|
1
|
-
import { mergeModels as z, useModel as R, onMounted as oe, ref as S, watch as ie, createElementBlock as v, openBlock as
|
|
1
|
+
import { mergeModels as z, useModel as R, onMounted as oe, ref as S, watch as ie, createElementBlock as v, openBlock as r, createVNode as n, unref as l, isRef as A, createSlots as ne, withCtx as i, createCommentVNode as k, Fragment as re, renderList as ae, createBlock as m, createElementVNode as se, createTextVNode as y, toDisplayString as I, normalizeClass as ue, withModifiers as de } from "vue";
|
|
2
2
|
import { icons as f } from "../../../../icons/index.js";
|
|
3
3
|
import { isNotEmpty as ce, isArray as _ } from "../../../../utils/utils.js";
|
|
4
4
|
import me from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
|
|
@@ -9,11 +9,11 @@ import pe from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.
|
|
|
9
9
|
import he from "../../../KunMenu/src/components/KunMenu.vue.js";
|
|
10
10
|
import { useAutocomplete as ve } from "../composables/useAutocomplete.js";
|
|
11
11
|
import { KunAutocompleteProps as ke } from "../composables/KunAutocompleteProps.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
12
|
+
import ye from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
13
|
+
import be from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
14
|
+
import ge from "../../../KunChip/src/components/KunChip.vue.js";
|
|
15
|
+
import b from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
16
|
+
const Ce = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "w-full flex overflow-x-auto whitespace-nowrap space-x-1"
|
|
19
19
|
}, we = { class: "flex items-center" }, Ve = {
|
|
@@ -28,9 +28,9 @@ const ge = {
|
|
|
28
28
|
itemsModifiers: {}
|
|
29
29
|
}),
|
|
30
30
|
emits: /* @__PURE__ */ z(["update:modelValue", "selectedItem", "createItem", "validation", "search"], ["update:modelValue", "update:items"]),
|
|
31
|
-
setup(
|
|
32
|
-
const a = R(
|
|
33
|
-
textFieldRef:
|
|
31
|
+
setup(g, { emit: T }) {
|
|
32
|
+
const a = R(g, "modelValue"), M = R(g, "items"), u = g, p = T, {
|
|
33
|
+
textFieldRef: C,
|
|
34
34
|
listRef: w,
|
|
35
35
|
menuModel: s,
|
|
36
36
|
search: c,
|
|
@@ -40,8 +40,8 @@ const ge = {
|
|
|
40
40
|
openMenu: V,
|
|
41
41
|
closeMenu: O,
|
|
42
42
|
toggleMenu: U,
|
|
43
|
-
onMenuKeydown:
|
|
44
|
-
getSelectedItem:
|
|
43
|
+
onMenuKeydown: x,
|
|
44
|
+
getSelectedItem: H,
|
|
45
45
|
textArr: q,
|
|
46
46
|
getItemText: P,
|
|
47
47
|
isAlphanumeric: W,
|
|
@@ -51,7 +51,7 @@ const ge = {
|
|
|
51
51
|
placeholder: J
|
|
52
52
|
} = ve(u, p, a, M);
|
|
53
53
|
oe(() => {
|
|
54
|
-
u.focusOnRender &&
|
|
54
|
+
u.focusOnRender && C.value.focus();
|
|
55
55
|
});
|
|
56
56
|
const K = S(null), h = S(""), $ = (e) => {
|
|
57
57
|
for (const o of u.rules) {
|
|
@@ -66,7 +66,7 @@ const ge = {
|
|
|
66
66
|
});
|
|
67
67
|
function Q() {
|
|
68
68
|
var e;
|
|
69
|
-
s.value = !1, (e =
|
|
69
|
+
s.value = !1, (e = C.value.inputField) == null || e.focus();
|
|
70
70
|
}
|
|
71
71
|
function X(e) {
|
|
72
72
|
var t, d;
|
|
@@ -84,16 +84,16 @@ const ge = {
|
|
|
84
84
|
$(a);
|
|
85
85
|
}
|
|
86
86
|
function ee(e) {
|
|
87
|
-
|
|
87
|
+
x(e);
|
|
88
88
|
}
|
|
89
89
|
function le() {
|
|
90
90
|
}
|
|
91
|
-
return (e, o) => (
|
|
91
|
+
return (e, o) => (r(), v("div", {
|
|
92
92
|
class: "w-full h-fit",
|
|
93
93
|
ref_key: "parentRef",
|
|
94
94
|
ref: K
|
|
95
95
|
}, [
|
|
96
|
-
|
|
96
|
+
n(ye, {
|
|
97
97
|
modelValue: l(c),
|
|
98
98
|
"onUpdate:modelValue": [
|
|
99
99
|
o[1] || (o[1] = (t) => A(c) ? c.value = t : null),
|
|
@@ -104,7 +104,7 @@ const ge = {
|
|
|
104
104
|
"hide-details": e.hideDetails,
|
|
105
105
|
density: e.density,
|
|
106
106
|
ref_key: "textFieldRef",
|
|
107
|
-
ref:
|
|
107
|
+
ref: C,
|
|
108
108
|
autocomplete: "off",
|
|
109
109
|
onFocusInput: Z,
|
|
110
110
|
onHandleClick: l(U),
|
|
@@ -114,17 +114,17 @@ const ge = {
|
|
|
114
114
|
placeholder: u.multiple && l(_)(a.value) && a.value.length ? "" : l(J),
|
|
115
115
|
error: !!h.value,
|
|
116
116
|
"error-messages": h.value
|
|
117
|
-
},
|
|
117
|
+
}, ne({
|
|
118
118
|
default: i(() => [
|
|
119
|
-
l(_)(a.value) ? (
|
|
120
|
-
(
|
|
119
|
+
l(_)(a.value) ? (r(), v("div", Ce, [
|
|
120
|
+
(r(!0), v(re, null, ae(a.value, (t) => (r(), m(ge, {
|
|
121
121
|
key: t.id ?? t.name,
|
|
122
122
|
size: "small"
|
|
123
123
|
}, {
|
|
124
124
|
default: i(() => [
|
|
125
125
|
se("div", we, [
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
y(I(l(P)(t, e.itemTitle)) + " ", 1),
|
|
127
|
+
n(b, {
|
|
128
128
|
color: "error",
|
|
129
129
|
icon: l(f).close,
|
|
130
130
|
size: "small",
|
|
@@ -136,7 +136,7 @@ const ge = {
|
|
|
136
136
|
_: 2
|
|
137
137
|
}, 1024))), 128))
|
|
138
138
|
])) : k("", !0),
|
|
139
|
-
|
|
139
|
+
n(he, {
|
|
140
140
|
transition: "fade",
|
|
141
141
|
"onClick:outside": l(L),
|
|
142
142
|
modelValue: l(s),
|
|
@@ -153,28 +153,27 @@ const ge = {
|
|
|
153
153
|
"hide-details": e.hideDetails
|
|
154
154
|
}, {
|
|
155
155
|
default: i(() => [
|
|
156
|
-
e.hasCreateItem ? (
|
|
157
|
-
|
|
156
|
+
e.hasCreateItem ? (r(), v("div", Ve, [
|
|
157
|
+
n(be, {
|
|
158
158
|
onClick: l(j),
|
|
159
159
|
bgColor: e.btnCreateBg,
|
|
160
160
|
class: ue(e.btnCreateClass)
|
|
161
161
|
}, {
|
|
162
162
|
default: i(() => [
|
|
163
|
-
|
|
163
|
+
y(I(e.btnCreateText), 1)
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
166
166
|
}, 8, ["onClick", "bgColor", "class"])
|
|
167
167
|
])) : k("", !0),
|
|
168
|
-
|
|
169
|
-
"onClick:select": l(
|
|
168
|
+
n(fe, {
|
|
169
|
+
"onClick:select": l(H),
|
|
170
170
|
ref_key: "listRef",
|
|
171
171
|
ref: w,
|
|
172
172
|
onKeyDown: ee,
|
|
173
|
-
selectable: !0
|
|
174
|
-
bgColor: e.listColor
|
|
173
|
+
selectable: !0
|
|
175
174
|
}, {
|
|
176
175
|
default: i(() => [
|
|
177
|
-
|
|
176
|
+
n(me, {
|
|
178
177
|
items: M.value,
|
|
179
178
|
search: l(c),
|
|
180
179
|
"searchable-keys": u.searchableKeys,
|
|
@@ -184,7 +183,7 @@ const ge = {
|
|
|
184
183
|
"item-height": 48
|
|
185
184
|
}, {
|
|
186
185
|
default: i(({ item: t, index: d, empty: te }) => [
|
|
187
|
-
!te && t != null ? (
|
|
186
|
+
!te && t != null ? (r(), m(B, {
|
|
188
187
|
value: t,
|
|
189
188
|
key: `kun-list-${d + 1}`,
|
|
190
189
|
id: `kun-item-${d + 1}`,
|
|
@@ -196,25 +195,25 @@ const ge = {
|
|
|
196
195
|
selectable: !0
|
|
197
196
|
}, {
|
|
198
197
|
default: i(() => [
|
|
199
|
-
|
|
198
|
+
n(F, { class: "text-wrap" }, {
|
|
200
199
|
default: i(() => [
|
|
201
|
-
|
|
200
|
+
y(I(l(D)(t, e.itemTitle ?? l(q), "hasDefault")), 1)
|
|
202
201
|
]),
|
|
203
202
|
_: 2
|
|
204
203
|
}, 1024),
|
|
205
|
-
|
|
204
|
+
n(pe, {
|
|
206
205
|
text: e.itemSubtitle ? l(D)(t, e.itemSubtitle) : ""
|
|
207
206
|
}, null, 8, ["text"])
|
|
208
207
|
]),
|
|
209
208
|
_: 2
|
|
210
|
-
}, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (
|
|
209
|
+
}, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (r(), m(B, {
|
|
211
210
|
key: 1,
|
|
212
211
|
disabled: ""
|
|
213
212
|
}, {
|
|
214
213
|
default: i(() => [
|
|
215
|
-
|
|
214
|
+
n(F, { class: "text-center w-full text-gray-500" }, {
|
|
216
215
|
default: i(() => o[2] || (o[2] = [
|
|
217
|
-
|
|
216
|
+
y(" No hay elementos disponibles ")
|
|
218
217
|
])),
|
|
219
218
|
_: 1,
|
|
220
219
|
__: [2]
|
|
@@ -227,7 +226,7 @@ const ge = {
|
|
|
227
226
|
}, 8, ["items", "search", "searchable-keys", "enabled"])
|
|
228
227
|
]),
|
|
229
228
|
_: 1
|
|
230
|
-
}, 8, ["onClick:select"
|
|
229
|
+
}, 8, ["onClick:select"])
|
|
231
230
|
]),
|
|
232
231
|
_: 1
|
|
233
232
|
}, 8, ["onClick:outside", "modelValue", "z-index", "parent-ref", "origin", "bgColor", "close-on-content-click", "max-height", "hide-details"])
|
|
@@ -237,7 +236,7 @@ const ge = {
|
|
|
237
236
|
e.hasIcons ? {
|
|
238
237
|
name: "append-inner",
|
|
239
238
|
fn: i(() => [
|
|
240
|
-
e.clearable && a.value ? (
|
|
239
|
+
e.clearable && a.value ? (r(), m(b, {
|
|
241
240
|
key: 0,
|
|
242
241
|
onClick: l(N),
|
|
243
242
|
size: "small",
|
|
@@ -245,14 +244,14 @@ const ge = {
|
|
|
245
244
|
icon: l(f).close,
|
|
246
245
|
class: "mr-1 mt-1"
|
|
247
246
|
}, null, 8, ["onClick", "icon"])) : k("", !0),
|
|
248
|
-
|
|
247
|
+
n(b, {
|
|
249
248
|
color: "teal-darken-1",
|
|
250
249
|
size: "large",
|
|
251
250
|
class: "cursor-pointer",
|
|
252
251
|
icon: l(s) ? l(f).menuUpOutline : l(f).menuDownOutline,
|
|
253
252
|
onClick: de(l(V), ["stop"])
|
|
254
253
|
}, null, 8, ["icon", "onClick"]),
|
|
255
|
-
e.required ? (
|
|
254
|
+
e.required ? (r(), m(b, {
|
|
256
255
|
key: 1,
|
|
257
256
|
color: "teal-darken-1",
|
|
258
257
|
size: "x-small",
|