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