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