adverich-kun-ui 0.1.406 → 0.1.408

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.
@@ -43,9 +43,9 @@ const be = { class: "relative" }, ye = {
43
43
  var T;
44
44
  if (!o.jsonMode) return;
45
45
  e.preventDefault();
46
- const t = e.target, n = t.selectionStart, g = ((T = t.value.substring(0, n).match(/(^|\n)(\s*)[^\n]*$/)) == null ? void 0 : T[2]) ?? "", M = t.value.slice(0, n) + `
47
- ` + g + t.value.slice(n);
48
- t.value = M, z(M), ve(() => t.setSelectionRange(n + 1 + g.length, n + 1 + g.length));
46
+ const n = e.target, t = n.selectionStart, g = ((T = n.value.substring(0, t).match(/(^|\n)(\s*)[^\n]*$/)) == null ? void 0 : T[2]) ?? "", M = n.value.slice(0, t) + `
47
+ ` + g + n.value.slice(t);
48
+ n.value = M, z(M), ve(() => n.setSelectionRange(t + 1 + g.length, t + 1 + g.length));
49
49
  }, Q = () => {
50
50
  c.value = !0, C("update:focused", !0);
51
51
  }, U = () => {
@@ -98,9 +98,9 @@ const be = { class: "relative" }, ye = {
98
98
  }, blur: () => {
99
99
  var e;
100
100
  return (e = p.value) == null ? void 0 : e.blur();
101
- }, props: o }, oe = R, te = R, ne = a(() => {
102
- const { class: e, ...t } = K;
103
- return t;
101
+ }, props: o }, oe = R, ne = R, te = a(() => {
102
+ const { class: e, ...n } = K;
103
+ return n;
104
104
  });
