adverich-kun-ui 0.1.329 → 0.1.331

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 { ref as D, watch as E, computed as f, createElementBlock as r, openBlock as o, normalizeStyle as F, normalizeClass as y, unref as t, createCommentVNode as a, createElementVNode as w, withDirectives as M, renderSlot as s, createBlock as C, withKeys as j, withModifiers as H, createVNode as K, createTextVNode as V, toDisplayString as g, Fragment as R, renderList as T } from "vue";
1
+ import { ref as D, watch as E, computed as f, createElementBlock as r, openBlock as o, mergeProps as F, unref as t, createCommentVNode as a, createElementVNode as $, withDirectives as M, renderSlot as s, createBlock as w, withKeys as j, normalizeClass as C, withModifiers as H, createVNode as K, createTextVNode as V, toDisplayString as g, Fragment as R, renderList as T } from "vue";
2
2
  import h from "../../../KunIcon/src/components/KunIcon.vue.js";
3
3
  import { useCheckboxModel as L } from "../composables/useCheckboxModel.js";
4
- import { useValidation as q } from "../composables/useValidation.js";
5
- import { vRipple as G } from "../../../../directives/ripple.js";
6
- import { icons as v } from "../../../../icons/index.js";
7
- const J = ["name", "checked", "value"], P = ["aria-checked", "aria-disabled", "tabindex"], Q = {
4
+ import { useValidation as P } from "../composables/useValidation.js";
5
+ import { vRipple as q } from "../../../../directives/ripple.js";
6
+ import { icons as y } from "../../../../icons/index.js";
7
+ const G = ["name", "checked", "value"], J = ["aria-checked", "aria-disabled", "tabindex"], Q = {
8
8
  key: 1,
9
9
  class: "cursor-pointer"
10
10
  }, U = {
@@ -60,49 +60,49 @@ const J = ["name", "checked", "value"], P = ["aria-checked", "aria-disabled", "t
60
60
  "click:append",
61
61
  "click:prepend"
62
62
  ],
63
- setup(b, { expose: I, emit: N }) {
64
- const c = N, e = b, d = D(e.focused ?? !1);
65
- E(() => e.focused, (i) => d.value = i);
63
+ setup(v, { expose: I, emit: N }) {
64
+ const c = N, e = v, d = D(e.focused ?? !1);
65
+ E(() => e.focused, (n) => d.value = n);
66
66
  const {
67
67
  isChecked: p,
68
68
  toggle: u,
69
69
  internalValue: W
70
70
  } = L(e, c), {
71
71
  errorMessages: m,
72
- isValid: k,
73
- validate: x,
72
+ isValid: b,
73
+ validate: k,
74
74
  resetValidation: z
75
- } = q(e, W);
76
- I({ validate: x, resetValidation: z });
77
- const O = f(() => e.indeterminate ? e.indeterminateIcon || v.checkboxIndeterminate : p.value ? e.trueIcon || v.checkboxOn : e.falseIcon || v.checkboxBlank), A = f(() => [
75
+ } = P(e, W);
76
+ I({ validate: k, resetValidation: z });
77
+ const O = f(() => e.indeterminate ? e.indeterminateIcon || y.checkboxIndeterminate : p.value ? e.trueIcon || y.checkboxOn : e.falseIcon || y.checkboxBlank), A = f(() => [
78
78
  typeof e.iconColor == "string" ? `text-${e.iconColor}` : "",
79
79
  e.glow && d.value ? "opacity-100" : "opacity-70"
80
- ]), S = f(() => ({
80
+ ]), x = f(() => ({
81
81
  sm: "w-4 h-4 text-sm",
82
82
  md: "w-5 h-5 text-base",
83
83
  lg: "w-6 h-6 text-lg"
84
84
  })[e.size] || e.size);
85
- return (i, n) => {
86
- var B;
87
- return o(), r("div", {
88
- class: y([
85
+ return (n, i) => {
86
+ var S;
87
+ return o(), r("div", F({
88
+ class: [
89
89
  "kun-checkbox",
90
90
  "flex",
91
- b.direction === "vertical" ? "flex-col items-start" : "flex-row items-center",
91
+ v.direction === "vertical" ? "flex-col items-start" : "flex-row items-center",
92
92
  "gap-2",
93
93
  e.color && `text-${e.color}`,
94
94
  {
95
95
  "opacity-50 pointer-events-none": e.disabled || e.readonly,
96
- "text-red-600": e.error || !t(k),
96
+ "text-red-600": e.error || !t(b),
97
97
  "focus-within:ring-2 ring-primary-500": d.value
98
98
  }
99
- ]),
100
- style: F({
99
+ ],
100
+ style: {
101
101
  width: e.width && `${e.width}px`,
102
102
  minWidth: e.minWidth && `${e.minWidth}px`,
103
103
  maxWidth: e.maxWidth && `${e.maxWidth}px`
104
- })
105
- }, [
104
+ }
105
+ }, n.$attrs), [
106
106
  e.name ? (o(), r("input", {
107
107
  key: 0,
108
108
  type: "checkbox",
@@ -110,71 +110,71 @@ const J = ["name", "checked", "value"], P = ["aria-checked", "aria-disabled", "t
110
110
  checked: t(p),
111
111
  value: e.value ?? e.trueValue,
112
112
  class: "hidden"
113
- }, null, 8, J)) : a("", !0),
114
- w("div", {
113
+ }, null, 8, G)) : a("", !0),
114
+ $("div", {
115
115
  class: "flex items-center gap-2",
116
- onClick: n[0] || (n[0] = (l) => i.$emit("click:prepend"))
116
+ onClick: i[0] || (i[0] = (l) => n.$emit("click:prepend"))
117
117
  }, [
118
- s(i.$slots, "prepend"),
119
- e.prependIcon ? (o(), C(h, {
118
+ s(n.$slots, "prepend"),
119
+ e.prependIcon ? (o(), w(h, {
120
120
  key: 0,
121
121
  icon: e.prependIcon
122
122
  }, null, 8, ["icon"])) : a("", !0)
123
123
  ]),
124
124
  M((o(), r("div", {
125
- class: y(["relative inline-flex items-center justify-center cursor-pointer", [S.value]]),
125
+ class: C(["relative inline-flex items-center justify-center cursor-pointer", [x.value]]),
126
126
  role: "checkbox",
127
127
  "aria-checked": e.indeterminate ? "mixed" : t(p),
128
128
  "aria-disabled": e.disabled,
129
129
  tabindex: e.disabled ? -1 : 0,
130
- onClick: n[1] || (n[1] = (...l) => t(u) && t(u)(...l)),
131
- onFocus: n[2] || (n[2] = () => {
130
+ onClick: i[1] || (i[1] = (...l) => t(u) && t(u)(...l)),
131
+ onFocus: i[2] || (i[2] = () => {
132
132
  d.value = !0, c("update:focused", !0);
133
133
  }),
134
- onBlur: n[3] || (n[3] = () => {
134
+ onBlur: i[3] || (i[3] = () => {
135
135
  var l;
136
- d.value = !1, c("update:focused", !1), (l = e.validateOn) != null && l.includes("blur") && t(x)();
136
+ d.value = !1, c("update:focused", !1), (l = e.validateOn) != null && l.includes("blur") && t(k)();
137
137
  }),
138
- onKeydown: n[4] || (n[4] = j(H((...l) => t(u) && t(u)(...l), ["prevent"]), ["space"]))
138
+ onKeydown: i[4] || (i[4] = j(H((...l) => t(u) && t(u)(...l), ["prevent"]), ["space"]))
139
139
  }, [
140
140
  K(h, {
141
141
  icon: O.value,
142
- class: y([...A.value, S.value])
142
+ class: C([...A.value, x.value])
143
143
  }, null, 8, ["icon", "class"]),
144
- s(i.$slots, "input")
145
- ], 42, P)), [
146
- [t(G), e.ripple]
144
+ s(n.$slots, "input")
145
+ ], 42, J)), [
146
+ [t(q), e.ripple]
147
147
  ]),
148
- e.label || i.$slots.label ? (o(), r("div", Q, [
149
- s(i.$slots, "label", {
148
+ e.label || n.$slots.label ? (o(), r("div", Q, [
149
+ s(n.$slots, "label", {
150
150
  label: e.label
151
151
  }, () => [
152
152
  V(g(e.label), 1)
153
153
  ])
154
154
  ])) : a("", !0),
155
- w("div", {
155
+ $("div", {
156
156
  class: "flex items-center gap-2",
157
- onClick: n[5] || (n[5] = (l) => i.$emit("click:append"))
157
+ onClick: i[5] || (i[5] = (l) => n.$emit("click:append"))
158
158
  }, [
159
- s(i.$slots, "append"),
160
- e.appendIcon ? (o(), C(h, {
159
+ s(n.$slots, "append"),
160
+ e.appendIcon ? (o(), w(h, {
161
161
  key: 0,
162
162
  icon: e.appendIcon
163
163
  }, null, 8, ["icon"])) : a("", !0)
164
164
  ]),
165
- !e.hideDetails && ((B = t(m)) != null && B.length || e.hint || e.persistentHint) ? (o(), r("div", U, [
166
- s(i.$slots, "details", {}, () => {
165
+ !e.hideDetails && ((S = t(m)) != null && S.length || e.hint || e.persistentHint) ? (o(), r("div", U, [
166
+ s(n.$slots, "details", {}, () => {
167
167
  var l;
168
168
  return [
169
- (e.error || !t(k)) && ((l = t(m)) != null && l.length) ? (o(), r("div", X, [
170
- (o(!0), r(R, null, T(t(m).slice(0, Number(e.maxErrors)), ($) => s(i.$slots, "message", { message: $ }, () => [
171
- V(g($), 1)
169
+ (e.error || !t(b)) && ((l = t(m)) != null && l.length) ? (o(), r("div", X, [
170
+ (o(!0), r(R, null, T(t(m).slice(0, Number(e.maxErrors)), (B) => s(n.$slots, "message", { message: B }, () => [
171
+ V(g(B), 1)
172
172
  ])), 256))
173
173
  ])) : e.hint || e.persistentHint ? (o(), r("div", Y, g(e.hint), 1)) : a("", !0)
174
174
  ];
175
175
  })
176
176
  ])) : a("", !0)
177
- ], 6);
177
+ ], 16);
178
178
  };
179
179
  }
180
180
  };
@@ -1,47 +1,48 @@
1
- import { ref as L, computed as p, createElementBlock as l, openBlock as s, normalizeClass as m, renderSlot as i, createElementVNode as a, normalizeProps as y, guardReactiveProps as k, unref as n, createCommentVNode as d, toDisplayString as b, createBlock as h, resolveDynamicComponent as C, Fragment as q, renderList as J, withDirectives as O, vShow as Q, createTextVNode as U } from "vue";
2
- import { kunTextareaProps as W } from "../composables/KunTextareaProps.js";
3
- import { useKunTextarea as X } from "../composables/useKunTextareaComposable.js";
1
+ import { ref as q, computed as p, createElementBlock as l, openBlock as s, normalizeClass as m, renderSlot as i, createElementVNode as a, normalizeProps as y, guardReactiveProps as k, unref as t, createCommentVNode as d, toDisplayString as b, createBlock as h, resolveDynamicComponent as C, Fragment as J, renderList as O, withDirectives as Q, vShow as U, createTextVNode as W } from "vue";
2
+ import { kunTextareaProps as X } from "../composables/KunTextareaProps.js";
3
+ import { useKunTextarea as Y } from "../composables/useKunTextareaComposable.js";
4
4
  import { renderIconSlot as $ } from "../../../../utils/renderIcon.js";
5
- const Y = {
5
+ const Z = {
6
6
  key: 0,
7
7
  class: "block text-sm font-medium mb-1"
8
- }, Z = { class: "relative" }, x = {
8
+ }, x = { class: "relative" }, _ = {
9
9
  key: 0,
10
10
  class: "absolute left-2 top-2 flex items-center"
11
- }, _ = {
11
+ }, ee = {
12
12
  key: 1,
13
13
  class: "absolute left-2 top-2 ml-1"
14
- }, ee = ["value", "rows", "disabled", "readonly", "placeholder"], re = {
14
+ }, oe = ["value", "rows", "disabled", "readonly", "placeholder"], re = {
15
15
  key: 3,
16
16
  class: "absolute right-2 top-2 mr-1"
17
- }, oe = {
17
+ }, te = {
18
18
  key: 4,
19
19
  class: "absolute right-2 top-2 flex items-center"
20
20
  }, ne = {
21
21
  key: 5,
22
22
  class: "mt-1"
23
- }, te = { class: "h-1 w-full bg-gray-200 rounded overflow-hidden" }, se = {
23
+ }, se = { class: "h-1 w-full bg-gray-200 rounded overflow-hidden" }, le = {
24
24
  key: 7,
25
25
  class: "text-xs text-right mt-1 text-gray-400"
26
- }, le = { key: 0 }, pe = {
26
+ }, ae = { key: 0 }, ce = {
27
27
  __name: "KunTextarea",
28
- props: W,
28
+ props: X,
29
29
  emits: ["update:modelValue", "click:clear", "click:control", "update:focused", "mousedown:control"],
30
- setup(B, { expose: R, emit: S }) {
31
- const r = B, V = S, u = L(null), {
30
+ setup(B, { expose: S, emit: D }) {
31
+ const o = B, R = D, u = q(null), {
32
32
  isFocused: v,
33
33
  internalValue: c,
34
- updateValue: D,
34
+ rootRef: V,
35
+ updateValue: F,
35
36
  handleClear: z,
36
- adjustHeight: F,
37
- validate: M,
38
- reset: T,
39
- resetValidation: A,
37
+ adjustHeight: M,
38
+ validate: T,
39
+ reset: A,
40
+ resetValidation: E,
40
41
  hasError: f,
41
42
  displayedMessages: w
42
- } = X(r, V, u), E = p(() => {
43
- const e = !!r.bgColor;
44
- switch (r.variant) {
43
+ } = Y(o, R, u), G = p(() => {
44
+ const e = !!o.bgColor;
45
+ switch (o.variant) {
45
46
  case "filled":
46
47
  return [
47
48
  e ? "" : "bg-gray-100 dark:bg-gray-900",
@@ -59,8 +60,8 @@ const Y = {
59
60
  default:
60
61
  return "";
61
62
  }
62
- }), G = p(() => {
63
- switch (r.density) {
63
+ }), N = p(() => {
64
+ switch (o.density) {
64
65
  case "comfortable":
65
66
  return "py-2";
66
67
  case "compact":
@@ -68,108 +69,115 @@ const Y = {
68
69
  default:
69
70
  return "";
70
71
  }
71
- }), N = p(() => [
72
+ }), P = p(() => [
72
73
  "w-full resize-none p-2 transition-colors duration-150",
73
- r.inputClass,
74
+ o.inputClass,
74
75
  {
75
- "rounded-md": !r.tile,
76
- "rounded-none": r.tile,
77
- [`rounded-${r.rounded}`]: typeof r.rounded == "string" || typeof r.rounded == "number",
78
- "shadow-md": r.variant === "solo" && !r.flat,
79
- "shadow-none": r.flat,
80
- [`text-${r.textColor}`]: r.textColor,
81
- [`${r.bgColor}`]: r.bgColor,
82
- "text-gray-500 bg-gray-200": r.disabled,
83
- "focus:outline-none focus:ring-2": !r.disabled,
84
- [`focus:ring-${r.color}`]: r.color && !r.disabled && !f.value,
76
+ "rounded-md": !o.tile,
77
+ "rounded-none": o.tile,
78
+ [`rounded-${o.rounded}`]: typeof o.rounded == "string" || typeof o.rounded == "number",
79
+ "shadow-md": o.variant === "solo" && !o.flat,
80
+ "shadow-none": o.flat,
81
+ [`text-${o.textColor}`]: o.textColor,
82
+ [`${o.bgColor}`]: o.bgColor,
83
+ "text-gray-500 bg-gray-200": o.disabled,
84
+ "focus:outline-none focus:ring-2": !o.disabled,
85
+ [`focus:ring-${o.color}`]: o.color && !o.disabled && !f.value,
85
86
  "border-red-500 ring-red-500 focus:ring-red-500": f.value,
86
- "resize-none": r.noResize || r.autoGrow,
87
- resize: !r.noResize && !r.autoGrow
87
+ "resize-none": o.noResize || o.autoGrow,
88
+ resize: !o.noResize && !o.autoGrow
88
89
  }
89
- ]), P = p(() => [
90
+ ]), H = p(() => [
90
91
  "relative w-full",
91
- r.class,
92
- r.wrapperClass
93
- ]), I = p(() => r.counter === !0 ? 25 : typeof r.counter == "number" || typeof r.counter == "string" ? r.counter : null), H = p(() => r.persistentCounter ? !0 : !!r.counter && v.value), K = p(() => typeof r.clearIcon == "string" ? r.clearIcon : "i-heroicons-x-mark-20-solid");
94
- function g(e, t) {
95
- V(`click:${t}`, e);
92
+ o.class,
93
+ o.wrapperClass
94
+ ]), I = p(() => o.counter === !0 ? 25 : typeof o.counter == "number" || typeof o.counter == "string" ? o.counter : null), K = p(() => o.persistentCounter ? !0 : !!o.counter && v.value), j = p(() => typeof o.clearIcon == "string" ? o.clearIcon : "i-heroicons-x-mark-20-solid");
95
+ function g(e, n) {
96
+ R(`click:${n}`, e);
96
97
  }
97
- return R({
98
- validate: M,
99
- reset: T,
100
- resetValidation: A,
98
+ return S({
99
+ validate: T,
100
+ reset: A,
101
+ resetValidation: E,
101
102
  errorMessages: w,
102
- isValid: p(() => !f.value)
103
- }), (e, t) => (s(), l("div", {
104
- class: m(P.value)
103
+ isValid: p(() => !f.value),
104
+ rootRef: V,
105
+ focus: () => {
106
+ var e;
107
+ return (e = u.value) == null ? void 0 : e.focus();
108
+ }
109
+ }), (e, n) => (s(), l("div", {
110
+ class: m(H.value),
111
+ ref_key: "rootRef",
112
+ ref: V
105
113
  }, [
106
- i(e.$slots, "label", y(k({ label: e.label, isFocused: n(v), isActive: !!n(c), controlRef: u.value, focus: () => {
107
- var o;
108
- return (o = u.value) == null ? void 0 : o.focus();
114
+ i(e.$slots, "label", y(k({ label: e.label, isFocused: t(v), isActive: !!t(c), controlRef: u.value, focus: () => {
115
+ var r;
116
+ return (r = u.value) == null ? void 0 : r.focus();
109
117
  }, blur: () => {
110
- var o;
111
- return (o = u.value) == null ? void 0 : o.blur();
112
- }, props: r })), () => [
113
- e.label ? (s(), l("label", Y, b(e.label), 1)) : d("", !0)
118
+ var r;
119
+ return (r = u.value) == null ? void 0 : r.blur();
120
+ }, props: o })), () => [
121
+ e.label ? (s(), l("label", Z, b(e.label), 1)) : d("", !0)
114
122
  ]),
115
- a("div", Z, [
116
- e.prependIcon || e.$slots.prepend ? (s(), l("div", x, [
123
+ a("div", x, [
124
+ e.prependIcon || e.$slots.prepend ? (s(), l("div", _, [
117
125
  i(e.$slots, "prepend", y(k(e.prependSlotBindings)), () => [
118
126
  a("div", {
119
- onClick: t[0] || (t[0] = (o) => g(o, "prepend"))
127
+ onClick: n[0] || (n[0] = (r) => g(r, "prepend"))
120
128
  }, [
121
- (s(), h(C(n($)(e.prependIcon))))
129
+ (s(), h(C(t($)(e.prependIcon))))
122
130
  ])
123
131
  ])
124
132
  ])) : d("", !0),
125
- e.prependInnerIcon || e.$slots["prepend-inner"] ? (s(), l("div", _, [
133
+ e.prependInnerIcon || e.$slots["prepend-inner"] ? (s(), l("div", ee, [
126
134
  i(e.$slots, "prepend-inner", {}, () => [
127
135
  a("div", {
128
- onClick: t[1] || (t[1] = (o) => g(o, "prependInner"))
136
+ onClick: n[1] || (n[1] = (r) => g(r, "prependInner"))
129
137
  }, [
130
- (s(), h(C(n($)(e.prependInnerIcon))))
138
+ (s(), h(C(t($)(e.prependInnerIcon))))
131
139
  ])
132
140
  ])
133
141
  ])) : d("", !0),
134
142
  a("textarea", {
135
143
  ref_key: "textareaRef",
136
144
  ref: u,
137
- value: n(c),
145
+ value: t(c),
138
146
  rows: e.rows,
139
147
  disabled: e.disabled,
140
148
  readonly: e.readonly,
141
149
  placeholder: e.placeholder,
142
- onInput: t[2] || (t[2] = (o) => {
143
- n(D)(o.target.value), e.autoGrow && n(F)();
150
+ onInput: n[2] || (n[2] = (r) => {
151
+ t(F)(r.target.value), e.autoGrow && t(M)();
144
152
  }),
145
- onFocus: t[3] || (t[3] = (o) => {
153
+ onFocus: n[3] || (n[3] = (r) => {
146
154
  v.value = !0, e.$emit("update:focused", !0);
147
155
  }),
148
- onBlur: t[4] || (t[4] = (o) => {
156
+ onBlur: n[4] || (n[4] = (r) => {
149
157
  v.value = !1, e.$emit("update:focused", !1);
150
158
  }),
151
- onClick: t[5] || (t[5] = (o) => e.$emit("click:control", o)),
152
- onMousedown: t[6] || (t[6] = (o) => e.$emit("mousedown:control", o)),
153
- class: m([E.value, G.value, N.value])
154
- }, null, 42, ee),
155
- e.clearable && n(c) ? (s(), l("div", {
159
+ onClick: n[5] || (n[5] = (r) => e.$emit("click:control", r)),
160
+ onMousedown: n[6] || (n[6] = (r) => e.$emit("mousedown:control", r)),
161
+ class: m([G.value, N.value, P.value])
162
+ }, null, 42, oe),
163
+ e.clearable && t(c) ? (s(), l("div", {
156
164
  key: 2,
157
165
  class: m(["absolute right-2 top-2", { "opacity-100": e.persistentClear, "hover:opacity-100 opacity-0 transition-opacity duration-200": !e.persistentClear }])
158
166
  }, [
159
- i(e.$slots, "clear", y(k({ isActive: !!n(c), isFocused: n(v), controlRef: u.value, focus: () => {
160
- var o;
161
- return (o = u.value) == null ? void 0 : o.focus();
167
+ i(e.$slots, "clear", y(k({ isActive: !!t(c), isFocused: t(v), controlRef: u.value, focus: () => {
168
+ var r;
169
+ return (r = u.value) == null ? void 0 : r.focus();
162
170
  }, blur: () => {
163
- var o;
164
- return (o = u.value) == null ? void 0 : o.blur();
165
- }, props: r })), () => [
171
+ var r;
172
+ return (r = u.value) == null ? void 0 : r.blur();
173
+ }, props: o })), () => [
166
174
  a("button", {
167
175
  type: "button",
168
- onClick: t[7] || (t[7] = (...o) => n(z) && n(z)(...o)),
176
+ onClick: n[7] || (n[7] = (...r) => t(z) && t(z)(...r)),
169
177
  class: "text-gray-500 hover:text-gray-700"
170
178
  }, [
171
179
  a("span", {
172
- class: m(K.value)
180
+ class: m(j.value)
173
181
  }, null, 2)
174
182
  ])
175
183
  ])
@@ -177,18 +185,18 @@ const Y = {
177
185
  e.appendInnerIcon || e.$slots["append-inner"] ? (s(), l("div", re, [
178
186
  i(e.$slots, "append-inner", {}, () => [
179
187
  a("div", {
180
- onClick: t[8] || (t[8] = (o) => g(o, "appendInner"))
188
+ onClick: n[8] || (n[8] = (r) => g(r, "appendInner"))
181
189
  }, [
182
- (s(), h(C(n($)(e.appendInnerIcon))))
190
+ (s(), h(C(t($)(e.appendInnerIcon))))
183
191
  ])
184
192
  ])
185
193
  ])) : d("", !0),
186
- e.appendIcon || e.$slots.append ? (s(), l("div", oe, [
194
+ e.appendIcon || e.$slots.append ? (s(), l("div", te, [
187
195
  i(e.$slots, "append", y(k(e.appendSlotBindings)), () => [
188
196
  a("div", {
189
- onClick: t[9] || (t[9] = (o) => g(o, "append"))
197
+ onClick: n[9] || (n[9] = (r) => g(r, "append"))
190
198
  }, [
191
- (s(), h(C(n($)(e.appendIcon))))
199
+ (s(), h(C(t($)(e.appendIcon))))
192
200
  ])
193
201
  ])
194
202
  ])) : d("", !0),
@@ -197,7 +205,7 @@ const Y = {
197
205
  color: e.loadingColor,
198
206
  isActive: !0
199
207
  }, () => [
200
- a("div", te, [
208
+ a("div", se, [
201
209
  a("div", {
202
210
  class: m(["h-full transition-all duration-300", [`${e.loadingColor}`]]),
203
211
  style: { width: "100%" }
@@ -205,34 +213,34 @@ const Y = {
205
213
  ])
206
214
  ])
207
215
  ])) : d("", !0),
208
- !e.hideDetails || e.hideDetails === "auto" && (n(w).length || e.hint) ? (s(), l("div", {
216
+ !e.hideDetails || e.hideDetails === "auto" && (t(w).length || e.hint) ? (s(), l("div", {
209
217
  key: 6,
210
- class: m(["text-xs mt-1 space-y-1", { "text-red-500": n(f), "text-gray-500": !n(f) }])
218
+ class: m(["text-xs mt-1 space-y-1", { "text-red-500": t(f), "text-gray-500": !t(f) }])
211
219
  }, [
212
220
  i(e.$slots, "details", {}, () => [
213
- n(f) ? (s(!0), l(q, { key: 0 }, J(n(w), (o, j) => i(e.$slots, "message", {
214
- key: j,
215
- message: o
221
+ t(f) ? (s(!0), l(J, { key: 0 }, O(t(w), (r, L) => i(e.$slots, "message", {
222
+ key: L,
223
+ message: r
216
224
  }, () => [
217
- a("div", null, b(o), 1)
225
+ a("div", null, b(r), 1)
218
226
  ])), 128)) : e.hint ? i(e.$slots, "hint", {
219
227
  key: 1,
220
228
  hint: e.hint
221
229
  }, () => [
222
- O(a("div", null, b(e.hint), 513), [
223
- [Q, e.persistentHint || n(v)]
230
+ Q(a("div", null, b(e.hint), 513), [
231
+ [U, e.persistentHint || t(v)]
224
232
  ])
225
233
  ]) : d("", !0)
226
234
  ])
227
235
  ], 2)) : d("", !0),
228
- H.value ? (s(), l("div", se, [
236
+ K.value ? (s(), l("div", le, [
229
237
  i(e.$slots, "counter", {
230
- counter: n(c).length,
238
+ counter: t(c).length,
231
239
  max: I.value,
232
- value: n(c).length
240
+ value: t(c).length
233
241
  }, () => [
234
- U(b(n(c).length), 1),
235
- I.value ? (s(), l("span", le, " / " + b(I.value), 1)) : d("", !0)
242
+ W(b(t(c).length), 1),
243
+ I.value ? (s(), l("span", ae, " / " + b(I.value), 1)) : d("", !0)
236
244
  ])
237
245
  ])) : d("", !0)
238
246
  ])
@@ -240,5 +248,5 @@ const Y = {
240
248
  }
241
249
  };
242
250
  export {
243
- pe as default
251
+ ce as default
244
252
  };
@@ -1,6 +1,6 @@
1
- import { ref as n, watch as N, nextTick as M, onMounted as T, computed as V } from "vue";
2
- function k(t, s, l) {
3
- const h = n(!1), w = n(t.modelValue), g = (e) => {
1
+ import { ref as o, watch as T, nextTick as M, onMounted as b, computed as V } from "vue";
2
+ function A(t, s, a) {
3
+ const h = o(!1), w = o(t.modelValue), H = o(null), g = (e) => {
4
4
  if (t.formatModel === "raw") return String(e ?? "");
5
5
  if ((t.formatModel === "json" || t.formatModel === "auto") && typeof e == "object" && e !== null)
6
6
  try {
@@ -12,65 +12,66 @@ function k(t, s, l) {
12
12
  }, m = (e) => {
13
13
  if (t.formatModel === "raw") return e;
14
14
  try {
15
- const a = JSON.parse(e);
15
+ const l = JSON.parse(e);
16
16
  if (t.formatModel === "json" || t.formatModel === "auto")
17
- return a;
17
+ return l;
18
18
  } catch {
19
19
  }
20
20
  return e;
21
- }, o = n(g(t.modelValue));
22
- N(() => t.modelValue, (e) => {
23
- w.value = e, o.value = g(e), t.autoGrow && M(c);
21
+ }, u = o(g(t.modelValue));
22
+ T(() => t.modelValue, (e) => {
23
+ w.value = e, u.value = g(e), t.autoGrow && M(c);
24
24
  });
25
25
  const v = (e) => {
26
- o.value = e;
27
- const a = m(e);
28
- s("update:modelValue", a);
29
- }, H = () => {
26
+ u.value = e;
27
+ const l = m(e);
28
+ s("update:modelValue", l);
29
+ }, S = () => {
30
30
  v(""), s("click:clear");
31
31
  }, c = () => {
32
- if (!l.value) return;
33
- l.value.style.height = "auto", l.value.style.overflowY = "hidden";
34
- const e = l.value.scrollHeight, a = parseFloat(getComputedStyle(l.value).lineHeight || "24"), i = Number(t.maxRows || 0);
32
+ if (!a.value) return;
33
+ a.value.style.height = "auto", a.value.style.overflowY = "hidden";
34
+ const e = a.value.scrollHeight, l = parseFloat(getComputedStyle(a.value).lineHeight || "24"), i = Number(t.maxRows || 0);
35
35
  if (t.maxRows && i > 0) {
36
- const u = i * a;
37
- l.value.style.height = Math.min(e, u) + "px";
36
+ const n = i * l;
37
+ a.value.style.height = Math.min(e, n) + "px";
38
38
  } else
39
- l.value.style.height = e + "px";
39
+ a.value.style.height = e + "px";
40
40
  };
41
- T(() => {
41
+ b(() => {
42
42
  t.autoGrow && M(c);
43
43
  });
44
- const r = n([]), S = n(!0), j = (e = !1) => {
45
- const a = t.validationValue ?? m(o.value), i = t.rules ?? [], u = [];
44
+ const r = o([]), j = o(!0), x = (e = !1) => {
45
+ const l = t.validationValue ?? m(u.value), i = t.rules ?? [], n = [];
46
46
  for (const d of i) {
47
- const f = typeof d == "function" ? d(a) : d;
48
- typeof f == "string" ? u.push(f) : f === !1 && u.push("Campo inválido");
47
+ const f = typeof d == "function" ? d(l) : d;
48
+ typeof f == "string" ? n.push(f) : f === !1 && n.push("Campo inválido");
49
49
  }
50
- return r.value = u.slice(0, t.maxErrors ?? 1), e || s("update:focused", h.value), r.value;
50
+ return r.value = n.slice(0, t.maxErrors ?? 1), e || s("update:focused", h.value), r.value;
51
51
  }, y = () => {
52
52
  r.value = [];
53
- }, x = () => {
54
- o.value = "", y(), s("update:modelValue", "");
55
- }, C = V(() => t.error || r.value.length > 0), E = V(() => {
53
+ }, C = () => {
54
+ u.value = "", y(), s("update:modelValue", "");
55
+ }, E = V(() => t.error || r.value.length > 0), N = V(() => {
56
56
  var e;
57
57
  return (e = t.errorMessages) != null && e.length ? Array.isArray(t.errorMessages) ? t.errorMessages : [t.errorMessages] : r.value;
58
58
  });
59
59
  return {
60
60
  isFocused: h,
61
- internalValue: o,
61
+ internalValue: u,
62
+ rootRef: H,
62
63
  updateValue: v,
63
- handleClear: H,
64
+ handleClear: S,
64
65
  adjustHeight: c,
65
- isPristine: S,
66
- validate: j,
67
- reset: x,
66
+ isPristine: j,
67
+ validate: x,
68
+ reset: C,
68
69
  resetValidation: y,
69
70
  validationErrors: r,
70
- hasError: C,
71
- displayedMessages: E
71
+ hasError: E,
72
+ displayedMessages: N
72
73
  };
73
74
  }
74
75
  export {
75
- k as useKunTextarea
76
+ A as useKunTextarea
76
77
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.329",
3
+ "version": "0.1.331",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",