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.
@@ -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 b, watch as p, onMounted as te, openBlock as n, createElementBlock as i, createVNode as C, createSlots as j, withCtx as B, renderSlot as S, createBlock as D, createCommentVNode as I, createElementVNode as r, normalizeClass as R, Fragment as F, renderList as $, normalizeStyle as A, mergeProps as le, toDisplayString as M, createTextVNode as ae, unref as se } from "vue";
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 ue from "./DataTableHeader.vue.js";
8
- import ce from "./DataTableRow.vue.js";
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-4" }, he = { class: "overflow-x-auto w-full" }, ge = { class: "hover:bg-transparent" }, ve = {
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
- }, pe = { class: "flex items-center justify-center" }, ye = { class: "[&_tr:last-child]:border-0" }, we = {
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
- }, be = { 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 = {
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(a, { emit: U }) {
55
+ setup(l, { emit: U }) {
54
56
  const O = (e, t) => {
55
57
  if (!(!e || !t))
56
- return t.includes(".") ? t.split(".").reduce((s, c) => s?.[c], e) : e[t];
57
- }, u = (e, t) => O(e, t), l = a, y = U, d = v({ field: "", order: "" }), k = v(l.itemsPerPage), h = v(l.pageInfo?.currentPage || 1), w = v(l.search || ""), P = v(!1), g = v("initial"), L = b(() => l.loading && (g.value === "initial" || g.value === "page"));
58
- p(
59
- () => l.loading,
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
- ), p(
64
- () => l.search,
65
+ ), y(
66
+ () => a.search,
65
67
  (e) => {
66
- e !== void 0 && e !== w.value && (w.value = e);
68
+ e !== void 0 && e !== p.value && (p.value = e);
67
69
  }
68
70
  );
69
71
  let z = null;
70
- p(w, (e) => {
72
+ y(p, (e) => {
71
73
  z && clearTimeout(z), z = setTimeout(() => {
72
- h.value = 1, g.value = "search", x();
74
+ h.value = 1, g.value = "search", C();
73
75
  }, 300);
74
- }), p(
75
- () => l.itemsPerPage,
76
+ }), y(
77
+ () => a.itemsPerPage,
76
78
  (e) => {
77
79
  k.value = e;
78
80
  }
79
- ), p(
80
- () => l.pageInfo?.currentPage,
81
+ ), y(
82
+ () => a.pageInfo?.currentPage,
81
83
  (e) => {
82
84
  e && (h.value = e);
83
85
  }
84
86
  );
85
- const E = (e) => u(e, l.keyField), o = v(/* @__PURE__ */ new Set());
86
- p(
87
- () => l.selectedRows,
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) => u(s, l.keyField)));
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 = b(() => l.rows.length === 0 ? !1 : l.rows.every((e) => o.value.has(u(e, l.keyField)))), N = b(() => o.value.size > 0 && !T.value), W = b(() => {
95
- const e = [...l.selectedRows || [], ...l.rows], t = /* @__PURE__ */ new Map();
96
- return e.forEach((s) => t.set(u(s, l.keyField), s)), Array.from(o.value).map((s) => t.get(s)).filter(Boolean);
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 ? 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))), V();
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 = l.selectedRows || [], t = /* @__PURE__ */ new Set(), s = [];
103
- l.rows.forEach((m) => {
104
- const f = u(m, l.keyField);
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 = u(m, l.keyField);
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 c = {
112
+ const u = {
111
113
  selected: s,
112
114
  all: T.value,
113
115
  indeterminate: N.value
114
116
  };
115
- y("select", c), y("update:selectedRows", s);
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", x();
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", x();
121
+ h.value = e, g.value = "page", C();
120
122
  }, K = (e) => {
121
- k.value = e, h.value = 1, g.value = "limit", y("update:itemsPerPage", e), x();
123
+ k.value = e, h.value = 1, g.value = "limit", b("update:itemsPerPage", e), C();
122
124
  }, Q = (e) => {
123
- y("rowClick", e);
125
+ b("rowClick", e);
124
126
  }, X = () => {
125
127
  const e = W.value;
126
- y("delete", e), P.value = !1;
127
- }, x = () => {
128
- y("change", {
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: w.value
136
+ search: p.value
135
137
  });
136
- }, Y = b(() => [
138
+ }, Y = w(() => [
137
139
  "w-full flex flex-col",
138
- l.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
140
+ a.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
139
141
  "overflow-hidden",
140
- l.bordered ? "border border-border/60" : "",
141
- l.class
142
- ].join(" ")), Z = b(() => ["w-full caption-bottom -text-fs-1", l.tableClass].join(" ")), _ = (e) => e.width ? e.width : "auto";
143
- return p(
144
- () => l.rows,
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(l.rows.map((t) => u(t, l.keyField)));
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
- x();
152
+ C();
151
153
  }), (e, t) => (n(), i("div", fe, [
152
- C(me, {
153
- modelValue: w.value,
154
- "onUpdate:modelValue": t[1] || (t[1] = (s) => w.value = s),
155
- "show-search": a.showSearch,
156
- placeholder: a.searchPlaceholder
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: B(() => [
161
- S(e.$slots, "toolbar-left")
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: B(() => [
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
- })) : I("", !0)
179
+ })) : $("", !0)
176
180
  ]),
177
181
  key: "1"
178
182
  } : void 0,
179
183
  e.$slots?.["toolbar-right"] ? {
180
184
  name: "right",
181
- fn: B(() => [
182
- S(e.$slots, "toolbar-right")
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: R(Y.value)
192
+ class: S(Y.value)
189
193
  }, [
190
194
  r("div", he, [
191
195
  r("table", {
192
- class: R([Z.value, "data-table"])
196
+ class: S([Z.value, "data-table"])
193
197
  }, [
194
198
  r("thead", {
195
- class: R([
196
- "[&_tr]:border-b [&_tr]:border-border/70! bg-muted",
197
- a.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
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
- a.selectable ? (n(), i("th", ve, [
202
- r("div", pe, [
203
- C(ne, {
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
- ])) : I("", !0),
211
- (n(!0), i(F, null, $(a.headers, (s) => (n(), D(ue, {
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: a.compact,
216
- "table-sortable": a.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", ye, [
226
- L.value ? (n(!0), i(F, { key: 0 }, $(Math.min(k.value, 15), (s) => (n(), i("tr", {
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/50 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
232
+ class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
229
233
  }, [
230
- a.selectable ? (n(), i("td", we, [...t[4] || (t[4] = [
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
- ])])) : I("", !0),
235
- (n(!0), i(F, null, $(a.headers, (c) => (n(), i("td", {
236
- key: c.field,
237
- class: R(["p-5! align-middle last:pr-6!", [c.hideOnMobile ? "hidden md:table-cell" : ""]])
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)) : a.rows.length > 0 ? (n(!0), i(F, { key: 1 }, $(a.rows, (s, c) => (n(), D(ce, {
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: a.headers,
250
- index: c,
251
- "key-field": a.keyField,
252
- selectable: a.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: a.hoverable,
255
- striped: a.striped,
256
- compact: a.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
- $(a.headers, (m) => ({
265
+ B(l.headers, (m) => ({
262
266
  name: m.field,
263
- fn: B((f) => [
264
- S(e.$slots, m.field, le({ ref_for: !0 }, f))
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", be, [
271
+ ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), i("tr", we, [
268
272
  r("td", {
269
- colspan: a.selectable ? a.headers.length + 1 : a.headers.length,
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", xe, [
274
- C(oe, {
275
- icon: a.emptyIcon,
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", Ce, M(a.emptyTitle), 1),
283
+ r("h3", xe, M(l.emptyTitle), 1),
280
284
  r("p", Se, [
281
- S(e.$slots, "empty-description", {}, () => [
282
- ae(M(a.emptyDescription), 1)
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
- S(e.$slots, "empty-action")
287
- ])) : I("", !0)
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
- a.showPagination && a.pageInfo && a.pageInfo.totalPages > 1 ? (n(), i("div", $e, [
296
- C(se(de), {
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": a.pageInfo.totalPages,
302
+ "total-pages": l.pageInfo.totalPages,
299
303
  "show-page-info": !1,
300
- "show-items-per-page": a.showItemsPerPage,
304
+ "show-items-per-page": l.showItemsPerPage,
301
305
  "items-per-page": k.value,
302
- "items-per-page-options": a.itemsPerPageOptions,
306
+ "items-per-page-options": l.itemsPerPageOptions,
303
307
  "nav-type": "icon",
304
- alignment: l.paginationPosition,
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
- ])) : I("", !0),
309
- C(ie, {
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 border-border/70 transition-colors data-[state=selected]:bg-muted h-full", [
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 p, computed as f, openBlock as l, createElementBlock as o, renderSlot as a, createCommentVNode as d, createElementVNode as c, createVNode as h } from "vue";
2
- import V from "../Input.vue.js";
3
- const v = { class: "flex flex-col sm:flex-row items-center gap-4 p-1" }, _ = {
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
- }, g = { class: "ml-auto" }, w = {
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(t, { emit: n }) {
18
- const u = t, m = n, s = f({
19
- get: () => u.modelValue,
20
- set: (e) => m("update:modelValue", 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, r) => (l(), o("div", v, [
23
- e.$slots?.left ? (l(), o("div", _, [
24
- a(e.$slots, "left")
25
- ])) : d("", !0),
26
- c("div", g, [
27
- a(e.$slots, "delete")
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
- t.showSearch ? (l(), o("div", w, [
30
- h(V, {
31
- modelValue: s.value,
32
- "onUpdate:modelValue": r[0] || (r[0] = (i) => s.value = i),
33
- placeholder: t.placeholder,
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
- ])) : d("", !0),
40
- c("div", b, [
41
- a(e.$slots, "right")
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
- S as default
51
+ $ as default
48
52
  };
@@ -46,6 +46,8 @@ export interface DataTableProps {
46
46
  search?: string;
47
47
  showSearch?: boolean;
48
48
  searchPlaceholder?: string;
49
+ toolbarClass?: string;
50
+ toolbarSearchClass?: string;
49
51
  headers: TableHeader[];
50
52
  keyField?: string;
51
53
  loading?: boolean;
@@ -1,2 +1,27 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
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 n, openBlock as i, createBlock as c, unref as e } from "vue";
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 r from "./Button.vue.js";
4
- const p = /* @__PURE__ */ n({
3
+ import c from "./Button.vue.js";
4
+ const g = /* @__PURE__ */ a({
5
5
  __name: "ThemeToggle",
6
- setup(l) {
7
- const { theme: o, toggleTheme: t } = m();
8
- return (a, h) => (i(), c(r, {
9
- icon: e(o) === "light" ? "lucide:sun" : "lucide:moon",
10
- variant: "secondary",
11
- title: e(o) === "light" ? "Switch to dark mode" : "Switch to light mode",
12
- onClick: e(t)
13
- }, null, 8, ["icon", "title", "onClick"]));
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
- p as default
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.17",
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.9",
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"