adverich-kun-ui 0.1.518 → 0.1.519

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