adverich-kun-ui 0.1.287 → 0.1.289

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,6 +1,6 @@
1
- import { computed as u, createElementBlock as s, openBlock as l, normalizeClass as a, createCommentVNode as r, renderSlot as g, createElementVNode as w, withModifiers as S, Fragment as f, renderList as h, createBlock as B, resolveDynamicComponent as $, unref as d, createTextVNode as A, toDisplayString as E } from "vue";
2
- import { getValue as x, formatValue as T } from "../../../../utils/tableFormatters.js";
3
- const V = { key: 0 }, N = { key: 1 }, j = ["checked"], D = "hover:bg-slate-300 dark:hover:bg-slate-600 border-t border-slate-300 dark:border-slate-700", F = "bg-slate-100 dark:bg-slate-900", C = "px-3 py-2 whitespace-nowrap text-sm text-black dark:text-white", z = {
1
+ import { computed as k, createElementBlock as s, openBlock as l, normalizeClass as o, createCommentVNode as r, renderSlot as u, createElementVNode as y, withModifiers as v, Fragment as w, renderList as S, createBlock as h, resolveDynamicComponent as B, unref as c, createTextVNode as $, toDisplayString as A } from "vue";
2
+ import { getValue as x, formatValue as E } from "../../../../utils/tableFormatters.js";
3
+ const T = { key: 0 }, V = { key: 1 }, N = ["checked"], j = "hover:bg-slate-300 dark:hover:bg-slate-600 border-t border-slate-300 dark:border-slate-700", D = "bg-slate-100 dark:bg-slate-900", F = "px-3 py-2 whitespace-nowrap text-sm text-black dark:text-white", z = {
4
4
  __name: "KunTableRow",
5
5
  props: {
6
6
  item: Object,
@@ -21,77 +21,86 @@ const V = { key: 0 }, N = { key: 1 }, j = ["checked"], D = "hover:bg-slate-300 d
21
21
  customSlots: Object
22
22
  },
23
23
  emits: ["toggle-expand", "toggle-select", "row-click"],
24
- setup(e, { emit: b }) {
25
- const n = e, c = b, v = u(() => [
24
+ setup(e, { emit: C }) {
25
+ const n = e, m = C, b = k(() => [
26
+ j,
26
27
  D,
27
- F,
28
28
  n.rowClass,
29
29
  n.trClass,
30
30
  n.stripedClass,
31
31
  n.isSelected ? n.selectedClass : ""
32
- ]), m = u(() => [C, n.tdClass]), y = u(() => ["text-center", n.actionsAlign]);
33
- return (o, i) => (l(), s("tr", {
34
- class: a(v.value),
35
- onClick: i[2] || (i[2] = (t) => c("row-click", { item: e.item, index: e.index, event: t }))
32
+ ]);
33
+ function d(a = null, i = null) {
34
+ return typeof n.tdClass == "function" ? n.tdClass({
35
+ item: n.item,
36
+ header: a,
37
+ value: i,
38
+ index: n.index
39
+ }) : n.tdClass;
40
+ }
41
+ const f = k(() => ["text-center", n.actionsAlign]);
42
+ return (a, i) => (l(), s("tr", {
43
+ class: o(b.value),
44
+ onClick: i[2] || (i[2] = (t) => m("row-click", { item: e.item, index: e.index, event: t }))
36
45
  }, [
37
46
  e.showExpand ? (l(), s("td", {
38
47
  key: 0,
39
- class: a(m.value)
48
+ class: o(d(e.item, "expand"))
40
49
  }, [
41
- o.$slots.expandIcon ? g(o.$slots, "expand-icon", {
50
+ a.$slots.expandIcon ? u(a.$slots, "expand-icon", {
42
51
  key: 0,
43
52
  item: e.item,
44
53
  index: e.index
45
54
  }) : (l(), s("button", {
46
55
  key: 1,
47
- onClick: i[0] || (i[0] = (t) => c("toggle-expand", e.item))
56
+ onClick: i[0] || (i[0] = (t) => m("toggle-expand", e.item))
48
57
  }, [
49
- e.isExpanded ? (l(), s("span", V, "−")) : (l(), s("span", N, "+"))
58
+ e.isExpanded ? (l(), s("span", T, "−")) : (l(), s("span", V, "+"))
50
59
  ]))
51
60
  ], 2)) : r("", !0),
52
61
  e.showSelect ? (l(), s("td", {
53
62
  key: 1,
54
- class: a([m.value, "h-full w-10 flex flex-col items-center justify-center"])
63
+ class: o([d(e.item, "checkbox"), "h-full w-10 flex flex-col items-center justify-center"])
55
64
  }, [
56
- w("input", {
65
+ y("input", {
57
66
  type: "checkbox",
58
67
  checked: e.isSelected,
59
- onChange: i[1] || (i[1] = S((t) => c("toggle-select", e.item), ["stop"])),
68
+ onChange: i[1] || (i[1] = v((t) => m("toggle-select", e.item), ["stop"])),
60
69
  class: "h-5 w-5 text-blue-600 transition-all duration-200 ease-in-out rounded"
61
- }, null, 40, j)
70
+ }, null, 40, N)
62
71
  ], 2)) : r("", !0),
63
- (l(!0), s(f, null, h(e.headers, (t) => {
64
- var k;
72
+ (l(!0), s(w, null, S(e.headers, (t) => {
73
+ var g;
65
74
  return l(), s("td", {
66
75
  key: t.value,
67
- class: a([
68
- C,
69
- typeof e.tdClass == "function" ? e.tdClass(e.item, t) : e.tdClass,
76
+ class: o([
77
+ F,
78
+ d(e.item, t),
70
79
  t.align === "right" ? "text-right" : t.align === "left" ? "text-left" : "text-center"
71
80
  ])
72
81
  }, [
73
- (k = e.customSlots) != null && k[`item.${t.value}`] ? (l(), B($(e.customSlots[`item.${t.value}`]), {
82
+ (g = e.customSlots) != null && g[`item.${t.value}`] ? (l(), h(B(e.customSlots[`item.${t.value}`]), {
74
83
  key: 0,
75
84
  item: e.item,
76
- value: d(x)(t, e.item),
85
+ value: c(x)(t, e.item),
77
86
  index: e.index,
78
87
  header: t
79
- }, null, 8, ["item", "value", "index", "header"])) : g(o.$slots, `item.${t.value}`, {
88
+ }, null, 8, ["item", "value", "index", "header"])) : u(a.$slots, `item.${t.value}`, {
80
89
  key: 1,
81
90
  item: e.item,
82
- value: d(x)(t, e.item),
91
+ value: c(x)(t, e.item),
83
92
  index: e.index,
84
93
  header: t
85
94
  }, () => [
86
- A(E(d(T)(t, d(x)(t, e.item))), 1)
95
+ $(A(c(E)(t, c(x)(t, e.item))), 1)
87
96
  ])
88
97
  ], 2);
89
98
  }), 128)),
90
99
  e.hasActions ? (l(), s("td", {
91
100
  key: 2,
92
- class: a([m.value, y.value])
101
+ class: o([d(e.item, "actions"), f.value])
93
102
  }, [
94
- g(o.$slots, "item.actions", {
103
+ u(a.$slots, "item.actions", {
95
104
  item: e.item,
96
105
  index: e.index,
97
106
  loading: e.loading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.287",
3
+ "version": "0.1.289",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",