adverich-kun-ui 0.1.528 → 0.1.529

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
- import { ref as d, computed as M, watch as H, nextTick as F } from "vue";
2
- import { isArray as S, isObject as O, fullCopy as L } from "../../../../utils/utils.js";
1
+ import { ref as d, computed as F, watch as L, nextTick as N } from "vue";
2
+ import { isArray as S, isObject as O, fullCopy as x } from "../../../../utils/utils.js";
3
3
  function U(t, y, c, v) {
4
- const l = d(null), b = d(null), x = d(null), i = d(!1), g = d(""), N = (e, n) => {
4
+ const l = d(null), b = d(null), T = d(null), i = d(!1), g = d(""), B = (e, n) => {
5
5
  if (t.returnObject) return s(e, t.itemTitle);
6
6
  const u = l.value.find((f) => f[t.itemValue] === e);
7
7
  return s(u, t.itemTitle);
8
- }, B = M(() => l.value !== null && l.value !== void 0 ? S(l.value) ? l.value.length ? s(l.value, t.itemTitle, "hasDefault") : t.placeholderText : O(l.value) ? s(l.value, t.itemTitle, "hasDefault") : l.value.toString() : v.value.length ? t.placeholderText : t.textNoItems), R = M(() => {
8
+ }, R = F(() => l.value !== null && l.value !== void 0 ? S(l.value) ? l.value.length ? s(l.value, t.itemTitle, "hasDefault") : t.placeholderText : O(l.value) ? s(l.value, t.itemTitle, "hasDefault") : l.value.toString() : v.value.length ? t.placeholderText : t.textNoItems), C = F(() => {
9
9
  const e = t.itemText;
10
10
  return typeof e == "string" && e.includes(",") ? e.split(",") : e;
11
11
  });
@@ -40,73 +40,73 @@ function U(t, y, c, v) {
40
40
  }
41
41
  return S(e) ? t.returnObject ? e.map((r) => r[n]).join(" - ") : e.map((r) => r).join(" - ") : u && typeof e != "number" ? e.includes(",") ? e.split(",") : e : ((f = e == null ? void 0 : e.toString) == null ? void 0 : f.call(e)) ?? "";
42
42
  }
43
- function C(e) {
43
+ function D(e) {
44
44
  try {
45
45
  let n = null;
46
- if (l.value = L(e), !t.multiple)
47
- t.returnObject ? n = e : O(e) ? t.itemValue ? n = e[t.itemValue] : n = Object.values(e)[0] : n = e, i.value = !1, j();
48
- else if (T(e)) {
49
- e && I(e);
46
+ if (l.value = x(e), !t.multiple)
47
+ t.returnObject ? n = x(e) : O(e) ? t.itemValue ? n = e[t.itemValue] : n = Object.values(e)[0] : n = e, i.value = !1, j();
48
+ else if (I(e)) {
49
+ e && A(e);
50
50
  return;
51
51
  } else {
52
- const u = t.returnObject ? e : O(e) ? t.itemValue ? e[t.itemValue] : Object.values(e)[0] : e;
52
+ const u = t.returnObject ? x(e) : O(e) ? t.itemValue ? e[t.itemValue] : Object.values(e)[0] : e;
53
53
  n = [...c.value || [], u];
54
54
  }
55
55
  c.value === n ? y("update:modelValue", n) : c.value = n, y("selectedItem", l.value);
56
56
  } catch (n) {
57
57
  console.log(n);
58
58
  } finally {
59
- F(() => {
60
- A();
59
+ N(() => {
60
+ k();
61
61
  });
62
62
  }
63
63
  }
64
- H(
64
+ L(
65
65
  [() => c.value, () => v.value],
66
66
  ([e]) => {
67
- const n = D(e);
67
+ const n = J(e);
68
68
  JSON.stringify(l.value) !== JSON.stringify(n) && (l.value = n);
69
69
  },
70
70
  { immediate: !0 }
71
71
  );
72
- function D(e) {
72
+ function J(e) {
73
73
  return e == null ? null : t.multiple && Array.isArray(e) ? t.returnObject ? e : e.map((u) => v.value.find((f) => f[t.itemValue] === u)).filter(Boolean) : t.returnObject ? e : v.value.find(
74
74
  (u) => typeof u == "object" ? u[t.itemValue] === e : u === e
75
75
  ) ?? e;
76
76
  }
77
- function T(e) {
77
+ function I(e) {
78
78
  if (!c.value || !e) return !1;
79
79
  const n = t.returnObject ? e : e[t.itemValue];
80
80
  return c.value.some((u) => u === n);
81
81
  }
82
- function I(e) {
82
+ function A(e) {
83
83
  const n = t.returnObject ? e : e[t.itemValue];
84
84
  c.value = c.value.filter((u) => u !== n);
85
85
  }
86
- function A(e) {
87
- t.clearSearchOnSelect && (g.value = ""), t.clearOnSelect && E(), t.focusOnSelect && j();
86
+ function k(e) {
87
+ t.clearSearchOnSelect && (g.value = ""), t.clearOnSelect && M(), t.focusOnSelect && j();
88
88
  }
89
- function k() {
89
+ function w() {
90
90
  i.value || (i.value = !0);
91
91
  }
92
- function J() {
92
+ function V() {
93
93
  i.value && (i.value = !1);
94
94
  }
95
- function V() {
95
+ function K() {
96
96
  i.value = !i.value;
97
97
  }
98
- function w(e) {
98
+ function E(e) {
99
99
  return e.length === 1 && e.match(/\w/);
100
100
  }
101
101
  function j() {
102
102
  b.value.inputField.focus();
103
103
  }
104
- function K() {
105
- i.value = !0, x.value && b.value.$el.focus();
104
+ function $() {
105
+ i.value = !0, T.value && b.value.$el.focus();
106
106
  }
107
- function $(e) {
107
+ function q(e) {
108
108
  const n = e.key;
109
- (w(n) || n === "Backspace") && (k(), j(), F(() => {
109
+ (E(n) || n === "Backspace") && (w(), j(), N(() => {
110
110
  var f;
111
111
  const u = (f = b.value) == null ? void 0 : f.inputField;
112
112
  if (u) {
@@ -115,43 +115,43 @@ function U(t, y, c, v) {
115
115
  }
116
116
  }));
117
117
  }
118
- function q() {
118
+ function z() {
119
119
  i.value = !1, y("createItem");
120
120
  }
121
- function z(e) {
121
+ function G(e) {
122
122
  let n = c.value.indexOf(e);
123
123
  c.value.splice(n, 1);
124
124
  }
125
- function E() {
125
+ function M() {
126
126
  g.value !== "" && (g.value = ""), c.value !== null && (c.value = null), l.value !== null && (l.value = null);
127
127
  }
128
- function G(e) {
128
+ function H(e) {
129
129
  return !!e.disabled;
130
130
  }
131
131
  return {
132
132
  selectedItem: l,
133
133
  textFieldRef: b,
134
- listRef: x,
134
+ listRef: T,
135
135
  menuModel: i,
136
136
  search: g,
137
- getArrayText: N,
138
- placeholder: B,
139
- textArr: R,
137
+ getArrayText: B,
138
+ placeholder: R,
139
+ textArr: C,
140
140
  itemToString: s,
141
- getSelectedItem: C,
142
- checkIfValueExist: T,
143
- removeFromArray: I,
144
- lightReset: A,
145
- openMenu: k,
146
- closeMenu: J,
147
- toggleMenu: V,
148
- focusOnMenu: K,
149
- onMenuKeydown: $,
150
- createItem: q,
151
- removeItem: z,
152
- clearSelection: E,
153
- checkDisabled: G,
154
- isAlphanumeric: w
141
+ getSelectedItem: D,
142
+ checkIfValueExist: I,
143
+ removeFromArray: A,
144
+ lightReset: k,
145
+ openMenu: w,
146
+ closeMenu: V,
147
+ toggleMenu: K,
148
+ focusOnMenu: $,
149
+ onMenuKeydown: q,
150
+ createItem: z,
151
+ removeItem: G,
152
+ clearSelection: M,
153
+ checkDisabled: H,
154
+ isAlphanumeric: E
155
155
  };
156
156
  }
157
157
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.528",
3
+ "version": "0.1.529",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",