vlite3 0.2.17 → 0.3.2
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/DataTable/DataTable.vue.d.ts +2 -0
- package/components/DataTable/DataTable.vue.js +116 -112
- package/components/DataTable/DataTableRow.vue.js +1 -1
- package/components/DataTable/DataTableToolbar.vue.d.ts +4 -0
- package/components/DataTable/DataTableToolbar.vue.js +32 -28
- package/components/DataTable/types.d.ts +2 -0
- package/components/ThemeToggle.vue.d.ts +26 -1
- package/components/ThemeToggle.vue.js +26 -12
- package/package.json +2 -2
|
@@ -47,6 +47,8 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
|
|
|
47
47
|
striped: boolean;
|
|
48
48
|
selectedRows: any[];
|
|
49
49
|
searchPlaceholder: string;
|
|
50
|
+
toolbarClass: string;
|
|
51
|
+
toolbarSearchClass: string;
|
|
50
52
|
emptyTitle: string;
|
|
51
53
|
emptyDescription: string;
|
|
52
54
|
emptyIcon: string;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as v, computed as
|
|
1
|
+
import { defineComponent as ee, ref as v, computed as w, watch as y, onMounted as te, openBlock as n, createElementBlock as i, createVNode as x, normalizeClass as S, createSlots as j, withCtx as R, renderSlot as I, createBlock as D, createCommentVNode as $, createElementVNode as r, Fragment as F, renderList as B, 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
3
|
import ne from "../CheckBox.vue.js";
|
|
4
4
|
import re from "../Button.vue.js";
|
|
5
5
|
import ie from "../ConfirmationModal.vue.js";
|
|
6
6
|
import de from "../Pagination/Pagination.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import ce from "./DataTableHeader.vue.js";
|
|
8
|
+
import ue from "./DataTableRow.vue.js";
|
|
9
9
|
import me from "./DataTableToolbar.vue.js";
|
|
10
|
-
const fe = { class: "space-y-
|
|
10
|
+
const fe = { class: "space-y-6.5" }, he = { class: "overflow-x-auto w-full" }, ge = { class: "hover:bg-transparent" }, ve = {
|
|
11
11
|
key: 0,
|
|
12
12
|
scope: "col",
|
|
13
13
|
class: "w-[48px] px-0 text-center font-medium text-muted-foreground",
|
|
14
14
|
style: { width: "48px" }
|
|
15
|
-
},
|
|
15
|
+
}, ye = { class: "flex items-center justify-center" }, be = { class: "[&_tr:last-child]:border-0" }, pe = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
18
18
|
style: { width: "48px" }
|
|
19
|
-
},
|
|
19
|
+
}, we = { key: 2 }, ke = ["colspan"], Pe = { class: "flex flex-col items-center justify-center gap-2 text-muted-foreground p-8" }, Ce = { class: "flex h-12 w-12 items-center justify-center rounded-full bg-muted" }, xe = { class: "mt-1 text-base font-semibold text-foreground" }, Se = { class: "text-sm max-w-sm mx-auto" }, Ie = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "mt-4"
|
|
22
22
|
}, $e = { key: 0 }, je = /* @__PURE__ */ ee({
|
|
@@ -27,6 +27,8 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
27
27
|
search: { default: "" },
|
|
28
28
|
showSearch: { type: Boolean, default: !0 },
|
|
29
29
|
searchPlaceholder: { default: "Search..." },
|
|
30
|
+
toolbarClass: { default: "" },
|
|
31
|
+
toolbarSearchClass: { default: "" },
|
|
30
32
|
headers: { default: () => [] },
|
|
31
33
|
keyField: { default: "_id" },
|
|
32
34
|
loading: { type: Boolean, default: !1 },
|
|
@@ -50,121 +52,123 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
50
52
|
variant: { default: "default" }
|
|
51
53
|
},
|
|
52
54
|
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
|
|
53
|
-
setup(
|
|
55
|
+
setup(l, { emit: U }) {
|
|
54
56
|
const O = (e, t) => {
|
|
55
57
|
if (!(!e || !t))
|
|
56
|
-
return t.includes(".") ? t.split(".").reduce((s,
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
() =>
|
|
58
|
+
return t.includes(".") ? t.split(".").reduce((s, u) => s?.[u], e) : e[t];
|
|
59
|
+
}, c = (e, t) => O(e, t), a = l, b = U, d = v({ field: "", order: "" }), k = v(a.itemsPerPage), h = v(a.pageInfo?.currentPage || 1), p = v(a.search || ""), P = v(!1), g = v("initial"), L = w(() => a.loading && (g.value === "initial" || g.value === "page"));
|
|
60
|
+
y(
|
|
61
|
+
() => a.loading,
|
|
60
62
|
(e, t) => {
|
|
61
63
|
!e && t && (g.value = "idle");
|
|
62
64
|
}
|
|
63
|
-
),
|
|
64
|
-
() =>
|
|
65
|
+
), y(
|
|
66
|
+
() => a.search,
|
|
65
67
|
(e) => {
|
|
66
|
-
e !== void 0 && e !==
|
|
68
|
+
e !== void 0 && e !== p.value && (p.value = e);
|
|
67
69
|
}
|
|
68
70
|
);
|
|
69
71
|
let z = null;
|
|
70
|
-
p
|
|
72
|
+
y(p, (e) => {
|
|
71
73
|
z && clearTimeout(z), z = setTimeout(() => {
|
|
72
|
-
h.value = 1, g.value = "search",
|
|
74
|
+
h.value = 1, g.value = "search", C();
|
|
73
75
|
}, 300);
|
|
74
|
-
}),
|
|
75
|
-
() =>
|
|
76
|
+
}), y(
|
|
77
|
+
() => a.itemsPerPage,
|
|
76
78
|
(e) => {
|
|
77
79
|
k.value = e;
|
|
78
80
|
}
|
|
79
|
-
),
|
|
80
|
-
() =>
|
|
81
|
+
), y(
|
|
82
|
+
() => a.pageInfo?.currentPage,
|
|
81
83
|
(e) => {
|
|
82
84
|
e && (h.value = e);
|
|
83
85
|
}
|
|
84
86
|
);
|
|
85
|
-
const E = (e) =>
|
|
86
|
-
|
|
87
|
-
() =>
|
|
87
|
+
const E = (e) => c(e, a.keyField), o = v(/* @__PURE__ */ new Set());
|
|
88
|
+
y(
|
|
89
|
+
() => a.selectedRows,
|
|
88
90
|
(e) => {
|
|
89
|
-
const t = new Set((e || []).map((s) =>
|
|
91
|
+
const t = new Set((e || []).map((s) => c(s, a.keyField)));
|
|
90
92
|
(t.size !== o.value.size || [...t].some((s) => !o.value.has(s))) && (o.value = t);
|
|
91
93
|
},
|
|
92
94
|
{ immediate: !0, deep: !0 }
|
|
93
95
|
);
|
|
94
|
-
const T =
|
|
95
|
-
const e = [...
|
|
96
|
-
return e.forEach((s) => t.set(
|
|
96
|
+
const T = w(() => a.rows.length === 0 ? !1 : a.rows.every((e) => o.value.has(c(e, a.keyField)))), N = w(() => o.value.size > 0 && !T.value), W = w(() => {
|
|
97
|
+
const e = [...a.selectedRows || [], ...a.rows], t = /* @__PURE__ */ new Map();
|
|
98
|
+
return e.forEach((s) => t.set(c(s, a.keyField), s)), Array.from(o.value).map((s) => t.get(s)).filter(Boolean);
|
|
97
99
|
}), q = (e) => {
|
|
98
|
-
e ?
|
|
100
|
+
e ? a.rows.forEach((t) => o.value.add(c(t, a.keyField))) : o.value.size > 0 && a.rows.forEach((t) => o.value.delete(c(t, a.keyField))), V();
|
|
99
101
|
}, G = (e) => {
|
|
100
102
|
o.value.has(e) ? o.value.delete(e) : o.value.add(e), V();
|
|
101
103
|
}, V = () => {
|
|
102
|
-
const e =
|
|
103
|
-
|
|
104
|
-
const f =
|
|
104
|
+
const e = a.selectedRows || [], t = /* @__PURE__ */ new Set(), s = [];
|
|
105
|
+
a.rows.forEach((m) => {
|
|
106
|
+
const f = c(m, a.keyField);
|
|
105
107
|
o.value.has(f) && (s.push(m), t.add(f));
|
|
106
108
|
}), e.forEach((m) => {
|
|
107
|
-
const f =
|
|
109
|
+
const f = c(m, a.keyField);
|
|
108
110
|
!t.has(f) && o.value.has(f) && (s.push(m), t.add(f));
|
|
109
111
|
});
|
|
110
|
-
const
|
|
112
|
+
const u = {
|
|
111
113
|
selected: s,
|
|
112
114
|
all: T.value,
|
|
113
115
|
indeterminate: N.value
|
|
114
116
|
};
|
|
115
|
-
|
|
117
|
+
b("select", u), b("update:selectedRows", s);
|
|
116
118
|
}, H = (e) => {
|
|
117
|
-
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, g.value = "sort",
|
|
119
|
+
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, g.value = "sort", C();
|
|
118
120
|
}, J = (e) => {
|
|
119
|
-
h.value = e, g.value = "page",
|
|
121
|
+
h.value = e, g.value = "page", C();
|
|
120
122
|
}, K = (e) => {
|
|
121
|
-
k.value = e, h.value = 1, g.value = "limit",
|
|
123
|
+
k.value = e, h.value = 1, g.value = "limit", b("update:itemsPerPage", e), C();
|
|
122
124
|
}, Q = (e) => {
|
|
123
|
-
|
|
125
|
+
b("rowClick", e);
|
|
124
126
|
}, X = () => {
|
|
125
127
|
const e = W.value;
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
128
|
+
b("delete", e), P.value = !1;
|
|
129
|
+
}, C = () => {
|
|
130
|
+
b("change", {
|
|
129
131
|
pagination: {
|
|
130
132
|
page: h.value,
|
|
131
133
|
limit: k.value
|
|
132
134
|
},
|
|
133
135
|
sorting: { ...d.value },
|
|
134
|
-
search:
|
|
136
|
+
search: p.value
|
|
135
137
|
});
|
|
136
|
-
}, Y =
|
|
138
|
+
}, Y = w(() => [
|
|
137
139
|
"w-full flex flex-col",
|
|
138
|
-
|
|
140
|
+
a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
|
|
139
141
|
"overflow-hidden",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
].join(" ")), Z =
|
|
143
|
-
return
|
|
144
|
-
() =>
|
|
142
|
+
a.bordered ? "border border-border" : "",
|
|
143
|
+
a.class
|
|
144
|
+
].join(" ")), Z = w(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), _ = (e) => e.width ? e.width : "auto";
|
|
145
|
+
return y(
|
|
146
|
+
() => a.rows,
|
|
145
147
|
() => {
|
|
146
|
-
const e = new Set(
|
|
148
|
+
const e = new Set(a.rows.map((t) => c(t, a.keyField)));
|
|
147
149
|
o.value = new Set([...o.value].filter((t) => e.has(t)));
|
|
148
150
|
}
|
|
149
151
|
), te(() => {
|
|
150
|
-
|
|
152
|
+
C();
|
|
151
153
|
}), (e, t) => (n(), i("div", fe, [
|
|
152
|
-
|
|
153
|
-
modelValue:
|
|
154
|
-
"onUpdate:modelValue": t[1] || (t[1] = (s) =>
|
|
155
|
-
"show-search":
|
|
156
|
-
placeholder:
|
|
154
|
+
x(me, {
|
|
155
|
+
modelValue: p.value,
|
|
156
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => p.value = s),
|
|
157
|
+
"show-search": l.showSearch,
|
|
158
|
+
placeholder: l.searchPlaceholder,
|
|
159
|
+
class: S(l.toolbarClass),
|
|
160
|
+
"search-class": l.toolbarSearchClass
|
|
157
161
|
}, j({ _: 2 }, [
|
|
158
162
|
e.$slots?.["toolbar-left"] ? {
|
|
159
163
|
name: "left",
|
|
160
|
-
fn:
|
|
161
|
-
|
|
164
|
+
fn: R(() => [
|
|
165
|
+
I(e.$slots, "toolbar-left")
|
|
162
166
|
]),
|
|
163
167
|
key: "0"
|
|
164
168
|
} : void 0,
|
|
165
169
|
o.value.size > 0 ? {
|
|
166
170
|
name: "delete",
|
|
167
|
-
fn:
|
|
171
|
+
fn: R(() => [
|
|
168
172
|
o.value.size > 0 ? (n(), D(re, {
|
|
169
173
|
key: 0,
|
|
170
174
|
rounded: "full",
|
|
@@ -172,48 +176,48 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
172
176
|
size: "lg",
|
|
173
177
|
icon: "lucide:trash-2",
|
|
174
178
|
onClick: t[0] || (t[0] = (s) => P.value = !0)
|
|
175
|
-
})) :
|
|
179
|
+
})) : $("", !0)
|
|
176
180
|
]),
|
|
177
181
|
key: "1"
|
|
178
182
|
} : void 0,
|
|
179
183
|
e.$slots?.["toolbar-right"] ? {
|
|
180
184
|
name: "right",
|
|
181
|
-
fn:
|
|
182
|
-
|
|
185
|
+
fn: R(() => [
|
|
186
|
+
I(e.$slots, "toolbar-right")
|
|
183
187
|
]),
|
|
184
188
|
key: "2"
|
|
185
189
|
} : void 0
|
|
186
|
-
]), 1032, ["modelValue", "show-search", "placeholder"]),
|
|
190
|
+
]), 1032, ["modelValue", "show-search", "placeholder", "class", "search-class"]),
|
|
187
191
|
r("div", {
|
|
188
|
-
class:
|
|
192
|
+
class: S(Y.value)
|
|
189
193
|
}, [
|
|
190
194
|
r("div", he, [
|
|
191
195
|
r("table", {
|
|
192
|
-
class:
|
|
196
|
+
class: S([Z.value, "data-table"])
|
|
193
197
|
}, [
|
|
194
198
|
r("thead", {
|
|
195
|
-
class:
|
|
196
|
-
"[&_tr]:border-b [&_tr]:border-border
|
|
197
|
-
|
|
199
|
+
class: S([
|
|
200
|
+
"[&_tr]:border-b [&_tr]:border-border bg-muted",
|
|
201
|
+
l.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
198
202
|
])
|
|
199
203
|
}, [
|
|
200
204
|
r("tr", ge, [
|
|
201
|
-
|
|
202
|
-
r("div",
|
|
203
|
-
|
|
205
|
+
l.selectable ? (n(), i("th", ve, [
|
|
206
|
+
r("div", ye, [
|
|
207
|
+
x(ne, {
|
|
204
208
|
"model-value": T.value,
|
|
205
209
|
indeterminate: N.value,
|
|
206
210
|
size: "xs",
|
|
207
211
|
"onUpdate:modelValue": q
|
|
208
212
|
}, null, 8, ["model-value", "indeterminate"])
|
|
209
213
|
])
|
|
210
|
-
])) :
|
|
211
|
-
(n(!0), i(F, null,
|
|
214
|
+
])) : $("", !0),
|
|
215
|
+
(n(!0), i(F, null, B(l.headers, (s) => (n(), D(ce, {
|
|
212
216
|
key: s.field,
|
|
213
217
|
header: s,
|
|
214
218
|
"sort-config": d.value,
|
|
215
|
-
compact:
|
|
216
|
-
"table-sortable":
|
|
219
|
+
compact: l.compact,
|
|
220
|
+
"table-sortable": l.sortable,
|
|
217
221
|
onSort: H,
|
|
218
222
|
class: "last:pr-5!",
|
|
219
223
|
style: A({
|
|
@@ -222,19 +226,19 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
222
226
|
}, null, 8, ["header", "sort-config", "compact", "table-sortable", "style"]))), 128))
|
|
223
227
|
])
|
|
224
228
|
], 2),
|
|
225
|
-
r("tbody",
|
|
226
|
-
L.value ? (n(!0), i(F, { key: 0 },
|
|
229
|
+
r("tbody", be, [
|
|
230
|
+
L.value ? (n(!0), i(F, { key: 0 }, B(Math.min(k.value, 15), (s) => (n(), i("tr", {
|
|
227
231
|
key: "skeleton-" + s,
|
|
228
|
-
class: "border-b border-border/
|
|
232
|
+
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
229
233
|
}, [
|
|
230
|
-
|
|
234
|
+
l.selectable ? (n(), i("td", pe, [...t[4] || (t[4] = [
|
|
231
235
|
r("div", { class: "flex items-center justify-center" }, [
|
|
232
236
|
r("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
233
237
|
], -1)
|
|
234
|
-
])])) :
|
|
235
|
-
(n(!0), i(F, null,
|
|
236
|
-
key:
|
|
237
|
-
class:
|
|
238
|
+
])])) : $("", !0),
|
|
239
|
+
(n(!0), i(F, null, B(l.headers, (u) => (n(), i("td", {
|
|
240
|
+
key: u.field,
|
|
241
|
+
class: S(["p-5! align-middle last:pr-6!", [u.hideOnMobile ? "hidden md:table-cell" : ""]])
|
|
238
242
|
}, [
|
|
239
243
|
r("div", {
|
|
240
244
|
class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
|
|
@@ -243,48 +247,48 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
243
247
|
})
|
|
244
248
|
}, null, 4)
|
|
245
249
|
], 2))), 128))
|
|
246
|
-
]))), 128)) :
|
|
250
|
+
]))), 128)) : l.rows.length > 0 ? (n(!0), i(F, { key: 1 }, B(l.rows, (s, u) => (n(), D(ue, {
|
|
247
251
|
key: E(s),
|
|
248
252
|
row: s,
|
|
249
|
-
headers:
|
|
250
|
-
index:
|
|
251
|
-
"key-field":
|
|
252
|
-
selectable:
|
|
253
|
+
headers: l.headers,
|
|
254
|
+
index: u,
|
|
255
|
+
"key-field": l.keyField,
|
|
256
|
+
selectable: l.selectable,
|
|
253
257
|
"is-selected": o.value.has(E(s)),
|
|
254
|
-
hoverable:
|
|
255
|
-
striped:
|
|
256
|
-
compact:
|
|
258
|
+
hoverable: l.hoverable,
|
|
259
|
+
striped: l.striped,
|
|
260
|
+
compact: l.compact,
|
|
257
261
|
onSelect: G,
|
|
258
262
|
onRowClick: Q,
|
|
259
263
|
class: "[&_td:last-child]:pr-3.5!"
|
|
260
264
|
}, j({ _: 2 }, [
|
|
261
|
-
|
|
265
|
+
B(l.headers, (m) => ({
|
|
262
266
|
name: m.field,
|
|
263
|
-
fn:
|
|
264
|
-
|
|
267
|
+
fn: R((f) => [
|
|
268
|
+
I(e.$slots, m.field, le({ ref_for: !0 }, f))
|
|
265
269
|
])
|
|
266
270
|
}))
|
|
267
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr",
|
|
271
|
+
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr", we, [
|
|
268
272
|
r("td", {
|
|
269
|
-
colspan:
|
|
273
|
+
colspan: l.selectable ? l.headers.length + 1 : l.headers.length,
|
|
270
274
|
class: "h-96 text-center align-middle hover:bg-transparent"
|
|
271
275
|
}, [
|
|
272
276
|
r("div", Pe, [
|
|
273
|
-
r("div",
|
|
274
|
-
|
|
275
|
-
icon:
|
|
277
|
+
r("div", Ce, [
|
|
278
|
+
x(oe, {
|
|
279
|
+
icon: l.emptyIcon,
|
|
276
280
|
class: "h-6 w-6 text-muted-foreground/80"
|
|
277
281
|
}, null, 8, ["icon"])
|
|
278
282
|
]),
|
|
279
|
-
r("h3",
|
|
283
|
+
r("h3", xe, M(l.emptyTitle), 1),
|
|
280
284
|
r("p", Se, [
|
|
281
|
-
|
|
282
|
-
ae(M(
|
|
285
|
+
I(e.$slots, "empty-description", {}, () => [
|
|
286
|
+
ae(M(l.emptyDescription), 1)
|
|
283
287
|
])
|
|
284
288
|
]),
|
|
285
289
|
e.$slots["empty-action"] ? (n(), i("div", Ie, [
|
|
286
|
-
|
|
287
|
-
])) :
|
|
290
|
+
I(e.$slots, "empty-action")
|
|
291
|
+
])) : $("", !0)
|
|
288
292
|
])
|
|
289
293
|
], 8, ke)
|
|
290
294
|
]))
|
|
@@ -292,21 +296,21 @@ const fe = { class: "space-y-4" }, he = { class: "overflow-x-auto w-full" }, ge
|
|
|
292
296
|
], 2)
|
|
293
297
|
])
|
|
294
298
|
], 2),
|
|
295
|
-
|
|
296
|
-
|
|
299
|
+
l.showPagination && l.pageInfo && l.pageInfo.totalPages > 1 ? (n(), i("div", $e, [
|
|
300
|
+
x(se(de), {
|
|
297
301
|
"current-page": h.value,
|
|
298
|
-
"total-pages":
|
|
302
|
+
"total-pages": l.pageInfo.totalPages,
|
|
299
303
|
"show-page-info": !1,
|
|
300
|
-
"show-items-per-page":
|
|
304
|
+
"show-items-per-page": l.showItemsPerPage,
|
|
301
305
|
"items-per-page": k.value,
|
|
302
|
-
"items-per-page-options":
|
|
306
|
+
"items-per-page-options": l.itemsPerPageOptions,
|
|
303
307
|
"nav-type": "icon",
|
|
304
|
-
alignment:
|
|
308
|
+
alignment: a.paginationPosition,
|
|
305
309
|
onChange: J,
|
|
306
310
|
"onUpdate:itemsPerPage": K
|
|
307
311
|
}, null, 8, ["current-page", "total-pages", "show-items-per-page", "items-per-page", "items-per-page-options", "alignment"])
|
|
308
|
-
])) :
|
|
309
|
-
|
|
312
|
+
])) : $("", !0),
|
|
313
|
+
x(ie, {
|
|
310
314
|
show: P.value,
|
|
311
315
|
"onUpdate:show": t[2] || (t[2] = (s) => P.value = s),
|
|
312
316
|
title: "Confirm Deletion",
|
|
@@ -63,7 +63,7 @@ const L = ["data-state"], U = { class: "flex items-center justify-center" }, h =
|
|
|
63
63
|
a("select", b.value);
|
|
64
64
|
};
|
|
65
65
|
return (e, t) => (c(), d("tr", {
|
|
66
|
-
class: u(["border-b
|
|
66
|
+
class: u(["border-b transition-colors data-[state=selected]:bg-muted h-full", [
|
|
67
67
|
i.hoverable ? "hover:bg-muted/20" : "",
|
|
68
68
|
i.striped && i.index % 2 === 1 ? "bg-muted/20" : "bg-background",
|
|
69
69
|
i.isSelected ? "bg-muted! hover:bg-muted/30" : "",
|
|
@@ -2,6 +2,8 @@ interface Props {
|
|
|
2
2
|
modelValue?: string;
|
|
3
3
|
showSearch?: boolean;
|
|
4
4
|
placeholder?: string;
|
|
5
|
+
class?: string;
|
|
6
|
+
searchClass?: string;
|
|
5
7
|
}
|
|
6
8
|
declare function __VLS_template(): {
|
|
7
9
|
attrs: Partial<{}>;
|
|
@@ -19,9 +21,11 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
19
21
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
20
22
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
21
23
|
}>, {
|
|
24
|
+
class: string;
|
|
22
25
|
placeholder: string;
|
|
23
26
|
modelValue: string;
|
|
24
27
|
showSearch: boolean;
|
|
28
|
+
searchClass: string;
|
|
25
29
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
26
30
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
31
|
export default _default;
|
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, computed as p, openBlock as a, createElementBlock as t, normalizeClass as d, renderSlot as o, createCommentVNode as u, createElementVNode as n, createVNode as V } from "vue";
|
|
2
|
+
import v from "../Input.vue.js";
|
|
3
|
+
const g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex items-center gap-3 mr-auto"
|
|
6
|
-
},
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "w-full sm:w-72!"
|
|
9
|
-
}, b = { class: "flex items-center gap-3" }, S = /* @__PURE__ */ p({
|
|
6
|
+
}, w = { class: "ml-auto" }, b = { class: "flex items-center gap-3" }, $ = /* @__PURE__ */ h({
|
|
10
7
|
__name: "DataTableToolbar",
|
|
11
8
|
props: {
|
|
12
9
|
modelValue: { default: "" },
|
|
13
10
|
showSearch: { type: Boolean, default: !0 },
|
|
14
|
-
placeholder: { default: "Search..." }
|
|
11
|
+
placeholder: { default: "Search..." },
|
|
12
|
+
class: { default: "" },
|
|
13
|
+
searchClass: { default: "" }
|
|
15
14
|
},
|
|
16
15
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
get: () =>
|
|
20
|
-
set: (e) =>
|
|
16
|
+
setup(l, { emit: m }) {
|
|
17
|
+
const s = l, i = m, r = p({
|
|
18
|
+
get: () => s.modelValue,
|
|
19
|
+
set: (e) => i("update:modelValue", e)
|
|
21
20
|
});
|
|
22
|
-
return (e,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
return (e, c) => (a(), t("div", {
|
|
22
|
+
class: d(["flex flex-col sm:flex-row items-center gap-4 p-1", s.class])
|
|
23
|
+
}, [
|
|
24
|
+
e.$slots?.left ? (a(), t("div", g, [
|
|
25
|
+
o(e.$slots, "left")
|
|
26
|
+
])) : u("", !0),
|
|
27
|
+
n("div", w, [
|
|
28
|
+
o(e.$slots, "delete")
|
|
28
29
|
]),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
l.showSearch ? (a(), t("div", {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: d(["w-full sm:w-72!", l.searchClass])
|
|
33
|
+
}, [
|
|
34
|
+
V(v, {
|
|
35
|
+
modelValue: r.value,
|
|
36
|
+
"onUpdate:modelValue": c[0] || (c[0] = (f) => r.value = f),
|
|
37
|
+
placeholder: l.placeholder,
|
|
34
38
|
icon: "lucide:search",
|
|
35
39
|
variant: "outline",
|
|
36
40
|
class: "bg-background",
|
|
37
41
|
"show-clear-button": !0
|
|
38
42
|
}, null, 8, ["modelValue", "placeholder"])
|
|
39
|
-
])) :
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
], 2)) : u("", !0),
|
|
44
|
+
n("div", b, [
|
|
45
|
+
o(e.$slots, "right")
|
|
42
46
|
])
|
|
43
|
-
]));
|
|
47
|
+
], 2));
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
export {
|
|
47
|
-
|
|
51
|
+
$ as default
|
|
48
52
|
};
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { ButtonRounded, ButtonSize, ButtonVariant } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: string;
|
|
4
|
+
rounded?: ButtonRounded;
|
|
5
|
+
size?: ButtonSize;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
};
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: {
|
|
11
|
+
default?(_: {
|
|
12
|
+
toggleTheme: () => void;
|
|
13
|
+
theme: "light" | "dark";
|
|
14
|
+
}): any;
|
|
15
|
+
};
|
|
16
|
+
refs: {};
|
|
17
|
+
rootEl: any;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
2
22
|
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, renderSlot as l, unref as e, createVNode as r, normalizeClass as s } from "vue";
|
|
2
2
|
import { useTheme as m } from "../composables/useTheme.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import c from "./Button.vue.js";
|
|
4
|
+
const g = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ThemeToggle",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
props: {
|
|
7
|
+
class: {},
|
|
8
|
+
rounded: {},
|
|
9
|
+
size: {},
|
|
10
|
+
variant: {}
|
|
11
|
+
},
|
|
12
|
+
setup(t) {
|
|
13
|
+
const { theme: o, toggleTheme: n } = m();
|
|
14
|
+
return (i, d) => l(i.$slots, "default", {
|
|
15
|
+
toggleTheme: e(n),
|
|
16
|
+
theme: e(o)
|
|
17
|
+
}, () => [
|
|
18
|
+
r(c, {
|
|
19
|
+
icon: e(o) === "light" ? "lucide:sun" : "lucide:moon",
|
|
20
|
+
variant: t.variant || "secondary",
|
|
21
|
+
rounded: t.rounded || "md",
|
|
22
|
+
size: t.size,
|
|
23
|
+
class: s(t.class),
|
|
24
|
+
title: e(o) === "light" ? "Switch to dark mode" : "Switch to light mode",
|
|
25
|
+
onClick: e(n)
|
|
26
|
+
}, null, 8, ["icon", "variant", "rounded", "size", "class", "title", "onClick"])
|
|
27
|
+
]);
|
|
14
28
|
}
|
|
15
29
|
});
|
|
16
30
|
export {
|
|
17
|
-
|
|
31
|
+
g as default
|
|
18
32
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "A Vue 3 UI component library built with Tailwind CSS.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.2
|
|
6
|
+
"version": "0.3.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"module": "index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"scrollreveal": "^4.0.9",
|
|
41
41
|
"tailwindcss": "^4.1.18",
|
|
42
42
|
"v-datepicker-lite": "^0.1.6",
|
|
43
|
-
"v-tooltip-lite": "^0.1
|
|
43
|
+
"v-tooltip-lite": "^0.2.1",
|
|
44
44
|
"vue-carousel-lite": "^0.2.7",
|
|
45
45
|
"vue-draggable-plus": "^0.5.3",
|
|
46
46
|
"vue3-google-signin": "^2.1.1"
|