adverich-kun-ui 0.1.330 → 0.1.332

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,34 +1,33 @@
1
- import { computed as r, watch as g } from "vue";
2
- function i(n, u) {
3
- const a = (l) => u.value.includes(l), h = (l) => {
4
- const o = u.value.indexOf(l);
5
- o === -1 ? u.value.push(l) : u.value.splice(o, 1);
1
+ import { computed as c, watch as g } from "vue";
2
+ function t(n, u) {
3
+ const e = (l) => u.value.includes(l), f = (l) => {
4
+ u.value.indexOf(l) === -1 ? u.value = [...u.value, l] : u.value = u.value.filter((S) => S.id !== l.id);
6
5
  }, v = () => {
7
6
  u.value = [...n.value];
8
- }, e = () => {
7
+ }, o = () => {
9
8
  u.value = [];
10
- }, f = () => {
11
- c.value ? e() : v();
12
- }, c = r(() => {
9
+ }, h = () => {
10
+ a.value ? o() : v();
11
+ }, a = c(() => {
13
12
  var l;
14
13
  return ((l = n.value) == null ? void 0 : l.length) > 0 && u.value.length === n.value.length;
15
- }), S = r(() => {
14
+ }), i = c(() => {
16
15
  var l;
17
16
  return ((l = n.value) == null ? void 0 : l.length) > 0 && u.value.length > 0 && u.value.length < n.value.length;
18
17
  });
19
- return g(() => n, (l, o) => {
20
- l !== o && e();
18
+ return g(() => n, (l, r) => {
19
+ l !== r && o();
21
20
  }, { deep: !0 }), {
22
21
  selectedItems: u,
23
- isSelected: a,
24
- toggleSelect: h,
22
+ isSelected: e,
23
+ toggleSelect: f,
25
24
  selectAll: v,
26
- clearSelection: e,
27
- toggleSelectAll: f,
28
- allSelected: c,
29
- someSelected: S
25
+ clearSelection: o,
26
+ toggleSelectAll: h,
27
+ allSelected: a,
28
+ someSelected: i
30
29
  };
31
30
  }
32
31
  export {
33
- i as default
32
+ t as default
34
33
  };
@@ -1,47 +1,48 @@
1
- import { ref as L, computed as p, createElementBlock as l, openBlock as s, normalizeClass as m, renderSlot as i, createElementVNode as a, normalizeProps as y, guardReactiveProps as k, unref as t, createCommentVNode as d, toDisplayString as b, createBlock as h, resolveDynamicComponent as C, Fragment as q, renderList as J, withDirectives as O, vShow as Q, createTextVNode as U } from "vue";
2
- import { kunTextareaProps as W } from "../composables/KunTextareaProps.js";
3
- import { useKunTextarea as X } from "../composables/useKunTextareaComposable.js";
1
+ import { ref as q, computed as p, createElementBlock as l, openBlock as s, mergeProps as J, renderSlot as i, createElementVNode as a, normalizeProps as y, guardReactiveProps as k, unref as t, createCommentVNode as d, toDisplayString as m, createBlock as h, resolveDynamicComponent as C, normalizeClass as g, Fragment as O, renderList as Q, withDirectives as U, vShow as W, createTextVNode as X } from "vue";
2
+ import { kunTextareaProps as Y } from "../composables/KunTextareaProps.js";
3
+ import { useKunTextarea as Z } from "../composables/useKunTextareaComposable.js";
4
4
  import { renderIconSlot as $ } from "../../../../utils/renderIcon.js";
5
- const Y = {
5
+ const x = {
6
6
  key: 0,
7
7
  class: "block text-sm font-medium mb-1"
8
- }, Z = { class: "relative" }, x = {
8
+ }, _ = { class: "relative" }, ee = {
9
9
  key: 0,
10
10
  class: "absolute left-2 top-2 flex items-center"
11
- }, _ = {
11
+ }, re = {
12
12
  key: 1,
13
13
  class: "absolute left-2 top-2 ml-1"
14
- }, ee = ["value", "rows", "disabled", "readonly", "placeholder"], oe = {
14
+ }, oe = ["value", "rows", "disabled", "readonly", "placeholder"], te = {
15
15
  key: 3,
16
16
  class: "absolute right-2 top-2 mr-1"
17
- }, re = {
17
+ }, ne = {
18
18
  key: 4,
19
19
  class: "absolute right-2 top-2 flex items-center"
20
- }, te = {
20
+ }, se = {
21
21
  key: 5,
22
22
  class: "mt-1"
23
- }, ne = { class: "h-1 w-full bg-gray-200 rounded overflow-hidden" }, se = {
23
+ }, le = { class: "h-1 w-full bg-gray-200 rounded overflow-hidden" }, ae = {
24
24
  key: 7,
25
25
  class: "text-xs text-right mt-1 text-gray-400"
26
- }, le = { key: 0 }, pe = {
26
+ }, ie = { key: 0 }, ve = {
27
27
  __name: "KunTextarea",
28
- props: W,
28
+ props: Y,
29
29
  emits: ["update:modelValue", "click:clear", "click:control", "update:focused", "mousedown:control"],
30
- setup(z, { expose: B, emit: S }) {
31
- const o = z, R = S, u = L(null), {
30
+ setup(B, { expose: S, emit: D }) {
31
+ const r = B, R = D, u = q(null), {
32
32
  isFocused: v,
33
33
  internalValue: c,
34
- updateValue: D,
35
- handleClear: V,
36
- adjustHeight: F,
37
- validate: M,
34
+ rootRef: V,
35
+ updateValue: F,
36
+ handleClear: z,
37
+ adjustHeight: M,
38
+ validate: P,
38
39
  reset: T,
39
40
  resetValidation: A,
40
41
  hasError: f,
41
42
  displayedMessages: w
42
- } = X(o, R, u), E = p(() => {
43
- const e = !!o.bgColor;
44
- switch (o.variant) {
43
+ } = Z(r, R, u), E = p(() => {
44
+ const e = !!r.bgColor;
45
+ switch (r.variant) {
45
46
  case "filled":
46
47
  return [
47
48
  e ? "" : "bg-gray-100 dark:bg-gray-900",
@@ -60,7 +61,7 @@ const Y = {
60
61
  return "";
61
62
  }
62
63
  }), G = p(() => {
63
- switch (o.density) {
64
+ switch (r.density) {
64
65
  case "comfortable":
65
66
  return "py-2";
66
67
  case "compact":
@@ -70,68 +71,69 @@ const Y = {
70
71
  }
71
72
  }), N = p(() => [
72
73
  "w-full resize-none p-2 transition-colors duration-150",
73
- o.inputClass,
74
+ r.inputClass,
74
75
  {
75
- "rounded-md": !o.tile,
76
- "rounded-none": o.tile,
77
- [`rounded-${o.rounded}`]: typeof o.rounded == "string" || typeof o.rounded == "number",
78
- "shadow-md": o.variant === "solo" && !o.flat,
79
- "shadow-none": o.flat,
80
- [`text-${o.textColor}`]: o.textColor,
81
- [`${o.bgColor}`]: o.bgColor,
82
- "text-gray-500 bg-gray-200": o.disabled,
83
- "focus:outline-none focus:ring-2": !o.disabled,
84
- [`focus:ring-${o.color}`]: o.color && !o.disabled && !f.value,
76
+ "rounded-md": !r.tile,
77
+ "rounded-none": r.tile,
78
+ [`rounded-${r.rounded}`]: typeof r.rounded == "string" || typeof r.rounded == "number",
79
+ "shadow-md": r.variant === "solo" && !r.flat,
80
+ "shadow-none": r.flat,
81
+ [`text-${r.textColor}`]: r.textColor,
82
+ [`${r.bgColor}`]: r.bgColor,
83
+ "text-gray-500 bg-gray-200": r.disabled,
84
+ "focus:outline-none focus:ring-2": !r.disabled,
85
+ [`focus:ring-${r.color}`]: r.color && !r.disabled && !f.value,
85
86
  "border-red-500 ring-red-500 focus:ring-red-500": f.value,
86
- "resize-none": o.noResize || o.autoGrow,
87
- resize: !o.noResize && !o.autoGrow
87
+ "resize-none": r.noResize || r.autoGrow,
88
+ resize: !r.noResize && !r.autoGrow
88
89
  }
89
- ]), P = p(() => [
90
+ ]), H = p(() => [
90
91
  "relative w-full",
91
- o.class,
92
- o.wrapperClass
93
- ]), I = p(() => o.counter === !0 ? 25 : typeof o.counter == "number" || typeof o.counter == "string" ? o.counter : null), H = p(() => o.persistentCounter ? !0 : !!o.counter && v.value), K = p(() => typeof o.clearIcon == "string" ? o.clearIcon : "i-heroicons-x-mark-20-solid");
94
- function g(e, n) {
92
+ r.class,
93
+ r.wrapperClass
94
+ ]), I = p(() => r.counter === !0 ? 25 : typeof r.counter == "number" || typeof r.counter == "string" ? r.counter : null), K = p(() => r.persistentCounter ? !0 : !!r.counter && v.value), j = p(() => typeof r.clearIcon == "string" ? r.clearIcon : "i-heroicons-x-mark-20-solid");
95
+ function b(e, n) {
95
96
  R(`click:${n}`, e);
96
97
  }
97
- return B({
98
- validate: M,
98
+ return S({
99
+ validate: P,
99
100
  reset: T,
100
101
  resetValidation: A,
101
102
  errorMessages: w,
102
103
  isValid: p(() => !f.value),
103
- rootRef,
104
+ rootRef: V,
104
105
  focus: () => {
105
106
  var e;
106
107
  return (e = u.value) == null ? void 0 : e.focus();
107
108
  }
108
- }), (e, n) => (s(), l("div", {
109
- class: m(P.value),
110
- ref: "rootRef"
111
- }, [
109
+ }), (e, n) => (s(), l("div", J({
110
+ class: H.value,
111
+ ref_key: "rootRef",
112
+ ref: V
113
+ }, e.$attrs), [
112
114
  i(e.$slots, "label", y(k({ label: e.label, isFocused: t(v), isActive: !!t(c), controlRef: u.value, focus: () => {
113
- var r;
114
- return (r = u.value) == null ? void 0 : r.focus();
115
+ var o;
116
+ return (o = u.value) == null ? void 0 : o.focus();
115
117
  }, blur: () => {
116
- var r;
117
- return (r = u.value) == null ? void 0 : r.blur();
118
- }, props: o })), () => [
119
- e.label ? (s(), l("label", Y, b(e.label), 1)) : d("", !0)
118
+ var o;
119
+ return (o = u.value) == null ? void 0 : o.blur();
120
+ }, props: r })), () => [
121
+ e.label ? (s(), l("label", x, m(e.label), 1)) : d("", !0)
120
122
  ]),
121
- a("div", Z, [
122
- e.prependIcon || e.$slots.prepend ? (s(), l("div", x, [
123
+ a("div", _, [
124
+ e.prependIcon || e.$slots.prepend ? (s(), l("div", ee, [
123
125
  i(e.$slots, "prepend", y(k(e.prependSlotBindings)), () => [
124
126
  a("div", {
125
- onClick: n[0] || (n[0] = (r) => g(r, "prepend"))
127
+ onClick: n[0] || (n[0] = (o) => b(o, "prepend"))
126
128
  }, [
127
129
  (s(), h(C(t($)(e.prependIcon))))
128
130
  ])
129
131
  ])
130
132
  ])) : d("", !0),
131
- e.prependInnerIcon || e.$slots["prepend-inner"] ? (s(), l("div", _, [
133
+ e.prependInnerIcon || e.$slots["prepend-inner"] ? (s(), l("div", re, [
132
134
  i(e.$slots, "prepend-inner", {}, () => [
133
135
  a("div", {
134
- onClick: n[1] || (n[1] = (r) => g(r, "prependInner"))
136
+ onClick: n[1] || (n[1] = (o) => b(o, "prependInner"))
135
137
  }, [
136
138
  (s(), h(C(t($)(e.prependInnerIcon))))
137
139
  ])
@@ -145,67 +147,67 @@ const Y = {
145
147
  disabled: e.disabled,
146
148
  readonly: e.readonly,
147
149
  placeholder: e.placeholder,
148
- onInput: n[2] || (n[2] = (r) => {
149
- t(D)(r.target.value), e.autoGrow && t(F)();
150
+ onInput: n[2] || (n[2] = (o) => {
151
+ t(F)(o.target.value), e.autoGrow && t(M)();
150
152
  }),
151
- onFocus: n[3] || (n[3] = (r) => {
153
+ onFocus: n[3] || (n[3] = (o) => {
152
154
  v.value = !0, e.$emit("update:focused", !0);
153
155
  }),
154
- onBlur: n[4] || (n[4] = (r) => {
156
+ onBlur: n[4] || (n[4] = (o) => {
155
157
  v.value = !1, e.$emit("update:focused", !1);
156
158
  }),
157
- onClick: n[5] || (n[5] = (r) => e.$emit("click:control", r)),
158
- onMousedown: n[6] || (n[6] = (r) => e.$emit("mousedown:control", r)),
159
- class: m([E.value, G.value, N.value])
160
- }, null, 42, ee),
159
+ onClick: n[5] || (n[5] = (o) => e.$emit("click:control", o)),
160
+ onMousedown: n[6] || (n[6] = (o) => e.$emit("mousedown:control", o)),
161
+ class: g([E.value, G.value, N.value])
162
+ }, null, 42, oe),
161
163
  e.clearable && t(c) ? (s(), l("div", {
162
164
  key: 2,
163
- class: m(["absolute right-2 top-2", { "opacity-100": e.persistentClear, "hover:opacity-100 opacity-0 transition-opacity duration-200": !e.persistentClear }])
165
+ class: g(["absolute right-2 top-2", { "opacity-100": e.persistentClear, "hover:opacity-100 opacity-0 transition-opacity duration-200": !e.persistentClear }])
164
166
  }, [
165
167
  i(e.$slots, "clear", y(k({ isActive: !!t(c), isFocused: t(v), controlRef: u.value, focus: () => {
166
- var r;
167
- return (r = u.value) == null ? void 0 : r.focus();
168
+ var o;
169
+ return (o = u.value) == null ? void 0 : o.focus();
168
170
  }, blur: () => {
169
- var r;
170
- return (r = u.value) == null ? void 0 : r.blur();
171
- }, props: o })), () => [
171
+ var o;
172
+ return (o = u.value) == null ? void 0 : o.blur();
173
+ }, props: r })), () => [
172
174
  a("button", {
173
175
  type: "button",
174
- onClick: n[7] || (n[7] = (...r) => t(V) && t(V)(...r)),
176
+ onClick: n[7] || (n[7] = (...o) => t(z) && t(z)(...o)),
175
177
  class: "text-gray-500 hover:text-gray-700"
176
178
  }, [
177
179
  a("span", {
178
- class: m(K.value)
180
+ class: g(j.value)
179
181
  }, null, 2)
180
182
  ])
181
183
  ])
182
184
  ], 2)) : d("", !0),
183
- e.appendInnerIcon || e.$slots["append-inner"] ? (s(), l("div", oe, [
185
+ e.appendInnerIcon || e.$slots["append-inner"] ? (s(), l("div", te, [
184
186
  i(e.$slots, "append-inner", {}, () => [
185
187
  a("div", {
186
- onClick: n[8] || (n[8] = (r) => g(r, "appendInner"))
188
+ onClick: n[8] || (n[8] = (o) => b(o, "appendInner"))
187
189
  }, [
188
190
  (s(), h(C(t($)(e.appendInnerIcon))))
189
191
  ])
190
192
  ])
191
193
  ])) : d("", !0),
192
- e.appendIcon || e.$slots.append ? (s(), l("div", re, [
194
+ e.appendIcon || e.$slots.append ? (s(), l("div", ne, [
193
195
  i(e.$slots, "append", y(k(e.appendSlotBindings)), () => [
194
196
  a("div", {
195
- onClick: n[9] || (n[9] = (r) => g(r, "append"))
197
+ onClick: n[9] || (n[9] = (o) => b(o, "append"))
196
198
  }, [
197
199
  (s(), h(C(t($)(e.appendIcon))))
198
200
  ])
199
201
  ])
200
202
  ])) : d("", !0),
201
- e.loading ? (s(), l("div", te, [
203
+ e.loading ? (s(), l("div", se, [
202
204
  i(e.$slots, "loader", {
203
205
  color: e.loadingColor,
204
206
  isActive: !0
205
207
  }, () => [
206
- a("div", ne, [
208
+ a("div", le, [
207
209
  a("div", {
208
- class: m(["h-full transition-all duration-300", [`${e.loadingColor}`]]),
210
+ class: g(["h-full transition-all duration-300", [`${e.loadingColor}`]]),
209
211
  style: { width: "100%" }
210
212
  }, null, 2)
211
213
  ])
@@ -213,38 +215,38 @@ const Y = {
213
215
  ])) : d("", !0),
214
216
  !e.hideDetails || e.hideDetails === "auto" && (t(w).length || e.hint) ? (s(), l("div", {
215
217
  key: 6,
216
- class: m(["text-xs mt-1 space-y-1", { "text-red-500": t(f), "text-gray-500": !t(f) }])
218
+ class: g(["text-xs mt-1 space-y-1", { "text-red-500": t(f), "text-gray-500": !t(f) }])
217
219
  }, [
218
220
  i(e.$slots, "details", {}, () => [
219
- t(f) ? (s(!0), l(q, { key: 0 }, J(t(w), (r, j) => i(e.$slots, "message", {
220
- key: j,
221
- message: r
221
+ t(f) ? (s(!0), l(O, { key: 0 }, Q(t(w), (o, L) => i(e.$slots, "message", {
222
+ key: L,
223
+ message: o
222
224
  }, () => [
223
- a("div", null, b(r), 1)
225
+ a("div", null, m(o), 1)
224
226
  ])), 128)) : e.hint ? i(e.$slots, "hint", {
225
227
  key: 1,
226
228
  hint: e.hint
227
229
  }, () => [
228
- O(a("div", null, b(e.hint), 513), [
229
- [Q, e.persistentHint || t(v)]
230
+ U(a("div", null, m(e.hint), 513), [
231
+ [W, e.persistentHint || t(v)]
230
232
  ])
231
233
  ]) : d("", !0)
232
234
  ])
233
235
  ], 2)) : d("", !0),
234
- H.value ? (s(), l("div", se, [
236
+ K.value ? (s(), l("div", ae, [
235
237
  i(e.$slots, "counter", {
236
238
  counter: t(c).length,
237
239
  max: I.value,
238
240
  value: t(c).length
239
241
  }, () => [
240
- U(b(t(c).length), 1),
241
- I.value ? (s(), l("span", le, " / " + b(I.value), 1)) : d("", !0)
242
+ X(m(t(c).length), 1),
243
+ I.value ? (s(), l("span", ie, " / " + m(I.value), 1)) : d("", !0)
242
244
  ])
243
245
  ])) : d("", !0)
244
246
  ])
245
- ], 2));
247
+ ], 16));
246
248
  }
247
249
  };
248
250
  export {
249
- pe as default
251
+ ve as default
250
252
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.330",
3
+ "version": "0.1.332",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",