adverich-kun-ui 0.1.495 → 0.1.496

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 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";
1
+ import { mergeModels as $, useModel as x, onMounted as se, ref as z, watch as ue, nextTick as A, createElementBlock as y, openBlock as d, createVNode as i, unref as t, withKeys as de, withModifiers as E, isRef as _, createSlots as ce, withCtx as n, createCommentVNode as g, normalizeClass as me, createTextVNode as b, toDisplayString as V, 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 _, isArray as R } from "../../../../utils/utils.js";
3
+ import { isNotEmpty as R, isArray as O } 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 O from "../../../KunListItem/src/components/KunListItem.vue.js";
7
- import B from "../../../KunListItemTitle/src/components/KunListItemTitle.vue.js";
6
+ import B from "../../../KunListItem/src/components/KunListItem.vue.js";
7
+ import F 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";
@@ -16,7 +16,7 @@ import C from "../../../KunIcon/src/components/KunIcon.vue.js";
16
16
  const De = {
17
17
  key: 0,
18
18
  class: "flex flex-nowrap items-center space-x-1 min-w-3xs max-w-full overflow-x-auto overflow-y-hidden"
19
- }, Ie = { class: "flex items-center" }, Le = {
19
+ }, Ie = { class: "flex items-center" }, Ke = {
20
20
  key: 0,
21
21
  class: "sticky top-0 z-10 p-2 border-b bg-select-background"
22
22
  }, je = {
@@ -28,32 +28,32 @@ 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: F, emit: T }) {
32
- const s = x(w, "modelValue"), f = x(w, "items"), u = w, m = T, {
31
+ setup(w, { expose: T, emit: N }) {
32
+ const s = x(w, "modelValue"), f = x(w, "items"), u = w, m = N, {
33
33
  textFieldRef: k,
34
34
  listRef: D,
35
35
  menuModel: c,
36
36
  search: r,
37
- removeItem: N,
38
- clearSelection: U,
39
- lightReset: j,
37
+ removeItem: U,
38
+ clearSelection: j,
39
+ lightReset: H,
40
40
  openMenu: S,
41
- closeMenu: H,
42
- toggleMenu: q,
43
- onMenuKeydown: P,
41
+ closeMenu: q,
42
+ toggleMenu: P,
43
+ onMenuKeydown: W,
44
44
  getSelectedItem: I,
45
- textArr: W,
46
- getArrayText: G,
47
- isAlphanumeric: J,
48
- createItem: Q,
49
- checkDisabled: X,
50
- itemToString: L,
51
- placeholder: Y
45
+ textArr: G,
46
+ getArrayText: J,
47
+ isAlphanumeric: Q,
48
+ createItem: X,
49
+ checkDisabled: Y,
50
+ itemToString: K,
51
+ placeholder: Z
52
52
  } = be(u, m, s, f);
53
- ie(() => {
53
+ se(() => {
54
54
  u.focusOnRender && k.value.focus();
55
55
  });
56
- const K = z(null), h = z(""), M = (e) => {
56
+ const L = z(null), h = z(""), M = (e) => {
57
57
  for (const o of u.rules) {
58
58
  const l = o(e);
59
59
  if (l !== !0)
@@ -61,34 +61,34 @@ const De = {
61
61
  }
62
62
  return h.value = "", m("validation", !0), !0;
63
63
  };
64
- se(() => s.value, (e, o) => {
65
- _(u.rules) && M(e);
64
+ ue(() => s.value, (e, o) => {
65
+ R(u.rules) && M(e);
66
66
  });
67
- function Z() {
67
+ function ee() {
68
68
  var e;
69
69
  c.value = !1, (e = k.value.inputField) == null || e.focus();
70
70
  }
71
- function ee(e) {
71
+ function le(e) {
72
72
  var l, a;
73
73
  const o = e.key;
74
74
  if (o === "Tab" || o === "Shift" || o === "Escape") {
75
- H(), m("keyDown", o);
75
+ q(), m("keyDown", o);
76
76
  return;
77
77
  }
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));
78
+ (Q(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 le(e) {
80
+ function te(e) {
81
81
  m("search", r);
82
82
  }
83
- function te() {
83
+ function oe() {
84
84
  M(s);
85
85
  }
86
- function oe(e) {
87
- P(e);
86
+ function ne(e) {
87
+ W(e);
88
88
  }
89
- function ne() {
89
+ function re() {
90
90
  }
91
- function re(e) {
91
+ function ae(e) {
92
92
  if (!r.value) return;
93
93
  let o = null;
94
94
  u.returnObject ? o = f.value.find(
@@ -103,7 +103,7 @@ const De = {
103
103
  m("keyDownEnter", e);
104
104
  });
105
105
  }
106
- return F({
106
+ return T({
107
107
  focus: () => A(() => {
108
108
  var e;
109
109
  return (e = k.value) == null ? void 0 : e.focus();
@@ -111,13 +111,13 @@ const De = {
111
111
  }), (e, o) => (d(), y("div", {
112
112
  class: "w-full h-fit",
113
113
  ref_key: "parentRef",
114
- ref: K
114
+ ref: L
115
115
  }, [
116
116
  i(we, {
117
117
  modelValue: t(r),
118
118
  "onUpdate:modelValue": [
119
- o[1] || (o[1] = (l) => E(r) ? r.value = l : null),
120
- le
119
+ o[1] || (o[1] = (l) => _(r) ? r.value = l : null),
120
+ te
121
121
  ],
122
122
  label: e.label,
123
123
  dirty: "",
@@ -126,34 +126,34 @@ const De = {
126
126
  ref_key: "textFieldRef",
127
127
  ref: k,
128
128
  autocomplete: "off",
129
- onFocusInput: te,
130
- onHandleClick: t(q),
129
+ onFocusInput: oe,
130
+ onHandleClick: t(P),
131
131
  rounded: t(c) ? "rounded-t" : "rounded",
132
- onBlur: ne,
132
+ onBlur: re,
133
133
  onKeyDown: [
134
- ee,
135
- ue(re, ["enter"])
134
+ le,
135
+ de(E(ae, ["prevent"]), ["enter"])
136
136
  ],
137
- placeholder: u.multiple && t(R)(s.value) && s.value.length ? "" : t(Y),
137
+ placeholder: u.multiple && t(O)(s.value) && s.value.length ? "" : t(Z),
138
138
  error: !!h.value,
139
139
  "error-messages": h.value
140
- }, de({
140
+ }, ce({
141
141
  "prepend-input-content": n(() => [
142
- t(R)(s.value) && t(_)(s.value) ? (d(), y("div", De, [
143
- (d(!0), y(me, null, fe(s.value, (l) => (d(), p(Ve, {
142
+ t(O)(s.value) && t(R)(s.value) ? (d(), y("div", De, [
143
+ (d(!0), y(fe, null, pe(s.value, (l) => (d(), p(Ve, {
144
144
  key: l.id ?? l.name,
145
145
  size: "small",
146
146
  variant: "pill"
147
147
  }, {
148
148
  default: n(() => [
149
- pe("div", Ie, [
150
- b(V(t(G)(l)) + " ", 1),
149
+ ve("div", Ie, [
150
+ b(V(t(J)(l)) + " ", 1),
151
151
  i(C, {
152
152
  color: "error",
153
153
  icon: t(v).close,
154
154
  size: "small",
155
155
  class: "ml-1",
156
- onClick: (a) => t(N)(l)
156
+ onClick: (a) => t(U)(l)
157
157
  }, null, 8, ["icon", "onClick"])
158
158
  ])
159
159
  ]),
@@ -164,14 +164,14 @@ const De = {
164
164
  default: n(() => [
165
165
  i(ge, {
166
166
  transition: "fade",
167
- "onClick:outside": t(j),
167
+ "onClick:outside": t(H),
168
168
  modelValue: t(c),
169
- "onUpdate:modelValue": o[0] || (o[0] = (l) => E(c) ? c.value = l : null),
169
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => _(c) ? c.value = l : null),
170
170
  activator: "parent",
171
171
  "z-index": e.zIndex,
172
- "parent-ref": K.value,
172
+ "parent-ref": L.value,
173
173
  origin: e.menuOrigin,
174
- onHandleEscape: Z,
174
+ onHandleEscape: ee,
175
175
  bgColor: e.bgMenuColor,
176
176
  "close-on-content-click": e.closeOnSelect,
177
177
  width: "w-full",
@@ -179,11 +179,11 @@ const De = {
179
179
  "hide-details": e.hideDetails
180
180
  }, {
181
181
  default: n(() => [
182
- e.hasCreateItem ? (d(), y("div", Le, [
182
+ e.hasCreateItem ? (d(), y("div", Ke, [
183
183
  i(Se, {
184
- onClick: t(Q),
184
+ onClick: t(X),
185
185
  bgColor: e.btnCreateBg,
186
- class: ce(e.btnCreateClass)
186
+ class: me(e.btnCreateClass)
187
187
  }, {
188
188
  default: n(() => [
189
189
  b(V(e.btnCreateText), 1)
@@ -195,7 +195,7 @@ const De = {
195
195
  "onClick:select": t(I),
196
196
  ref_key: "listRef",
197
197
  ref: D,
198
- onKeyDown: oe,
198
+ onKeyDown: ne,
199
199
  selectable: !0
200
200
  }, {
201
201
  default: n(() => [
@@ -208,12 +208,12 @@ const De = {
208
208
  enabled: t(c),
209
209
  "item-height": 48
210
210
  }, {
211
- default: n(({ item: l, index: a, empty: ae }) => [
212
- !ae && l != null ? (d(), p(O, {
211
+ default: n(({ item: l, index: a, empty: ie }) => [
212
+ !ie && l != null ? (d(), p(B, {
213
213
  value: l,
214
214
  key: `kun-list-${a + 1}`,
215
215
  id: `kun-item-${a + 1}`,
216
- disabled: t(X)(l),
216
+ disabled: t(Y)(l),
217
217
  "bg-items": e.bgItemListColor,
218
218
  "hover-bg": e.hoverItemListColor,
219
219
  activeClass: e.selectedItemListColor,
@@ -221,23 +221,23 @@ const De = {
221
221
  selectable: !0
222
222
  }, {
223
223
  default: n(() => [
224
- i(B, { class: "text-wrap" }, {
224
+ i(F, { class: "text-wrap" }, {
225
225
  default: n(() => [
226
- b(V(t(L)(l, e.itemTitle ?? t(W), "hasDefault")), 1)
226
+ b(V(t(K)(l, e.itemTitle ?? t(G), "hasDefault")), 1)
227
227
  ]),
228
228
  _: 2
229
229
  }, 1024),
230
230
  i(ye, {
231
- text: e.itemSubtitle ? t(L)(l, e.itemSubtitle) : ""
231
+ text: e.itemSubtitle ? t(K)(l, e.itemSubtitle) : ""
232
232
  }, null, 8, ["text"])
233
233
  ]),
234
234
  _: 2
235
- }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(O, {
235
+ }, 1032, ["value", "id", "disabled", "bg-items", "hover-bg", "activeClass", "density"])) : (d(), p(B, {
236
236
  key: 1,
237
237
  disabled: ""
238
238
  }, {
239
239
  default: n(() => [
240
- i(B, { class: "text-center w-full text-gray-500" }, {
240
+ i(F, { class: "text-center w-full text-gray-500" }, {
241
241
  default: n(() => o[2] || (o[2] = [
242
242
  b(" No hay elementos disponibles ")
243
243
  ])),
@@ -264,7 +264,7 @@ const De = {
264
264
  fn: n(() => [
265
265
  e.clearable && s.value ? (d(), p(C, {
266
266
  key: 0,
267
- onClick: t(U),
267
+ onClick: t(j),
268
268
  size: "small",
269
269
  color: "error",
270
270
  icon: t(v).close,
@@ -275,7 +275,7 @@ const De = {
275
275
  size: "large",
276
276
  class: "cursor-pointer",
277
277
  icon: t(c) ? t(v).menuUpOutline : t(v).menuDownOutline,
278
- onClick: ve(t(S), ["stop"])
278
+ onClick: E(t(S), ["stop"])
279
279
  }, null, 8, ["icon", "onClick"]),
280
280
  e.required ? (d(), p(C, {
281
281
  key: 1,
@@ -287,7 +287,7 @@ const De = {
287
287
  ]),
288
288
  key: "0"
289
289
  } : void 0
290
- ]), 1032, ["modelValue", "label", "hide-details", "density", "onHandleClick", "rounded", "placeholder", "error", "error-messages"])
290
+ ]), 1032, ["modelValue", "label", "hide-details", "density", "onHandleClick", "rounded", "onKeyDown", "placeholder", "error", "error-messages"])
291
291
  ], 512));
292
292
  }
293
293
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.495",
3
+ "version": "0.1.496",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",