adverich-kun-ui 0.1.493 → 0.1.495

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 $, useModel as x, onMounted as ae, ref as z, watch as ie, nextTick as se, createElementBlock as y, openBlock as d, createVNode as i, unref as t, withKeys as ue, isRef as A, createSlots as de, withCtx as n, createCommentVNode as g, normalizeClass as ce, createTextVNode as b, toDisplayString as V, createBlock as p, Fragment as me, renderList as fe, createElementVNode as pe, withModifiers as ve } from "vue";
1
+ import { mergeModels as $, useModel as x, onMounted as ie, ref as z, watch as se, nextTick as A, createElementBlock as y, openBlock as d, createVNode as i, unref as t, withKeys as ue, isRef as E, createSlots as de, withCtx as n, createCommentVNode as g, normalizeClass as ce, createTextVNode as b, toDisplayString as V, createBlock as p, Fragment as me, renderList as fe, createElementVNode as pe, withModifiers as ve } from "vue";
2
2
  import { icons as v } from "../../../../icons/index.js";
3
- import { isNotEmpty as E, isArray as _ } from "../../../../utils/utils.js";
3
+ import { isNotEmpty as _, isArray as R } from "../../../../utils/utils.js";
4
4
  import ke from "../../../KunInfiniteScroll/src/components/KunInfiniteScroll.vue.js";
5
5
  import he from "../../../KunList/src/components/KunList.vue.js";
6
- import R from "../../../KunListItem/src/components/KunListItem.vue.js";
7
- import O from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
6
+ import O from "../../../KunListItem/src/components/KunListItem.vue.js";
7
+ import B from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
8
8
  import ye from "../../../KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
9
9
  import ge from "../../../KunMenu/src/components/KunMenu.vue.js";
10
10
  import { useAutocomplete as be } from "../composables/useAutocomplete.js";
@@ -28,29 +28,29 @@ const De = {
28
28
  itemsModifiers: {}
29
29
  }),
30
30
  emits: /* @__PURE__ */ $(["update:modelValue", "selectedItem", "createItem", "validation", "search", "keyDown", "keyDownEnter"], ["update:modelValue", "update:items"]),
