adverich-kun-ui 0.1.461 → 0.1.462

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