vlite3 0.1.3 → 0.1.4

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,5 +1,5 @@
1
1
  import { defineComponent as v, useSlots as x, computed as s, withDirectives as y, openBlock as r, createElementBlock as w, normalizeClass as i, createBlock as a, createCommentVNode as u, renderSlot as p, createTextVNode as k, toDisplayString as z, unref as B } from "vue";
2
- import l from "./Icon.vue.js";
2
+ import c from "./Icon.vue.js";
3
3
  import { vRipple as C } from "../directives/vRipple.js";
4
4
  const R = ["type", "disabled"], D = /* @__PURE__ */ v({
5
5
  __name: "Button",
@@ -16,8 +16,8 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
16
16
  rounded: { default: "md" }
17
17
  },
18
18
  setup(e) {
19
- const t = e, g = x(), c = s(() => t.icon && !t.text && !g.default), h = s(() => {
20
- const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-95 cursor-pointer gap-2", d = {
19
+ const t = e, g = x(), l = s(() => t.icon && !t.text && !g.default), h = s(() => {
20
+ const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-95 cursor-pointer gap-2", d = {
21
21
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
22
22
  "primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
23
23
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -62,7 +62,7 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
62
62
  n,
63
63
  d[t.variant],
64
64
  m[t.rounded],
65
- c.value ? b[t.size] : f[t.size],
65
+ l.value ? b[t.size] : f[t.size],
66
66
  t.class
67
67
  ].join(" ");
68
68
  }), o = s(() => ({
@@ -77,22 +77,22 @@ const R = ["type", "disabled"], D = /* @__PURE__ */ v({
77
77
  class: i(h.value),
78
78
  disabled: e.disabled || e.loading
79
79
  }, [
80
- e.loading ? (r(), a(l, {
80
+ e.loading ? (r(), a(c, {
81
81
  key: 0,
82
82
  icon: "lucide:loader-2",
83
83
  class: i(["animate-spin", { [o.value]: !0 }])
84
- }, null, 8, ["class"])) : e.icon ? (r(), a(l, {
84
+ }, null, 8, ["class"])) : e.icon ? (r(), a(c, {
85
85
  key: 1,
86
86
  icon: e.icon,
87
87
  class: i({
88
- "mx-auto": c.value,
88
+ "mx-auto": l.value,
89
89
  [o.value]: !0
90
90
  })
91
91
  }, null, 8, ["icon", "class"])) : u("", !0),
92
92
  p(n.$slots, "default", {}, () => [
93
93
  k(z(e.text), 1)
94
94
  ]),
95
- e.iconRight && !e.loading ? (r(), a(l, {
95
+ e.iconRight && !e.loading ? (r(), a(c, {
96
96
  key: 2,
97
97
  icon: e.iconRight,
98
98
  class: i([o.value, "h-4 w-4"])
@@ -32,10 +32,10 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
32
32
  "onUpdate:selectedRows"?: (value: any[]) => any;
33
33
  }>, {
34
34
  search: string;
35
+ variant: "default" | "raised";
35
36
  loading: boolean;
36
37
  rows: any[];
37
38
  selectable: boolean;
38
- emptyMessage: string;
39
39
  showSearch: boolean;
40
40
  showItemsPerPage: boolean;
41
41
  itemsPerPage: number;
@@ -47,9 +47,12 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
47
47
  striped: boolean;
48
48
  selectedRows: any[];
49
49
  searchPlaceholder: string;
50
+ emptyTitle: string;
51
+ emptyDescription: string;
50
52
  emptyIcon: string;
51
53
  showPagination: boolean;
52
54
  bordered: boolean;
55
+ sortable: boolean;
53
56
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
54
57
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
55
58
  export default _default;
@@ -1,7 +1,7 @@
1
- import a from "./DataTable.vue2.js";
1
+ import o from "./DataTable.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(a, [["__scopeId", "data-v-45a246be"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-32de2313"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,28 +1,25 @@
1
- import { defineComponent as _, ref as g, computed as b, watch as p, onMounted as ee, openBlock as n, createElementBlock as i, createVNode as $, createSlots as V, withCtx as z, renderSlot as I, createBlock as j, createCommentVNode as k, createElementVNode as r, normalizeClass as E, Fragment as B, renderList as P, normalizeStyle as D, mergeProps as te, toDisplayString as le, createTextVNode as ae, unref as se } from "vue";
1
+ import { defineComponent as ee, ref as g, computed as y, watch as p, onMounted as te, openBlock as r, createElementBlock as d, createVNode as C, createSlots as V, withCtx as T, renderSlot as S, createBlock as D, createCommentVNode as I, createElementVNode as n, normalizeClass as B, Fragment as F, renderList as $, normalizeStyle as A, mergeProps as le, toDisplayString as M, createTextVNode as ae, unref as se } from "vue";
2
2
  import oe from "../Icon.vue.js";
3
- import ne from "../CheckBox.vue.js";
4
- import re from "../Button.vue.js";
5
- import ie from "../ConfirmationModal.vue.js";
6
- import de from "../Pagination/Pagination.vue.js";
3
+ import re from "../CheckBox.vue.js";
4
+ import ne from "../Button.vue.js";
5
+ import de from "../ConfirmationModal.vue.js";
6
+ import ie from "../Pagination/Pagination.vue.js";
7
7
  import ue from "./DataTableHeader.vue.js";
8
8
  import ce from "./DataTableRow.vue.js";
9
9
  import me from "./DataTableToolbar.vue.js";
10
- const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve = {
11
- key: 0,
12
- style: { width: "48px" }
13
- }, ge = { class: "[&_tr]:border-b [&_tr]:border-border/70! bg-muted" }, pe = { class: "hover:bg-transparent" }, we = {
10
+ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve = { class: "hover:bg-transparent" }, ge = {
14
11
  key: 0,
15
12
  scope: "col",
16
13
  class: "w-[48px] px-0 text-center font-medium text-muted-foreground",
17
14
  style: { width: "48px" }
18
- }, ye = { class: "flex items-center justify-center" }, be = { class: "[&_tr:last-child]:border-0" }, ke = {
15
+ }, pe = { class: "flex items-center justify-center" }, be = { class: "[&_tr:last-child]:border-0" }, we = {
19
16
  key: 0,
20
17
  class: "w-[48px] px-0 py-4 align-middle text-center",
21
18
  style: { width: "48px" }
22
- }, Pe = { key: 2 }, xe = ["colspan"], Ce = { class: "flex flex-col items-center justify-center gap-2 text-muted-foreground p-8" }, Se = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-muted/20" }, $e = { class: "mt-2 text-base font-semibold text-foreground" }, Ie = { class: "text-sm max-w-sm mx-auto" }, Be = {
19
+ }, ye = { key: 2 }, ke = ["colspan"], Pe = { class: "flex flex-col items-center justify-center gap-2 text-muted-foreground p-8" }, xe = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-muted" }, Ce = { class: "mt-1 text-base font-semibold text-foreground" }, Se = { class: "text-sm max-w-sm mx-auto" }, Ie = {
23
20
  key: 0,
24
21
  class: "mt-4"
25
- }, Fe = { key: 0 }, Ae = /* @__PURE__ */ _({
22
+ }, $e = { key: 0 }, Ve = /* @__PURE__ */ ee({
26
23
  __name: "DataTable",
27
24
  props: {
28
25
  rows: { default: () => [] },
@@ -34,7 +31,8 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
34
31
  keyField: { default: "_id" },
35
32
  loading: { type: Boolean, default: !1 },
36
33
  selectable: { type: Boolean, default: !1 },
37
- emptyMessage: { default: "No data available" },
34
+ emptyTitle: { default: "No data available" },
35
+ emptyDescription: { default: "No results found. Try adjusting your filters or search terms." },
38
36
  emptyIcon: { default: "lucide:inbox" },
39
37
  showPagination: { type: Boolean, default: !0 },
40
38
  pageInfo: {},
@@ -46,265 +44,274 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ve
46
44
  bordered: { type: Boolean, default: !0 },
47
45
  compact: { type: Boolean, default: !1 },
48
46
  tableClass: {},
49
- class: {}
47
+ class: {},
48
+ sortable: { type: Boolean, default: !1 },
49
+ variant: { default: "default" }
50
50
  },
51
51
  emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
52
- setup(s, { emit: A }) {
53
- const U = (e, t) => t.split(".").reduce((l, c) => l?.[c], e), u = (e, t) => U(e, t), a = s, w = A, d = g({ field: "", order: "" }), x = g(a.itemsPerPage), h = g(a.pageInfo?.currentPage || 1), y = g(a.search || ""), C = g(!1), v = g("initial"), O = b(() => a.loading && (v.value === "initial" || v.value === "page"));
52
+ setup(a, { emit: U }) {
53
+ const O = (e, t) => t.split(".").reduce((s, c) => s?.[c], e), u = (e, t) => O(e, t), l = a, b = U, i = g({ field: "", order: "" }), k = g(l.itemsPerPage), h = g(l.pageInfo?.currentPage || 1), w = g(l.search || ""), P = g(!1), v = g("initial"), L = y(() => l.loading && (v.value === "initial" || v.value === "page"));
54
54
  p(
55
- () => a.loading,
55
+ () => l.loading,
56
56
  (e, t) => {
57
57
  !e && t && (v.value = "idle");
58
58
  }
59
59
  ), p(
60
- () => a.search,
60
+ () => l.search,
61
61
  (e) => {
62
- e !== void 0 && e !== y.value && (y.value = e);
62
+ e !== void 0 && e !== w.value && (w.value = e);
63
63
  }
64
64
  );
65
- let F = null;
66
- p(y, (e) => {
67
- F && clearTimeout(F), F = setTimeout(() => {
68
- h.value = 1, v.value = "search", S();
65
+ let R = null;
66
+ p(w, (e) => {
67
+ R && clearTimeout(R), R = setTimeout(() => {
68
+ h.value = 1, v.value = "search", x();
69
69
  }, 300);
70
70
  }), p(
71
- () => a.itemsPerPage,
71
+ () => l.itemsPerPage,
72
72
  (e) => {
73
- x.value = e;
73
+ k.value = e;
74
74
  }
75
75
  ), p(
76
- () => a.pageInfo?.currentPage,
76
+ () => l.pageInfo?.currentPage,
77
77
  (e) => {
78
78
  e && (h.value = e);
79
79
  }
80
80
  );
81
- const M = (e) => u(e, a.keyField), o = g(/* @__PURE__ */ new Set());
81
+ const j = (e) => u(e, l.keyField), o = g(/* @__PURE__ */ new Set());
82
82
  p(
83
- () => a.selectedRows,
83
+ () => l.selectedRows,
84
84
  (e) => {
85
- const t = new Set((e || []).map((l) => u(l, a.keyField)));
86
- (t.size !== o.value.size || [...t].some((l) => !o.value.has(l))) && (o.value = t);
85
+ const t = new Set((e || []).map((s) => u(s, l.keyField)));
86
+ (t.size !== o.value.size || [...t].some((s) => !o.value.has(s))) && (o.value = t);
87
87
  },
88
88
  { immediate: !0, deep: !0 }
89
89
  );
90
- const R = b(() => a.rows.length === 0 ? !1 : a.rows.every((e) => o.value.has(u(e, a.keyField)))), N = b(() => o.value.size > 0 && !R.value), L = b(() => {
91
- const e = [...a.selectedRows || [], ...a.rows], t = /* @__PURE__ */ new Map();
92
- return e.forEach((l) => t.set(u(l, a.keyField), l)), Array.from(o.value).map((l) => t.get(l)).filter(Boolean);
93
- }), W = (e) => {
94
- e ? a.rows.forEach((t) => o.value.add(u(t, a.keyField))) : o.value.size > 0 && a.rows.forEach((t) => o.value.delete(u(t, a.keyField))), T();
95
- }, q = (e) => {
96
- o.value.has(e) ? o.value.delete(e) : o.value.add(e), T();
97
- }, T = () => {
98
- const e = a.selectedRows || [], t = /* @__PURE__ */ new Set(), l = [];
99
- a.rows.forEach((m) => {
100
- const f = u(m, a.keyField);
101
- o.value.has(f) && (l.push(m), t.add(f));
90
+ const z = y(() => l.rows.length === 0 ? !1 : l.rows.every((e) => o.value.has(u(e, l.keyField)))), E = y(() => o.value.size > 0 && !z.value), W = y(() => {
91
+ const e = [...l.selectedRows || [], ...l.rows], t = /* @__PURE__ */ new Map();
92
+ return e.forEach((s) => t.set(u(s, l.keyField), s)), Array.from(o.value).map((s) => t.get(s)).filter(Boolean);
93
+ }), q = (e) => {
94
+ e ? l.rows.forEach((t) => o.value.add(u(t, l.keyField))) : o.value.size > 0 && l.rows.forEach((t) => o.value.delete(u(t, l.keyField))), N();
95
+ }, G = (e) => {
96
+ o.value.has(e) ? o.value.delete(e) : o.value.add(e), N();
97
+ }, N = () => {
98
+ const e = l.selectedRows || [], t = /* @__PURE__ */ new Set(), s = [];
99
+ l.rows.forEach((m) => {
100
+ const f = u(m, l.keyField);
101
+ o.value.has(f) && (s.push(m), t.add(f));
102
102
  }), e.forEach((m) => {
103
- const f = u(m, a.keyField);
104
- !t.has(f) && o.value.has(f) && (l.push(m), t.add(f));
103
+ const f = u(m, l.keyField);
104
+ !t.has(f) && o.value.has(f) && (s.push(m), t.add(f));
105
105
  });
106
106
  const c = {
107
- selected: l,
108
- all: R.value,
109
- indeterminate: N.value
107
+ selected: s,
108
+ all: z.value,
109
+ indeterminate: E.value
110
110
  };
111
- w("select", c), w("update:selectedRows", l);
112
- }, G = (e) => {
113
- d.value.field === e ? d.value.order === "asc" ? d.value.order = "desc" : d.value.order === "desc" ? (d.value.order = "", d.value.field = "") : d.value.order = "asc" : (d.value.field = e, d.value.order = "asc"), h.value = 1, v.value = "sort", S();
111
+ b("select", c), b("update:selectedRows", s);
114
112
  }, H = (e) => {
115
- h.value = e, v.value = "page", S();
113
+ i.value.field === e ? i.value.order === "asc" ? i.value.order = "desc" : i.value.order === "desc" ? (i.value.order = "", i.value.field = "") : i.value.order = "asc" : (i.value.field = e, i.value.order = "asc"), h.value = 1, v.value = "sort", x();
116
114
  }, J = (e) => {
117
- x.value = e, h.value = 1, v.value = "limit", w("update:itemsPerPage", e), S();
115
+ h.value = e, v.value = "page", x();
118
116
  }, K = (e) => {
119
- w("rowClick", e);
120
- }, Q = () => {
121
- const e = L.value;
122
- w("delete", e), C.value = !1;
123
- }, S = () => {
124
- w("change", {
117
+ k.value = e, h.value = 1, v.value = "limit", b("update:itemsPerPage", e), x();
118
+ }, Q = (e) => {
119
+ b("rowClick", e);
120
+ }, X = () => {
121
+ const e = W.value;
122
+ b("delete", e), P.value = !1;
123
+ }, x = () => {
124
+ b("change", {
125
125
  pagination: {
126
126
  page: h.value,
127
- limit: x.value
127
+ limit: k.value
128
128
  },
129
- sorting: { ...d.value },
130
- search: y.value
129
+ sorting: { ...i.value },
130
+ search: w.value
131
131
  });
132
- }, X = b(() => [
133
- "w-full bg-background rounded border border-border/60 flex flex-col",
134
- "overflow-hidden",
135
- a.class
136
- ].join(" ")), Y = b(() => ["w-full caption-bottom text-sm", a.tableClass].join(" ")), Z = (e) => e.width ? e.width : "auto";
132
+ }, Y = y(() => {
133
+ const e = l.variant === "raised";
134
+ return [
135
+ "w-full flex flex-col",
136
+ e ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
137
+ "overflow-hidden",
138
+ !e && l.bordered ? "border-b border-border/60" : "",
139
+ l.class
140
+ ].join(" ");
141
+ }), Z = y(() => ["w-full caption-bottom text-sm", l.tableClass].join(" ")), _ = (e) => e.width ? e.width : "auto";
137
142
  return p(
138
- () => a.rows,
143
+ () => l.rows,
139
144
  () => {
140
- const e = new Set(a.rows.map((t) => u(t, a.keyField)));
145
+ const e = new Set(l.rows.map((t) => u(t, l.keyField)));
141
146
  o.value = new Set([...o.value].filter((t) => e.has(t)));
142
147
  }
143
- ), ee(() => {
144
- S();
145
- }), (e, t) => (n(), i("div", fe, [
146
- $(me, {
147
- modelValue: y.value,
148
- "onUpdate:modelValue": t[1] || (t[1] = (l) => y.value = l),
149
- "show-search": s.showSearch,
150
- placeholder: s.searchPlaceholder
148
+ ), te(() => {
149
+ x();
150
+ }), (e, t) => (r(), d("div", fe, [
151
+ C(me, {
152
+ modelValue: w.value,
153
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => w.value = s),
154
+ "show-search": a.showSearch,
155
+ placeholder: a.searchPlaceholder
151
156
  }, V({ _: 2 }, [
152
157
  e.$slots?.["toolbar-left"] ? {
153
158
  name: "left",
154
- fn: z(() => [
155
- I(e.$slots, "toolbar-left", {}, void 0, !0)
159
+ fn: T(() => [
160
+ S(e.$slots, "toolbar-left", {}, void 0, !0)
156
161
  ]),
157
162
  key: "0"
158
163
  } : void 0,
159
164
  e.$slots?.["toolbar-right"] || o.value.size > 0 ? {
160
165
  name: "right",
161
- fn: z(() => [
162
- o.value.size > 0 ? (n(), j(re, {
166
+ fn: T(() => [
167
+ o.value.size > 0 ? (r(), D(ne, {
163
168
  key: 0,
164
169
  rounded: "full",
165
170
  variant: "ghost",
166
171
  icon: "lucide:trash-2",
167
172
  class: "text-destructive! bg-destructive/10 hover:bg-destructive/15",
168
- onClick: t[0] || (t[0] = (l) => C.value = !0)
169
- })) : k("", !0),
170
- I(e.$slots, "toolbar-right", {}, void 0, !0)
173
+ onClick: t[0] || (t[0] = (s) => P.value = !0)
174
+ })) : I("", !0),
175
+ S(e.$slots, "toolbar-right", {}, void 0, !0)
171
176
  ]),
172
177
  key: "1"
173
178
  } : void 0
174
179
  ]), 1032, ["modelValue", "show-search", "placeholder"]),
175
- r("div", {
176
- class: E(X.value)
180
+ n("div", {
181
+ class: B(Y.value)
177
182
  }, [
178
- r("div", he, [
179
- r("table", {
180
- class: E(Y.value)
183
+ n("div", he, [
184
+ n("table", {
185
+ class: B([Z.value, ""])
181
186
  }, [
182
- r("colgroup", null, [
183
- s.selectable ? (n(), i("col", ve)) : k("", !0),
184
- (n(!0), i(B, null, P(s.headers, (l) => (n(), i("col", {
185
- key: l.field,
186
- style: D({
187
- width: Z(l)
188
- })
189
- }, null, 4))), 128))
190
- ]),
191
- r("thead", ge, [
192
- r("tr", pe, [
193
- s.selectable ? (n(), i("th", we, [
194
- r("div", ye, [
195
- $(ne, {
196
- "model-value": R.value,
197
- indeterminate: N.value,
187
+ n("thead", {
188
+ class: B([
189
+ "[&_tr]:border-b [&_tr]:border-border/70! bg-muted",
190
+ a.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
191
+ ])
192
+ }, [
193
+ n("tr", ve, [
194
+ a.selectable ? (r(), d("th", ge, [
195
+ n("div", pe, [
196
+ C(re, {
197
+ "model-value": z.value,
198
+ indeterminate: E.value,
198
199
  size: "xs",
199
- "onUpdate:modelValue": W
200
+ "onUpdate:modelValue": q
200
201
  }, null, 8, ["model-value", "indeterminate"])
201
202
  ])
202
- ])) : k("", !0),
203
- (n(!0), i(B, null, P(s.headers, (l) => (n(), j(ue, {
204
- key: l.field,
205
- header: l,
206
- "sort-config": d.value,
207
- compact: s.compact,
208
- onSort: G
209
- }, null, 8, ["header", "sort-config", "compact"]))), 128))
203
+ ])) : I("", !0),
204
+ (r(!0), d(F, null, $(a.headers, (s) => (r(), D(ue, {
205
+ key: s.field,
206
+ header: s,
207
+ "sort-config": i.value,
208
+ compact: a.compact,
209
+ "table-sortable": a.sortable,
210
+ onSort: H,
211
+ class: "last:pr-5!",
212
+ style: A({
213
+ width: _(s)
214
+ })
215
+ }, null, 8, ["header", "sort-config", "compact", "table-sortable", "style"]))), 128))
210
216
  ])
211
- ]),
212
- r("tbody", be, [
213
- O.value ? (n(!0), i(B, { key: 0 }, P(Math.min(x.value, 15), (l) => (n(), i("tr", {
214
- key: "skeleton-" + l,
217
+ ], 2),
218
+ n("tbody", be, [
219
+ L.value ? (r(!0), d(F, { key: 0 }, $(Math.min(k.value, 15), (s) => (r(), d("tr", {
220
+ key: "skeleton-" + s,
215
221
  class: "border-b border-border/50 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
216
222
  }, [
217
- s.selectable ? (n(), i("td", ke, [...t[4] || (t[4] = [
218
- r("div", { class: "flex items-center justify-center" }, [
219
- r("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
223
+ a.selectable ? (r(), d("td", we, [...t[4] || (t[4] = [
224
+ n("div", { class: "flex items-center justify-center" }, [
225
+ n("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
220
226
  ], -1)
221
- ])])) : k("", !0),
222
- (n(!0), i(B, null, P(s.headers, (c) => (n(), i("td", {
227
+ ])])) : I("", !0),
228
+ (r(!0), d(F, null, $(a.headers, (c) => (r(), d("td", {
223
229
  key: c.field,
224
- class: E(["p-5! align-middle", [c.hideOnMobile ? "hidden md:table-cell" : ""]])
230
+ class: B(["p-5! align-middle last:pr-6!", [c.hideOnMobile ? "hidden md:table-cell" : ""]])
225
231
  }, [
226
- r("div", {
232
+ n("div", {
227
233
  class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
228
- style: D({
234
+ style: A({
229
235
  width: `${50 + Math.random() * 40}%`
230
236
  })
231
237
  }, null, 4)
232
238
  ], 2))), 128))
233
- ]))), 128)) : s.rows.length > 0 ? (n(!0), i(B, { key: 1 }, P(s.rows, (l, c) => (n(), j(ce, {
234
- key: M(l),
235
- row: l,
236
- headers: s.headers,
239
+ ]))), 128)) : a.rows.length > 0 ? (r(!0), d(F, { key: 1 }, $(a.rows, (s, c) => (r(), D(ce, {
240
+ key: j(s),
241
+ row: s,
242
+ headers: a.headers,
237
243
  index: c,
238
- "key-field": s.keyField,
239
- selectable: s.selectable,
240
- "is-selected": o.value.has(M(l)),
241
- hoverable: s.hoverable,
242
- striped: s.striped,
243
- compact: s.compact,
244
- onSelect: q,
245
- onRowClick: K
244
+ "key-field": a.keyField,
245
+ selectable: a.selectable,
246
+ "is-selected": o.value.has(j(s)),
247
+ hoverable: a.hoverable,
248
+ striped: a.striped,
249
+ compact: a.compact,
250
+ onSelect: G,
251
+ onRowClick: Q,
252
+ class: "[&_td:last-child]:pr-3.5!"
246
253
  }, V({ _: 2 }, [
247
- P(s.headers, (m) => ({
254
+ $(a.headers, (m) => ({
248
255
  name: m.field,
249
- fn: z((f) => [
250
- I(e.$slots, m.field, te({ ref_for: !0 }, f), void 0, !0)
256
+ fn: T((f) => [
257
+ S(e.$slots, m.field, le({ ref_for: !0 }, f), void 0, !0)
251
258
  ])
252
259
  }))
253
- ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr", Pe, [
254
- r("td", {
255
- colspan: s.selectable ? s.headers.length + 1 : s.headers.length,
260
+ ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (r(), d("tr", ye, [
261
+ n("td", {
262
+ colspan: a.selectable ? a.headers.length + 1 : a.headers.length,
256
263
  class: "h-96 text-center align-middle hover:bg-transparent"
257
264
  }, [
258
- r("div", Ce, [
259
- r("div", Se, [
260
- $(oe, {
261
- icon: s.emptyIcon,
265
+ n("div", Pe, [
266
+ n("div", xe, [
267
+ C(oe, {
268
+ icon: a.emptyIcon,
262
269
  class: "h-6 w-6 text-muted-foreground/80"
263
270
  }, null, 8, ["icon"])
264
271
  ]),
265
- r("h3", $e, le(s.emptyMessage), 1),
266
- r("p", Ie, [
267
- I(e.$slots, "empty-description", {}, () => [
268
- t[5] || (t[5] = ae(" No results found. Try adjusting your filters or search terms. ", -1))
272
+ n("h3", Ce, M(a.emptyTitle), 1),
273
+ n("p", Se, [
274
+ S(e.$slots, "empty-description", {}, () => [
275
+ ae(M(a.emptyDescription), 1)
269
276
  ], !0)
270
277
  ]),
271
- e.$slots["empty-action"] ? (n(), i("div", Be, [
272
- I(e.$slots, "empty-action", {}, void 0, !0)
273
- ])) : k("", !0)
278
+ e.$slots["empty-action"] ? (r(), d("div", Ie, [
279
+ S(e.$slots, "empty-action", {}, void 0, !0)
280
+ ])) : I("", !0)
274
281
  ])
275
- ], 8, xe)
282
+ ], 8, ke)
276
283
  ]))
277
284
  ])
278
285
  ], 2)
279
286
  ])
280
287
  ], 2),
281
- s.showPagination && s.pageInfo ? (n(), i("div", Fe, [
282
- $(se(de), {
288
+ a.showPagination && a.pageInfo && a.pageInfo.totalItems > 0 ? (r(), d("div", $e, [
289
+ C(se(ie), {
283
290
  "current-page": h.value,
284
- "total-pages": s.pageInfo.totalPages,
291
+ "total-pages": a.pageInfo.totalPages,
285
292
  "show-page-info": !1,
286
- "show-items-per-page": s.showItemsPerPage,
287
- "items-per-page": x.value,
288
- "items-per-page-options": s.itemsPerPageOptions,
293
+ "show-items-per-page": a.showItemsPerPage,
294
+ "items-per-page": k.value,
295
+ "items-per-page-options": a.itemsPerPageOptions,
289
296
  "nav-type": "icon",
290
- onChange: H,
291
- "onUpdate:itemsPerPage": J
297
+ onChange: J,
298
+ "onUpdate:itemsPerPage": K
292
299
  }, null, 8, ["current-page", "total-pages", "show-items-per-page", "items-per-page", "items-per-page-options"])
293
- ])) : k("", !0),
294
- $(ie, {
295
- show: C.value,
296
- "onUpdate:show": t[2] || (t[2] = (l) => C.value = l),
300
+ ])) : I("", !0),
301
+ C(de, {
302
+ show: P.value,
303
+ "onUpdate:show": t[2] || (t[2] = (s) => P.value = s),
297
304
  title: "Confirm Deletion",
298
305
  description: "Are you sure you want to delete the selected items?",
299
306
  "confirm-text": "Delete",
300
307
  "cancel-text": "Cancel",
301
308
  variant: "danger",
302
- onConfirm: Q,
303
- onCancel: t[3] || (t[3] = (l) => C.value = !1)
309
+ onConfirm: X,
310
+ onCancel: t[3] || (t[3] = (s) => P.value = !1)
304
311
  }, null, 8, ["show"])
305
312
  ]));
306
313
  }
307
314
  });
308
315
  export {
309
- Ae as default
316
+ Ve as default
310
317
  };
@@ -3,6 +3,7 @@ interface Props {
3
3
  header: TableHeader;
4
4
  sortConfig?: SortConfig;
5
5
  compact?: boolean;
6
+ tableSortable?: boolean;
6
7
  }
7
8
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
9
  sort: (field: string) => any;
@@ -10,5 +11,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
10
11
  onSort?: (field: string) => any;
11
12
  }>, {
12
13
  compact: boolean;
14
+ tableSortable: boolean;
13
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLTableCellElement>;
14
16
  export default _default;