adverich-kun-ui 0.1.490 → 0.1.491

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