adverich-kun-ui 0.1.53 → 0.1.54

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,17 +1,17 @@
1
- import { mergeModels as T, useModel as b, watchEffect as fe, resolveComponent as d, createBlock as m, openBlock as r, unref as e, withKeys as pe, isRef as _, createSlots as ve, withCtx as s, createElementBlock as w, createCommentVNode as V, createVNode as u, Fragment as z, renderList as P, createElementVNode as U, createTextVNode as c, toDisplayString as k, normalizeClass as ye } from "vue";
1
+ import { mergeModels as T, useModel as b, ref as _, onMounted as pe, onUnmounted as ve, watchEffect as ye, watch as Ve, resolveComponent as d, createBlock as m, openBlock as r, unref as e, withKeys as ke, isRef as z, createSlots as Ie, withCtx as s, createElementBlock as w, createCommentVNode as V, createVNode as u, Fragment as P, renderList as U, createElementVNode as B, createTextVNode as c, toDisplayString as k, normalizeClass as Ce } from "vue";
2
2
  import { isArray as M } from "../utils/helpers.js";
3
- import { useAutocomplete as Ve } from "../composables/useAutocomplete.js";
4
- import { useIntersect as ke } from "../composables/useIntersect.js";
5
- import { KunAutocompleteProps as Ie } from "../composables/KunAutocompleteProps.js";
6
- import Ce from "../../../KunTextField/src/components/KunTextField.vue.js";
7
- import ge from "../../../KunChip/src/components/KunChip.vue.js";
3
+ import { useAutocomplete as ge } from "../composables/useAutocomplete.js";
4
+ import { useIntersect as be } from "../composables/useIntersect.js";
5
+ import { KunAutocompleteProps as we } from "../composables/KunAutocompleteProps.js";
6
+ import Me from "../../../KunTextField/src/components/KunTextField.vue.js";
7
+ import Se from "../../../KunChip/src/components/KunChip.vue.js";
8
8
  import I from "../../../KunIcon/src/components/KunIcon.vue.js";
