adverich-kun-ui 0.1.315 → 0.1.317

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.
@@ -104,6 +104,7 @@ const Le = ["placeholder"], Ue = { class: "flex-1 overflow-auto" }, He = { key:
104
104
  a(e.$slots, "prependSearch"),
105
105
  e.filterable && e.filters.length ? (l(), S(Be, {
106
106
  key: 0,
107
+ class: "h-fit",
107
108
  onClick: o[0] || (o[0] = (t) => v.value = !0),
108
109
  rounded: "rounded-full",
109
110
  size: "xs",
@@ -1,11 +1,11 @@
1
- import { ref as A, onMounted as v, watch as k, createElementBlock as r, openBlock as o, normalizeClass as a, createElementVNode as m, createCommentVNode as d, renderSlot as g, Fragment as E, renderList as T, normalizeStyle as $, toDisplayString as h, createBlock as D, resolveDynamicComponent as z } from "vue";
2
- import I from "../../../../icons/IconArrowUp.vue.js";
3
- import L from "../../../../icons/IconArrowDown.vue.js";
4
- import O from "../../../../icons/IconArrowDownUp.vue.js";
5
- const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onClick"], V = {
1
+ import { ref as $, onMounted as E, watch as f, createElementBlock as a, openBlock as o, normalizeClass as r, createElementVNode as k, createCommentVNode as u, renderSlot as g, Fragment as T, renderList as D, normalizeStyle as O, createBlock as h, resolveDynamicComponent as b, toDisplayString as x } from "vue";
2
+ import j from "../../../../icons/IconArrowUp.vue.js";
3
+ import z from "../../../../icons/IconArrowDown.vue.js";
4
+ import I from "../../../../icons/IconArrowDownUp.vue.js";
5
+ const L = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onClick"], V = {
6
6
  key: 0,
7
7
  class: "inline-flex items-center gap-1 ml-1 print:hidden"
8
- }, F = "bg-slate-200 dark:bg-slate-800 sticky top-0 z-5", H = "", K = "px-3 py-2 text-xs font-medium text-slate-700 dark:text-slate-300 uppercase tracking-wider", P = {
8
+ }, F = "bg-slate-200 dark:bg-slate-800 sticky top-0 z-5", H = "", K = "px-3 py-2 text-xs font-medium text-slate-700 dark:text-slate-300 uppercase tracking-wider", Q = {
9
9
  __name: "KunTableHeaders",
10
10
  props: {
11
11
  headers: Array,
@@ -19,86 +19,96 @@ const j = { key: 0 }, N = { key: 1 }, R = ["checked", "aria-checked"], U = ["onC
19
19
  trClass: String,
20
20
  thClass: String,
21
21
  hasActions: Boolean,
22
- actionLabel: String
22
+ actionLabel: String,
23
+ customSlots: Object
23
24
  },
24
25
  emits: ["toggle-select-all", "sort", "expandAll", "collapseAll"],
25
- setup(n, { emit: b }) {
26
- const t = n, c = b;
27
- function x() {
26
+ setup(l, { emit: S }) {
27
+ const t = l, c = S;
28
+ function p() {
28
29
  c("toggle-select-all");
29
30
  }
30
- function p(l) {
31
- if (!l.sortable) return;
32
- let s = null;
33
- Array.isArray(t.sortBy) ? s = t.sortBy.find((f) => f.key === l.value) : typeof t.sortBy == "string" && (s = t.sortBy === l.value ? { key: l.value, order: "asc" } : null);
34
- const e = (s == null ? void 0 : s.order) === "asc" ? "desc" : "asc";
35
- c("sort", { key: l.value, order: e });
31
+ function C(s) {
32
+ if (!s.sortable) return;
33
+ let n = null;
34
+ Array.isArray(t.sortBy) ? n = t.sortBy.find((d) => d.key === s.value) : typeof t.sortBy == "string" && (n = t.sortBy === s.value ? { key: s.value, order: "asc" } : null);
35
+ const e = (n == null ? void 0 : n.order) === "asc" ? "desc" : "asc";
36
+ c("sort", { key: s.value, order: e });
36
37
  }
37
- function S(l) {
38
- var s;
38
+ function B(s) {
39
+ var n;
39
40
  if (Array.isArray(t.sortBy))
40
- return (s = t.sortBy.find((e) => e.key === l.value)) == null ? void 0 : s.order;
41
- if (typeof t.sortBy == "string" && t.sortBy === l.value)
41
+ return (n = t.sortBy.find((e) => e.key === s.value)) == null ? void 0 : n.order;
42
+ if (typeof t.sortBy == "string" && t.sortBy === s.value)
42
43
  return "asc";
43
44
  }
44
- const C = (l) => {
45
- const s = S(l);
46
- return s ? s === "asc" ? I : L : O;
47
- }, B = [F, t.theadClass], w = [H, t.trClass], i = [K, t.thClass], u = A(null), y = () => {
48
- u.value && (u.value.indeterminate = t.someSelected && !t.allSelected);
45
+ const w = (s) => {
46
+ const n = B(s);
47
+ return n ? n === "asc" ? j : z : I;
48
+ }, A = [F, t.theadClass], v = [H, t.trClass], i = [K, t.thClass], y = $(null), m = () => {
49
+ y.value && (y.value.indeterminate = t.someSelected && !t.allSelected);
49
50
  };
50
- return v(y), k(() => t.someSelected, y), k(() => t.allSelected, y), (l, s) => (o(), r("thead", {
51
- class: a(B)
51
+ return E(m), f(() => t.someSelected, m), f(() => t.allSelected, m), (s, n) => (o(), a("thead", {
52
+ class: r(A)
52
53
  }, [
53
- m("tr", {
54
- class: a(w)
54
+ k("tr", {
55
+ class: r(v)
55
56
  }, [
56
- n.showExpand ? (o(), r("th", {
57
+ l.showExpand ? (o(), a("th", {
57
58
  key: 0,
58
- class: a([i])
59
+ class: r([i])
59
60
  }, [
60
- l.$slots.expandIcon ? g(l.$slots, "expand-icon", { key: 0 }) : (o(), r("button", {
61
+ s.$slots.expandIcon ? g(s.$slots, "expand-icon", { key: 0 }) : (o(), a("button", {
61
62
  key: 1,
62
- onClick: s[0] || (s[0] = (e) => n.isExpanded ? c("expandAll") : c("collapseAll"))
63
+ onClick: n[0] || (n[0] = (e) => l.isExpanded ? c("expandAll") : c("collapseAll"))
63
64
  }, [
64
- n.isExpanded ? (o(), r("span", j, "−")) : (o(), r("span", N, "+"))
65
+ l.isExpanded ? (o(), a("span", L, "−")) : (o(), a("span", N, "+"))
65
66
  ]))
66
- ], 2)) : d("", !0),
67
- n.showSelect ? (o(), r("th", {
67
+ ], 2)) : u("", !0),
68
+ l.showSelect ? (o(), a("th", {
68
69
  key: 1,
69
- class: a([i, "h-full w-10 flex flex-col items-center justify-center"])
70
+ class: r([i, "h-full w-10 flex flex-col items-center justify-center"])
70
71
  }, [
71
- m("input", {
72
+ k("input", {
72
73
  ref_key: "checkboxRef",
73
- ref: u,
74
+ ref: y,
74
75
  type: "checkbox",
75
- checked: n.allSelected,
76
- "aria-checked": n.someSelected && !n.allSelected ? "mixed" : n.allSelected ? "true" : "false",
77
- onChange: x,
76
+ checked: l.allSelected,
77
+ "aria-checked": l.someSelected && !l.allSelected ? "mixed" : l.allSelected ? "true" : "false",
78
+ onChange: p,
78
79
  class: "h-6 w-6 text-blue-600 transition-all duration-200 ease-in-out rounded print:hidden border-gray-300 dark:border-slate-600 checked:bg-blue-600 checked:border-blue-600 indeterminate:bg-blue-400 indeterminate:border-blue-400"
79
80
  }, null, 40, R)
80
- ])) : d("", !0),
81
- (o(!0), r(E, null, T(n.headers, (e) => (o(), r("th", {
82
- key: e.key,
83
- class: a([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "left" ? "text-left" : "text-center"]),
84
- onClick: (f) => p(e),
85
- style: $({ cursor: e.sortable ? "pointer" : "default" })
86
- }, [
87
- g(l.$slots, `header.${e.key}`, { header: e }, () => [
88
- m("span", null, h(e.label ?? e.text), 1),
89
- e.sortable ? (o(), r("span", V, [
90
- (o(), D(z(C(e)), { class: "w-4 h-4 text-gray-500" }))
91
- ])) : d("", !0)
92
- ])
93
- ], 14, U))), 128)),
94
- n.hasActions ? (o(), r("th", {
81
+ ])) : u("", !0),
82
+ (o(!0), a(T, null, D(l.headers, (e) => {
83
+ var d;
84
+ return o(), a("th", {
85
+ key: e.key,
86
+ class: r([i, e.headerAlign === "right" ? "text-right" : e.headerAlign === "left" ? "text-left" : "text-center"]),
87
+ onClick: (M) => C(e),
88
+ style: O({ cursor: e.sortable ? "pointer" : "default" })
89
+ }, [
90
+ (d = l.customSlots) != null && d[`header.${e.value}`] ? (o(), h(b(l.customSlots[`header.${e.value}`]), {
91
+ key: 0,
92
+ header: e
93
+ }, null, 8, ["header"])) : g(s.$slots, `header.${e.key}`, {
94
+ key: 1,
95
+ header: e
96
+ }, () => [
97
+ k("span", null, x(e.label ?? e.text), 1),
98
+ e.sortable ? (o(), a("span", V, [
99
+ (o(), h(b(w(e)), { class: "w-4 h-4 text-gray-500" }))
100
+ ])) : u("", !0)
101
+ ])
102
+ ], 14, U);
103
+ }), 128)),
104
+ l.hasActions ? (o(), a("th", {
95
105
  key: 2,
96
- class: a([[i], "text-center print:hidden"])
97
- }, h(n.actionLabel), 3)) : d("", !0)
106
+ class: r([[i], "text-center print:hidden"])
107
+ }, x(l.actionLabel), 3)) : u("", !0)
98
108
  ])
99
109
  ]));
100
110
  }
101
111
  };
102
112
  export {
103
- P as default
113
+ Q as default
104
114
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.315",
3
+ "version": "0.1.317",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",