adverich-kun-ui 0.1.93 → 0.1.94
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,207 +1,206 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
import { icons as
|
|
3
|
-
import { isNotEmpty as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useAutocomplete as
|
|
11
|
-
import { KunAutocompleteProps as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const
|
|
1
|
+
import { mergeModels as x, useModel as A, onMounted as le, ref as te, watch as oe, createBlock as d, openBlock as a, unref as l, isRef as E, createSlots as ne, withCtx as i, createElementBlock as L, createCommentVNode as k, createVNode as s, Fragment as re, renderList as ie, createElementVNode as ae, createTextVNode as C, toDisplayString as b, normalizeClass as se, withModifiers as ue } from "vue";
|
|
2
|
+
import { icons as m } from "../../../../icons/index.js";
|
|
3
|
+
import { isNotEmpty as de, isArray as R } from "../../../../utils/utils.js";
|
|
4
|
+
import ce from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
|
|
5
|
+
import me from "../../../KunList/src/components/KunList.vue.js";
|
|
6
|
+
import U from "../../../KunListItem/src/components/KunListItem.vue.js";
|
|
7
|
+
import fe from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
|
|
8
|
+
import pe from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
|
|
9
|
+
import ve from "../../../kunMenu/src/components/kunMenu.vue.js";
|
|
10
|
+
import { useAutocomplete as ke } from "../composables/useAutocomplete.js";
|
|
11
|
+
import { KunAutocompleteProps as ye } from "../composables/KunAutocompleteProps.js";
|
|
12
|
+
import he from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
13
|
+
import ge 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 be = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "flex justify-center align-center"
|
|
19
|
-
},
|
|
19
|
+
}, Ve = { class: "flex justify-center align-center" }, Be = {
|
|
20
20
|
__name: "KunAutocomplete",
|
|
21
|
-
props: /* @__PURE__ */
|
|
21
|
+
props: /* @__PURE__ */ x(ye, {
|
|
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(
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
clearSelection: N,
|
|
27
|
+
emits: /* @__PURE__ */ x(["createItem", "validation", "search"], ["update:modelValue", "update:items"]),
|
|
28
|
+
setup(h, { emit: z }) {
|
|
29
|
+
const r = A(h, "modelValue"), V = A(h, "items"), n = h, f = z, {
|
|
30
|
+
textFieldRef: p,
|
|
31
|
+
listRef: g,
|
|
32
|
+
menuModel: u,
|
|
33
|
+
search: c,
|
|
34
|
+
removeItem: B,
|
|
35
|
+
clearSelection: F,
|
|
37
36
|
lightReset: w,
|
|
38
|
-
openMenu:
|
|
39
|
-
toggleMenu:
|
|
40
|
-
onMenuKeydown:
|
|
41
|
-
getSelectedItem:
|
|
42
|
-
textArr:
|
|
43
|
-
getItemText:
|
|
44
|
-
createItem:
|
|
45
|
-
checkDisabled:
|
|
46
|
-
itemToString:
|
|
47
|
-
placeholder:
|
|
48
|
-
hasCreateItem:
|
|
49
|
-
} =
|
|
37
|
+
openMenu: N,
|
|
38
|
+
toggleMenu: T,
|
|
39
|
+
onMenuKeydown: I,
|
|
40
|
+
getSelectedItem: H,
|
|
41
|
+
textArr: O,
|
|
42
|
+
getItemText: j,
|
|
43
|
+
createItem: q,
|
|
44
|
+
checkDisabled: P,
|
|
45
|
+
itemToString: K,
|
|
46
|
+
placeholder: _,
|
|
47
|
+
hasCreateItem: W
|
|
48
|
+
} = ke(n, f, r, V);
|
|
50
49
|
le(() => {
|
|
51
|
-
n.focusOnRender &&
|
|
50
|
+
n.focusOnRender && p.value.focus();
|
|
52
51
|
});
|
|
53
|
-
function
|
|
54
|
-
return
|
|
52
|
+
function G(e) {
|
|
53
|
+
return r.value === null || r.value === void 0 ? n.bgItemListColor : n.multiple ? r.value.find((o) => o[n.itemValue] === e[n.itemValue]) ? n.selectedColor : n.bgItemListColor : _.value === e[n.itemTitle] ? n.selectedColor : n.bgItemListColor;
|
|
55
54
|
}
|
|
56
|
-
const
|
|
55
|
+
const v = te(""), M = (e) => {
|
|
57
56
|
for (const o of n.rules) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
57
|
+
const t = o(e);
|
|
58
|
+
if (t !== !0)
|
|
59
|
+
return v.value = t, f("validation", !1), !1;
|
|
61
60
|
}
|
|
62
|
-
return
|
|
61
|
+
return v.value = "", f("validation", !0), !0;
|
|
63
62
|
};
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
oe(() => r.value, (e, o) => {
|
|
64
|
+
de(n.rules) && M(e);
|
|
66
65
|
});
|
|
67
|
-
function
|
|
68
|
-
var
|
|
69
|
-
|
|
66
|
+
function S() {
|
|
67
|
+
var e;
|
|
68
|
+
u.value = !1, (e = p.value.inputField) == null || e.focus();
|
|
70
69
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
70
|
+
function J(e) {
|
|
71
|
+
f("search", c);
|
|
73
72
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
73
|
+
function Q() {
|
|
74
|
+
M(r);
|
|
76
75
|
}
|
|
77
|
-
function
|
|
78
|
-
const o =
|
|
76
|
+
function X(e) {
|
|
77
|
+
const o = e.key;
|
|
79
78
|
if (o === "Escape") {
|
|
80
|
-
|
|
79
|
+
S();
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
if (["ArrowDown", "ArrowUp"].includes(o)) {
|
|
84
|
-
if (!
|
|
85
|
-
|
|
83
|
+
if (!g.value) return;
|
|
84
|
+
g.value.focusWithKey(o);
|
|
86
85
|
return;
|
|
87
86
|
}
|
|
88
|
-
|
|
87
|
+
I(e);
|
|
89
88
|
}
|
|
90
|
-
function
|
|
91
|
-
|
|
89
|
+
function Y(e) {
|
|
90
|
+
I(e);
|
|
92
91
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
92
|
+
function Z() {
|
|
93
|
+
u.value = !1;
|
|
95
94
|
}
|
|
96
|
-
return (
|
|
97
|
-
modelValue:
|
|
95
|
+
return (e, o) => (a(), d(he, {
|
|
96
|
+
modelValue: l(c),
|
|
98
97
|
"onUpdate:modelValue": [
|
|
99
|
-
o[2] || (o[2] = (
|
|
100
|
-
|
|
98
|
+
o[2] || (o[2] = (t) => E(c) ? c.value = t : null),
|
|
99
|
+
J
|
|
101
100
|
],
|
|
102
|
-
label:
|
|
101
|
+
label: e.label,
|
|
103
102
|
dirty: "",
|
|
104
|
-
"hide-details":
|
|
105
|
-
density:
|
|
103
|
+
"hide-details": e.hideDetails,
|
|
104
|
+
density: e.density,
|
|
106
105
|
ref_key: "textFieldRef",
|
|
107
|
-
ref:
|
|
106
|
+
ref: p,
|
|
108
107
|
autocomplete: "off",
|
|
109
|
-
onKeyDown:
|
|
110
|
-
onFocusInput:
|
|
111
|
-
onHandleClick:
|
|
112
|
-
onBlurInput:
|
|
113
|
-
placeholder: n.multiple &&
|
|
114
|
-
error: !!
|
|
115
|
-
"error-messages":
|
|
116
|
-
},
|
|
117
|
-
default:
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
-
key:
|
|
108
|
+
onKeyDown: X,
|
|
109
|
+
onFocusInput: Q,
|
|
110
|
+
onHandleClick: l(T),
|
|
111
|
+
onBlurInput: Z,
|
|
112
|
+
placeholder: n.multiple && l(R)(r.value) && r.value.length ? "" : l(_),
|
|
113
|
+
error: !!v.value,
|
|
114
|
+
"error-messages": v.value
|
|
115
|
+
}, ne({
|
|
116
|
+
default: i(() => [
|
|
117
|
+
l(R)(r.value) ? (a(), L("div", be, [
|
|
118
|
+
(a(!0), L(re, null, ie(r.value, (t) => (a(), d(Ce, {
|
|
119
|
+
key: t.id ?? t.name,
|
|
121
120
|
size: "small",
|
|
122
121
|
class: "ml-1"
|
|
123
122
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
126
|
-
b(
|
|
127
|
-
|
|
123
|
+
default: i(() => [
|
|
124
|
+
ae("div", Ve, [
|
|
125
|
+
C(b(l(j)(t, e.itemTitle)) + " ", 1),
|
|
126
|
+
s(y, {
|
|
128
127
|
color: "error",
|
|
129
|
-
icon:
|
|
128
|
+
icon: l(m).close,
|
|
130
129
|
size: "small",
|
|
131
130
|
class: "ml-1",
|
|
132
|
-
onClick: (
|
|
131
|
+
onClick: (ee) => l(B)(t)
|
|
133
132
|
}, null, 8, ["icon", "onClick"])
|
|
134
133
|
])
|
|
135
134
|
]),
|
|
136
135
|
_: 2
|
|
137
136
|
}, 1024))), 128))
|
|
138
|
-
])) :
|
|
139
|
-
|
|
137
|
+
])) : k("", !0),
|
|
138
|
+
s(ve, {
|
|
140
139
|
transition: "fade",
|
|
141
|
-
"onClick:outside":
|
|
142
|
-
modelValue:
|
|
143
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
140
|
+
"onClick:outside": l(w),
|
|
141
|
+
modelValue: l(u),
|
|
142
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => E(u) ? u.value = t : null),
|
|
144
143
|
activator: "parent",
|
|
145
|
-
"parent-ref":
|
|
146
|
-
onHandleEscape:
|
|
147
|
-
"close-on-content-click":
|
|
148
|
-
"max-height":
|
|
149
|
-
"hide-details":
|
|
144
|
+
"parent-ref": l(p),
|
|
145
|
+
onHandleEscape: S,
|
|
146
|
+
"close-on-content-click": e.closeOnSelect,
|
|
147
|
+
"max-height": e.maxHeight,
|
|
148
|
+
"hide-details": e.hideDetails
|
|
150
149
|
}, {
|
|
151
|
-
default:
|
|
152
|
-
|
|
153
|
-
"onUpdate:selected":
|
|
154
|
-
"onClick:select": o[0] || (o[0] = (
|
|
150
|
+
default: i(() => [
|
|
151
|
+
s(me, {
|
|
152
|
+
"onUpdate:selected": l(H),
|
|
153
|
+
"onClick:select": o[0] || (o[0] = (t) => l(w)()),
|
|
155
154
|
ref_key: "listRef",
|
|
156
|
-
ref:
|
|
157
|
-
onKeyDown:
|
|
155
|
+
ref: g,
|
|
156
|
+
onKeyDown: Y
|
|
158
157
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
|
|
161
|
-
default:
|
|
162
|
-
|
|
163
|
-
onClick:
|
|
158
|
+
default: i(() => [
|
|
159
|
+
l(W) ? (a(), d(U, { key: 0 }, {
|
|
160
|
+
default: i(() => [
|
|
161
|
+
s(ge, {
|
|
162
|
+
onClick: l(q),
|
|
164
163
|
class: "w-full",
|
|
165
164
|
color: "bg-green-400"
|
|
166
165
|
}, {
|
|
167
|
-
default:
|
|
168
|
-
|
|
166
|
+
default: i(() => o[3] || (o[3] = [
|
|
167
|
+
C(" Crear item ")
|
|
169
168
|
])),
|
|
170
169
|
_: 1,
|
|
171
170
|
__: [3]
|
|
172
171
|
}, 8, ["onClick"])
|
|
173
172
|
]),
|
|
174
173
|
_: 1
|
|
175
|
-
})) :
|
|
176
|
-
|
|
177
|
-
items:
|
|
178
|
-
search:
|
|
174
|
+
})) : k("", !0),
|
|
175
|
+
s(ce, {
|
|
176
|
+
items: V.value,
|
|
177
|
+
search: l(c),
|
|
179
178
|
"searchable-keys": n.searchableKeys,
|
|
180
179
|
"items-per-intersection": 10,
|
|
181
|
-
enabled:
|
|
180
|
+
enabled: l(u),
|
|
182
181
|
virtual: !1,
|
|
183
182
|
"item-height": 48
|
|
184
183
|
}, {
|
|
185
|
-
default:
|
|
186
|
-
var
|
|
184
|
+
default: i(({ item: t, index: ee }) => {
|
|
185
|
+
var D, $;
|
|
187
186
|
return [
|
|
188
|
-
(
|
|
189
|
-
value:
|
|
190
|
-
key: ((
|
|
191
|
-
disabled:
|
|
192
|
-
class:
|
|
193
|
-
density:
|
|
194
|
-
id: ((
|
|
187
|
+
(a(), d(U, {
|
|
188
|
+
value: t,
|
|
189
|
+
key: ((D = t.id) == null ? void 0 : D.toString()) ?? t.name,
|
|
190
|
+
disabled: l(P)(t),
|
|
191
|
+
class: se(G(t)),
|
|
192
|
+
density: e.density,
|
|
193
|
+
id: (($ = t.id) == null ? void 0 : $.toString()) ?? t.name
|
|
195
194
|
}, {
|
|
196
|
-
default:
|
|
197
|
-
|
|
198
|
-
default:
|
|
199
|
-
b(
|
|
195
|
+
default: i(() => [
|
|
196
|
+
s(fe, { class: "text-wrap" }, {
|
|
197
|
+
default: i(() => [
|
|
198
|
+
C(b(l(K)(t, l(O), "hasDefault")), 1)
|
|
200
199
|
]),
|
|
201
200
|
_: 2
|
|
202
201
|
}, 1024),
|
|
203
|
-
|
|
204
|
-
textContent:
|
|
202
|
+
s(pe, {
|
|
203
|
+
textContent: b(e.itemSubtitle ? l(K)(t, e.itemSubtitle) : "")
|
|
205
204
|
}, null, 8, ["textContent"])
|
|
206
205
|
]),
|
|
207
206
|
_: 2
|
|
@@ -219,31 +218,31 @@ const Ve = {
|
|
|
219
218
|
]),
|
|
220
219
|
_: 2
|
|
221
220
|
}, [
|
|
222
|
-
|
|
221
|
+
e.hasIcons ? {
|
|
223
222
|
name: "append-inner",
|
|
224
|
-
fn:
|
|
225
|
-
|
|
223
|
+
fn: i(() => [
|
|
224
|
+
e.clearable && r.value ? (a(), d(y, {
|
|
226
225
|
key: 0,
|
|
227
|
-
onClick:
|
|
226
|
+
onClick: l(F),
|
|
228
227
|
size: "small",
|
|
229
228
|
color: "error",
|
|
230
|
-
icon:
|
|
229
|
+
icon: l(m).close,
|
|
231
230
|
class: "mr-1 mt-1"
|
|
232
|
-
}, null, 8, ["onClick", "icon"])) :
|
|
233
|
-
|
|
231
|
+
}, null, 8, ["onClick", "icon"])) : k("", !0),
|
|
232
|
+
s(y, {
|
|
234
233
|
color: "teal-darken-1",
|
|
235
234
|
size: "large",
|
|
236
235
|
class: "cursor-pointer",
|
|
237
|
-
icon:
|
|
238
|
-
onClick:
|
|
236
|
+
icon: l(u) ? l(m).menuUpOutline : l(m).menuDownOutline,
|
|
237
|
+
onClick: ue(l(N), ["stop"])
|
|
239
238
|
}, null, 8, ["icon", "onClick"]),
|
|
240
|
-
|
|
239
|
+
e.required ? (a(), d(y, {
|
|
241
240
|
key: 1,
|
|
242
241
|
color: "teal-darken-1",
|
|
243
242
|
size: "x-small",
|
|
244
243
|
class: "mb-4",
|
|
245
|
-
icon:
|
|
246
|
-
}, null, 8, ["icon"])) :
|
|
244
|
+
icon: l(m).asterisk
|
|
245
|
+
}, null, 8, ["icon"])) : k("", !0)
|
|
247
246
|
]),
|
|
248
247
|
key: "0"
|
|
249
248
|
} : void 0
|
|
@@ -251,5 +250,5 @@ const Ve = {
|
|
|
251
250
|
}
|
|
252
251
|
};
|
|
253
252
|
export {
|
|
254
|
-
|
|
253
|
+
Be as default
|
|
255
254
|
};
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isArray as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
1
|
+
import { ref as f, computed as T } from "vue";
|
|
2
|
+
import { isArray as O, isObject as a } from "../../../../utils/utils.js";
|
|
3
|
+
function G(t, y, u, A, q) {
|
|
4
|
+
const l = f(null), s = f(null), b = f(null), r = f(!1), v = f(""), M = (e, n) => n.split(".").reduce((c, i) => c && c[i] !== void 0 ? c[i] : null, e), F = T(() => l.value ? O(l.value) ? l.value.length ? o(l.value, t.itemTitle, "hasDefault") : t.placeholderText : a(l.value) ? o(l.value, t.itemTitle, "hasDefault") : l.value.toString() : A.value.length ? t.placeholderText : t.textNoItems), k = T(() => t.itemText.includes(",") ? t.itemText.split(",") : t.itemText);
|
|
5
|
+
function o(e, n, c) {
|
|
6
|
+
if (a(e)) {
|
|
7
7
|
if (n) {
|
|
8
|
-
if (
|
|
9
|
-
return n.map((
|
|
8
|
+
if (O(n))
|
|
9
|
+
return n.map((i) => e[i] ?? "No definido").join(" - ");
|
|
10
10
|
if (n.includes(","))
|
|
11
|
-
return n.split(",").map((
|
|
11
|
+
return n.split(",").map((i) => e[i]).join(" - ");
|
|
12
12
|
if (n.includes(".")) {
|
|
13
|
-
const
|
|
13
|
+
const i = n.split(".");
|
|
14
14
|
let x = e;
|
|
15
|
-
for (const
|
|
16
|
-
x = x[
|
|
15
|
+
for (const $ of i)
|
|
16
|
+
x = x[$];
|
|
17
17
|
return x;
|
|
18
18
|
}
|
|
19
|
-
return !
|
|
19
|
+
return !t.returnObject && typeof e[n] == "number" || e[n] ? e[n].toString() : "";
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
21
|
+
if (c)
|
|
22
22
|
return Object.values(e)[0];
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return O(e) ? t.returnObject ? e.map((i) => i[n]).join(" - ") : e.map((i) => i).join(" - ") : c && typeof e != "number" && e.includes(",") ? e.split(",") : e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function R(e) {
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
l.value = e, t.multiple ? (u.value || (u.value = []), j(e) ? e && g(e) : t.returnObject ? u.value.push(e) : a(e) ? t.itemValue ? u.value.push(e[t.itemValue]) : u.value.push(Object.values(e)[0]) : u.value.push(e)) : (t.returnObject ? u.value = e : a(e) ? t.itemValue ? u.value = e[t.itemValue] : u.value = Object.values(e)[0] : u.value = e, r.value = !1), t.clearOnSelect && S();
|
|
29
29
|
} catch (n) {
|
|
30
30
|
console.log(n);
|
|
31
31
|
} finally {
|
|
32
32
|
h();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
37
|
-
(n) =>
|
|
35
|
+
function j(e) {
|
|
36
|
+
return u.value === null ? !1 : e ? u.value.some(
|
|
37
|
+
(n) => t.returnObject ? n[t.itemValue] === e[t.itemValue] : n === e[t.itemValue]
|
|
38
38
|
) : !0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (
|
|
42
|
-
const n =
|
|
43
|
-
(
|
|
44
|
-
),
|
|
45
|
-
|
|
40
|
+
function g(e) {
|
|
41
|
+
if (t.returnObject) {
|
|
42
|
+
const n = u.value.find(
|
|
43
|
+
(i) => i[t.itemValue] === e[t.itemValue]
|
|
44
|
+
), c = u.value.indexOf(n);
|
|
45
|
+
u.value.splice(c, 1);
|
|
46
46
|
} else {
|
|
47
|
-
const n =
|
|
48
|
-
|
|
47
|
+
const n = u.value.indexOf(e[t.itemValue]);
|
|
48
|
+
u.value.splice(n, 1);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
51
|
+
function w(e) {
|
|
52
|
+
t.clearSearchOnSelect && (v.value = ""), t.focusOnSelect && h();
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
54
|
+
function d() {
|
|
55
|
+
r.value || (r.value = !0);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
57
|
+
function D() {
|
|
58
|
+
r.value = !r.value;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function I(e) {
|
|
61
61
|
return e.length === 1 && e.match(/\w/);
|
|
62
62
|
}
|
|
63
63
|
function h() {
|
|
64
64
|
s.value.inputField.focus();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function N() {
|
|
67
|
+
r.value = !0, b.value && s.value.$el.focus();
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function B(e) {
|
|
70
70
|
const n = e.key;
|
|
71
|
-
(
|
|
71
|
+
(I(n) || n === "Backspace") && (d(), h());
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
73
|
+
function E() {
|
|
74
|
+
r.value = !1, y("createItem");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
let n =
|
|
78
|
-
|
|
76
|
+
function K(e) {
|
|
77
|
+
let n = u.value.indexOf(e);
|
|
78
|
+
u.value.splice(n, 1);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
v.value = "",
|
|
80
|
+
function S() {
|
|
81
|
+
v.value = "", u.value = null, l.value = null;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function P(e) {
|
|
84
84
|
return !!e.disabledItem;
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
|
-
selectedItem:
|
|
87
|
+
selectedItem: l,
|
|
88
88
|
textFieldRef: s,
|
|
89
89
|
listRef: b,
|
|
90
|
-
menuModel:
|
|
90
|
+
menuModel: r,
|
|
91
91
|
search: v,
|
|
92
|
-
getItemText:
|
|
93
|
-
placeholder:
|
|
94
|
-
textArr:
|
|
95
|
-
itemToString:
|
|
96
|
-
getSelectedItem:
|
|
97
|
-
checkIfValueExist:
|
|
98
|
-
removeFromArray:
|
|
99
|
-
lightReset:
|
|
100
|
-
openMenu:
|
|
101
|
-
toggleMenu:
|
|
102
|
-
focusOnMenu:
|
|
103
|
-
onMenuKeydown:
|
|
104
|
-
createItem:
|
|
105
|
-
removeItem:
|
|
106
|
-
clearSelection:
|
|
107
|
-
checkDisabled:
|
|
108
|
-
isAlphanumeric:
|
|
92
|
+
getItemText: M,
|
|
93
|
+
placeholder: F,
|
|
94
|
+
textArr: k,
|
|
95
|
+
itemToString: o,
|
|
96
|
+
getSelectedItem: R,
|
|
97
|
+
checkIfValueExist: j,
|
|
98
|
+
removeFromArray: g,
|
|
99
|
+
lightReset: w,
|
|
100
|
+
openMenu: d,
|
|
101
|
+
toggleMenu: D,
|
|
102
|
+
focusOnMenu: N,
|
|
103
|
+
onMenuKeydown: B,
|
|
104
|
+
createItem: E,
|
|
105
|
+
removeItem: K,
|
|
106
|
+
clearSelection: S,
|
|
107
|
+
checkDisabled: P,
|
|
108
|
+
isAlphanumeric: I
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
G as useAutocomplete
|
|
113
113
|
};
|