vlite3 0.3.7 → 0.3.8
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 +4 -4
- package/components/DataList/DataList.vue.js +44 -52
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.js +155 -159
- package/components/Empty/Empty.vue.d.ts +27 -0
- package/components/Empty/Empty.vue.js +33 -0
- package/components/Empty/Empty.vue2.js +4 -0
- package/components/Empty/index.d.ts +1 -0
- package/components/Screen/Screen.vue.js +145 -141
- package/components/Screen/types.d.ts +2 -0
- package/package.json +1 -1
- package/style.css +5 -2
- package/types/button.d.ts +1 -1
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as W, computed as S, ref as y, provide as E, watch as N, resolveComponent as X, openBlock as a, createElementBlock as i, normalizeClass as D, createElementVNode as h, renderSlot as B, toDisplayString as f, createCommentVNode as m, createBlock as s, unref as I, createVNode as r, resolveDynamicComponent as R, Fragment as P, mergeProps as c, withCtx as o, createTextVNode as v } from "vue";
|
|
2
2
|
import Y from "../Input.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import u from "../Button.vue.js";
|
|
4
|
+
import F from "../Icon.vue.js";
|
|
5
5
|
import H from "../Modal.vue.js";
|
|
6
6
|
import Z from "../ConfirmationModal.vue.js";
|
|
7
7
|
import p from "../Pagination/Pagination.vue.js";
|
|
8
|
-
import _ from "
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class: "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"
|
|
13
|
-
}, ne = { class: "flex flex-col shrink-0" }, le = {
|
|
8
|
+
import _ from "../Empty/Empty.vue.js";
|
|
9
|
+
import ee from "./ScreenFilter.vue.js";
|
|
10
|
+
import { usePersistentState as te } from "../../utils/usePersistentState.js";
|
|
11
|
+
const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex-col shrink-0" }, le = {
|
|
14
12
|
key: 0,
|
|
15
13
|
class: "text-fs-7.5 font-bold text-foreground"
|
|
16
14
|
}, de = {
|
|
@@ -22,13 +20,13 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
22
20
|
}, re = {
|
|
23
21
|
key: 4,
|
|
24
22
|
class: "w-full md:w-60! max-sm:order-last"
|
|
25
|
-
}, ue = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, ce = ["href", "target"], fe =
|
|
23
|
+
}, ue = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, ce = ["href", "target"], fe = ["href", "target"], me = {
|
|
26
24
|
key: 1,
|
|
27
25
|
class: "p-8 text-center text-muted-foreground border border-dashed border-border rounded-lg"
|
|
28
|
-
},
|
|
26
|
+
}, ve = {
|
|
29
27
|
key: 2,
|
|
30
28
|
class: "-mt-2"
|
|
31
|
-
},
|
|
29
|
+
}, $e = /* @__PURE__ */ W({
|
|
32
30
|
__name: "Screen",
|
|
33
31
|
props: {
|
|
34
32
|
name: { default: "" },
|
|
@@ -45,7 +43,7 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
45
43
|
itemsPerPageOptions: [10, 25, 50, 100]
|
|
46
44
|
}) },
|
|
47
45
|
emptyTitle: { default: "No records found" },
|
|
48
|
-
emptyDescription: { default: "
|
|
46
|
+
emptyDescription: { default: "There are currently no items to show" },
|
|
49
47
|
emptyIcon: { default: "lucide:inbox" },
|
|
50
48
|
addComponent: {},
|
|
51
49
|
addBtn: {},
|
|
@@ -57,108 +55,113 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
57
55
|
pagination: { type: Boolean, default: !0 },
|
|
58
56
|
filterSchema: { default: () => [] },
|
|
59
57
|
filterType: { default: "modal" },
|
|
60
|
-
showRefresh: { type: Boolean, default: !1 }
|
|
58
|
+
showRefresh: { type: Boolean, default: !1 },
|
|
59
|
+
containerClass: {},
|
|
60
|
+
headerClass: {}
|
|
61
61
|
},
|
|
62
62
|
emits: ["add", "delete"],
|
|
63
63
|
setup(e, { emit: L }) {
|
|
64
|
-
const l = e,
|
|
64
|
+
const l = e, U = L, K = S(() => l.name || l.title || "default-screen"), b = te(
|
|
65
65
|
`view-mode-${K.value}`,
|
|
66
66
|
l.table ? "table" : "list"
|
|
67
|
-
),
|
|
68
|
-
E("screen-selected-rows",
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
), x = y(""), A = y({}), w = y(l.pageInfo?.currentPage || 1), $ = y(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), g = y([]), j = y([]), k = y(!1);
|
|
68
|
+
E("screen-selected-rows", g), E("screen-request-delete", (t) => T(t));
|
|
69
|
+
const T = (t) => {
|
|
70
|
+
j.value = t, k.value = !0;
|
|
71
71
|
}, O = () => {
|
|
72
|
-
|
|
72
|
+
U("delete", j.value), k.value = !1, g.value = [];
|
|
73
73
|
}, Q = (t) => {
|
|
74
|
-
|
|
74
|
+
U("delete", t), g.value = [];
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
N(
|
|
77
77
|
() => l.pageInfo?.currentPage,
|
|
78
78
|
(t) => {
|
|
79
|
-
t && (
|
|
79
|
+
t && (w.value = t);
|
|
80
80
|
}
|
|
81
|
-
),
|
|
81
|
+
), N(
|
|
82
82
|
() => l.pageInfo?.itemsPerPage,
|
|
83
83
|
(t) => {
|
|
84
84
|
t && ($.value = t);
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
let V = null;
|
|
88
|
+
N(x, (t) => {
|
|
89
|
+
V && clearTimeout(V), V = setTimeout(() => {
|
|
90
|
+
w.value = 1, C();
|
|
91
91
|
}, 300);
|
|
92
92
|
});
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
$.value = t,
|
|
97
|
-
},
|
|
93
|
+
const G = (t) => {
|
|
94
|
+
w.value = t, C();
|
|
95
|
+
}, J = (t) => {
|
|
96
|
+
$.value = t, w.value = 1, C();
|
|
97
|
+
}, C = () => {
|
|
98
98
|
const t = {
|
|
99
99
|
pageinfo: {
|
|
100
|
-
page:
|
|
100
|
+
page: w.value,
|
|
101
101
|
limit: $.value
|
|
102
102
|
},
|
|
103
103
|
pagination: {
|
|
104
|
-
page:
|
|
104
|
+
page: w.value,
|
|
105
105
|
limit: $.value
|
|
106
106
|
},
|
|
107
|
-
search:
|
|
108
|
-
filter:
|
|
107
|
+
search: x.value,
|
|
108
|
+
filter: A.value
|
|
109
109
|
};
|
|
110
110
|
l.refetch && l.refetch(t);
|
|
111
|
-
}, z =
|
|
111
|
+
}, z = S(() => b.value === "table" && l.table ? l.table : l.list), M = S(() => l.data && l.data.length > 0);
|
|
112
112
|
return (t, n) => {
|
|
113
113
|
const q = X("router-link");
|
|
114
|
-
return a(), i("div",
|
|
115
|
-
e.customHeader ? B(t.$slots, "custom-header", { key: 1 }) : (a(), i("div",
|
|
116
|
-
|
|
114
|
+
return a(), i("div", ae, [
|
|
115
|
+
e.customHeader ? B(t.$slots, "custom-header", { key: 1 }) : (a(), i("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: D([e.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
|
|
118
|
+
}, [
|
|
119
|
+
h("div", ne, [
|
|
117
120
|
B(t.$slots, "title", {}, () => [
|
|
118
|
-
e.title ? (a(), i("h1", le,
|
|
121
|
+
e.title ? (a(), i("h1", le, f(e.title), 1)) : m("", !0)
|
|
119
122
|
]),
|
|
120
123
|
B(t.$slots, "description", {}, () => [
|
|
121
|
-
e.description ? (a(), i("p", de,
|
|
124
|
+
e.description ? (a(), i("p", de, f(e.description), 1)) : m("", !0)
|
|
122
125
|
])
|
|
123
126
|
]),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
h("div", ie, [
|
|
128
|
+
h("div", oe, [
|
|
129
|
+
g.value.length > 0 ? (a(), s(u, {
|
|
127
130
|
key: 0,
|
|
128
131
|
variant: "outline",
|
|
129
132
|
class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
|
|
130
133
|
icon: "lucide:trash-2",
|
|
131
134
|
title: "Delete Selected",
|
|
132
|
-
onClick: n[0] || (n[0] = (d) =>
|
|
133
|
-
})) :
|
|
135
|
+
onClick: n[0] || (n[0] = (d) => T(g.value))
|
|
136
|
+
})) : m("", !0),
|
|
134
137
|
e.table && e.list ? (a(), i("div", se, [
|
|
135
|
-
|
|
136
|
-
onClick: n[1] || (n[1] = (d) =>
|
|
137
|
-
class:
|
|
138
|
-
|
|
138
|
+
h("button", {
|
|
139
|
+
onClick: n[1] || (n[1] = (d) => b.value = "list"),
|
|
140
|
+
class: D(["p-1.5 rounded", [
|
|
141
|
+
I(b) === "list" ? "bg-secondary/85 dark:bg-gray-250 shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
139
142
|
]]),
|
|
140
143
|
title: "List View"
|
|
141
144
|
}, [
|
|
142
|
-
|
|
145
|
+
r(F, {
|
|
143
146
|
icon: "lucide:layout-grid",
|
|
144
147
|
class: "w-4 h-4"
|
|
145
148
|
})
|
|
146
149
|
], 2),
|
|
147
|
-
|
|
148
|
-
onClick: n[2] || (n[2] = (d) =>
|
|
149
|
-
class:
|
|
150
|
-
|
|
150
|
+
h("button", {
|
|
151
|
+
onClick: n[2] || (n[2] = (d) => b.value = "table"),
|
|
152
|
+
class: D(["p-1.5 rounded", [
|
|
153
|
+
I(b) === "table" ? "bg-secondary/85 dark:bg-gray-250 shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
151
154
|
]]),
|
|
152
155
|
title: "Table View"
|
|
153
156
|
}, [
|
|
154
|
-
|
|
157
|
+
r(F, {
|
|
155
158
|
icon: "lucide:list",
|
|
156
159
|
class: "w-4 h-4"
|
|
157
160
|
})
|
|
158
161
|
], 2)
|
|
159
|
-
])) :
|
|
162
|
+
])) : m("", !0),
|
|
160
163
|
B(t.$slots, "before-search"),
|
|
161
|
-
e.showRefresh ? (a(),
|
|
164
|
+
e.showRefresh ? (a(), s(u, {
|
|
162
165
|
key: 2,
|
|
163
166
|
variant: "outline",
|
|
164
167
|
icon: "lucide:refresh-cw",
|
|
@@ -166,34 +169,34 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
166
169
|
class: "shrink-0 h-9! w-9!",
|
|
167
170
|
title: "Refresh",
|
|
168
171
|
disabled: e.loading,
|
|
169
|
-
onClick:
|
|
170
|
-
}, null, 8, ["disabled"])) :
|
|
171
|
-
e.filterSchema && e.filterSchema.length > 0 ? (a(),
|
|
172
|
+
onClick: C
|
|
173
|
+
}, null, 8, ["disabled"])) : m("", !0),
|
|
174
|
+
e.filterSchema && e.filterSchema.length > 0 ? (a(), s(ee, {
|
|
172
175
|
key: 3,
|
|
173
176
|
schema: e.filterSchema,
|
|
174
177
|
type: e.filterType,
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue": n[3] || (n[3] = (d) =>
|
|
177
|
-
onChange:
|
|
178
|
-
}, null, 8, ["schema", "type", "modelValue"])) :
|
|
178
|
+
modelValue: A.value,
|
|
179
|
+
"onUpdate:modelValue": n[3] || (n[3] = (d) => A.value = d),
|
|
180
|
+
onChange: C
|
|
181
|
+
}, null, 8, ["schema", "type", "modelValue"])) : m("", !0),
|
|
179
182
|
e.canSearch ? (a(), i("div", re, [
|
|
180
|
-
|
|
183
|
+
r(Y, {
|
|
181
184
|
lazy: "",
|
|
182
|
-
modelValue:
|
|
183
|
-
"onUpdate:modelValue": n[4] || (n[4] = (d) =>
|
|
185
|
+
modelValue: x.value,
|
|
186
|
+
"onUpdate:modelValue": n[4] || (n[4] = (d) => x.value = d),
|
|
184
187
|
icon: "lucide:search",
|
|
185
188
|
placeholder: "Search...",
|
|
186
189
|
variant: "outline",
|
|
187
190
|
class: "bg-background w-full",
|
|
188
191
|
"show-clear-button": !0
|
|
189
192
|
}, null, 8, ["modelValue"])
|
|
190
|
-
])) :
|
|
193
|
+
])) : m("", !0)
|
|
191
194
|
]),
|
|
192
|
-
|
|
195
|
+
h("div", ue, [
|
|
193
196
|
B(t.$slots, "actions", {}, () => [
|
|
194
|
-
e.addComponent ? (a(),
|
|
197
|
+
e.addComponent ? (a(), s(R(e.addComponent), { key: 0 })) : e.canAdd ? (a(), i(P, { key: 1 }, [
|
|
195
198
|
e.addBtn ? (a(), i(P, { key: 0 }, [
|
|
196
|
-
e.addBtn.modal ? (a(),
|
|
199
|
+
e.addBtn.modal ? (a(), s(H, c({
|
|
197
200
|
key: 0,
|
|
198
201
|
body: e.addBtn.modal
|
|
199
202
|
}, e.addBtn.modalProps, {
|
|
@@ -202,32 +205,32 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
202
205
|
triggerClass: "w-full",
|
|
203
206
|
loading: e.loading
|
|
204
207
|
}), {
|
|
205
|
-
trigger:
|
|
206
|
-
|
|
208
|
+
trigger: o(() => [
|
|
209
|
+
r(u, c({
|
|
207
210
|
class: "w-full",
|
|
208
211
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
209
212
|
variant: e.addBtn.variant || "primary"
|
|
210
213
|
}, e.addBtn.buttonProps), {
|
|
211
|
-
default:
|
|
212
|
-
v(
|
|
214
|
+
default: o(() => [
|
|
215
|
+
v(f(e.addBtn.label || "Add"), 1)
|
|
213
216
|
]),
|
|
214
217
|
_: 1
|
|
215
218
|
}, 16, ["icon", "variant"])
|
|
216
219
|
]),
|
|
217
220
|
_: 1
|
|
218
|
-
}, 16, ["body", "refetch", "data", "loading"])) : e.addBtn.to ? (a(),
|
|
221
|
+
}, 16, ["body", "refetch", "data", "loading"])) : e.addBtn.to ? (a(), s(q, {
|
|
219
222
|
key: 1,
|
|
220
223
|
to: e.addBtn.to,
|
|
221
224
|
class: "inline-flex w-full sm:w-auto"
|
|
222
225
|
}, {
|
|
223
|
-
default:
|
|
224
|
-
|
|
226
|
+
default: o(() => [
|
|
227
|
+
r(u, c({
|
|
225
228
|
class: "w-full",
|
|
226
229
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
227
230
|
variant: e.addBtn.variant || "primary"
|
|
228
231
|
}, e.addBtn.buttonProps), {
|
|
229
|
-
default:
|
|
230
|
-
v(
|
|
232
|
+
default: o(() => [
|
|
233
|
+
v(f(e.addBtn.label || "Add"), 1)
|
|
231
234
|
]),
|
|
232
235
|
_: 1
|
|
233
236
|
}, 16, ["icon", "variant"])
|
|
@@ -239,17 +242,17 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
239
242
|
target: e.addBtn.target,
|
|
240
243
|
class: "inline-flex w-full sm:w-auto"
|
|
241
244
|
}, [
|
|
242
|
-
|
|
245
|
+
r(u, c({
|
|
243
246
|
class: "w-full",
|
|
244
247
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
245
248
|
variant: e.addBtn.variant || "primary"
|
|
246
249
|
}, e.addBtn.buttonProps), {
|
|
247
|
-
default:
|
|
248
|
-
v(
|
|
250
|
+
default: o(() => [
|
|
251
|
+
v(f(e.addBtn.label || "Add"), 1)
|
|
249
252
|
]),
|
|
250
253
|
_: 1
|
|
251
254
|
}, 16, ["icon", "variant"])
|
|
252
|
-
], 8, ce)) : (a(),
|
|
255
|
+
], 8, ce)) : (a(), s(u, c({
|
|
253
256
|
key: 3,
|
|
254
257
|
class: "w-full sm:w-auto",
|
|
255
258
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
@@ -257,71 +260,71 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
257
260
|
}, e.addBtn.buttonProps, {
|
|
258
261
|
onClick: n[5] || (n[5] = (d) => e.addBtn.onClick ? e.addBtn.onClick() : t.$emit("add"))
|
|
259
262
|
}), {
|
|
260
|
-
default:
|
|
261
|
-
v(
|
|
263
|
+
default: o(() => [
|
|
264
|
+
v(f(e.addBtn.label || "Add"), 1)
|
|
262
265
|
]),
|
|
263
266
|
_: 1
|
|
264
267
|
}, 16, ["icon", "variant"]))
|
|
265
|
-
], 64)) : (a(),
|
|
268
|
+
], 64)) : (a(), s(u, {
|
|
266
269
|
key: 1,
|
|
267
270
|
class: "w-full sm:w-auto",
|
|
268
271
|
icon: "fluent:add-16-filled",
|
|
269
272
|
variant: "primary",
|
|
270
273
|
onClick: n[6] || (n[6] = (d) => t.$emit("add"))
|
|
271
274
|
}, {
|
|
272
|
-
default:
|
|
275
|
+
default: o(() => [...n[12] || (n[12] = [
|
|
273
276
|
v(" Add ", -1)
|
|
274
277
|
])]),
|
|
275
278
|
_: 1
|
|
276
279
|
}))
|
|
277
|
-
], 64)) :
|
|
280
|
+
], 64)) : m("", !0)
|
|
278
281
|
]),
|
|
279
282
|
B(t.$slots, "after-add")
|
|
280
283
|
])
|
|
281
284
|
])
|
|
282
|
-
])),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
r("div", he, [
|
|
295
|
-
e.addComponent ? (a(), o(N(e.addComponent), { key: 0 })) : e.canAdd ? (a(), i(P, { key: 1 }, [
|
|
285
|
+
], 2)),
|
|
286
|
+
h("div", {
|
|
287
|
+
class: D(["flex-1 w-full relative min-h-[300px]", e.containerClass])
|
|
288
|
+
}, [
|
|
289
|
+
!M.value && !e.loading ? B(t.$slots, "empty", { key: 0 }, () => [
|
|
290
|
+
r(I(_), {
|
|
291
|
+
title: e.emptyTitle,
|
|
292
|
+
description: e.emptyDescription,
|
|
293
|
+
icon: e.emptyIcon
|
|
294
|
+
}, {
|
|
295
|
+
action: o(() => [
|
|
296
|
+
e.addComponent ? (a(), s(R(e.addComponent), { key: 0 })) : e.canAdd ? (a(), i(P, { key: 1 }, [
|
|
296
297
|
e.addBtn ? (a(), i(P, { key: 0 }, [
|
|
297
|
-
e.addBtn.modal ? (a(),
|
|
298
|
+
e.addBtn.modal ? (a(), s(H, c({
|
|
298
299
|
key: 0,
|
|
299
300
|
body: e.addBtn.modal
|
|
300
301
|
}, e.addBtn.modalProps), {
|
|
301
|
-
trigger:
|
|
302
|
-
|
|
302
|
+
trigger: o(() => [
|
|
303
|
+
r(u, c({
|
|
303
304
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
304
|
-
variant: e.addBtn.variant || "
|
|
305
|
+
variant: e.addBtn.variant || "primary",
|
|
306
|
+
rounded: "full",
|
|
307
|
+
class: "px-6!"
|
|
305
308
|
}, e.addBtn.buttonProps), {
|
|
306
|
-
default:
|
|
307
|
-
v(
|
|
309
|
+
default: o(() => [
|
|
310
|
+
v(f(e.addBtn.label || "Add New"), 1)
|
|
308
311
|
]),
|
|
309
312
|
_: 1
|
|
310
313
|
}, 16, ["icon", "variant"])
|
|
311
314
|
]),
|
|
312
315
|
_: 1
|
|
313
|
-
}, 16, ["body"])) : e.addBtn.to ? (a(),
|
|
316
|
+
}, 16, ["body"])) : e.addBtn.to ? (a(), s(q, {
|
|
314
317
|
key: 1,
|
|
315
318
|
to: e.addBtn.to,
|
|
316
319
|
class: "inline-flex"
|
|
317
320
|
}, {
|
|
318
|
-
default:
|
|
319
|
-
|
|
321
|
+
default: o(() => [
|
|
322
|
+
r(u, c({
|
|
320
323
|
icon: e.addBtn.icon || "fluent:add-16-filled",
|
|
321
324
|
variant: e.addBtn.variant || "outline"
|
|
322
325
|
}, e.addBtn.buttonProps), {
|
|
323
|
-
default:
|
|
324
|
-
v(
|
|
326
|
+
default: o(() => [
|
|
327
|
+
v(f(e.addBtn.label || "Add New"), 1)
|
|
325
328
|
]),
|
|
326
329
|
_: 1
|
|
327
330
|
}, 16, ["icon", "variant"])
|
|
@@ -333,65 +336,66 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
333
336
|
target: e.addBtn.target,
|
|
334
337
|
class: "inline-flex"
|
|
335
338
|
}, [
|
|
336
|
-
|
|
339
|
+
r(u, c({
|
|
337
340
|
icon: e.addBtn.icon || "lucide:plus",
|
|
338
341
|
variant: e.addBtn.variant || "outline"
|
|
339
342
|
}, e.addBtn.buttonProps), {
|
|
340
|
-
default:
|
|
341
|
-
v(
|
|
343
|
+
default: o(() => [
|
|
344
|
+
v(f(e.addBtn.label || "Add New"), 1)
|
|
342
345
|
]),
|
|
343
346
|
_: 1
|
|
344
347
|
}, 16, ["icon", "variant"])
|
|
345
|
-
], 8,
|
|
348
|
+
], 8, fe)) : (a(), s(u, c({
|
|
346
349
|
key: 3,
|
|
347
350
|
icon: e.addBtn.icon || "lucide:plus",
|
|
348
351
|
variant: e.addBtn.variant || "outline"
|
|
349
352
|
}, e.addBtn.buttonProps, {
|
|
350
353
|
onClick: n[7] || (n[7] = (d) => e.addBtn.onClick ? e.addBtn.onClick() : t.$emit("add"))
|
|
351
354
|
}), {
|
|
352
|
-
default:
|
|
353
|
-
v(
|
|
355
|
+
default: o(() => [
|
|
356
|
+
v(f(e.addBtn.label || "Add New"), 1)
|
|
354
357
|
]),
|
|
355
358
|
_: 1
|
|
356
359
|
}, 16, ["icon", "variant"]))
|
|
357
|
-
], 64)) : (a(),
|
|
360
|
+
], 64)) : (a(), s(u, {
|
|
358
361
|
key: 1,
|
|
359
362
|
icon: "lucide:plus",
|
|
360
363
|
variant: "outline",
|
|
361
364
|
onClick: n[8] || (n[8] = (d) => t.$emit("add"))
|
|
362
365
|
}, {
|
|
363
|
-
default:
|
|
366
|
+
default: o(() => [...n[13] || (n[13] = [
|
|
364
367
|
v(" Add New ", -1)
|
|
365
368
|
])]),
|
|
366
369
|
_: 1
|
|
367
370
|
}))
|
|
368
|
-
], 64)) :
|
|
369
|
-
])
|
|
370
|
-
|
|
371
|
+
], 64)) : m("", !0)
|
|
372
|
+
]),
|
|
373
|
+
_: 1
|
|
374
|
+
}, 8, ["title", "description", "icon"])
|
|
371
375
|
]) : (a(), i(P, { key: 1 }, [
|
|
372
|
-
z.value ? (a(),
|
|
376
|
+
z.value ? (a(), s(R(z.value), {
|
|
373
377
|
key: 0,
|
|
374
378
|
data: e.data,
|
|
375
379
|
loading: e.loading,
|
|
376
380
|
refetch: e.refetch,
|
|
377
|
-
selectedRows:
|
|
378
|
-
"onUpdate:selectedRows": n[9] || (n[9] = (d) =>
|
|
379
|
-
delete:
|
|
381
|
+
selectedRows: g.value,
|
|
382
|
+
"onUpdate:selectedRows": n[9] || (n[9] = (d) => g.value = d),
|
|
383
|
+
delete: T,
|
|
380
384
|
onDelete: Q
|
|
381
|
-
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (a(), i("div",
|
|
385
|
+
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (a(), i("div", me, " Please provide a `:list` or `:table` component. "))
|
|
382
386
|
], 64))
|
|
383
|
-
]),
|
|
384
|
-
e.pagination && e.pageInfo && e.pageInfo.totalPages > 1 ? (a(), i("div",
|
|
385
|
-
|
|
387
|
+
], 2),
|
|
388
|
+
e.pagination && e.pageInfo && e.pageInfo.totalPages > 1 ? (a(), i("div", ve, [
|
|
389
|
+
r(I(p), c({
|
|
386
390
|
"current-page": e.pageInfo.currentPage,
|
|
387
391
|
"total-pages": e.pageInfo.totalPages,
|
|
388
392
|
"total-items": e.pageInfo.totalItems
|
|
389
393
|
}, e.paginationProps, {
|
|
390
|
-
onChange:
|
|
391
|
-
"onUpdate:itemsPerPage":
|
|
394
|
+
onChange: G,
|
|
395
|
+
"onUpdate:itemsPerPage": J
|
|
392
396
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
393
|
-
])) :
|
|
394
|
-
|
|
397
|
+
])) : m("", !0),
|
|
398
|
+
r(Z, {
|
|
395
399
|
show: k.value,
|
|
396
400
|
"onUpdate:show": n[10] || (n[10] = (d) => k.value = d),
|
|
397
401
|
title: "Confirm Deletion",
|
|
@@ -407,5 +411,5 @@ const te = { class: "flex flex-col w-full space-y-8" }, ae = {
|
|
|
407
411
|
}
|
|
408
412
|
});
|
|
409
413
|
export {
|
|
410
|
-
|
|
414
|
+
$e as default
|
|
411
415
|
};
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -203,8 +203,9 @@
|
|
|
203
203
|
var(--color-mixture-1, #ffffff) 27%,
|
|
204
204
|
var(--color-mixture-2, #000000));
|
|
205
205
|
|
|
206
|
+
|
|
206
207
|
--color-gray-800: color-mix(in oklab,
|
|
207
|
-
var(--color-mixture-1, #ffffff)
|
|
208
|
+
var(--color-mixture-1, #ffffff) 17%,
|
|
208
209
|
var(--color-mixture-2, #000000));
|
|
209
210
|
|
|
210
211
|
--color-gray-850: color-mix(in oklab,
|
|
@@ -230,7 +231,9 @@
|
|
|
230
231
|
|
|
231
232
|
--color-muted-light: var(--color-gray-50);
|
|
232
233
|
--color-muted: var(--color-gray-100);
|
|
233
|
-
--color-muted-foreground:
|
|
234
|
+
--color-muted-foreground: color-mix(in oklab,
|
|
235
|
+
var(--color-mixture-1, #ffffff) 23%,
|
|
236
|
+
var(--color-mixture-2, #000000));
|
|
234
237
|
|
|
235
238
|
--color-accent: var(--color-gray-150);
|
|
236
239
|
--color-accent-foreground: var(--color-foreground);
|