105
105
  return G({
106
106
  validate: j,
@@ -113,11 +113,11 @@ const be = { class: "relative" }, ye = {
113
113
  var e;
114
114
  return (e = p.value) == null ? void 0 : e.focus();
115
115
  }
116
- }), (e, t) => (r(), l("div", E({
116
+ }), (e, n) => (r(), l("div", E({
117
117
  class: X.value,
118
118
  ref_key: "rootRef",
119
119
  ref: B
120
- }, ne.value), [
120
+ }, te.value), [
121
121
  i(e.$slots, "label", E({ for: N }, ee), () => [
122
122
  e.label ? (r(), l("label", {
123
123
  key: 0,
@@ -128,7 +128,7 @@ const be = { class: "relative" }, ye = {
128
128
  e.prependIcon || e.$slots.prepend ? (r(), l("div", ye, [
129
129
  i(e.$slots, "prepend", S(V(s(oe))), () => [
130
130
  d("div", {
131
- onClick: t[0] || (t[0] = (n) => e.handleIconClick(n, "prepend"))
131
+ onClick: n[0] || (n[0] = (t) => e.handleIconClick(t, "prepend"))
132
132
  }, [
133
133
  (r(), m(h(s(k)(e.prependIcon))))
134
134
  ])
@@ -137,7 +137,7 @@ const be = { class: "relative" }, ye = {
137
137
  e.prependInnerIcon || e.$slots["prepend-inner"] ? (r(), l("div", me, [
138
138
  i(e.$slots, "prepend-inner", {}, () => [
139
139
  d("div", {
140
- onClick: t[1] || (t[1] = (n) => e.handleIconClick(n, "prependInner"))
140
+ onClick: n[1] || (n[1] = (t) => e.handleIconClick(t, "prependInner"))
141
141
  }, [
142
142
  (r(), m(h(s(k)(e.prependInnerIcon))))
143
143
  ])
@@ -147,7 +147,7 @@ const be = { class: "relative" }, ye = {
147
147
  ref_key: "textareaRef",
148
148
  ref: p,
149
149
  value: s(v),
150
- rows: e.autoGrow ? 1 : e.rows,
150
+ rows: e.autoGrow ? void 0 : e.rows,
151
151
  disabled: e.disabled,
152
152
  readonly: e.readonly,
153
153
  placeholder: e.placeholder,
@@ -157,8 +157,8 @@ const be = { class: "relative" }, ye = {
157
157
  onKeydown: ae(O, ["enter"]),
158
158
  onFocus: Q,
159
159
  onBlur: U,
160
- onClick: t[2] || (t[2] = (n) => e.$emit("click:control", n)),
161
- onMousedown: t[3] || (t[3] = (n) => e.$emit("mousedown:control", n))
160
+ onClick: n[2] || (n[2] = (t) => e.$emit("click:control", t)),
161
+ onMousedown: n[3] || (n[3] = (t) => e.$emit("mousedown:control", t))
162
162
  }, null, 42, he),
163
163
  e.clearable && s(v) ? (r(), l("div", {
164
164
  key: 2,
@@ -167,7 +167,7 @@ const be = { class: "relative" }, ye = {
167
167
  i(e.$slots, "clear", S(V(R)), () => [
168
168
  d("button", {
169
169
  type: "button",
170
- onClick: t[4] || (t[4] = (...n) => s(D) && s(D)(...n)),
170
+ onClick: n[4] || (n[4] = (...t) => s(D) && s(D)(...t)),
171
171
  class: "text-gray-500 hover:text-gray-700"
172
172
  }, [
173
173
  (r(), m(h(s(k)(e.clearIcon))))
@@ -177,16 +177,16 @@ const be = { class: "relative" }, ye = {
177
177
  e.appendInnerIcon || e.$slots["append-inner"] ? (r(), l("div", ke, [
178
178
  i(e.$slots, "append-inner", {}, () => [
179
179
  d("div", {
180
- onClick: t[5] || (t[5] = (n) => e.handleIconClick(n, "appendInner"))
180
+ onClick: n[5] || (n[5] = (t) => e.handleIconClick(t, "appendInner"))
181
181
  }, [
182
182
  (r(), m(h(s(k)(e.appendInnerIcon))))
183
183
  ])
184
184
  ])
185
185
  ])) : u("", !0),
186
186
  e.appendIcon || e.$slots.append ? (r(), l("div", Ce, [
187
- i(e.$slots, "append", S(V(s(te))), () => [
187
+ i(e.$slots, "append", S(V(s(ne))), () => [
188
188
  d("div", {
189
- onClick: t[6] || (t[6] = (n) => e.handleIconClick(n, "append"))
189
+ onClick: n[6] || (n[6] = (t) => e.handleIconClick(t, "append"))
190
190
  }, [
191
191
  (r(), m(h(s(k)(e.appendIcon))))
192
192
  ])
@@ -210,11 +210,11 @@ const be = { class: "relative" }, ye = {
210
210
  class: b(["text-xs mt-1 space-y-1", { "text-red-500": s(f), "text-gray-500": !s(f) }])
211
211
  }, [
212
212
  i(e.$slots, "details", {}, () => [
213
- s(f) ? (r(!0), l(ie, { key: 0 }, de(s(w), (n, g) => i(e.$slots, "message", {
213
+ s(f) ? (r(!0), l(ie, { key: 0 }, de(s(w), (t, g) => i(e.$slots, "message", {
214
214
  key: g,
215
- message: n
215
+ message: t
216
216
  }, () => [
217
- d("div", null, y(n), 1)
217
+ d("div", null, y(t), 1)
218
218
  ])), 128)) : e.hint ? i(e.$slots, "hint", {
219
219
  key: 1,
220
220
  hint: e.hint
@@ -1,6 +1,6 @@
1
- import { ref as l, computed as m, watch as G, nextTick as i, onMounted as R, onBeforeUnmount as T } from "vue";
1
+ import { ref as l, computed as m, watch as R, nextTick as i, onMounted as T, onBeforeUnmount as $ } from "vue";
2
2
  function F(t, v) {
3
- const c = l(null), o = l(""), f = l(t.modelValue), J = l(!1), s = l([]), y = l(null), d = m(() => t.formatModel === "json" || t.formatModel === "auto" && typeof t.modelValue == "object");
3
+ const c = l(null), o = l(""), f = l(t.modelValue), H = l(!1), s = l([]), y = l(null), d = m(() => t.formatModel === "json" || t.formatModel === "auto" && typeof t.modelValue == "object");
4
4
  function M(e) {
5
5
  if (d.value && e != null)
6
6
  try {
@@ -19,11 +19,11 @@ function F(t, v) {
19
19
  }
20
20
  return e;
21
21
  }
22
- function I(e) {
22
+ function O(e) {
23
23
  const n = S(e);
24
24
  f.value = n, v("update:modelValue", n), v("change", n);
25
25
  }
26
- G(() => t.modelValue, (e) => {
26
+ R(() => t.modelValue, (e) => {
27
27
  const n = JSON.stringify(e), u = JSON.stringify(f.value);
28
28
  n !== u && (f.value = e, o.value = M(e), t.autoGrow && i(g));
29
29
  });
@@ -31,24 +31,24 @@ function F(t, v) {
31
31
  const e = c.value;
32
32
  !e || !t.autoGrow || i(() => {
33
33
  e.style.height = "auto";
34
- const n = parseInt(getComputedStyle(e).lineHeight || "24") * (t.rows || 2), u = Math.min(e.scrollHeight, t.maxHeight || 9999);
35
- e.style.height = `${Math.max(n, u)}px`;
34
+ const n = t.maxHeight || 9999, u = e.scrollHeight;
35
+ e.style.height = `${Math.min(u, n)}px`;
36
36
  const r = e.selectionStart;
37
37
  e.setSelectionRange(r, r);
38
38
  });
39
39
  }
40
- R(() => {
40
+ T(() => {
41
41
  o.value = M(t.modelValue), i(() => {
42
42
  t.autoGrow && g();
43
43
  });
44
- }), T(() => {
44
+ }), $(() => {
45
45
  y.value && cancelAnimationFrame(y.value);
46
46
  });
47
47
  const V = m(() => {
48
48
  var e;
49
49
  return !!(s.value.length || (e = t.errorMessages) != null && e.length);
50
- }), O = m(() => V.value ? [...t.errorMessages || [], ...s.value].slice(0, t.maxErrors) : []);
51
- function E() {
50
+ }), E = m(() => V.value ? [...t.errorMessages || [], ...s.value].slice(0, t.maxErrors) : []);
51
+ function I() {
52
52
  const e = t.rules || [], n = t.required && !o.value ? null : S(o.value), u = [];
53
53
  for (const r of e) {
54
54
  const a = typeof r == "function" ? r(n) : r;
@@ -60,27 +60,27 @@ function F(t, v) {
60
60
  s.value = [];
61
61
  }
62
62
  function j(e) {
63
- var x;
63
+ var w;
64
64
  if (!d.value || e.key !== "Enter") return;
65
65
  const n = c.value;
66
66
  if (!n) return;
67
- const u = n.selectionStart, r = o.value, a = " ", h = r.slice(0, u), A = r.slice(u), C = h.lastIndexOf(`
68
- `) + 1, w = `
69
- ${((x = h.slice(C).match(/^\s*/)) == null ? void 0 : x[0]) ?? ""}${a}`;
70
- o.value = h + w + A, i(() => {
71
- const H = u + w.length;
72
- n.setSelectionRange(H, H);
67
+ const u = n.selectionStart, r = o.value, a = " ", h = r.slice(0, u), A = r.slice(u), G = h.lastIndexOf(`
68
+ `) + 1, x = `
69
+ ${((w = h.slice(G).match(/^\s*/)) == null ? void 0 : w[0]) ?? ""}${a}`;
70
+ o.value = h + x + A, i(() => {
71
+ const J = u + x.length;
72
+ n.setSelectionRange(J, J);
73
73
  }), e.preventDefault();
74
74
  }
75
75
  return {
76
76
  inputRef: c,
77
77
  internalValue: o,
78
- isFocused: J,
78
+ isFocused: H,
79
79
  hasError: V,
80
- displayedMessages: O,
81
- validate: E,
80
+ displayedMessages: E,
81
+ validate: I,
82
82
  resetValidation: N,
83
- updateModel: I,
83
+ updateModel: O,
84
84
  adjustHeight: g,
85
85
  handleJsonEnter: j
86
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.406",
3
+ "version": "0.1.408",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",