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.
- package/components/Button.vue.js +8 -8
- package/components/DataTable/DataTable.vue.d.ts +4 -1
- package/components/DataTable/DataTable.vue.js +3 -3
- package/components/DataTable/DataTable.vue2.js +177 -170
- package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableRow.vue.js +1 -1
- package/components/DataTable/types.d.ts +4 -1
- package/components/FilePicker/FilePicker.vue.js +3 -3
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +21 -30
- package/components/Input.vue.js +1 -1
- package/components/Modal.vue.js +6 -6
- package/components/Navbar/Navbar.vue.d.ts +1 -0
- package/components/Navbar/Navbar.vue.js +89 -68
- package/package.json +1 -1
- package/style.css +11 -8
- package/types/navbar.type.d.ts +1 -0
package/components/Button.vue.js
CHANGED
|
@@ -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
|
|
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(),
|
|
20
|
-
const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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":
|
|
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(
|
|
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
|
|
1
|
+
import o from "./DataTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */ o
|
|
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
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
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(
|
|
53
|
-
const
|
|
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
|
-
() =>
|
|
55
|
+
() => l.loading,
|
|
56
56
|
(e, t) => {
|
|
57
57
|
!e && t && (v.value = "idle");
|
|
58
58
|
}
|
|
59
59
|
), p(
|
|
60
|
-
() =>
|
|
60
|
+
() => l.search,
|
|
61
61
|
(e) => {
|
|
62
|
-
e !== void 0 && e !==
|
|
62
|
+
e !== void 0 && e !== w.value && (w.value = e);
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
let
|
|
66
|
-
p(
|
|
67
|
-
|
|
68
|
-
h.value = 1, v.value = "search",
|
|
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
|
-
() =>
|
|
71
|
+
() => l.itemsPerPage,
|
|
72
72
|
(e) => {
|
|
73
|
-
|
|
73
|
+
k.value = e;
|
|
74
74
|
}
|
|
75
75
|
), p(
|
|
76
|
-
() =>
|
|
76
|
+
() => l.pageInfo?.currentPage,
|
|
77
77
|
(e) => {
|
|
78
78
|
e && (h.value = e);
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
const
|
|
81
|
+
const j = (e) => u(e, l.keyField), o = g(/* @__PURE__ */ new Set());
|
|
82
82
|
p(
|
|
83
|
-
() =>
|
|
83
|
+
() => l.selectedRows,
|
|
84
84
|
(e) => {
|
|
85
|
-
const t = new Set((e || []).map((
|
|
86
|
-
(t.size !== o.value.size || [...t].some((
|
|
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
|
|
91
|
-
const e = [...
|
|
92
|
-
return e.forEach((
|
|
93
|
-
}),
|
|
94
|
-
e ?
|
|
95
|
-
},
|
|
96
|
-
o.value.has(e) ? o.value.delete(e) : o.value.add(e),
|
|
97
|
-
},
|
|
98
|
-
const e =
|
|
99
|
-
|
|
100
|
-
const f = u(m,
|
|
101
|
-
o.value.has(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,
|
|
104
|
-
!t.has(f) && o.value.has(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:
|
|
108
|
-
all:
|
|
109
|
-
indeterminate:
|
|
107
|
+
selected: s,
|
|
108
|
+
all: z.value,
|
|
109
|
+
indeterminate: E.value
|
|
110
110
|
};
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
+
h.value = e, v.value = "page", x();
|
|
118
116
|
}, K = (e) => {
|
|
119
|
-
|
|
120
|
-
}, Q = () => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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:
|
|
127
|
+
limit: k.value
|
|
128
128
|
},
|
|
129
|
-
sorting: { ...
|
|
130
|
-
search:
|
|
129
|
+
sorting: { ...i.value },
|
|
130
|
+
search: w.value
|
|
131
131
|
});
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
() =>
|
|
143
|
+
() => l.rows,
|
|
139
144
|
() => {
|
|
140
|
-
const e = new Set(
|
|
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
|
-
),
|
|
144
|
-
|
|
145
|
-
}), (e, t) => (
|
|
146
|
-
|
|
147
|
-
modelValue:
|
|
148
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
149
|
-
"show-search":
|
|
150
|
-
placeholder:
|
|
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:
|
|
155
|
-
|
|
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:
|
|
162
|
-
o.value.size > 0 ? (
|
|
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] = (
|
|
169
|
-
})) :
|
|
170
|
-
|
|
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
|
-
|
|
176
|
-
class:
|
|
180
|
+
n("div", {
|
|
181
|
+
class: B(Y.value)
|
|
177
182
|
}, [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
class:
|
|
183
|
+
n("div", he, [
|
|
184
|
+
n("table", {
|
|
185
|
+
class: B([Z.value, ""])
|
|
181
186
|
}, [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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":
|
|
200
|
+
"onUpdate:modelValue": q
|
|
200
201
|
}, null, 8, ["model-value", "indeterminate"])
|
|
201
202
|
])
|
|
202
|
-
])) :
|
|
203
|
-
(
|
|
204
|
-
key:
|
|
205
|
-
header:
|
|
206
|
-
"sort-config":
|
|
207
|
-
compact:
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
key: "skeleton-" +
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
])])) :
|
|
222
|
-
(
|
|
227
|
+
])])) : I("", !0),
|
|
228
|
+
(r(!0), d(F, null, $(a.headers, (c) => (r(), d("td", {
|
|
223
229
|
key: c.field,
|
|
224
|
-
class:
|
|
230
|
+
class: B(["p-5! align-middle last:pr-6!", [c.hideOnMobile ? "hidden md:table-cell" : ""]])
|
|
225
231
|
}, [
|
|
226
|
-
|
|
232
|
+
n("div", {
|
|
227
233
|
class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
|
|
228
|
-
style:
|
|
234
|
+
style: A({
|
|
229
235
|
width: `${50 + Math.random() * 40}%`
|
|
230
236
|
})
|
|
231
237
|
}, null, 4)
|
|
232
238
|
], 2))), 128))
|
|
233
|
-
]))), 128)) :
|
|
234
|
-
key:
|
|
235
|
-
row:
|
|
236
|
-
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":
|
|
239
|
-
selectable:
|
|
240
|
-
"is-selected": o.value.has(
|
|
241
|
-
hoverable:
|
|
242
|
-
striped:
|
|
243
|
-
compact:
|
|
244
|
-
onSelect:
|
|
245
|
-
onRowClick:
|
|
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
|
-
|
|
254
|
+
$(a.headers, (m) => ({
|
|
248
255
|
name: m.field,
|
|
249
|
-
fn:
|
|
250
|
-
|
|
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)) : (
|
|
254
|
-
|
|
255
|
-
colspan:
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
icon:
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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"] ? (
|
|
272
|
-
|
|
273
|
-
])) :
|
|
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,
|
|
282
|
+
], 8, ke)
|
|
276
283
|
]))
|
|
277
284
|
])
|
|
278
285
|
], 2)
|
|
279
286
|
])
|
|
280
287
|
], 2),
|
|
281
|
-
|
|
282
|
-
|
|
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":
|
|
291
|
+
"total-pages": a.pageInfo.totalPages,
|
|
285
292
|
"show-page-info": !1,
|
|
286
|
-
"show-items-per-page":
|
|
287
|
-
"items-per-page":
|
|
288
|
-
"items-per-page-options":
|
|
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:
|
|
291
|
-
"onUpdate:itemsPerPage":
|
|
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
|
-
])) :
|
|
294
|
-
|
|
295
|
-
show:
|
|
296
|
-
"onUpdate:show": t[2] || (t[2] = (
|
|
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:
|
|
303
|
-
onCancel: t[3] || (t[3] = (
|
|
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
|
-
|
|
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;
|