adverich-kun-ui 0.1.512 → 0.1.513

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,32 +1,31 @@
1
- import { useAttrs as oe, ref as re, getCurrentInstance as te, computed as a, createElementBlock as l, openBlock as r, mergeProps as M, renderSlot as d, createElementVNode as i, createCommentVNode as u, normalizeClass as b, toDisplayString as g, normalizeProps as R, guardReactiveProps as z, unref as t, createBlock as y, resolveDynamicComponent as m, Fragment as ne, renderList as se, withDirectives as le, vShow as ae, createTextVNode as de } from "vue";
2
- import { kunTextareaProps as ie } from "../composables/KunTextareaProps.js";
3
- import ue from "../composables/useKunTextareaComposable.js";
1
+ import { useAttrs as ee, ref as oe, getCurrentInstance as ne, computed as a, createElementBlock as l, openBlock as r, mergeProps as A, renderSlot as d, createElementVNode as i, createCommentVNode as u, normalizeClass as b, toDisplayString as g, normalizeProps as R, guardReactiveProps as z, unref as t, createBlock as y, resolveDynamicComponent as m, Fragment as re, renderList as te, withDirectives as se, vShow as le, createTextVNode as ae } from "vue";
2
+ import { kunTextareaProps as de } from "../composables/KunTextareaProps.js";
3
+ import ie from "../composables/useKunTextareaComposable.js";
4
4
  import { renderIconSlot as h } from "../../../../utils/renderIcon.js";