31
- setup(w, { expose: B, emit: F }) {
32
- const s = x(w, "modelValue"), f = x(w, "items"), u = w, m = F, {
31
+ setup(w, { expose: F, emit: T }) {
32
+ const s = x(w, "modelValue"), f = x(w, "items"), u = w, m = T, {
33
33
  textFieldRef: k,
34
34
  listRef: D,
35
35
  menuModel: c,
36
36
  search: r,
37
- removeItem: T,
38
- clearSelection: N,
39
- lightReset: U,
37
+ removeItem: N,
38
+ clearSelection: U,
39
+ lightReset: j,
40
40
  openMenu: S,
41
- closeMenu: j,
42
- toggleMenu: H,
43
- onMenuKeydown: q,
41
+ closeMenu: H,
42
+ toggleMenu: q,
43
+ onMenuKeydown: P,
44
44
  getSelectedItem: I,
45
- textArr: P,
46
- getArrayText: W,
47
- isAlphanumeric: G,
48
- createItem: J,
49
- checkDisabled: Q,
45
+ textArr: W,
46
+ getArrayText: G,
47
+ isAlphanumeric: J,
48
+ createItem: Q,
49
+ checkDisabled: X,
50
50
  itemToString: L,
51
- placeholder: X
51
+ placeholder: Y
52
52
  } = be(u, m, s, f);
53
- ae(() => {
53
+ ie(() => {
54
54
  u.focusOnRender && k.value.focus();
55
55
  });
56
56
  const K = z(null), h = z(""), M = (e) => {
@@ -61,34 +61,34 @@ const De = {
61
61
  }
62
62
  return h.value = "", m("validation", !0), !0;
63
63
  };
64
- ie(() => s.value, (e, o) => {
65
- E(u.rules) && M(e);
64
+ se(() => s.value, (e, o) => {
65
+ _(u.rules) && M(e);
66
66
  });
67
- function Y() {
67
+ function Z() {
68
68
  var e;
69
69
  c.value = !1, (e = k.value.inputField) == null || e.focus();
70
70
  }
71
- function Z(e) {
71
+ function ee(e) {
72
72
  var l, a;
73
73
  const o = e.key;
74
74
  if (o === "Tab" || o === "Shift" || o === "Escape") {
75
- j(), m("keyDown", o);
75
+ H(), m("keyDown", o);
76
76
  return;
77
77
  }
78
- (G(o) || o === "Backspace") && S(), ["ArrowUp", "ArrowDown"].includes(o) && (e.preventDefault(), c.value || S(), (a = (l = D.value) == null ? void 0 : l.focusWithKey) == null || a.call(l, o));
78
+ (J(o) || o === "Backspace") && S(), ["ArrowUp", "ArrowDown"].includes(o) && (e.preventDefault(), c.value || S(), (a = (l = D.value) == null ? void 0 : l.focusWithKey) == null || a.call(l, o));
79
79
  }
80
- function ee(e) {
80
+ function le(e) {
81
81
  m("search", r);
82
82
  }
83
- function le() {
83
+ function te() {
84
84
  M(s);
85
85
  }
86
- function te(e) {
87
- q(e);
86
+ function oe(e) {
87
+ P(e);
88
88
  }
89
- function oe() {
89
+ function ne() {
90
90
  }
91
- function ne(e) {
91
+ function re(e) {
92
92
  if (!r.value) return;
93
93
  let o = null;
94
94
  u.returnObject ? o = f.value.find(
@@ -99,10 +99,12 @@ const De = {
99
99
  (l) => String(l[u.itemValue]).toLowerCase() === String(r.value).toLowerCase()
100
100
  ) : o = f.value.find(
101
101
  (l) => typeof l == "object" ? Object.values(l).some((a) => String(a).toLowerCase() === String(r.value).toLowerCase()) : String(l).toLowerCase() === String(r.value).toLowerCase()
102
- ), o && I(o), m("keyDownEnter", e);
102
+ ), o && I(o), A(() => {
103
+ m("keyDownEnter", e);
104
+ });
103
105
  }
104
- return B({
105
- focus: () => se(() => {
106
+ return F({
107
+ focus: () => A(() => {
106
108
  var e;
107
109
  return (e = k.value) == null ? void 0 : e.focus();
108
110
  })
@@ -114,8 +116,8 @@ const De = {
114
116
  i(we, {
115
117
  modelValue: t(r),
116
118
  "onUpdate:modelValue": [
117
- o[1] || (o[1] = (l) => A(r) ? r.value = l : null),
118
- ee
119
+ o[1] || (o[1] = (l) => E(r) ? r.value = l : null),
120
+ le
119
121
  ],
120
122
  label: e.label,
121
123
  dirty: "",
@@ -124,20 +126,20 @@ const De = {
124
126
  ref_key: "textFieldRef",
125
127
  ref: k,
126
128
  autocomplete: "off",
127
- onFocusInput: le,
128
- onHandleClick: t(H),
129
+ onFocusInput: te,
130
+ onHandleClick: t(q),
129
131
  rounded: t(c) ? "rounded-t" : "rounded",
130
- onBlur: oe,
132
+ onBlur: ne,
131
133
  onKeyDown: [
132
- Z,
133
- ue(ne, ["enter"])
134
+ ee,
135
+ ue(re, ["enter"])
134
136
  ],
135
- placeholder: u.multiple && t(_)(s.value) && s.value.length ? "" : t(X),
137
+ placeholder: u.multiple && t(R)(s.value) && s.value.length ? "" : t(Y),
136
138
  error: !!h.value,
137
139
  "error-messages": h.value
138
140
  }, de({
139
141
  "prepend-input-content": n(() => [
140
- t(_)(s.value) && t(E)(s.value) ? (d(), y("div", De, [
142
+ t(R)(s.value) && t(_)(s.value) ? (d(), y("div", De, [
141
143
  (d(!0), y(me, null, fe(s.value, (l) => (d(), p(Ve, {
142
144
  key: l.id ?? l.name,
143
145
  size: "small",
@@ -145,13 +147,13 @@ const De = {
145
147
  }, {
146
148
  default: n(() => [
147
149
  pe("div", Ie, [
148
- b(V(t(W)(l)) + " ", 1),
150
+ b(V(t(G)(l)) + " ", 1),
149
151
  i(C, {
150
152
  color: "error",
151
153
  icon: t(v).close,
152
154
  size: "small",
153
155
  class: "ml-1",
154
- onClick: (a) => t(T)(l)
156
+ onClick: (a) => t(N)(l)
155
157
  }, null, 8, ["icon", "onClick"])
156
158
  ])
157
159
  ]),
@@ -162,14 +164,14 @@ const De = {
162
164
  default: n(() => [
163
165
  i(ge, {
164
166
  transition: "fade",
165
- "onClick:outside": t(U),
167
+ "onClick:outside": t(j),
166
168
  modelValue: t(c),
167
- "onUpdate:modelValue": o[0] || (o[0] = (l) => A(c) ? c.value = l : null),
169
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => E(c) ? c.value = l : null),
168
170
  activator: "parent",
169
171
  "z-index": e.zIndex,
170
172
  "parent-ref": K.value,
171
173
  origin: e.menuOrigin,
172
- onHandleEscape: Y,
174
+ onHandleEscape: Z,
173
175
  bgColor: e.bgMenuColor,
174
176
  "close-on-content-click": e.closeOnSelect,
175
177
  width: "w-full",
@@ -179,7 +181,7 @@ const De = {
179
181
  default: n(() => [
180
182
  e.hasCreateItem ? (d(), y("div", Le, [
181
183
  i(Se, {
182
- onClick: t(J),
184
+ onClick: t(Q),
183
185
  bgColor: e.btnCreateBg,
184
186
  class: ce(e.btnCreateClass)
185
187
  }, {
@@ -193,7 +195,7 @@ const De = {
193
195
  "onClick:select": t(I),
194
196
  ref_key: "listRef",
195
197
  ref: D,
196
- onKeyDown: te,
198
+ onKeyDown: oe,
197
199
  selectable: !0
198
200
  }, {
199
201
  default: n(() => [
@@ -206,12 +208,12 @@ const De = {
206
208
  enabled: t(c),
207
209
  "item-height": 48
208
210
  }, {
209
- default: n(({ item: l, index: a, empty: re }) => [
210
- !re && l != null ? (d(), p(R, {
211
+ default: n(({ item: l, index: a, empty: ae }) => [
212
+ !ae && l != null ? (d(), p(O, {
211
213
  value: l,
212
214
  key: `kun-list-${a + 1}`,
213
215
  id: `kun-item-${a + 1}`,
214
- disabled: t(Q)(l),
216
+ disabled: t(X)(l),
215
217
  "bg-items": e.bgItemListColor,
216
218
  "hover-bg": e.hoverItemListColor,
217
219
  activeClass: e.selectedItemListColor,
@@ -219,9 +221,9 @@ const De = {
219
221
  selectable: !0
220
222
  }, {
221
223
  default: n(() => [
222
- i(O, { class: "text-wrap" }, {
224
+ i(B, { class: "text-wrap" }, {
223
225
  default: n(() => [
224
- b(V(t(L)(l, e.itemTitle ?? t(P), "hasDefault")), 1)
226
+ b(V(t(L)(l, e.itemTitle ?? t(W), "hasDefault")), 1)
225
227
  ]),
226
228
  _: 2
227
229
  }, 1024),
@@ -230,12 +232,12 @@ const De = {
230
232
  }, null, 8, ["text"])
231
233
  ]),
232
234
  _: 2
233
- }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(R, {
235
+ }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(O, {
234
236
  key: 1,
235
237
  disabled: ""
236
238
  }, {
237
239
  default: n(() => [
238
- i(O, { class: "text-center w-full text-gray-500" }, {
240
+ i(B, { class: "text-center w-full text-gray-500" }, {
239
241
  default: n(() => o[2] || (o[2] = [
240
242
  b(" No hay elementos disponibles ")
241
243
  ])),
@@ -262,7 +264,7 @@ const De = {
262
264
  fn: n(() => [
263
265
  e.clearable && s.value ? (d(), p(C, {
264
266
  key: 0,
265
- onClick: t(N),
267
+ onClick: t(U),
266
268
  size: "small",
267
269
  color: "error",
268
270
  icon: t(v).close,
@@ -1,7 +1,7 @@
1
- import { ref as a, inject as V, computed as E, watch as F, onUnmounted as T } from "vue";
1
+ import { ref as a, inject as V, computed as E, watch as g, onUnmounted as T } from "vue";
2
2
  import { debounce as j } from "../../../../utils/utils.js";
3
3
  function R(u, r) {
4
- const l = a(u.modelValue ?? ""), o = a(!1), t = a(""), n = a(!1), g = a(null), h = a(null), s = a(!1), d = V("registerField", null), v = V("unregisterField", null), y = E(() => u.error || !!t.value && n.value), c = async () => {
4
+ const l = a(u.modelValue ?? ""), o = a(!1), t = a(""), n = a(!1), F = a(null), h = a(null), s = a(!1), d = V("registerField", null), v = V("unregisterField", null), b = E(() => u.error || !!t.value && n.value), c = async () => {
5
5
  for (const e of u.rules) {
6
6
  const m = await Promise.resolve(e(l.value));
7
7
  if (m !== !0) return m;
@@ -11,16 +11,16 @@ function R(u, r) {
11
11
  const e = await c();
12
12
  t.value = e === !0 ? "" : e;
13
13
  }, u.debounce ?? 300);
14
- F(() => u.modelValue, (e) => {
14
+ g(() => u.modelValue, (e) => {
15
15
  e !== l.value && (s.value = !0, l.value = e ?? "");
16
- }), F(l, () => {
16
+ }), g(l, () => {
17
17
  if (s.value) {
18
18
  s.value = !1;
19
19
  return;
20
20
  }
21
21
  n.value = !0, r("update:modelValue", l.value), u.validateOnBlur || f();
22
22
  });
23
- const b = (e) => {
23
+ const y = (e) => {
24
24
  l.value = e.target.value;
25
25
  }, w = async () => {
26
26
  if (o.value = !1, u.validateOnBlur) {
@@ -29,7 +29,7 @@ function R(u, r) {
29
29
  }
30
30
  r("blur");
31
31
  }, B = () => {
32
- o.value = !0, r("focus");
32
+ console.log("deberia hacer el focus"), o.value = !0, r("focus");
33
33
  }, I = () => {
34
34
  l.value = "", r("update:modelValue", ""), n.value = !0, u.validateOnBlur || f();
35
35
  }, i = async () => {
@@ -44,13 +44,13 @@ function R(u, r) {
44
44
  return d && d({ validate: i }), T(() => {
45
45
  v && v({ validate: i });
46
46
  }), {
47
- inputField: g,
47
+ inputField: F,
48
48
  inputValue: l,
49
49
  rootRef: h,
50
50
  inputFocused: o,
51
51
  validationError: t,
52
- hasError: y,
53
- handleInput: b,
52
+ hasError: b,
53
+ handleInput: y,
54
54
  handleBlur: w,
55
55
  focusInput: B,
56
56
  validate: i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.493",
3
+ "version": "0.1.495",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",