adverich-kun-ui 0.1.515 → 0.1.517

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,10 +1,10 @@
1
- import { mergeModels as z, useModel as A, onMounted as se, ref as E, watch as ue, nextTick as x, createElementBlock as h, openBlock as d, createVNode as a, unref as t, withKeys as de, withModifiers as R, isRef as O, createSlots as ce, withCtx as n, createCommentVNode as g, normalizeClass as me, createTextVNode as C, toDisplayString as D, createBlock as p, Fragment as fe, renderList as pe, createElementVNode as ve } from "vue";
1
+ import { mergeModels as z, useModel as A, onMounted as se, ref as E, watch as ue, nextTick as F, createElementBlock as h, openBlock as c, createVNode as s, unref as t, withKeys as de, withModifiers as x, isRef as O, createSlots as ce, withCtx as r, createCommentVNode as g, normalizeClass as fe, createTextVNode as C, toDisplayString as D, createBlock as p, Fragment as me, renderList as pe, createElementVNode as ve } from "vue";
2
2
  import { icons as v } from "../../../../icons/index.js";
3
- import { isNotEmpty as B, isArray as F } from "../../../../utils/utils.js";
3
+ import { isNotEmpty as R, isArray as B } from "../../../../utils/utils.js";
4
4
  import ke from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
5
5
  import ye from "../../../KunList/src/components/KunList.vue.js";
6
- import T from "../../../KunListItem/src/components/KunListItem.vue.js";
7
- import N from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
6
+ import N from "../../../KunListItem/src/components/KunListItem.vue.js";
7
+ import T from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
8
8
  import he from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
9
9
  import ge from "../../../KunMenu/src/components/KunMenu.vue.js";
10
10
  import { useAutocomplete as Ce } from "../composables/useAutocomplete.js";
@@ -24,13 +24,13 @@ const De = { class: "flex items-center" }, Ie = {
24
24
  items: { default: [], type: Array, required: !0 },
25
25
  itemsModifiers: {}
26
26
  }),
