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