5
- import { debounce as pe } from "../../../../utils/utils.js";
6
- const ce = { class: "relative" }, ve = {
5
+ const ue = { class: "relative" }, pe = {
7
6
  key: 0,
8
7
  class: "absolute left-2 top-2 flex items-center"
9
- }, fe = {
8
+ }, ce = {
10
9
  key: 1,
11
10
  class: "absolute left-2 top-2 ml-1"
12
- }, be = ["value", "rows", "disabled", "readonly", "placeholder"], ge = {
11
+ }, ve = ["value", "rows", "disabled", "readonly", "placeholder"], fe = {
13
12
  key: 3,
14
13
  class: "absolute right-2 top-2 mr-1"
15
- }, ye = {
14
+ }, be = {
16
15
  key: 4,
17
16
  class: "absolute right-2 top-2 flex items-center"
18
- }, me = {
17
+ }, ge = {
19
18
  key: 5,
20
19
  class: "mt-1"
21
- }, he = { class: "h-1 w-full bg-field-background rounded overflow-hidden" }, ke = {
20
+ }, ye = { class: "h-1 w-full bg-field-background rounded overflow-hidden" }, me = {
22
21
  key: 7,
23
22
  class: "text-xs text-right mt-1 text-gray-400"
24
- }, Ce = { key: 0 }, Be = {
23
+ }, he = { key: 0 }, $e = {
25
24
  __name: "KunTextarea",
26
- props: { ...ie },
25
+ props: { ...de },
27
26
  emits: ["update:modelValue", "click:clear", "click:control", "update:focused", "mousedown:control"],
28
- setup(A, { expose: D, emit: F }) {
29
- const o = A, k = F, G = oe(), p = re(null), B = `textarea-${te().uid}`, {
27
+ setup(D, { expose: M, emit: F }) {
28
+ const o = D, k = F, G = ee(), p = oe(null), B = `textarea-${ne().uid}`, {
30
29
  isFocused: c,
31
30
  internalValue: v,
32
31
  updateModel: P,
@@ -37,13 +36,12 @@ const ce = { class: "relative" }, ve = {
37
36
  hasError: f,
38
37
  displayedMessages: C,
39
38
  adjustHeight: H
40
- } = ue(o, k, p), L = (e) => {
41
- v.value = e.target.value, j(e.target.value), o.autoGrow && H();
42
- }, j = pe((e) => {
43
- P(e);
44
- }, 100), K = () => {
39
+ } = ie(o, k, p), L = (e) => {
40
+ const n = e.target.value;
41
+ v.value = n, P(n), o.autoGrow && H();
42
+ }, j = () => {
45
43
  c.value = !0, k("update:focused", !0);
46
- }, U = () => {
44
+ }, K = () => {
47
45
  c.value = !1, k("update:focused", !1);
48
46
  }, V = a(() => c.value || !!v.value || o.dirty), w = a(() => typeof v.value == "string" ? v.value.length : 0), I = a(() => o.counter === !0 ? 25 : o.counter || null), q = a(() => o.persistentCounter || o.counter && c.value), J = a(() => ["relative w-full flex flex-col", o.class, o.wrapperClass]), O = a(
49
47
  () => o.persistentClear ? "opacity-100" : "hover:opacity-100 opacity-0 transition-opacity duration-200"
@@ -61,9 +59,9 @@ const ce = { class: "relative" }, ve = {
61
59
  default:
62
60
  return "";
63
61
  }
64
- }), W = a(
62
+ }), U = a(
65
63
  () => o.density === "compact" ? "p-1" : o.density === "comfortable" ? "p-2" : "p-3"
66
- ), X = a(() => [
64
+ ), W = a(() => [
67
65
  "w-full resize-none p-2 transition-colors duration-150",
68
66
  o.inputClass,
69
67
  {
@@ -82,8 +80,8 @@ const ce = { class: "relative" }, ve = {
82
80
  resize: !o.noResize && !o.autoGrow
83
81
  },
84
82
  Q.value,
85
- W.value
86
- ]), Y = {
83
+ U.value
84
+ ]), X = {
87
85
  label: o.label,
88
86
  isFocused: c,
89
87
  isActive: V,
@@ -110,11 +108,11 @@ const ce = { class: "relative" }, ve = {
110
108
  return (e = p.value) == null ? void 0 : e.blur();
111
109
  },
112
110
  props: o
113
- }, Z = $, x = $, _ = a(() => {
111
+ }, Y = $, Z = $, x = a(() => {
114
112
  const { class: e, ...n } = G;
115
113
  return n;
116
114
  });
117
- return D({
115
+ return M({
118
116
  validate: T,
119
117
  reset: E,
120
118
  resetValidation: N,
@@ -125,20 +123,20 @@ const ce = { class: "relative" }, ve = {
125
123
  return (e = p.value) == null ? void 0 : e.focus();
126
124
  },
127
125
  rootRef: p
128
- }), (e, n) => (r(), l("div", M({
126
+ }), (e, n) => (r(), l("div", A({
129
127
  class: J.value,
130
128
  ref: "rootRef"
131
- }, _.value), [
132
- d(e.$slots, "label", M({ for: B }, Y), () => [
129
+ }, x.value), [
130
+ d(e.$slots, "label", A({ for: B }, X), () => [
133
131
  e.label ? (r(), l("label", {
134
132
  key: 0,
135
133
  for: B,
136
134
  class: b(["absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10", V.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"])
137
135
  }, g(e.label), 3)) : u("", !0)
138
136
  ]),
139
- i("div", ce, [
140
- e.prependIcon || e.$slots.prepend ? (r(), l("div", ve, [
141
- d(e.$slots, "prepend", R(z(t(Z))), () => [
137
+ i("div", ue, [
138
+ e.prependIcon || e.$slots.prepend ? (r(), l("div", pe, [
139
+ d(e.$slots, "prepend", R(z(t(Y))), () => [
142
140
  i("div", {
143
141
  onClick: n[0] || (n[0] = (s) => e.handleIconClick(s, "prepend"))
144
142
  }, [
@@ -146,7 +144,7 @@ const ce = { class: "relative" }, ve = {
146
144
  ])
147
145
  ])
148
146
  ])) : u("", !0),
149
- e.prependInnerIcon || e.$slots["prepend-inner"] ? (r(), l("div", fe, [
147
+ e.prependInnerIcon || e.$slots["prepend-inner"] ? (r(), l("div", ce, [
150
148
  d(e.$slots, "prepend-inner", {}, () => [
151
149
  i("div", {
152
150
  onClick: n[1] || (n[1] = (s) => e.handleIconClick(s, "prependInner"))
@@ -164,13 +162,13 @@ const ce = { class: "relative" }, ve = {
164
162
  readonly: e.readonly,
165
163
  placeholder: e.placeholder,
166
164
  onInput: L,
167
- onFocus: K,
168
- onBlur: U,
165
+ onFocus: j,
166
+ onBlur: K,
169
167
  onClick: n[2] || (n[2] = (s) => e.$emit("click:control", s)),
170
168
  onMousedown: n[3] || (n[3] = (s) => e.$emit("mousedown:control", s)),
171
- class: b(["bg-field-background", [X.value]]),
169
+ class: b(["bg-field-background", [W.value]]),
172
170
  style: { width: "100%", "box-sizing": "border-box", "overflow-y": "hidden" }
173
- }, null, 42, be),
171
+ }, null, 42, ve),
174
172
  e.clearable && t(v) ? (r(), l("div", {
175
173
  key: 2,
176
174
  class: b(["absolute right-2 top-2", O.value])
@@ -185,7 +183,7 @@ const ce = { class: "relative" }, ve = {
185
183
  ])
186
184
  ])
187
185
  ], 2)) : u("", !0),
188
- e.appendInnerIcon || e.$slots["append-inner"] ? (r(), l("div", ge, [
186
+ e.appendInnerIcon || e.$slots["append-inner"] ? (r(), l("div", fe, [
189
187
  d(e.$slots, "append-inner", {}, () => [
190
188
  i("div", {
191
189
  onClick: n[5] || (n[5] = (s) => e.handleIconClick(s, "appendInner"))
@@ -194,8 +192,8 @@ const ce = { class: "relative" }, ve = {
194
192
  ])
195
193
  ])
196
194
  ])) : u("", !0),
197
- e.appendIcon || e.$slots.append ? (r(), l("div", ye, [
198
- d(e.$slots, "append", R(z(t(x))), () => [
195
+ e.appendIcon || e.$slots.append ? (r(), l("div", be, [
196
+ d(e.$slots, "append", R(z(t(Z))), () => [
199
197
  i("div", {
200
198
  onClick: n[6] || (n[6] = (s) => e.handleIconClick(s, "append"))
201
199
  }, [
@@ -203,12 +201,12 @@ const ce = { class: "relative" }, ve = {
203
201
  ])
204
202
  ])
205
203
  ])) : u("", !0),
206
- e.loading ? (r(), l("div", me, [
204
+ e.loading ? (r(), l("div", ge, [
207
205
  d(e.$slots, "loader", {
208
206
  color: e.loadingColor,
209
207
  isActive: !0
210
208
  }, () => [
211
- i("div", he, [
209
+ i("div", ye, [
212
210
  i("div", {
213
211
  class: b(["h-full transition-all duration-300", [e.loadingColor]]),
214
212
  style: { width: "100%" }
@@ -221,8 +219,8 @@ const ce = { class: "relative" }, ve = {
221
219
  class: b(["text-xs mt-1 space-y-1", { "text-red-500": t(f), "text-gray-500": !t(f) }])
222
220
  }, [
223
221
  d(e.$slots, "details", {}, () => [
224
- t(f) ? (r(!0), l(ne, { key: 0 }, se(t(C), (s, ee) => d(e.$slots, "message", {
225
- key: ee,
222
+ t(f) ? (r(!0), l(re, { key: 0 }, te(t(C), (s, _) => d(e.$slots, "message", {
223
+ key: _,
226
224
  message: s
227
225
  }, () => [
228
226
  i("div", null, g(s), 1)
@@ -230,20 +228,20 @@ const ce = { class: "relative" }, ve = {
230
228
  key: 1,
231
229
  hint: e.hint
232
230
  }, () => [
233
- le(i("div", null, g(e.hint), 513), [
234
- [ae, e.persistentHint || t(c)]
231
+ se(i("div", null, g(e.hint), 513), [
232
+ [le, e.persistentHint || t(c)]
235
233
  ])
236
234
  ]) : u("", !0)
237
235
  ])
238
236
  ], 2)) : u("", !0),
239
- q.value ? (r(), l("div", ke, [
237
+ q.value ? (r(), l("div", me, [
240
238
  d(e.$slots, "counter", {
241
239
  counter: w.value,
242
240
  max: I.value,
243
241
  value: w.value
244
242
  }, () => [
245
- de(g(w.value), 1),
246
- I.value ? (r(), l("span", Ce, " / " + g(I.value), 1)) : u("", !0)
243
+ ae(g(w.value), 1),
244
+ I.value ? (r(), l("span", he, " / " + g(I.value), 1)) : u("", !0)
247
245
  ])
248
246
  ])) : u("", !0)
249
247
  ])
@@ -251,5 +249,5 @@ const ce = { class: "relative" }, ve = {
251
249
  }
252
250
  };
253
251
  export {
254
- Be as default
252
+ $e as default
255
253
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.512",
3
+ "version": "0.1.513",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",