adverich-kun-ui 0.1.112 → 0.1.114

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