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