adverich-kun-ui 0.1.400 → 0.1.402

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,11 +1,11 @@
1
1
  import { ref as v, computed as j, watch as q, nextTick as C } from "vue";
2
2
  import { format as h, clamp as w, toRawNumberString as S, fromRawString as L } from "./numberFormatUtils.js";
3
3
  function O(t, o) {
4
- const u = v(""), a = v(null), F = v(null), x = v(!1), s = v(0);
4
+ const u = v(""), a = v(null), K = v(null), x = v(!1), s = v(0);
5
5
  let e = "";
6
- const K = j(() => Number(t.precision) > 0 ? Number(t.precision) + 1 : 1);
6
+ const $ = j(() => Number(t.precision) > 0 ? Number(t.precision) + 1 : 1);
7
7
  function d(n) {
8
- return Number(t.precision) === 0 ? n === "" ? "0" : n.replace(/^0+(\d)/, "$1") : n.padStart(K.value, "0");
8
+ return Number(t.precision) === 0 ? n === "" ? "0" : n.replace(/^0+(\d)/, "$1") : n.padStart($.value, "0");
9
9
  }
10
10
  q(() => t.modelValue, (n) => {
11
11
  if (n == null || isNaN(n))
@@ -15,7 +15,7 @@ function O(t, o) {
15
15
  e = S(c, Number(t.precision)), e.length < Number(t.precision) + 1 && (e = e.padStart(Number(t.precision) + 1, "0")), u.value = h(c, t);
16
16
  }
17
17
  }, { immediate: !0 });
18
- function $(n) {
18
+ function B(n) {
19
19
  const { key: i, target: c } = n, l = /^[0-9]$/.test(i), A = i === "Backspace", y = i === "Delete", g = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(i), b = n.ctrlKey || n.metaKey, m = i === "Home", z = i === "End";
20
20
  if (m) {
21
21
  C(() => {
@@ -34,10 +34,10 @@ function O(t, o) {
34
34
  return;
35
35
  }
36
36
  if (g || b) return;
37
- const D = E(u.value, c.selectionStart);
37
+ const D = M(u.value, c.selectionStart);
38
38
  n.preventDefault();
39
- const k = Number(t.precision) + 1;
40
- for (; e.length < k; )
39
+ const F = Number(t.precision) + 1;
40
+ for (; e.length < F; )
41
41
  e = "0" + e;
42
42
  const f = R(u.value, D);
43
43
  if (l)
@@ -51,7 +51,7 @@ function O(t, o) {
51
51
  }
52
52
  r > 0 && (e = e.slice(0, N) + e.slice(r), e = d(e), s.value = N);
53
53
  } else y && D < u.value.length && f < e.length && (e = e.substring(0, f) + e.substring(f + 1), s.value = f);
54
- for (e = d(e); e.length < k; )
54
+ for (e = d(e); e.length < F; )
55
55
  e = "0" + e;
56
56
  V();
57
57
  }
@@ -61,7 +61,7 @@ function O(t, o) {
61
61
  /\d/.test(n[l]) && c++;
62
62
  return c;
63
63
  }
64
- function B(n, i) {
64
+ function E(n, i) {
65
65
  let c = 0;
66
66
  for (let l = 0; l < n.length; l++)
67
67
  if (/\d/.test(n[l])) {
@@ -74,7 +74,7 @@ function O(t, o) {
74
74
  return l + 1;
75
75
  return n.length;
76
76
  }
77
- function E(n, i) {
77
+ function M(n, i) {
78
78
  for (; i < n.length && !/\d/.test(n[i]); )
79
79
  i++;
80
80
  if (i >= n.length)
@@ -91,7 +91,7 @@ function O(t, o) {
91
91
  if (a.value)
92
92
  try {
93
93
  const b = u.value;
94
- let m = B(b, s.value);
94
+ let m = E(b, s.value);
95
95
  for (; m < b.length && !/\d/.test(b[m]); )
96
96
  m++;
97
97
  a.value.setSelectionRange(m, m);
@@ -100,12 +100,12 @@ function O(t, o) {
100
100
  }
101
101
  });
102
102
  }
103
- function M() {
103
+ function P() {
104
104
  x.value = !1, e = d(e);
105
105
  const n = L(e, Number(t.precision)), i = w(n, t.min, t.max);
106
106
  e = S(i, Number(t.precision)), e = d(e), u.value = h(i, t), o("update:modelValue", i), o("blur");
107
107
  }
108
- function P() {
108
+ function k() {
109
109
  var i;
110
110
  x.value = !0;
111
111
  const n = ((i = a.value) == null ? void 0 : i.selectionStart) || 0;
@@ -120,15 +120,15 @@ function O(t, o) {
120
120
  n = w(n - Number(t.step), t.min, t.max), e = S(n, Number(t.precision)), u.value = h(n, t), o("update:modelValue", n);
121
121
  }
122
122
  function I() {
123
- e = "0".repeat(Number(t.precision) + 1), s.value = Number(t.precision) + 1, V();
123
+ e = "0".repeat(Number(t.precision) + 1), s.value = Number(t.precision) + 1, k(), V();
124
124
  }
125
125
  return {
126
126
  inputValue: u,
127
127
  numberInput: a,
128
- rootRef: F,
129
- validateKey: $,
130
- handleFocus: P,
131
- handleBlur: M,
128
+ rootRef: K,
129
+ validateKey: B,
130
+ handleFocus: k,
131
+ handleBlur: P,
132
132
  onIncrement: T,
133
133
  onDecrement: H,
134
134
  onClear: I,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.400",
3
+ "version": "0.1.402",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",