adverich-kun-ui 0.1.519 → 0.1.520

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,9 +1,9 @@
1
- import { mergeModels as z, useModel as A, onMounted as se, ref as E, watch as ue, nextTick as x, createElementBlock as g, openBlock as d, createVNode as i, unref as t, withKeys as de, withModifiers as F, isRef as R, createSlots as ce, withCtx as r, createCommentVNode as h, 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 g, 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 h, 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 O, isArray as B } from "../../../../utils/utils.js";
3
+ import { isNotEmpty as R, isArray as N } 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 N from "../../../KunListItem/src/components/KunListItem.vue.js";
6
+ import B from "../../../KunListItem/src/components/KunListItem.vue.js";
7
7
  import T from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
8
8
  import ge from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
9
9
  import he from "../../../KunMenu/src/components/KunMenu.vue.js";
@@ -26,10 +26,10 @@ const De = { class: "flex items-center" }, Ie = {
26
26
  }),
27
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,
32
+ menuModel: d,
33
33
  search: n,
34
34
  removeItem: j,
35
35
  clearSelection: H,
@@ -46,39 +46,39 @@ 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
- O(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
- var l, a;
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(), (a = (l = I.value) == null ? void 0 : l.focusWithKey) == null || a.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", n);
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);
@@ -86,35 +86,34 @@ const De = { class: "flex items-center" }, Ie = {
86
86
  function re() {
87
87
  }
88
88
  function ae(e) {
89
- if (console.log(1), !n.value) return;
90
- console.log(2);
89
+ if (!n.value) return;
91
90
  let o = null;
92
- u.returnObject ? o = f.value.find(
91
+ a.returnObject ? o = m.value.find(
93
92
  (l) => Object.values(l).some(
94
- (a) => String(a).toLowerCase() === String(n.value).toLowerCase()
93
+ (i) => String(i).toLowerCase() === String(n.value).toLowerCase()
95
94
  )
96
- ) : u.itemValue ? o = f.value.find(
97
- (l) => String(l[u.itemValue]).toLowerCase() === String(n.value).toLowerCase()
98
- ) : o = f.value.find(
99
- (l) => typeof l == "object" ? Object.values(l).some((a) => String(a).toLowerCase() === String(n.value).toLowerCase()) : String(l).toLowerCase() === String(n.value).toLowerCase()
100
- ), o ? K(o) : (console.log("No se encontró el elemento:", n.value), m("notFound", n.value)), x(() => {
101
- 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) : (console.log("No se encontró el elemento:", n.value), f("notFound", n.value), a.clearOnNotFound && (n.value = "", d.value = !1)), F(() => {
100
+ f("keyDownEnter", e);
102
101
  });
103
102
  }
104
103
  return _({
105
- focus: () => x(() => {
104
+ focus: () => F(() => {
106
105
  var e;
107
106
  return (e = k.value) == null ? void 0 : e.focus();
108
107
  })
109
- }), (e, o) => (d(), g("div", {
108
+ }), (e, o) => (c(), g("div", {
110
109
  class: "w-full h-fit",
111
110
  ref_key: "parentRef",
112
111
  ref: M
113
112
  }, [
114
- i(we, {
113
+ s(we, {
115
114
  modelValue: t(n),
116
115
  "onUpdate:modelValue": [
117
- o[2] || (o[2] = (l) => R(n) ? n.value = l : null),
116
+ o[2] || (o[2] = (l) => O(n) ? n.value = l : null),
118
117
  te
119
118
  ],
120
119
  label: e.label,
@@ -126,23 +125,23 @@ const De = { class: "flex items-center" }, Ie = {
126
125
  autocomplete: "off",
127
126
  onFocusInput: oe,
128
127
  onHandleClick: t(V),
129
- rounded: t(c) ? "rounded-t" : "rounded",
128
+ rounded: t(d) ? "rounded-t" : "rounded",
130
129
  onBlur: re,
131
130
  onKeyDown: [
132
131
  le,
133
- de(F(ae, ["prevent"]), ["enter"])
132
+ de(x(ae, ["prevent"]), ["enter"])
134
133
  ],
135
- placeholder: u.multiple && t(B)(s.value) && s.value.length ? "" : t(Z),
134
+ placeholder: a.multiple && t(N)(u.value) && u.value.length ? "" : t(Z),
136
135
  error: !!y.value,
137
136
  "error-messages": y.value
138
137
  }, ce({
139
138
  "prepend-input-content": r(() => [
140
- t(B)(s.value) && t(O)(s.value) ? (d(), g("div", {
139
+ t(N)(u.value) && t(R)(u.value) ? (c(), g("div", {
141
140
  key: 0,
142
141
  class: "flex flex-nowrap items-center space-x-1 min-w-[calc(100%-56px)] overflow-x-auto overflow-y-hidden",
143
142
  onClick: o[0] || (o[0] = (...l) => t(V) && t(V)(...l))
144
143
  }, [
145
- (d(!0), g(fe, null, pe(s.value, (l) => (d(), p(Ve, {
144
+ (c(!0), g(me, null, pe(u.value, (l) => (c(), p(Ve, {
146
145
  key: l.id ?? l.name,
147
146
  size: "small",
148
147
  variant: "pill"
@@ -150,12 +149,12 @@ const De = { class: "flex items-center" }, Ie = {
150
149
  default: r(() => [
151
150
  ve("div", De, [
152
151
  C(D(t(J)(l)) + " ", 1),
153
- i(b, {
152
+ s(b, {
154
153
  color: "error",
155
154
  icon: t(v).close,
156
155
  size: "small",
157
156
  class: "ml-1",
158
- onClick: (a) => t(j)(l)
157
+ onClick: (i) => t(j)(l)
159
158
  }, null, 8, ["icon", "onClick"])
160
159
  ])
161
160
  ]),
@@ -164,11 +163,11 @@ const De = { class: "flex items-center" }, Ie = {
164
163
  ])) : h("", !0)
165
164
  ]),
166
165
  default: r(() => [
167
- i(he, {
166
+ s(he, {
168
167
  transition: "fade",
169
168
  "onClick:outside": t(q),
170
- modelValue: t(c),
171
- "onUpdate:modelValue": o[1] || (o[1] = (l) => R(c) ? c.value = l : null),
169
+ modelValue: t(d),
170
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => O(d) ? d.value = l : null),
172
171
  activator: "parent",
173
172
  "z-index": e.zIndex,
174
173
  "parent-ref": M.value,
@@ -181,11 +180,11 @@ const De = { class: "flex items-center" }, Ie = {
181
180
  "hide-details": e.hideDetails
182
181
  }, {
183
182
  default: r(() => [
184
- e.hasCreateItem ? (d(), g("div", Ie, [
185
- i(Se, {
183
+ e.hasCreateItem ? (c(), g("div", Ie, [
184
+ s(Se, {
186
185
  onClick: t(X),
187
186
  bgColor: e.btnCreateBg,
188
- class: me(e.btnCreateClass)
187
+ class: fe(e.btnCreateClass)
189
188
  }, {
190
189
  default: r(() => [
191
190
  C(D(e.btnCreateText), 1)
@@ -193,7 +192,7 @@ const De = { class: "flex items-center" }, Ie = {
193
192
  _: 1
194
193
  }, 8, ["onClick", "bgColor", "class"])
195
194
  ])) : h("", !0),
196
- i(ye, {
195
+ s(ye, {
197
196
  "onClick:select": t(K),
198
197
  ref_key: "listRef",
199
198
  ref: I,
@@ -201,20 +200,20 @@ const De = { class: "flex items-center" }, Ie = {
201
200
  selectable: !0
202
201
  }, {
203
202
  default: r(() => [
204
- i(ke, {
205
- items: f.value,
203
+ s(ke, {
204
+ items: m.value,
206
205
  search: t(n),
207
- "searchable-keys": u.searchableKeys,
206
+ "searchable-keys": a.searchableKeys,
208
207
  virtual: !1,
209
208
  "items-per-intersection": 10,
210
- enabled: t(c),
209
+ enabled: t(d),
211
210
  "item-height": 48
212
211
  }, {
213
- default: r(({ item: l, index: a, empty: ie }) => [
214
- !ie && l != null ? (d(), p(N, {
212
+ default: r(({ item: l, index: i, empty: ie }) => [
213
+ !ie && l != null ? (c(), p(B, {
215
214
  value: l,
216
- key: `kun-list-${a + 1}`,
217
- id: `kun-item-${a + 1}`,
215
+ key: `kun-list-${i + 1}`,
216
+ id: `kun-item-${i + 1}`,
218
217
  disabled: t(Y)(l),
219
218
  "bg-items": e.bgItemListColor,
220
219
  "hover-bg": e.hoverItemListColor,
@@ -223,23 +222,23 @@ const De = { class: "flex items-center" }, Ie = {
223
222
  selectable: !0
224
223
  }, {
225
224
  default: r(() => [
226
- i(T, { class: "text-wrap" }, {
225
+ s(T, { class: "text-wrap" }, {
227
226
  default: r(() => [
228
227
  C(D(t(L)(l, e.itemTitle ?? t(G), "hasDefault")), 1)
229
228
  ]),
230
229
  _: 2
231
230
  }, 1024),
232
- i(ge, {
231
+ s(ge, {
233
232
  text: e.itemSubtitle ? t(L)(l, e.itemSubtitle) : ""
234
233
  }, null, 8, ["text"])
235
234
  ]),
236
235
  _: 2
237
- }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(N, {
236
+ }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (c(), p(B, {
238
237
  key: 1,
239
238
  disabled: ""
240
239
  }, {
241
240
  default: r(() => [
242
- i(T, { class: "text-center w-full text-gray-500" }, {
241
+ s(T, { class: "text-center w-full text-gray-500" }, {
243
242
  default: r(() => o[3] || (o[3] = [
244
243
  C(" No hay elementos disponibles ")
245
244
  ])),
@@ -264,7 +263,7 @@ const De = { class: "flex items-center" }, Ie = {
264
263
  e.hasIcons ? {
265
264
  name: "append-inner",
266
265
  fn: r(() => [
267
- e.clearable && s.value ? (d(), p(b, {
266
+ e.clearable && u.value ? (c(), p(b, {
268
267
  key: 0,
269
268
  onClick: t(H),
270
269
  size: "small",
@@ -272,14 +271,14 @@ const De = { class: "flex items-center" }, Ie = {
272
271
  icon: t(v).close,
273
272
  class: "mr-1 mt-1"
274
273
  }, null, 8, ["onClick", "icon"])) : h("", !0),
275
- i(b, {
274
+ s(b, {
276
275
  color: "teal-darken-1",
277
276
  size: "large",
278
277
  class: "cursor-pointer",
279
- icon: t(c) ? t(v).menuUpOutline : t(v).menuDownOutline,
280
- onClick: F(t(S), ["stop"])
278
+ icon: t(d) ? t(v).menuUpOutline : t(v).menuDownOutline,
279
+ onClick: x(t(S), ["stop"])
281
280
  }, null, 8, ["icon", "onClick"]),
282
- e.required ? (d(), p(b, {
281
+ e.required ? (c(), p(b, {
283
282
  key: 1,
284
283
  color: "teal-darken-1",
285
284
  size: "x-small",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.519",
3
+ "version": "0.1.520",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",