9
- const be = {
9
+ const he = {
10
10
  key: 0,
11
11
  class: "d-flex justify-center align-center"
12
- }, we = { class: "d-flex justify-center align-center" }, Ne = {
12
+ }, $e = { class: "d-flex justify-center align-center" }, Te = {
13
13
  __name: "KunAutocomplete",
14
- props: /* @__PURE__ */ T(Ie, {
14
+ props: /* @__PURE__ */ T(we, {
15
15
  modelValue: { default: null },
16
16
  modelModifiers: {},
17
17
  items: { default: [], type: Array, required: !0 },
@@ -20,42 +20,42 @@ const be = {
20
20
  itemsPerIntersectionModifiers: {}
21
21
  }),
22
22
  emits: /* @__PURE__ */ T(["createItem", "validation"], ["update:modelValue", "update:items", "update:itemsPerIntersection"]),
23
- setup(f, { emit: B }) {
24
- const o = b(f, "modelValue"), D = b(f, "items"), F = b(f, "itemsPerIntersection"), i = f, C = B, S = ref(null), {
23
+ setup(f, { emit: D }) {
24
+ const o = b(f, "modelValue"), F = b(f, "items"), j = b(f, "itemsPerIntersection"), i = f, C = D, S = _(null), {
25
25
  selectedItem: a,
26
26
  textFieldRef: h,
27
27
  listRef: $,
28
28
  menuModel: p,
29
29
  search: g,
30
- removeItem: j,
31
- clearSelection: q,
30
+ removeItem: q,
31
+ clearSelection: H,
32
32
  lightReset: K,
33
- openMenu: H,
34
- focusOnMenu: G,
35
- onMenuKeydown: J,
36
- setSelectedItemValue: Q,
37
- getSelectedItem: W,
38
- textArr: X,
39
- getItemText: Y,
40
- createItem: Z,
41
- checkDisabled: ee,
42
- filteredItems: te,
33
+ openMenu: G,
34
+ focusOnMenu: J,
35
+ onMenuKeydown: Q,
36
+ setSelectedItemValue: W,
37
+ getSelectedItem: X,
38
+ textArr: Y,
39
+ getItemText: Z,
40
+ createItem: ee,
41
+ checkDisabled: te,
42
+ filteredItems: le,
43
43
  itemToString: L,
44
44
  placeholder: x,
45
- isCloseOnSelect: le,
46
- handleIntersect: ne,
45
+ isCloseOnSelect: ne,
46
+ handleIntersect: oe,
47
47
  intersectObserved: R
48
- } = Ve(i, C, o, D, F), { observe: oe, stopObserver: se } = ke(() => ne(), "0px 0px 200px 0px", R, p, S);
49
- function re() {
50
- R.value || oe();
48
+ } = ge(i, C, o, F, j), { observe: se, stopObserver: re } = be(() => oe(), "0px 0px 200px 0px", R, p, S);
49
+ function ie() {
50
+ R.value || se();
51
51
  }
52
- onMounted(() => i.focusOnRender ? h.value.focus() : ""), onUnmounted(() => se()), fe(() => {
53
- isObject(o.value) && !isNotEmpty(o.value) && (a.value = {}), M(o.value) && !isNotEmpty(o.value) && (a.value = []), o.value === null && (a.value = null), Q();
52
+ pe(() => i.focusOnRender ? h.value.focus() : ""), ve(() => re()), ye(() => {
53
+ isObject(o.value) && !isNotEmpty(o.value) && (a.value = {}), M(o.value) && !isNotEmpty(o.value) && (a.value = []), o.value === null && (a.value = null), W();
54
54
  });
55
- function ie(t) {
55
+ function ae(t) {
56
56
  return o.value === null || o.value === void 0 ? !1 : i.multiple ? o.value.find((l) => l[i.itemValue] === t[i.itemValue]) : x.value === t[i.itemTitle];
57
57
  }
58
- const v = ref(""), N = (t) => {
58
+ const v = _(""), N = (t) => {
59
59
  for (const l of i.rules) {
60
60
  const y = l(t);
61
61
  if (y !== !0)
@@ -63,73 +63,73 @@ const be = {
63
63
  }
64
64
  return v.value = "", C("validation", !0), !0;
65
65
  };
66
- return watch(() => o.value, (t, l) => {
66
+ return Ve(() => o.value, (t, l) => {
67
67
  isNotEmpty(i.rules) && N(t);
68
68
  }), (t, l) => {
69
- const y = d("VBtn"), O = d("VListItem"), ae = d("VListItemTitle"), ue = d("VListItemSubtitle"), de = d("VList"), me = d("VMenu");
70
- return r(), m(Ce, {
69
+ const y = d("VBtn"), O = d("VListItem"), ue = d("VListItemTitle"), de = d("VListItemSubtitle"), me = d("VList"), ce = d("VMenu");
70
+ return r(), m(Me, {
71
71
  modelValue: e(g),
72
- "onUpdate:modelValue": l[3] || (l[3] = (n) => _(g) ? g.value = n : null),
72
+ "onUpdate:modelValue": l[3] || (l[3] = (n) => z(g) ? g.value = n : null),
73
73
  label: t.label,
74
74
  dirty: "",
75
75
  "hide-details": t.hideDetails,
76
76
  density: t.density,
77
- onKeydown: e(H),
78
- onKeyup: pe(e(G), ["down"]),
77
+ onKeydown: e(G),
78
+ onKeyup: ke(e(J), ["down"]),
79
79
  ref_key: "textFieldRef",
80
80
  ref: h,
81
81
  autocomplete: "off",
82
82
  width: "100%",
83
83
  placeholder: e(M)(e(a)) && e(a).length ? "" : e(x),
84
- error: !!e(v),
84
+ error: !!v.value,
85
85
  onFocus: l[4] || (l[4] = (n) => {
86
86
  N(o.value);
87
87
  }),
88
- "error-messages": e(v)
89
- }, ve({
88
+ "error-messages": v.value
89
+ }, Ie({
90
90
  default: s(() => [
91
- e(M)(e(a)) ? (r(), w("div", be, [
92
- (r(!0), w(z, null, P(e(a), (n) => (r(), m(ge, {
91
+ e(M)(e(a)) ? (r(), w("div", he, [
92
+ (r(!0), w(P, null, U(e(a), (n) => (r(), m(Se, {
93
93
  size: "small",
94
94
  class: "ml-1"
95
95
  }, {
96
96
  default: s(() => [
97
- U("div", we, [
98
- c(k(e(Y)(n, t.itemTitle)) + " ", 1),
97
+ B("div", $e, [
98
+ c(k(e(Z)(n, t.itemTitle)) + " ", 1),
99
99
  u(I, {
100
100
  color: "error",
101
101
  icon: "$mdiClose",
102
102
  size: "small",
103
103
  class: "ml-1",
104
- onClick: (ce) => e(j)(n)
104
+ onClick: (fe) => e(q)(n)
105
105
  }, null, 8, ["onClick"])
106
106
  ])
107
107
  ]),
108
108
  _: 2
109
109
  }, 1024))), 256))
110
110
  ])) : V("", !0),
111
- u(me, {
111
+ u(ce, {
112
112
  "onClick:outside": l[1] || (l[1] = (n) => e(K)()),
113
113
  modelValue: e(p),
114
- "onUpdate:modelValue": l[2] || (l[2] = (n) => _(p) ? p.value = n : null),
114
+ "onUpdate:modelValue": l[2] || (l[2] = (n) => z(p) ? p.value = n : null),
115
115
  activator: "parent",
116
- onKeydown: e(J),
117
- "close-on-content-click": e(le),
116
+ onKeydown: e(Q),
117
+ "close-on-content-click": e(ne),
118
118
  "max-height": t.maxHeight
119
119
  }, {
120
120
  default: s(() => [
121
- u(de, {
122
- "onUpdate:selected": e(W),
121
+ u(me, {
122
+ "onUpdate:selected": e(X),
123
123
  "onClick:select": l[0] || (l[0] = (n) => e(K)()),
124
124
  ref_key: "listRef",
125
125
  ref: $,
126
- onMouseover: re
126
+ onMouseover: ie
127
127
  }, {
128
128
  default: s(() => [
129
129
  t.hasCreateItem ? (r(), m(O, { key: 0 }, {
130
130
  default: s(() => [
131
131
  u(y, {
132
- onClick: e(Z),
132
+ onClick: e(ee),
133
133
  class: "w-100",
134
134
  color: "success"
135
135
  }, {
@@ -141,24 +141,24 @@ const be = {
141
141
  ]),
142
142
  _: 1
143
143
  })) : V("", !0),
144
- (r(!0), w(z, null, P(e(te), (n, ce) => {
144
+ (r(!0), w(P, null, U(e(le), (n, fe) => {
145
145
  var A, E;
146
146
  return r(), m(O, {
147
147
  key: ((A = n.id) == null ? void 0 : A.toString()) ?? n.name,
148
148
  value: n,
149
- disabled: e(ee)(n),
150
- class: ye(ie(n) ? t.selectedColor : t.bgItemListColor),
149
+ disabled: e(te)(n),
150
+ class: Ce(ae(n) ? t.selectedColor : t.bgItemListColor),
151
151
  density: t.density,
152
152
  id: ((E = n.id) == null ? void 0 : E.toString()) ?? n.name
153
153
  }, {
154
154
  default: s(() => [
155
- u(ae, { class: "text-wrap" }, {
155
+ u(ue, { class: "text-wrap" }, {
156
156
  default: s(() => [
157
- c(k(e(L)(n, e(X), "hasDefault")), 1)
157
+ c(k(e(L)(n, e(Y), "hasDefault")), 1)
158
158
  ]),
159
159
  _: 2
160
160
  }, 1024),
161
- u(ue, {
161
+ u(de, {
162
162
  class: "text-wrap",
163
163
  textContent: k(t.itemSubtitle ? e(L)(n, t.itemSubtitle) : "")
164
164
  }, null, 8, ["textContent"])
@@ -166,7 +166,7 @@ const be = {
166
166
  _: 2
167
167
  }, 1032, ["value", "disabled", "class", "density", "id"]);
168
168
  }), 128)),
169
- U("div", {
169
+ B("div", {
170
170
  ref_key: "intersectRef",
171
171
  ref: S
172
172
  }, null, 512)
@@ -184,7 +184,7 @@ const be = {
184
184
  fn: s(() => [
185
185
  t.clearable && e(a) ? (r(), m(I, {
186
186
  key: 0,
187
- onClick: e(q),
187
+ onClick: e(H),
188
188
  size: "small",
189
189
  color: "error",
190
190
  icon: "$mdiClose",
@@ -219,5 +219,5 @@ const be = {
219
219
  }
220
220
  };
221
221
  export {
222
- Ne as default
222
+ Te as default
223
223
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",