adverich-kun-ui 0.1.491 → 0.1.493

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