27
- emits: /* @__PURE__ */ z(["update:modelValue", "selectedItem", "createItem", "validation", "search", "keyDown", "keyDownEnter"], ["update:modelValue", "update:items"]),
27
+ emits: /* @__PURE__ */ z(["update:modelValue", "selectedItem", "createItem", "validation", "search", "keyDown", "keyDownEnter", "notFound"], ["update:modelValue", "update:items"]),
28
28
  setup(w, { expose: _, emit: U }) {
29
- const s = A(w, "modelValue"), f = A(w, "items"), u = w, m = U, {
29
+ const u = A(w, "modelValue"), m = A(w, "items"), a = w, f = U, {
30
30
  textFieldRef: k,
31
31
  listRef: I,
32
- menuModel: c,
33
- search: r,
32
+ menuModel: d,
33
+ search: n,
34
34
  removeItem: j,
35
35
  clearSelection: H,
36
36
  lightReset: q,
@@ -46,74 +46,74 @@ const De = { class: "flex items-center" }, Ie = {
46
46
  checkDisabled: Y,
47
47
  itemToString: L,
48
48
  placeholder: Z
49
- } = Ce(u, m, s, f);
49
+ } = Ce(a, f, u, m);
50
50
  se(() => {
51
- u.focusOnRender && k.value.focus();
51
+ a.focusOnRender && k.value.focus();
52
52
  });
53
53
  const M = E(null), y = E(""), $ = (e) => {
54
- for (const o of u.rules) {
54
+ for (const o of a.rules) {
55
55
  const l = o(e);
56
56
  if (l !== !0)
57
- return y.value = l, m("validation", !1), !1;
57
+ return y.value = l, f("validation", !1), !1;
58
58
  }
59
- return y.value = "", m("validation", !0), !0;
59
+ return y.value = "", f("validation", !0), !0;
60
60
  };
61
- ue(() => s.value, (e, o) => {
62
- B(u.rules) && $(e);
61
+ ue(() => u.value, (e, o) => {
62
+ R(a.rules) && $(e);
63
63
  });
64
64
  function ee() {
65
65
  var e;
66
- c.value = !1, (e = k.value.inputField) == null || e.focus();
66
+ d.value = !1, (e = k.value.inputField) == null || e.focus();
67
67
  }
68
68
  function le(e) {
69
69
  var l, i;
70
70
  const o = e.key;
71
71
  if (o === "Tab" || o === "Shift" || o === "Escape") {
72
- P(), m("keyDown", o);
72
+ P(), f("keyDown", o);
73
73
  return;
74
74
  }
75
- (Q(o) || o === "Backspace") && S(), ["ArrowUp", "ArrowDown"].includes(o) && (e.preventDefault(), c.value || S(), (i = (l = I.value) == null ? void 0 : l.focusWithKey) == null || i.call(l, o));
75
+ (Q(o) || o === "Backspace") && S(), ["ArrowUp", "ArrowDown"].includes(o) && (e.preventDefault(), d.value || S(), (i = (l = I.value) == null ? void 0 : l.focusWithKey) == null || i.call(l, o));
76
76
  }
77
77
  function te(e) {
78
- m("search", r);
78
+ f("search", n);
79
79
  }
80
80
  function oe() {
81
- $(s);
81
+ $(u);
82
82
  }
83
83
  function ne(e) {
84
84
  W(e);
85
85
  }
86
86
  function re() {
87
87
  }
88
- function ie(e) {
89
- if (!r.value) return;
88
+ function ae(e) {
89
+ if (!n.value) return;
90
90
  let o = null;
91
- u.returnObject ? o = f.value.find(
91
+ a.returnObject ? o = m.value.find(
92
92
  (l) => Object.values(l).some(
93
- (i) => String(i).toLowerCase() === String(r.value).toLowerCase()
93
+ (i) => String(i).toLowerCase() === String(n.value).toLowerCase()
94
94
  )
95
- ) : u.itemValue ? o = f.value.find(
96
- (l) => String(l[u.itemValue]).toLowerCase() === String(r.value).toLowerCase()
97
- ) : o = f.value.find(
98
- (l) => typeof l == "object" ? Object.values(l).some((i) => String(i).toLowerCase() === String(r.value).toLowerCase()) : String(l).toLowerCase() === String(r.value).toLowerCase()
99
- ), o && K(o), x(() => {
100
- m("keyDownEnter", e);
95
+ ) : a.itemValue ? o = m.value.find(
96
+ (l) => String(l[a.itemValue]).toLowerCase() === String(n.value).toLowerCase()
97
+ ) : o = m.value.find(
98
+ (l) => typeof l == "object" ? Object.values(l).some((i) => String(i).toLowerCase() === String(n.value).toLowerCase()) : String(l).toLowerCase() === String(n.value).toLowerCase()
99
+ ), o ? K(o) : (f("notFound", n.value), a.clearOnNotFound && (n.value = "", d.value = !1)), F(() => {
100
+ f("keyDownEnter", e);
101
101
  });
102
102
  }
103
103
  return _({
104
- focus: () => x(() => {
104
+ focus: () => F(() => {
105
105
  var e;
106
106
  return (e = k.value) == null ? void 0 : e.focus();
107
107
  })
108
- }), (e, o) => (d(), h("div", {
108
+ }), (e, o) => (c(), h("div", {
109
109
  class: "w-full h-fit",
110
110
  ref_key: "parentRef",
111
111
  ref: M
112
112
  }, [
113
- a(we, {
114
- modelValue: t(r),
113
+ s(we, {
114
+ modelValue: t(n),
115
115
  "onUpdate:modelValue": [
116
- o[2] || (o[2] = (l) => O(r) ? r.value = l : null),
116
+ o[2] || (o[2] = (l) => O(n) ? n.value = l : null),
117
117
  te
118
118
  ],
119
119
  label: e.label,
@@ -125,31 +125,31 @@ const De = { class: "flex items-center" }, Ie = {
125
125
  autocomplete: "off",
126
126
  onFocusInput: oe,
127
127
  onHandleClick: t(V),
128
- rounded: t(c) ? "rounded-t" : "rounded",
128
+ rounded: t(d) ? "rounded-t" : "rounded",
129
129
  onBlur: re,
130
130
  onKeyDown: [
131
131
  le,
132
- de(R(ie, ["prevent"]), ["enter"])
132
+ de(x(ae, ["prevent"]), ["enter"])
133
133
  ],
134
- placeholder: u.multiple && t(F)(s.value) && s.value.length ? "" : t(Z),
134
+ placeholder: a.multiple && t(B)(u.value) && u.value.length ? "" : t(Z),
135
135
  error: !!y.value,
136
136
  "error-messages": y.value
137
137
  }, ce({
138
- "prepend-input-content": n(() => [
139
- t(F)(s.value) && t(B)(s.value) ? (d(), h("div", {
138
+ "prepend-input-content": r(() => [
139
+ t(B)(u.value) && t(R)(u.value) ? (c(), h("div", {
140
140
  key: 0,
141
141
  class: "flex flex-nowrap items-center space-x-1 min-w-[calc(100%-56px)] overflow-x-auto overflow-y-hidden",
142
142
  onClick: o[0] || (o[0] = (...l) => t(V) && t(V)(...l))
143
143
  }, [
144
- (d(!0), h(fe, null, pe(s.value, (l) => (d(), p(Ve, {
144
+ (c(!0), h(me, null, pe(u.value, (l) => (c(), p(Ve, {
145
145
  key: l.id ?? l.name,
146
146
  size: "small",
147
147
  variant: "pill"
148
148
  }, {
149
- default: n(() => [
149
+ default: r(() => [
150
150
  ve("div", De, [
151
151
  C(D(t(J)(l)) + " ", 1),
152
- a(b, {
152
+ s(b, {
153
153
  color: "error",
154
154
  icon: t(v).close,
155
155
  size: "small",
@@ -162,12 +162,12 @@ const De = { class: "flex items-center" }, Ie = {
162
162
  }, 1024))), 128))
163
163
  ])) : g("", !0)
164
164
  ]),
165
- default: n(() => [
166
- a(ge, {
165
+ default: r(() => [
166
+ s(ge, {
167
167
  transition: "fade",
168
168
  "onClick:outside": t(q),
169
- modelValue: t(c),
170
- "onUpdate:modelValue": o[1] || (o[1] = (l) => O(c) ? c.value = l : null),
169
+ modelValue: t(d),
170
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => O(d) ? d.value = l : null),
171
171
  activator: "parent",
172
172
  "z-index": e.zIndex,
173
173
  "parent-ref": M.value,
@@ -179,38 +179,38 @@ const De = { class: "flex items-center" }, Ie = {
179
179
  "max-height": e.maxHeight,
180
180
  "hide-details": e.hideDetails
181
181
  }, {
182
- default: n(() => [
183
- e.hasCreateItem ? (d(), h("div", Ie, [
184
- a(Se, {
182
+ default: r(() => [
183
+ e.hasCreateItem ? (c(), h("div", Ie, [
184
+ s(Se, {
185
185
  onClick: t(X),
186
186
  bgColor: e.btnCreateBg,
187
- class: me(e.btnCreateClass)
187
+ class: fe(e.btnCreateClass)
188
188
  }, {
189
- default: n(() => [
189
+ default: r(() => [
190
190
  C(D(e.btnCreateText), 1)
191
191
  ]),
192
192
  _: 1
193
193
  }, 8, ["onClick", "bgColor", "class"])
194
194
  ])) : g("", !0),
195
- a(ye, {
195
+ s(ye, {
196
196
  "onClick:select": t(K),
197
197
  ref_key: "listRef",
198
198
  ref: I,
199
199
  onKeyDown: ne,
200
200
  selectable: !0
201
201
  }, {
202
- default: n(() => [
203
- a(ke, {
204
- items: f.value,
205
- search: t(r),
206
- "searchable-keys": u.searchableKeys,
202
+ default: r(() => [
203
+ s(ke, {
204
+ items: m.value,
205
+ search: t(n),
206
+ "searchable-keys": a.searchableKeys,
207
207
  virtual: !1,
208
208
  "items-per-intersection": 10,
209
- enabled: t(c),
209
+ enabled: t(d),
210
210
  "item-height": 48
211
211
  }, {
212
- default: n(({ item: l, index: i, empty: ae }) => [
213
- !ae && l != null ? (d(), p(T, {
212
+ default: r(({ item: l, index: i, empty: ie }) => [
213
+ !ie && l != null ? (c(), p(N, {
214
214
  value: l,
215
215
  key: `kun-list-${i + 1}`,
216
216
  id: `kun-item-${i + 1}`,
@@ -221,25 +221,25 @@ const De = { class: "flex items-center" }, Ie = {
221
221
  density: e.density,
222
222
  selectable: !0
223
223
  }, {
224
- default: n(() => [
225
- a(N, { class: "text-wrap" }, {
226
- default: n(() => [
224
+ default: r(() => [
225
+ s(T, { class: "text-wrap" }, {
226
+ default: r(() => [
227
227
  C(D(t(L)(l, e.itemTitle ?? t(G), "hasDefault")), 1)
228
228
  ]),
229
229
  _: 2
230
230
  }, 1024),
231
- a(he, {
231
+ s(he, {
232
232
  text: e.itemSubtitle ? t(L)(l, e.itemSubtitle) : ""
233
233
  }, null, 8, ["text"])
234
234
  ]),
235
235
  _: 2
236
- }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(T, {
236
+ }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (c(), p(N, {
237
237
  key: 1,
238
238
  disabled: ""
239
239
  }, {
240
- default: n(() => [
241
- a(N, { class: "text-center w-full text-gray-500" }, {
242
- default: n(() => o[3] || (o[3] = [
240
+ default: r(() => [
241
+ s(T, { class: "text-center w-full text-gray-500" }, {
242
+ default: r(() => o[3] || (o[3] = [
243
243
  C(" No hay elementos disponibles ")
244
244
  ])),
245
245
  _: 1,
@@ -262,8 +262,8 @@ const De = { class: "flex items-center" }, Ie = {
262
262
  }, [
263
263
  e.hasIcons ? {
264
264
  name: "append-inner",
265
- fn: n(() => [
266
- e.clearable && s.value ? (d(), p(b, {
265
+ fn: r(() => [
266
+ e.clearable && u.value ? (c(), p(b, {
267
267
  key: 0,
268
268
  onClick: t(H),
269
269
  size: "small",
@@ -271,14 +271,14 @@ const De = { class: "flex items-center" }, Ie = {
271
271
  icon: t(v).close,
272
272
  class: "mr-1 mt-1"
273
273
  }, null, 8, ["onClick", "icon"])) : g("", !0),
274
- a(b, {
274
+ s(b, {
275
275
  color: "teal-darken-1",
276
276
  size: "large",
277
277
  class: "cursor-pointer",
278
- icon: t(c) ? t(v).menuUpOutline : t(v).menuDownOutline,
279
- onClick: R(t(S), ["stop"])
278
+ icon: t(d) ? t(v).menuUpOutline : t(v).menuDownOutline,
279
+ onClick: x(t(S), ["stop"])
280
280
  }, null, 8, ["icon", "onClick"]),
281
- e.required ? (d(), p(b, {
281
+ e.required ? (c(), p(b, {
282
282
  key: 1,
283
283
  color: "teal-darken-1",
284
284
  size: "x-small",
@@ -46,6 +46,7 @@ const e = {
46
46
  type: Boolean,
47
47
  default: !0
48
48
  },
49
+ clearOnNotFound: { type: Boolean, default: !0 },
49
50
  closeOnSelect: { type: Boolean, default: !0 },
50
51
  menuOrigin: { type: String, default: "bottom left" },
51
52
  startEmtpy: { type: Boolean, default: !1 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.515",
3
+ "version": "0.1.517",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",