adverich-kun-ui 0.1.628 → 0.1.630

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.
package/AGENTS.md CHANGED
@@ -672,6 +672,10 @@ Input de archivos.
672
672
  <KunFileInput v-model="files" label="Subir archivo" multiple clearable />
673
673
  ```
674
674
 
675
+ **Eventos:** update:modelValue, change, click:clear, click:control, update:focused
676
+
677
+ **Nota:** usa `inheritAttrs: false` y reenvía `$attrs` al contenedor interno, de modo que `@change`/`@click` y `id`/`aria-*` no se duplican en el DOM.
678
+
675
679
  ---
676
680
 
677
681
  ### KunDatePicker
package/dist/AGENTS.md CHANGED
@@ -672,6 +672,10 @@ Input de archivos.
672
672
  <KunFileInput v-model="files" label="Subir archivo" multiple clearable />
673
673
  ```
674
674
 
675
+ **Eventos:** update:modelValue, change, click:clear, click:control, update:focused
676
+
677
+ **Nota:** usa `inheritAttrs: false` y reenvía `$attrs` al contenedor interno, de modo que `@change`/`@click` y `id`/`aria-*` no se duplican en el DOM.
678
+
675
679
  ---
676
680
 
677
681
  ### KunDatePicker
@@ -1,54 +1,62 @@
1
1
  import { __exportAll as e } from "../../../../_virtual/_rolldown/runtime.js";
2
- import { renderIconSlot as t } from "../../../../utils/renderIcon.js";
3
- import { kunFileInputProps as n } from "../composables/kunFileInputProps.js";
4
- import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, watch as _, withModifiers as v } from "vue";
2
+ import t from "../../../KunIcon/src/components/KunIcon.js";
3
+ import { icons as n } from "../../../../icons/index.js";
4
+ import { kunFileInputProps as r } from "../composables/kunFileInputProps.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, mergeProps as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, watch as b, withModifiers as x } from "vue";
5
6
  //#region src/components/KunFileInput/src/components/KunFileInput.vue
