adverich-kun-ui 0.1.290 → 0.1.291
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,24 +1,24 @@
|
|
|
1
|
-
import { mergeModels as A, useModel as R, onMounted as
|
|
1
|
+
import { mergeModels as A, useModel as R, onMounted as ae, ref as $, watch as se, createElementBlock as w, openBlock as r, createVNode as i, unref as l, isRef as z, createSlots as ue, withCtx as n, createCommentVNode as v, Fragment as de, renderList as ce, createBlock as d, createElementVNode as me, createTextVNode as k, toDisplayString as F, withModifiers as fe } from "vue";
|
|
2
2
|
import { icons as m } from "../../../../icons/index.js";
|
|
3
|
-
import { isNotEmpty as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { isNotEmpty as pe, isArray as B } from "../../../../utils/utils.js";
|
|
4
|
+
import he from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
|
|
5
|
+
import ve from "../../../KunList/src/components/KunList.vue.js";
|
|
6
6
|
import V from "../../../KunListItem/src/components/KunListItem.vue.js";
|
|
7
7
|
import E from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
8
8
|
import ke from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import { useAutocomplete as
|
|
11
|
-
import { KunAutocompleteProps as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
9
|
+
import ye from "../../../kunMenu/src/components/kunMenu.vue.js";
|
|
10
|
+
import { useAutocomplete as ge } from "../composables/useAutocomplete.js";
|
|
11
|
+
import { KunAutocompleteProps as be } from "../composables/KunAutocompleteProps.js";
|
|
12
|
+
import Ce from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
13
|
+
import we from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
14
|
+
import Ve from "../../../KunChip/src/components/KunChip.vue.js";
|
|
15
15
|
import y from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
16
|
-
const
|
|
16
|
+
const Ie = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "flex justify-center align-center"
|
|
19
|
-
},
|
|
19
|
+
}, _e = { class: "flex justify-center align-center" }, Ue = {
|
|
20
20
|
__name: "KunAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */ A(
|
|
21
|
+
props: /* @__PURE__ */ A(be, {
|
|
22
22
|
modelValue: { default: null },
|
|
23
23
|
modelModifiers: {},
|
|
24
24
|
items: { default: [], type: Array, required: !0 },
|
|
@@ -31,25 +31,26 @@ const Ve = {
|
|
|
31
31
|
listRef: _,
|
|
32
32
|
menuModel: s,
|
|
33
33
|
search: c,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
selectedItem: T,
|
|
35
|
+
removeItem: L,
|
|
36
|
+
clearSelection: U,
|
|
37
|
+
lightReset: H,
|
|
37
38
|
openMenu: C,
|
|
38
|
-
closeMenu:
|
|
39
|
-
toggleMenu:
|
|
40
|
-
onMenuKeydown:
|
|
41
|
-
getSelectedItem:
|
|
42
|
-
textArr:
|
|
43
|
-
getItemText:
|
|
44
|
-
isAlphanumeric:
|
|
45
|
-
createItem:
|
|
46
|
-
checkDisabled:
|
|
39
|
+
closeMenu: O,
|
|
40
|
+
toggleMenu: j,
|
|
41
|
+
onMenuKeydown: q,
|
|
42
|
+
getSelectedItem: P,
|
|
43
|
+
textArr: W,
|
|
44
|
+
getItemText: G,
|
|
45
|
+
isAlphanumeric: J,
|
|
46
|
+
createItem: Q,
|
|
47
|
+
checkDisabled: X,
|
|
47
48
|
itemToString: S,
|
|
48
|
-
placeholder:
|
|
49
|
-
hasCreateItem:
|
|
50
|
-
} =
|
|
51
|
-
|
|
52
|
-
u.focusOnRender && b.value.focus();
|
|
49
|
+
placeholder: Y,
|
|
50
|
+
hasCreateItem: Z
|
|
51
|
+
} = ge(u, f, a, I);
|
|
52
|
+
ae(() => {
|
|
53
|
+
console.log(T.value), u.focusOnRender && b.value.focus();
|
|
53
54
|
});
|
|
54
55
|
const D = $(null), p = $(""), K = (e) => {
|
|
55
56
|
for (const o of u.rules) {
|
|
@@ -59,43 +60,43 @@ const Ve = {
|
|
|
59
60
|
}
|
|
60
61
|
return p.value = "", f("validation", !0), !0;
|
|
61
62
|
};
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
se(() => a.value, (e, o) => {
|
|
64
|
+
pe(u.rules) && K(e);
|
|
64
65
|
});
|
|
65
|
-
function
|
|
66
|
+
function ee() {
|
|
66
67
|
var e;
|
|
67
68
|
s.value = !1, (e = b.value.inputField) == null || e.focus();
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function le(e) {
|
|
70
71
|
var t, h;
|
|
71
72
|
const o = e.key;
|
|
72
73
|
if (o === "Tab" || o === "Shift") {
|
|
73
|
-
|
|
74
|
+
O();
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
(
|
|
77
|
+
(J(o) || o === "Backspace") && C(), ["ArrowUp", "ArrowDown"].includes(o) && (e.preventDefault(), s.value || C(), (h = (t = _.value) == null ? void 0 : t.focusWithKey) == null || h.call(t, o));
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function te(e) {
|
|
79
80
|
f("search", c);
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function oe() {
|
|
82
83
|
K(a);
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
85
|
+
function ne(e) {
|
|
86
|
+
q(e);
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function ie() {
|
|
88
89
|
}
|
|
89
90
|
return (e, o) => (r(), w("div", {
|
|
90
91
|
class: "w-full h-fit",
|
|
91
92
|
ref_key: "parentRef",
|
|
92
93
|
ref: D
|
|
93
94
|
}, [
|
|
94
|
-
i(
|
|
95
|
+
i(Ce, {
|
|
95
96
|
modelValue: l(c),
|
|
96
97
|
"onUpdate:modelValue": [
|
|
97
98
|
o[1] || (o[1] = (t) => z(c) ? c.value = t : null),
|
|
98
|
-
|
|
99
|
+
te
|
|
99
100
|
],
|
|
100
101
|
label: e.label,
|
|
101
102
|
dirty: "",
|
|
@@ -104,40 +105,40 @@ const Ve = {
|
|
|
104
105
|
ref_key: "textFieldRef",
|
|
105
106
|
ref: b,
|
|
106
107
|
autocomplete: "off",
|
|
107
|
-
onFocusInput:
|
|
108
|
-
onHandleClick: l(
|
|
108
|
+
onFocusInput: oe,
|
|
109
|
+
onHandleClick: l(j),
|
|
109
110
|
rounded: l(s) ? "rounded-t" : "rounded",
|
|
110
|
-
onBlur:
|
|
111
|
-
onKeyDown:
|
|
112
|
-
placeholder: u.multiple && l(B)(a.value) && a.value.length ? "" : l(
|
|
111
|
+
onBlur: ie,
|
|
112
|
+
onKeyDown: le,
|
|
113
|
+
placeholder: u.multiple && l(B)(a.value) && a.value.length ? "" : l(Y),
|
|
113
114
|
error: !!p.value,
|
|
114
115
|
"error-messages": p.value
|
|
115
|
-
},
|
|
116
|
+
}, ue({
|
|
116
117
|
default: n(() => [
|
|
117
|
-
l(B)(a.value) ? (r(), w("div",
|
|
118
|
-
(r(!0), w(
|
|
118
|
+
l(B)(a.value) ? (r(), w("div", Ie, [
|
|
119
|
+
(r(!0), w(de, null, ce(a.value, (t) => (r(), d(Ve, {
|
|
119
120
|
key: t.id ?? t.name,
|
|
120
121
|
size: "small",
|
|
121
122
|
class: "ml-1"
|
|
122
123
|
}, {
|
|
123
124
|
default: n(() => [
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
me("div", _e, [
|
|
126
|
+
k(F(l(G)(t, e.itemTitle)) + " ", 1),
|
|
126
127
|
i(y, {
|
|
127
128
|
color: "error",
|
|
128
129
|
icon: l(m).close,
|
|
129
130
|
size: "small",
|
|
130
131
|
class: "ml-1",
|
|
131
|
-
onClick: (h) => l(
|
|
132
|
+
onClick: (h) => l(L)(t)
|
|
132
133
|
}, null, 8, ["icon", "onClick"])
|
|
133
134
|
])
|
|
134
135
|
]),
|
|
135
136
|
_: 2
|
|
136
137
|
}, 1024))), 128))
|
|
137
|
-
])) :
|
|
138
|
-
i(
|
|
138
|
+
])) : v("", !0),
|
|
139
|
+
i(ye, {
|
|
139
140
|
transition: "fade",
|
|
140
|
-
"onClick:outside": l(
|
|
141
|
+
"onClick:outside": l(H),
|
|
141
142
|
modelValue: l(s),
|
|
142
143
|
"onUpdate:modelValue": o[0] || (o[0] = (t) => z(s) ? s.value = t : null),
|
|
143
144
|
activator: "parent",
|
|
@@ -145,38 +146,38 @@ const Ve = {
|
|
|
145
146
|
"parent-ref": D.value,
|
|
146
147
|
location: "bottom",
|
|
147
148
|
origin: "bottom left",
|
|
148
|
-
onHandleEscape:
|
|
149
|
+
onHandleEscape: ee,
|
|
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: n(() => [
|
|
155
|
-
i(
|
|
156
|
-
"onClick:select": l(
|
|
156
|
+
i(ve, {
|
|
157
|
+
"onClick:select": l(P),
|
|
157
158
|
ref_key: "listRef",
|
|
158
159
|
ref: _,
|
|
159
|
-
onKeyDown:
|
|
160
|
+
onKeyDown: ne,
|
|
160
161
|
selectable: !0
|
|
161
162
|
}, {
|
|
162
163
|
default: n(() => [
|
|
163
|
-
l(
|
|
164
|
+
l(Z) ? (r(), d(V, { key: 0 }, {
|
|
164
165
|
default: n(() => [
|
|
165
|
-
i(
|
|
166
|
-
onClick: l(
|
|
166
|
+
i(we, {
|
|
167
|
+
onClick: l(Q),
|
|
167
168
|
class: "w-full",
|
|
168
169
|
bgColor: "bg-green-500"
|
|
169
170
|
}, {
|
|
170
171
|
default: n(() => o[2] || (o[2] = [
|
|
171
|
-
|
|
172
|
+
k(" Crear item ")
|
|
172
173
|
])),
|
|
173
174
|
_: 1,
|
|
174
175
|
__: [2]
|
|
175
176
|
}, 8, ["onClick"])
|
|
176
177
|
]),
|
|
177
178
|
_: 1
|
|
178
|
-
})) :
|
|
179
|
-
i(
|
|
179
|
+
})) : v("", !0),
|
|
180
|
+
i(he, {
|
|
180
181
|
items: I.value,
|
|
181
182
|
search: l(c),
|
|
182
183
|
"searchable-keys": u.searchableKeys,
|
|
@@ -185,13 +186,13 @@ const Ve = {
|
|
|
185
186
|
enabled: l(s),
|
|
186
187
|
"item-height": 48
|
|
187
188
|
}, {
|
|
188
|
-
default: n(({ item: t, index: h, empty:
|
|
189
|
+
default: n(({ item: t, index: h, empty: re }) => {
|
|
189
190
|
var M, x;
|
|
190
191
|
return [
|
|
191
|
-
!
|
|
192
|
+
!re && t ? (r(), d(V, {
|
|
192
193
|
value: t,
|
|
193
194
|
key: ((M = t.id) == null ? void 0 : M.toString()) ?? t.name,
|
|
194
|
-
disabled: l(
|
|
195
|
+
disabled: l(X)(t),
|
|
195
196
|
"bg-items": e.bgItemListColor,
|
|
196
197
|
"hover-bg": e.hoverItemListColor,
|
|
197
198
|
activeClass: e.selectedItemListColor,
|
|
@@ -202,7 +203,7 @@ const Ve = {
|
|
|
202
203
|
default: n(() => [
|
|
203
204
|
i(E, { class: "text-wrap" }, {
|
|
204
205
|
default: n(() => [
|
|
205
|
-
|
|
206
|
+
k(F(l(S)(t, e.itemTitle ?? l(W), "hasDefault")), 1)
|
|
206
207
|
]),
|
|
207
208
|
_: 2
|
|
208
209
|
}, 1024),
|
|
@@ -218,7 +219,7 @@ const Ve = {
|
|
|
218
219
|
default: n(() => [
|
|
219
220
|
i(E, { class: "text-center w-full text-gray-500" }, {
|
|
220
221
|
default: n(() => o[3] || (o[3] = [
|
|
221
|
-
|
|
222
|
+
k(" No hay elementos disponibles ")
|
|
222
223
|
])),
|
|
223
224
|
_: 1,
|
|
224
225
|
__: [3]
|
|
@@ -244,18 +245,18 @@ const Ve = {
|
|
|
244
245
|
fn: n(() => [
|
|
245
246
|
e.clearable && a.value ? (r(), d(y, {
|
|
246
247
|
key: 0,
|
|
247
|
-
onClick: l(
|
|
248
|
+
onClick: l(U),
|
|
248
249
|
size: "small",
|
|
249
250
|
color: "error",
|
|
250
251
|
icon: l(m).close,
|
|
251
252
|
class: "mr-1 mt-1"
|
|
252
|
-
}, null, 8, ["onClick", "icon"])) :
|
|
253
|
+
}, null, 8, ["onClick", "icon"])) : v("", !0),
|
|
253
254
|
i(y, {
|
|
254
255
|
color: "teal-darken-1",
|
|
255
256
|
size: "large",
|
|
256
257
|
class: "cursor-pointer",
|
|
257
258
|
icon: l(s) ? l(m).menuUpOutline : l(m).menuDownOutline,
|
|
258
|
-
onClick:
|
|
259
|
+
onClick: fe(l(C), ["stop"])
|
|
259
260
|
}, null, 8, ["icon", "onClick"]),
|
|
260
261
|
e.required ? (r(), d(y, {
|
|
261
262
|
key: 1,
|
|
@@ -263,7 +264,7 @@ const Ve = {
|
|
|
263
264
|
size: "x-small",
|
|
264
265
|
class: "mb-4",
|
|
265
266
|
icon: l(m).asterisk
|
|
266
|
-
}, null, 8, ["icon"])) :
|
|
267
|
+
}, null, 8, ["icon"])) : v("", !0)
|
|
267
268
|
]),
|
|
268
269
|
key: "0"
|
|
269
270
|
} : void 0
|
|
@@ -272,5 +273,5 @@ const Ve = {
|
|
|
272
273
|
}
|
|
273
274
|
};
|
|
274
275
|
export {
|
|
275
|
-
|
|
276
|
+
Ue as default
|
|
276
277
|
};
|