adverich-kun-ui 0.1.490 → 0.1.492

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