6
- var y = /* @__PURE__ */ e({ default: () => P }), b = { class: "relative flex w-full flex-col" }, x = { key: 0 }, S = ["multiple", "disabled"], C = { class: "flex-1 truncate" }, w = { key: 0 }, T = {
7
+ var S = /* @__PURE__ */ e({ default: () => F }), C = { class: "relative flex w-full flex-col" }, w = {
8
+ key: 0,
9
+ class: "flex items-center"
10
+ }, T = ["multiple", "disabled"], E = { class: "flex-1 truncate" }, D = { key: 0 }, O = {
7
11
  key: 1,
8
12
  class: "text-ui-disabled"
9
- }, E = { key: 0 }, D = { key: 0 }, O = { key: 1 }, k = {
13
+ }, k = {
14
+ key: 3,
15
+ class: "flex items-center"
16
+ }, A = {
10
17
  key: 1,
11
18
  class: "mt-1 text-sm"
12
- }, A = {
19
+ }, j = {
13
20
  key: 0,
14
21
  class: "text-ui-error"
15
- }, j = {
22
+ }, M = {
16
23
  key: 1,
17
24
  class: "text-ui-muted"
18
- }, M = {
25
+ }, N = {
19
26
  key: 2,
20
27
  class: "mt-1 text-xs text-ui-disabled text-right"
21
- }, N = { key: 0 }, P = {
28
+ }, P = { key: 0 }, F = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
22
29
  __name: "KunFileInput",
23
- props: n,
30
+ props: r,
24
31
  emits: [
25
32
  "update:modelValue",
26
33
  "click:clear",
27
34
  "click:control",
28
- "update:focused"
35
+ "update:focused",
36
+ "change"
29
37
  ],
30
- setup(e, { expose: n, emit: y }) {
31
- let P = e, F = y, I = f(null), L = f(!1), R = f([]), z = f([]);
32
- _(() => P.modelValue, (e) => {
33
- R.value = Array.isArray(e) ? e : e ? [e] : [];
38
+ setup(e, { expose: r, emit: S }) {
39
+ let F = e, I = S, L = h(null), R = h(!1), z = h([]), B = h([]);
40
+ b(() => F.modelValue, (e) => {
41
+ z.value = Array.isArray(e) ? e : e ? [e] : [];
34
42
  }, { immediate: !0 });
35
- function B(e) {
43
+ function V(e) {
36
44
  let t = e.target.files;
37
45
  if (!t) return;
38
46
  let n = Array.from(t);
39
- R.value = P.multiple ? n : [n[0]], F("update:modelValue", P.multiple ? n : n[0]), J();
40
- }
41
- function V() {
42
- R.value = [], F("update:modelValue", P.multiple ? [] : null), F("click:clear"), z.value = [];
47
+ z.value = F.multiple ? n : [n[0]], I("update:modelValue", F.multiple ? n : n[0]), I("change", e), Y();
43
48
  }
44
49
  function H() {
45
- L.value = !0, F("update:focused", !0);
50
+ z.value = [], I("update:modelValue", F.multiple ? [] : null), I("click:clear"), B.value = [];
46
51
  }
47
52
  function U() {
48
- L.value = !1, F("update:focused", !1);
53
+ R.value = !0, I("update:focused", !0);
54
+ }
55
+ function W() {
56
+ R.value = !1, I("update:focused", !1);
49
57
  }
50
- let W = i(() => R.value.map((e) => e.name)), G = i(() => P.dirty || L.value || W.value.length > 0), K = i(() => R.value.reduce((e, t) => e + t.size, 0)), q = i(() => {
51
- let e = K.value, t = P.showSize === 1024 ? 1024 : 1e3, n = [
58
+ let G = a(() => z.value.map((e) => e.name)), K = a(() => F.dirty || R.value || G.value.length > 0), q = a(() => z.value.reduce((e, t) => e + t.size, 0)), J = a(() => {
59
+ let e = q.value, t = F.showSize === 1024 ? 1024 : 1e3, n = [
52
60
  "B",
53
61
  "KB",
54
62
  "MB",
@@ -57,67 +65,119 @@ var y = /* @__PURE__ */ e({ default: () => P }), b = { class: "relative flex w-f
57
65
  for (; i >= t && r < n.length - 1;) i /= t, r++;
58
66
  return `${i.toFixed(1)} ${n[r]}`;
59
67
  });
60
- async function J(e = !1) {
68
+ async function Y(e = !1) {
61
69
  let t = [];
62
- for (let e of P.rules) {
63
- let n = typeof e != "function" || e(P.multiple ? R.value : R.value[0]);
70
+ for (let e of F.rules) {
71
+ let n = typeof e != "function" || e(F.multiple ? z.value : z.value[0]);
64
72
  typeof n == "string" ? t.push(n) : n === !1 && t.push("Valor inválido");
65
73
  }
66
- return z.value = t, !e && t.length && F("update:focused", !0), t;
67
- }
68
- async function Y() {
69
- V();
74
+ return B.value = t, !e && t.length && I("update:focused", !0), t;
70
75
  }
71
76
  async function X() {
72
- z.value = [];
77
+ H();
78
+ }
79
+ async function Z() {
80
+ B.value = [];
73
81
  }
74
- return n({
75
- reset: Y,
76
- resetValidation: X,
77
- validate: J,
78
- isValid: i(() => z.value.length === 0),
79
- errorMessages: z
80
- }), (e, n) => (d(), o("div", b, [
81
- e.label ? (d(), o("label", {
82
+ return r({
83
+ reset: X,
84
+ resetValidation: Z,
85
+ validate: Y,
86
+ isValid: a(() => B.value.length === 0),
87
+ errorMessages: B
88
+ }), (e, r) => (m(), c("div", C, [
89
+ e.label ? (m(), c("label", {
82
90
  key: 0,
83
- class: u(["absolute left-2 z-10 px-1 text-ui transition-all duration-200 ease-in-out pointer-events-none select-none", G.value ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"])
84
- }, h(e.label), 3)) : a("", !0),
85
- s("div", l({ class: ["flex items-center gap-2 rounded px-3 py-2 cursor-pointer transition", [
91
+ class: p(["absolute left-2 z-10 px-1 text-ui transition-all duration-200 ease-in-out pointer-events-none select-none", K.value ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"])
92
+ }, v(e.label), 3)) : s("", !0),
93
+ l("div", f({ class: ["flex items-center gap-2 rounded px-3 py-2 cursor-pointer transition", [
86
94
  e.variant === "outlined" ? "border border-ui" : e.variant === "solo" ? "border-ui shadow-inner" : "bg-surface border border-ui",
87
95
  e.disabled ? "border-ui cursor-not-allowed" : "hover:border-ui-primary",
88
- e.error || z.value.length ? "border-error" : "",
89
- L.value ? "ring-2 ring-ui-focus" : ""
96
+ e.error || B.value.length ? "border-error" : "",
97
+ R.value ? "ring-2 ring-ui-focus" : ""
90
98
  ]] }, e.$attrs, {
91
- onClick: n[0] ||= () => I.value?.click(),
92
- onFocusin: H,
93
- onFocusout: U
99
+ onClick: r[0] ||= () => L.value?.click(),
100
+ onFocusin: U,
101
+ onFocusout: W
94
102
  }), [
95
- m(e.$slots, "prepend", {}, () => [e.prependIcon ? (d(), o("span", x, h(g(t)(e.prependIcon)), 1)) : a("", !0)]),
96
- s("input", {
103
+ e.prependIcon || e.$slots.prepend ? (m(), c("span", w, [_(e.$slots, "prepend", {}, () => [e.prependIcon ? (m(), o(t, {
104
+ key: 0,
105
+ icon: e.prependIcon,
106
+ size: e.iconSize,
107
+ disabled: e.disabled
108
+ }, null, 8, [
109
+ "icon",
110
+ "size",
111
+ "disabled"
112
+ ])) : s("", !0)])])) : s("", !0),
113
+ e.prependInnerIcon || e.$slots["prepend-inner"] ? (m(), c("span", {
114
+ key: 1,
115
+ class: p([e.prependInnerClass, "flex items-center"])
116
+ }, [_(e.$slots, "prepend-inner", {}, () => [e.prependInnerIcon ? (m(), o(t, {
117
+ key: 0,
118
+ icon: e.prependInnerIcon,
119
+ size: e.iconSize,
120
+ disabled: e.disabled
121
+ }, null, 8, [
122
+ "icon",
123
+ "size",
124
+ "disabled"
125
+ ])) : s("", !0)])], 2)) : s("", !0),
126
+ l("input", {
97
127
  ref_key: "inputRef",
98
- ref: I,
128
+ ref: L,
99
129
  type: "file",
100
130
  class: "hidden",
101
131
  multiple: e.multiple,
102
132
  disabled: e.disabled,
103
- onChange: B
104
- }, null, 40, S),
105
- s("div", C, [m(e.$slots, "selection", {
106
- fileNames: W.value,
107
- totalBytes: K.value,
108
- totalBytesReadable: q.value
109
- }, () => [W.value.length ? (d(), o("span", w, h(W.value.join(", ")), 1)) : (d(), o("span", T, "Seleccionar archivo"))])]),
110
- m(e.$slots, "append", {}, () => [e.appendIcon ? (d(), o("span", E, h(g(t)(e.appendIcon)), 1)) : a("", !0)]),
111
- e.clearable && W.value.length ? (d(), o("button", {
133
+ onChange: V
134
+ }, null, 40, T),
135
+ l("div", E, [_(e.$slots, "selection", {
136
+ fileNames: G.value,
137
+ totalBytes: q.value,
138
+ totalBytesReadable: J.value
139
+ }, () => [G.value.length ? (m(), c("span", D, v(G.value.join(", ")), 1)) : (m(), c("span", O, "Seleccionar archivo"))])]),
140
+ e.appendInnerIcon || e.$slots["append-inner"] ? (m(), c("span", {
141
+ key: 2,
142
+ class: p([e.appendInnerClass, "flex items-center"])
143
+ }, [_(e.$slots, "append-inner", {}, () => [e.appendInnerIcon ? (m(), o(t, {
144
+ key: 0,
145
+ icon: e.appendInnerIcon,
146
+ size: e.iconSize,
147
+ disabled: e.disabled
148
+ }, null, 8, [
149
+ "icon",
150
+ "size",
151
+ "disabled"
152
+ ])) : s("", !0)])], 2)) : s("", !0),
153
+ e.appendIcon || e.$slots.append ? (m(), c("span", k, [_(e.$slots, "append", {}, () => [e.appendIcon ? (m(), o(t, {
112
154
  key: 0,
113
- onClick: v(V, ["stop"]),
155
+ icon: e.appendIcon,
156
+ size: e.iconSize,
157
+ disabled: e.disabled
158
+ }, null, 8, [
159
+ "icon",
160
+ "size",
161
+ "disabled"
162
+ ])) : s("", !0)])])) : s("", !0),
163
+ e.clearable && G.value.length ? (m(), c("button", {
164
+ key: 4,
165
+ onClick: x(H, ["stop"]),
114
166
  class: "cursor-pointer text-ui-muted hover:text-ui-error"
115
- }, [e.clearIcon ? (d(), o("span", D, h(g(t)(e.clearIcon)), 1)) : (d(), o("span", O, "✕"))])) : a("", !0)
167
+ }, [d(t, {
168
+ icon: e.clearIcon || y(n).close,
169
+ size: e.iconSize,
170
+ disabled: e.disabled
171
+ }, null, 8, [
172
+ "icon",
173
+ "size",
174
+ "disabled"
175
+ ])])) : s("", !0)
116
176
  ], 16),
117
- e.hint || z.value.length ? (d(), o("div", k, [z.value.length ? (d(), o("div", A, [(d(!0), o(r, null, p(z.value, (e, t) => (d(), o("div", { key: t }, h(e), 1))), 128))])) : e.hint ? (d(), o("div", j, h(e.hint), 1)) : a("", !0)])) : a("", !0),
118
- e.counter ? (d(), o("div", M, [c(h(e.counterString ?? `${W.value.length} archivo(s)`) + " ", 1), e.showSize ? (d(), o("span", N, " — " + h(q.value), 1)) : a("", !0)])) : a("", !0)
177
+ e.hint || B.value.length ? (m(), c("div", A, [B.value.length ? (m(), c("div", j, [(m(!0), c(i, null, g(B.value, (e, t) => (m(), c("div", { key: t }, v(e), 1))), 128))])) : e.hint ? (m(), c("div", M, v(e.hint), 1)) : s("", !0)])) : s("", !0),
178
+ e.counter ? (m(), c("div", N, [u(v(e.counterString ?? `${G.value.length} archivo(s)`) + " ", 1), e.showSize ? (m(), c("span", P, " — " + v(J.value), 1)) : s("", !0)])) : s("", !0)
119
179
  ]));
120
180
  }
121
- };
181
+ });
122
182
  //#endregion
123
- export { y as KunFileInput_exports, P as default };
183
+ export { S as KunFileInput_exports, F as default };
@@ -18,9 +18,42 @@ var e = {
18
18
  counter: Boolean,
19
19
  counterString: String,
20
20
  counterSizeString: String,
21
- prependIcon: String,
22
- appendIcon: String,
23
- clearIcon: String,
21
+ prependIcon: [
22
+ String,
23
+ Object,
24
+ Function,
25
+ Array
26
+ ],
27
+ appendIcon: [
28
+ String,
29
+ Object,
30
+ Function,
31
+ Array
32
+ ],
33
+ prependInnerIcon: [
34
+ String,
35
+ Object,
36
+ Function,
37
+ Array
38
+ ],
39
+ appendInnerIcon: [
40
+ String,
41
+ Object,
42
+ Function,
43
+ Array
44
+ ],
45
+ prependInnerClass: String,
46
+ appendInnerClass: String,
47
+ clearIcon: [
48
+ String,
49
+ Object,
50
+ Function,
51
+ Array
52
+ ],
53
+ iconSize: {
54
+ type: String,
55
+ default: "text-base"
56
+ },
24
57
  variant: {
25
58
  type: String,
26
59
  default: "filled"
@@ -1,38 +1,38 @@
1
1
  import { __exportAll as e } from "../../../../_virtual/_rolldown/runtime.js";
2
2
  import { debounce as t } from "../../../../utils/utils.js";
3
- import { renderIconSlot as n } from "../../../../utils/renderIcon.js";
4
- import { kunTextareaProps as r } from "../composables/kunTextareaProps.js";
5
- import i from "../composables/useKunTextareaComposable.js";
6
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, guardReactiveProps as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, ref as ee, renderList as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useAttrs as S, useId as C, vShow as w, withDirectives as T, withKeys as E } from "vue";
3
+ import { kunTextareaProps as n } from "../composables/kunTextareaProps.js";
4
+ import r from "../composables/useKunTextareaComposable.js";
5
+ import { renderIconSlot as i } from "../../../../utils/renderIcon.js";
6
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, guardReactiveProps as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, ref as _, renderList as v, renderSlot as y, resolveDynamicComponent as b, toDisplayString as x, unref as S, useAttrs as C, useId as w, vShow as T, withDirectives as ee, withKeys as te } from "vue";
7
7
  //#region src/components/KunTextarea/src/components/KunTextarea.vue
8
- var D = /* @__PURE__ */ e({ default: () => P }), te = ["for"], ne = { class: "relative" }, re = {
8
+ var E = /* @__PURE__ */ e({ default: () => N }), ne = ["for"], re = { class: "relative" }, D = {
9
9
  key: 0,
10
10
  class: "absolute left-2 top-2 flex items-center"
11
- }, ie = {
11
+ }, O = {
12
12
  key: 1,
13
13
  class: "absolute left-2 top-2 ml-1"
14
- }, ae = [
14
+ }, ie = [
15
15
  "id",
16
16
  "value",
17
17
  "rows",
18
18
  "disabled",
19
19
  "readonly",
20
20
  "placeholder"
21
- ], O = {
21
+ ], ae = {
22
22
  key: 3,
23
23
  class: "absolute right-2 top-2 mr-1"
24
- }, k = {
24
+ }, oe = {
25
25
  key: 4,
26
26
  class: "absolute right-2 top-2 flex items-center"
27
- }, A = {
27
+ }, k = {
28
28
  key: 5,
29
29
  class: "mt-1"
30
- }, j = { class: "h-1 w-full bg-field-background rounded overflow-hidden" }, M = {
30
+ }, A = { class: "h-1 w-full bg-field-background rounded overflow-hidden" }, j = {
31
31
  key: 7,
32
32
  class: "text-xs text-right mt-1 text-ui-disabled"
33
- }, N = { key: 0 }, P = {
33
+ }, M = { key: 0 }, N = {
34
34
  __name: "KunTextarea",
35
- props: { ...r },
35
+ props: { ...n },
36
36
  emits: [
37
37
  "update:modelValue",
38
38
  "click:clear",
@@ -40,12 +40,12 @@ var D = /* @__PURE__ */ e({ default: () => P }), te = ["for"], ne = { class: "re
40
40
  "update:focused",
41
41
  "mousedown:control"
42
42
  ],
43
- setup(e, { expose: r, emit: D }) {
44
- let P = e, F = D, I = S(), L = ee(null), R = P.id || `textarea-${C()}`, { isFocused: z, internalValue: B, updateModel: V, handleClear: H, validate: U, reset: W, resetValidation: G, hasError: K, displayedMessages: q, adjustHeight: oe, handleJsonEnter: J, isLocalChange: se } = i(P, F, L), ce = (e) => {
45
- let t = L.value;
43
+ setup(e, { expose: n, emit: E }) {
44
+ let N = e, P = E, F = C(), I = _(null), L = N.id || `textarea-${w()}`, { isFocused: R, internalValue: z, updateModel: B, handleClear: V, validate: H, reset: U, resetValidation: W, hasError: G, displayedMessages: K, adjustHeight: q, handleJsonEnter: J, isLocalChange: se } = r(N, P, I), ce = (e) => {
45
+ let t = I.value;
46
46
  t && e !== null && t.setSelectionRange(e.start, e.end);
47
47
  }, le = () => {
48
- let e = [], t = L.value?.parentElement;
48
+ let e = [], t = I.value?.parentElement;
49
49
  for (; t;) t.scrollHeight > t.clientHeight && e.push({
50
50
  el: t,
51
51
  scrollTop: t.scrollTop
@@ -63,89 +63,89 @@ var D = /* @__PURE__ */ e({ default: () => P }), te = ["for"], ne = { class: "re
63
63
  start: e.target.selectionStart,
64
64
  end: e.target.selectionEnd
65
65
  }, r = le();
66
- se.value = !0, P.autoGrow && requestAnimationFrame(() => {
67
- oe(), ce(n), ue(r);
66
+ se.value = !0, N.autoGrow && requestAnimationFrame(() => {
67
+ q(), ce(n), ue(r);
68
68
  }), fe(t);
69
69
  }, fe = t((e) => {
70
- V(e);
71
- }, P.debounceTime), pe = () => {
72
- z.value = !0, F("update:focused", !0);
70
+ B(e);
71
+ }, N.debounceTime), pe = () => {
72
+ R.value = !0, P("update:focused", !0);
73
73
  }, me = () => {
74
- z.value = !1, F("update:focused", !1);
75
- }, Y = o(() => z.value || !!B.value || P.dirty), X = o(() => typeof B.value == "string" ? B.value.length : 0), Z = o(() => P.counter === !0 ? 25 : P.counter || null), he = o(() => P.persistentCounter || P.counter && z.value), ge = o(() => [
74
+ R.value = !1, P("update:focused", !1);
75
+ }, Y = o(() => R.value || !!z.value || N.dirty), X = o(() => typeof z.value == "string" ? z.value.length : 0), Z = o(() => N.counter === !0 ? 25 : N.counter || null), he = o(() => N.persistentCounter || N.counter && R.value), ge = o(() => [
76
76
  "relative w-full flex flex-col",
77
- P.class,
78
- P.wrapperClass
79
- ]), Q = o(() => P.persistentClear ? "opacity-100" : "hover:opacity-100 opacity-0 transition-opacity duration-200"), _e = o(() => {
80
- let e = P.bgColor ? "" : P.variant === "filled" ? "bg-field-background" : "";
81
- switch (P.variant) {
77
+ N.class,
78
+ N.wrapperClass
79
+ ]), _e = o(() => N.persistentClear ? "opacity-100" : "hover:opacity-100 opacity-0 transition-opacity duration-200"), ve = o(() => {
80
+ let e = N.bgColor ? "" : N.variant === "filled" ? "bg-field-background" : "";
81
+ switch (N.variant) {
82
82
  case "filled": return [e, "border border-transparent"];
83
83
  case "outlined": return "border border-ui bg-transparent";
84
84
  case "underlined": return "border-b border-ui bg-transparent rounded-none";
85
85
  case "solo": return [e || "bg-ui-surface-raised", "shadow-md border-transparent"];
86
86
  default: return "";
87
87
  }
88
- }), ve = o(() => P.density === "compact" ? "p-1" : P.density === "comfortable" ? "p-2" : "p-3"), ye = o(() => [
88
+ }), Q = o(() => N.density === "compact" ? "p-1" : N.density === "comfortable" ? "p-2" : "p-3"), ye = o(() => [
89
89
  "w-full resize-none p-2 transition-colors duration-150 text-ui",
90
- P.inputClass,
90
+ N.inputClass,
91
91
  {
92
- rounded: !P.tile,
93
- "rounded-none": P.tile,
94
- [`rounded-${P.rounded}`]: typeof P.rounded == "string" || typeof P.rounded == "number",
95
- "shadow-md": P.variant === "solo" && !P.flat,
96
- "shadow-none": P.flat,
97
- [P.bgColor]: P.bgColor,
98
- "text-ui-disabled bg-surface": P.disabled,
99
- "focus:outline-none focus:ring-1": !P.disabled,
100
- [`${P.focusRingColor}`]: P.focusRingColor && !P.disabled && !K.value,
101
- "border-error ring-ui-focus": K.value,
102
- "resize-none": P.noResize || P.autoGrow,
103
- resize: !P.noResize && !P.autoGrow
92
+ rounded: !N.tile,
93
+ "rounded-none": N.tile,
94
+ [`rounded-${N.rounded}`]: typeof N.rounded == "string" || typeof N.rounded == "number",
95
+ "shadow-md": N.variant === "solo" && !N.flat,
96
+ "shadow-none": N.flat,
97
+ [N.bgColor]: N.bgColor,
98
+ "text-ui-disabled bg-surface": N.disabled,
99
+ "focus:outline-none focus:ring-1": !N.disabled,
100
+ [`${N.focusRingColor}`]: N.focusRingColor && !N.disabled && !G.value,
101
+ "border-error ring-ui-focus": G.value,
102
+ "resize-none": N.noResize || N.autoGrow,
103
+ resize: !N.noResize && !N.autoGrow
104
104
  },
105
- _e.value,
106
- ve.value
105
+ ve.value,
106
+ Q.value
107
107
  ]), be = {
108
- label: P.label,
109
- isFocused: z,
108
+ label: N.label,
109
+ isFocused: R,
110
110
  isActive: Y,
111
- controlRef: L,
112
- focus: () => L.value?.focus(),
113
- blur: () => L.value?.blur(),
114
- props: P
111
+ controlRef: I,
112
+ focus: () => I.value?.focus(),
113
+ blur: () => I.value?.blur(),
114
+ props: N
115
115
  }, $ = {
116
- isActive: !!B.value,
117
- isFocused: z,
118
- controlRef: L,
119
- focus: () => L.value?.focus(),
120
- blur: () => L.value?.blur(),
121
- props: P
116
+ isActive: !!z.value,
117
+ isFocused: R,
118
+ controlRef: I,
119
+ focus: () => I.value?.focus(),
120
+ blur: () => I.value?.blur(),
121
+ props: N
122
122
  }, xe = $, Se = $, Ce = o(() => {
123
- let { class: e, ...t } = I;
123
+ let { class: e, ...t } = F;
124
124
  return t;
125
125
  });
126
- return r({
127
- validate: U,
128
- reset: W,
129
- resetValidation: G,
130
- errorMessages: q,
131
- isValid: o(() => !K.value),
132
- focus: () => L.value?.focus(),
133
- rootRef: L
126
+ return n({
127
+ validate: H,
128
+ reset: U,
129
+ resetValidation: W,
130
+ errorMessages: K,
131
+ isValid: o(() => !G.value),
132
+ focus: () => I.value?.focus(),
133
+ rootRef: I
134
134
  }), (e, t) => (g(), l("div", p({
135
135
  class: ge.value,
136
136
  ref: "rootRef"
137
- }, Ce.value), [v(e.$slots, "label", p({ for: x(R) }, be), () => [e.label ? (g(), l("label", {
137
+ }, Ce.value), [y(e.$slots, "label", p({ for: S(L) }, be), () => [e.label ? (g(), l("label", {
138
138
  key: 0,
139
- for: x(R),
139
+ for: S(L),
140
140
  class: m(["absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10", Y.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"])
141
- }, b(e.label), 11, te)) : c("", !0)]), u("div", ne, [
142
- e.prependIcon || e.$slots.prepend ? (g(), l("div", re, [v(e.$slots, "prepend", h(f(x(xe))), () => [u("div", { onClick: t[0] ||= (t) => e.handleIconClick(t, "prepend") }, [(g(), s(y(x(n)(e.prependIcon))))])])])) : c("", !0),
143
- e.prependInnerIcon || e.$slots["prepend-inner"] ? (g(), l("div", ie, [v(e.$slots, "prepend-inner", {}, () => [u("div", { onClick: t[1] ||= (t) => e.handleIconClick(t, "prependInner") }, [(g(), s(y(x(n)(e.prependInnerIcon))))])])])) : c("", !0),
141
+ }, x(e.label), 11, ne)) : c("", !0)]), u("div", re, [
142
+ e.prependIcon || e.$slots.prepend ? (g(), l("div", D, [y(e.$slots, "prepend", h(f(S(xe))), () => [u("div", { onClick: t[0] ||= (t) => e.handleIconClick(t, "prepend") }, [(g(), s(b(S(i)(e.prependIcon))))])])])) : c("", !0),
143
+ e.prependInnerIcon || e.$slots["prepend-inner"] ? (g(), l("div", O, [y(e.$slots, "prepend-inner", {}, () => [u("div", { onClick: t[1] ||= (t) => e.handleIconClick(t, "prependInner") }, [(g(), s(b(S(i)(e.prependInnerIcon))))])])])) : c("", !0),
144
144
  u("textarea", {
145
145
  ref_key: "textareaRef",
146
- ref: L,
147
- id: x(R),
148
- value: x(B),
146
+ ref: I,
147
+ id: S(L),
148
+ value: S(z),
149
149
  rows: e.autoGrow ? void 0 : e.rows,
150
150
  disabled: e.disabled,
151
151
  readonly: e.readonly,
@@ -153,7 +153,7 @@ var D = /* @__PURE__ */ e({ default: () => P }), te = ["for"], ne = { class: "re
153
153
  onInput: de,
154
154
  onFocus: pe,
155
155
  onBlur: me,
156
- onKeydown: t[2] ||= E((...e) => x(J) && x(J)(...e), ["enter"]),
156
+ onKeydown: t[2] ||= te((...e) => S(J) && S(J)(...e), ["enter"]),
157
157
  onClick: t[3] ||= (t) => e.$emit("click:control", t),
158
158
  onMousedown: t[4] ||= (t) => e.$emit("mousedown:control", t),
159
159
  class: m(["bg-field-background", [ye.value]]),
@@ -162,39 +162,39 @@ var D = /* @__PURE__ */ e({ default: () => P }), te = ["for"], ne = { class: "re
162
162
  "box-sizing": "border-box",
163
163
  "overflow-y": "hidden"
164
164
  }
165
- }, null, 42, ae),
166
- e.clearable && x(B) ? (g(), l("div", {
165
+ }, null, 42, ie),
166
+ e.clearable && S(z) ? (g(), l("div", {
167
167
  key: 2,
168
- class: m(["absolute right-2 top-2", Q.value])
169
- }, [v(e.$slots, "clear", h(f($)), () => [e.clearIcon ? (g(), l("button", {
168
+ class: m(["absolute right-2 top-2", _e.value])
169
+ }, [y(e.$slots, "clear", h(f($)), () => [e.clearIcon ? (g(), l("button", {
170
170
  key: 0,
171
171
  type: "button",
172
- onClick: t[5] ||= (...e) => x(H) && x(H)(...e),
172
+ onClick: t[5] ||= (...e) => S(V) && S(V)(...e),
173
173
  class: "text-ui-muted hover:text-ui"
174
- }, [(g(), s(y(x(n)(e.clearIcon))))])) : c("", !0)])], 2)) : c("", !0),
175
- e.appendInnerIcon || e.$slots["append-inner"] ? (g(), l("div", O, [v(e.$slots, "append-inner", {}, () => [u("div", { onClick: t[6] ||= (t) => e.handleIconClick(t, "appendInner") }, [(g(), s(y(x(n)(e.appendInnerIcon))))])])])) : c("", !0),
176
- e.appendIcon || e.$slots.append ? (g(), l("div", k, [v(e.$slots, "append", h(f(x(Se))), () => [u("div", { onClick: t[7] ||= (t) => e.handleIconClick(t, "append") }, [(g(), s(y(x(n)(e.appendIcon))))])])])) : c("", !0),
177
- e.loading ? (g(), l("div", A, [v(e.$slots, "loader", {
174
+ }, [(g(), s(b(S(i)(e.clearIcon))))])) : c("", !0)])], 2)) : c("", !0),
175
+ e.appendInnerIcon || e.$slots["append-inner"] ? (g(), l("div", ae, [y(e.$slots, "append-inner", {}, () => [u("div", { onClick: t[6] ||= (t) => e.handleIconClick(t, "appendInner") }, [(g(), s(b(S(i)(e.appendInnerIcon))))])])])) : c("", !0),
176
+ e.appendIcon || e.$slots.append ? (g(), l("div", oe, [y(e.$slots, "append", h(f(S(Se))), () => [u("div", { onClick: t[7] ||= (t) => e.handleIconClick(t, "append") }, [(g(), s(b(S(i)(e.appendIcon))))])])])) : c("", !0),
177
+ e.loading ? (g(), l("div", k, [y(e.$slots, "loader", {
178
178
  color: e.loadingColor,
179
179
  isActive: !0
180
- }, () => [u("div", j, [u("div", {
180
+ }, () => [u("div", A, [u("div", {
181
181
  class: m(["h-full transition-all duration-300", [e.loadingColor]]),
182
182
  style: { width: "100%" }
183
183
  }, null, 2)])])])) : c("", !0),
184
- !e.hideDetails || e.hideDetails === "auto" && (x(q).length || e.hint) ? (g(), l("div", {
184
+ !e.hideDetails || e.hideDetails === "auto" && (S(K).length || e.hint) ? (g(), l("div", {
185
185
  key: 6,
186
186
  class: m(["text-xs mt-1 space-y-1", {
187
- "text-ui-error": x(K),
188
- "text-ui-muted": !x(K)
187
+ "text-ui-error": S(G),
188
+ "text-ui-muted": !S(G)
189
189
  }])
190
- }, [v(e.$slots, "details", {}, () => [x(K) ? (g(!0), l(a, { key: 0 }, _(x(q), (t, n) => v(e.$slots, "message", { message: t }, () => [u("div", null, b(t), 1)], void 0, n)), 128)) : e.hint ? v(e.$slots, "hint", { hint: e.hint }, () => [T(u("div", null, b(e.hint), 513), [[w, e.persistentHint || x(z)]])], void 0, 1) : c("", !0)])], 2)) : c("", !0),
191
- he.value ? (g(), l("div", M, [v(e.$slots, "counter", {
190
+ }, [y(e.$slots, "details", {}, () => [S(G) ? (g(!0), l(a, { key: 0 }, v(S(K), (t, n) => y(e.$slots, "message", { message: t }, () => [u("div", null, x(t), 1)], void 0, n)), 128)) : e.hint ? y(e.$slots, "hint", { hint: e.hint }, () => [ee(u("div", null, x(e.hint), 513), [[T, e.persistentHint || S(R)]])], void 0, 1) : c("", !0)])], 2)) : c("", !0),
191
+ he.value ? (g(), l("div", j, [y(e.$slots, "counter", {
192
192
  counter: X.value,
193
193
  max: Z.value,
194
194
  value: X.value
195
- }, () => [d(b(X.value), 1), Z.value ? (g(), l("span", N, " / " + b(Z.value), 1)) : c("", !0)])])) : c("", !0)
195
+ }, () => [d(x(X.value), 1), Z.value ? (g(), l("span", M, " / " + x(Z.value), 1)) : c("", !0)])])) : c("", !0)
196
196
  ])], 16));
197
197
  }
198
198
  };
199
199
  //#endregion
200
- export { D as KunTextarea_exports, P as default };
200
+ export { E as KunTextarea_exports, N as default };
@@ -1,12 +1,13 @@
1
+ import { h as e, resolveComponent as t } from "vue";
1
2
  //#region src/utils/renderIcon.js
2
- function e(e, t = {}, n = null) {
3
- return e ? typeof e == "string" ? h("span", {
4
- class: e,
5
- ...t
6
- }) : typeof e == "function" ? h(e, t) : h(resolveComponent("KunIcon"), {
7
- icon: e,
8
- ...t
9
- }) : n;
3
+ function n(n, r = {}, i = null) {
4
+ return n ? typeof n == "string" ? e("span", {
5
+ class: n,
6
+ ...r
7
+ }) : typeof n == "function" ? e(n, r) : e(t("KunIcon"), {
8
+ icon: n,
9
+ ...r
10
+ }) : i;
10
11
  }
11
12
  //#endregion
12
- export { e as renderIconSlot };
13
+ export { n as renderIconSlot };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.628",
3
+ "version": "0.1.630",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",