vlite3 0.7.6 → 0.7.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/DataTable/DataTable.vue.d.ts +2 -2
- package/components/DataTable/DataTable.vue.js +159 -200
- package/components/DataTable/DataTableHeader.vue.js +24 -22
- package/components/DataTable/types.d.ts +18 -7
- package/components/Screen/Screen.vue.js +216 -220
- package/components/Screen/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as $e, useSlots as Ie, computed as i, ref as y, provide as z, watch as H, resolveComponent as Se, openBlock as a, createElementBlock as s, normalizeClass as A, createElementVNode as x, renderSlot as w, toDisplayString as m, createBlock as c, withCtx as d, createVNode as u, createCommentVNode as f, unref as p, resolveDynamicComponent as K, Fragment as P, mergeProps as g, createTextVNode as B, renderList as Te } from "vue";
|
|
2
|
+
import Ve from "../Input.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
4
|
+
import h from "../Button.vue.js";
|
|
5
5
|
import N from "../Icon.vue.js";
|
|
6
|
-
import
|
|
6
|
+
import Re from "../Tooltip.vue.js";
|
|
7
7
|
import J from "../Modal.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { usePersistentState as
|
|
16
|
-
import { useVLiteConfig as
|
|
8
|
+
import Ee from "../ConfirmationModal.vue.js";
|
|
9
|
+
import Oe from "../Pagination/Pagination.vue.js";
|
|
10
|
+
import je from "../Empty/Empty.vue.js";
|
|
11
|
+
import Ae from "./ScreenFilter.vue.js";
|
|
12
|
+
import Ne from "../Dropdown/Dropdown.vue.js";
|
|
13
|
+
import Fe from "../ExportData/ExportData.vue.js";
|
|
14
|
+
import Le from "../ImportData/ImportData.vue.js";
|
|
15
|
+
import { usePersistentState as Me } from "../../utils/usePersistentState.js";
|
|
16
|
+
import { useVLiteConfig as Ue } from "../../core/config.js";
|
|
17
17
|
import { $t as r } from "../../utils/i18n.js";
|
|
18
|
-
import { SCREEN_CONTEXT_KEY as
|
|
19
|
-
const
|
|
18
|
+
import { SCREEN_CONTEXT_KEY as qe } from "../DataTable/types.js";
|
|
19
|
+
const ze = { class: "flex flex-col w-full space-y-8" }, He = { class: "flex flex-col shrink-0" }, Ke = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "flex items-center! gap-2"
|
|
22
|
-
},
|
|
22
|
+
}, Je = { class: "text-fs-7.5 font-bold text-foreground" }, Qe = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "text-sm text-gray-700 mt-1 md:max-w-[450px]"
|
|
25
|
-
},
|
|
25
|
+
}, Xe = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-2.5 w-full justify-end" }, Ye = { class: "flex items-center gap-2 w-full sm:w-auto flex-1 md:flex-none justify-start sm:justify-end" }, Ge = {
|
|
26
26
|
key: 1,
|
|
27
27
|
class: "flex items-center p-1 rounded-md border border-border shrink-0"
|
|
28
|
-
},
|
|
28
|
+
}, We = ["title"], Ze = ["title"], _e = {
|
|
29
29
|
key: 4,
|
|
30
30
|
class: "w-full md:w-60! max-sm:order-last"
|
|
31
|
-
},
|
|
31
|
+
}, et = { class: "flex items-center gap-3 max-sm:w-full sm:w-auto max-sm:order-last" }, tt = ["href", "target"], lt = ["href", "target"], at = {
|
|
32
32
|
key: 4,
|
|
33
33
|
class: "p-8 text-center text-muted-foreground border border-dashed border-border rounded-lg"
|
|
34
|
-
},
|
|
34
|
+
}, nt = {
|
|
35
35
|
key: 2,
|
|
36
36
|
class: "-mt-2"
|
|
37
|
-
},
|
|
37
|
+
}, ot = { class: "px-1 py-1 text-sm" }, it = { class: "font-medium mb-3 text-muted-foreground" }, rt = { class: "space-y-3" }, dt = { key: 4 }, St = /* @__PURE__ */ $e({
|
|
38
38
|
__name: "Screen",
|
|
39
39
|
props: {
|
|
40
40
|
name: { default: "" },
|
|
@@ -81,115 +81,115 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
81
81
|
headerClass: {}
|
|
82
82
|
},
|
|
83
83
|
emits: ["add", "delete"],
|
|
84
|
-
setup(t, { emit:
|
|
85
|
-
const
|
|
86
|
-
|
|
84
|
+
setup(t, { emit: te }) {
|
|
85
|
+
const l = t, $ = Ue(), Q = te, V = Ie(), le = i(() => l.name || l.title || "default-screen"), k = Me(
|
|
86
|
+
`view-mode-${le.value}`,
|
|
87
|
+
l.table || V.table ? "table" : "list"
|
|
88
|
+
), I = y(""), R = y({}), X = y({ field: "", order: "" }), S = y(l.pageInfo?.currentPage || 1), F = y(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), v = y([]), E = y([]), T = y(!1);
|
|
89
|
+
z(qe, {
|
|
87
90
|
disableSearch: !0,
|
|
88
|
-
forceSelectable: !0
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
z("screen-selected-rows", v), z("screen-request-delete", (e) => C(e));
|
|
95
|
-
const C = (e) => {
|
|
91
|
+
forceSelectable: !0,
|
|
92
|
+
onTableChange: (e) => {
|
|
93
|
+
X.value = { field: e.sort.field, order: e.sort.order }, C();
|
|
94
|
+
}
|
|
95
|
+
}), z("screen-selected-rows", v), z("screen-request-delete", (e) => D(e));
|
|
96
|
+
const D = (e) => {
|
|
96
97
|
E.value = e, T.value = !0;
|
|
97
98
|
}, ae = () => {
|
|
98
99
|
Q("delete", E.value), T.value = !1, v.value = [];
|
|
99
|
-
},
|
|
100
|
+
}, ne = (e) => {
|
|
100
101
|
Q("delete", e), v.value = [];
|
|
101
102
|
};
|
|
102
103
|
H(
|
|
103
|
-
() =>
|
|
104
|
+
() => l.pageInfo?.currentPage,
|
|
104
105
|
(e) => {
|
|
105
106
|
e && (S.value = e);
|
|
106
107
|
}
|
|
107
108
|
), H(
|
|
108
|
-
() =>
|
|
109
|
+
() => l.pageInfo?.itemsPerPage,
|
|
109
110
|
(e) => {
|
|
110
111
|
e && (F.value = e);
|
|
111
112
|
}
|
|
112
113
|
);
|
|
113
114
|
let L = null;
|
|
114
|
-
H(
|
|
115
|
+
H(I, () => {
|
|
115
116
|
L && clearTimeout(L), L = setTimeout(() => {
|
|
116
|
-
S.value = 1,
|
|
117
|
+
S.value = 1, C();
|
|
117
118
|
}, 300);
|
|
118
119
|
});
|
|
119
|
-
const
|
|
120
|
-
S.value = e,
|
|
121
|
-
},
|
|
122
|
-
F.value = e, S.value = 1,
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
pagination: {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
a.refetch && a.refetch(e);
|
|
134
|
-
}, X = i(() => k.value === "table" ? a.table || !!V.table : a.list || !!V.list || !!V.grid), ie = i(() => a.data && a.data.length > 0), Y = i(() => a.titleI18n ? r(a.titleI18n) : a.title), G = i(
|
|
135
|
-
() => a.descriptionI18n ? r(a.descriptionI18n) : a.description
|
|
136
|
-
), re = i(() => {
|
|
120
|
+
const oe = (e) => {
|
|
121
|
+
S.value = e, C();
|
|
122
|
+
}, ie = (e) => {
|
|
123
|
+
F.value = e, S.value = 1, C();
|
|
124
|
+
}, C = () => {
|
|
125
|
+
l.refetch && l.refetch({
|
|
126
|
+
pagination: { page: S.value, limit: F.value },
|
|
127
|
+
search: I.value,
|
|
128
|
+
sort: { ...X.value },
|
|
129
|
+
filter: { ...R.value }
|
|
130
|
+
});
|
|
131
|
+
}, Y = i(() => k.value === "table" ? l.table || !!V.table : l.list || !!V.list || !!V.grid), re = i(() => l.data && l.data.length > 0), G = i(() => l.titleI18n ? r(l.titleI18n) : l.title), W = i(
|
|
132
|
+
() => l.descriptionI18n ? r(l.descriptionI18n) : l.description
|
|
133
|
+
), de = i(() => {
|
|
137
134
|
const e = r("vlite.screen.deleteSelected");
|
|
138
135
|
return e !== "vlite.screen.deleteSelected" ? e : "Delete Selected";
|
|
139
|
-
}),
|
|
136
|
+
}), se = i(() => {
|
|
140
137
|
const e = r("vlite.screen.listView");
|
|
141
138
|
return e !== "vlite.screen.listView" ? e : "List View";
|
|
142
|
-
}),
|
|
139
|
+
}), ce = i(() => {
|
|
143
140
|
const e = r("vlite.screen.tableView");
|
|
144
141
|
return e !== "vlite.screen.tableView" ? e : "Table View";
|
|
145
|
-
}),
|
|
142
|
+
}), ue = i(() => {
|
|
146
143
|
const e = r("vlite.screen.refresh");
|
|
147
144
|
return e !== "vlite.screen.refresh" ? e : "Refresh";
|
|
148
|
-
}),
|
|
145
|
+
}), fe = i(() => {
|
|
149
146
|
const e = r("vlite.screen.searchPlaceholder");
|
|
150
147
|
return e !== "vlite.screen.searchPlaceholder" ? e : "Search...";
|
|
151
148
|
}), me = i(() => {
|
|
152
149
|
const e = r("vlite.screen.confirmDeleteTitle");
|
|
153
150
|
return e !== "vlite.screen.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
154
|
-
}),
|
|
151
|
+
}), ve = i(() => {
|
|
155
152
|
const e = r("vlite.screen.confirmDeleteDesc", { count: E.value.length });
|
|
156
153
|
return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${E.value.length > 1 ? "items" : "item"}?`;
|
|
157
|
-
}),
|
|
154
|
+
}), ge = i(() => {
|
|
158
155
|
const e = r("vlite.screen.confirmDeleteBtn");
|
|
159
156
|
return e !== "vlite.screen.confirmDeleteBtn" ? e : "Delete";
|
|
160
157
|
}), he = i(() => {
|
|
161
158
|
const e = r("vlite.screen.cancelBtn");
|
|
162
159
|
return e !== "vlite.screen.cancelBtn" ? e : "Cancel";
|
|
163
|
-
}),
|
|
160
|
+
}), ye = i(() => {
|
|
164
161
|
const e = r("vlite.screen.missingView");
|
|
165
162
|
return e !== "vlite.screen.missingView" ? e : "Please provide a `:list` or `:table` component or slot.";
|
|
166
163
|
}), b = i(() => {
|
|
167
|
-
if (
|
|
168
|
-
if (
|
|
164
|
+
if (l.addBtn?.labelI18n) return r(l.addBtn.labelI18n);
|
|
165
|
+
if (l.addBtn?.label) return l.addBtn.label;
|
|
169
166
|
const e = r("vlite.screen.addNew");
|
|
170
167
|
return e !== "vlite.screen.addNew" ? e : "Add New";
|
|
171
|
-
}),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}), M = i(() => {
|
|
168
|
+
}), Z = i(
|
|
169
|
+
() => l.exportSchema && l.exportSchema.length > 0 && l.exportProps !== !1 || l.importSchema && l.importSchema.length > 0 && l.importProps !== !1
|
|
170
|
+
), M = i(() => {
|
|
175
171
|
const e = r("vlite.screen.exportData");
|
|
176
172
|
return e !== "vlite.screen.exportData" ? e : "Export Data";
|
|
177
|
-
}),
|
|
173
|
+
}), _ = i(() => {
|
|
178
174
|
const e = r("vlite.screen.importData");
|
|
179
175
|
return e !== "vlite.screen.importData" ? e : "Import Data";
|
|
180
|
-
}),
|
|
176
|
+
}), xe = i(() => {
|
|
181
177
|
const e = [];
|
|
182
|
-
return
|
|
183
|
-
}), U =
|
|
178
|
+
return l.exportProps !== !1 && e.push({ value: "export", label: M.value, icon: "lucide:download" }), l.importProps !== !1 && e.push({ value: "import", label: _.value, icon: "lucide:upload" }), e;
|
|
179
|
+
}), U = y(null), we = y(null), O = y(!1), q = y(!1), pe = (e) => {
|
|
184
180
|
e.value === "export" ? O.value = !0 : e.value === "import" && (q.value = !0);
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
181
|
+
}, be = i(
|
|
182
|
+
() => (l.exportSchema || []).map((e) => ({
|
|
183
|
+
field: e.name || e.field,
|
|
184
|
+
title: e.label || e.title || e.name || e.field
|
|
185
|
+
}))
|
|
186
|
+
), Be = i(
|
|
187
|
+
() => (l.importSchema || []).map((e) => ({
|
|
188
|
+
field: e.name || e.field,
|
|
189
|
+
title: e.label || e.title || e.name || e.field,
|
|
190
|
+
required: e.required || !1
|
|
191
|
+
}))
|
|
192
|
+
), ke = async (e) => $?.services?.importApi && l.importType ? await $.services.importApi(l.importType, e) : (console.warn(
|
|
193
193
|
"VLite Screen: No importApi configured or no importType provided for generic import."
|
|
194
194
|
), {
|
|
195
195
|
processed: e.data.length,
|
|
@@ -198,33 +198,29 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
198
198
|
skipped: 0,
|
|
199
199
|
failed: 0,
|
|
200
200
|
errors: []
|
|
201
|
-
}),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
} else
|
|
212
|
-
console.warn(
|
|
213
|
-
"VLite Screen: No exportApi configured or no exportType provided for generic backend export."
|
|
214
|
-
);
|
|
201
|
+
}), Ce = () => C(), De = i(
|
|
202
|
+
() => l.exportMode || $?.exportData?.mode || "frontend"
|
|
203
|
+
), Pe = async (e) => {
|
|
204
|
+
$?.services?.exportApi && l.exportType ? await $.services.exportApi(l.exportType, {
|
|
205
|
+
format: e,
|
|
206
|
+
search: I.value,
|
|
207
|
+
filter: R.value
|
|
208
|
+
}) : console.warn(
|
|
209
|
+
"VLite Screen: No exportApi configured or no exportType provided for generic backend export."
|
|
210
|
+
);
|
|
215
211
|
};
|
|
216
212
|
return (e, n) => {
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
t.customHeader ?
|
|
213
|
+
const ee = Se("router-link");
|
|
214
|
+
return a(), s("div", ze, [
|
|
215
|
+
t.customHeader ? w(e.$slots, "custom-header", { key: 1 }) : (a(), s("div", {
|
|
220
216
|
key: 0,
|
|
221
217
|
class: A([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
|
|
222
218
|
}, [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
t.info || t.infoI18n ? (
|
|
219
|
+
x("div", He, [
|
|
220
|
+
w(e.$slots, "title", {}, () => [
|
|
221
|
+
G.value ? (a(), s("div", Ke, [
|
|
222
|
+
x("h1", Je, m(G.value), 1),
|
|
223
|
+
t.info || t.infoI18n ? (a(), c(Re, {
|
|
228
224
|
key: 0,
|
|
229
225
|
content: t.info,
|
|
230
226
|
"content-i18n": t.infoI18n,
|
|
@@ -237,86 +233,86 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
237
233
|
})
|
|
238
234
|
]),
|
|
239
235
|
_: 1
|
|
240
|
-
}, 8, ["content", "content-i18n"])) :
|
|
241
|
-
])) :
|
|
236
|
+
}, 8, ["content", "content-i18n"])) : f("", !0)
|
|
237
|
+
])) : f("", !0)
|
|
242
238
|
]),
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
w(e.$slots, "description", {}, () => [
|
|
240
|
+
W.value ? (a(), s("p", Qe, m(W.value), 1)) : f("", !0)
|
|
245
241
|
])
|
|
246
242
|
]),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
v.value.length > 0 ? (
|
|
243
|
+
x("div", Xe, [
|
|
244
|
+
x("div", Ye, [
|
|
245
|
+
v.value.length > 0 ? (a(), c(h, {
|
|
250
246
|
key: 0,
|
|
251
247
|
variant: "outline",
|
|
252
248
|
class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
|
|
253
249
|
icon: "lucide:trash-2",
|
|
254
|
-
title:
|
|
255
|
-
onClick: n[0] || (n[0] = (o) =>
|
|
256
|
-
}, null, 8, ["title"])) :
|
|
257
|
-
(t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (
|
|
258
|
-
|
|
250
|
+
title: de.value,
|
|
251
|
+
onClick: n[0] || (n[0] = (o) => D(v.value))
|
|
252
|
+
}, null, 8, ["title"])) : f("", !0),
|
|
253
|
+
(t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (a(), s("div", Ge, [
|
|
254
|
+
x("button", {
|
|
259
255
|
onClick: n[1] || (n[1] = (o) => k.value = "list"),
|
|
260
256
|
class: A(["p-1.5 rounded", [
|
|
261
|
-
|
|
257
|
+
p(k) === "list" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
262
258
|
]]),
|
|
263
|
-
title:
|
|
259
|
+
title: se.value
|
|
264
260
|
}, [
|
|
265
261
|
u(N, {
|
|
266
262
|
icon: "lucide:layout-grid",
|
|
267
263
|
class: "w-4 h-4"
|
|
268
264
|
})
|
|
269
|
-
], 10,
|
|
270
|
-
|
|
265
|
+
], 10, We),
|
|
266
|
+
x("button", {
|
|
271
267
|
onClick: n[2] || (n[2] = (o) => k.value = "table"),
|
|
272
268
|
class: A(["p-1.5 rounded", [
|
|
273
|
-
|
|
269
|
+
p(k) === "table" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
274
270
|
]]),
|
|
275
|
-
title:
|
|
271
|
+
title: ce.value
|
|
276
272
|
}, [
|
|
277
273
|
u(N, {
|
|
278
274
|
icon: "lucide:list",
|
|
279
275
|
class: "w-4 h-4"
|
|
280
276
|
})
|
|
281
|
-
], 10,
|
|
282
|
-
])) :
|
|
283
|
-
|
|
284
|
-
t.showRefresh ? (
|
|
277
|
+
], 10, Ze)
|
|
278
|
+
])) : f("", !0),
|
|
279
|
+
w(e.$slots, "before-search"),
|
|
280
|
+
t.showRefresh ? (a(), c(h, {
|
|
285
281
|
key: 2,
|
|
286
282
|
variant: "outline",
|
|
287
283
|
icon: "lucide:refresh-cw",
|
|
288
284
|
size: "lg",
|
|
289
285
|
class: "shrink-0 h-9! w-9!",
|
|
290
|
-
title:
|
|
286
|
+
title: ue.value,
|
|
291
287
|
disabled: t.loading,
|
|
292
|
-
onClick:
|
|
293
|
-
}, null, 8, ["title", "disabled"])) :
|
|
294
|
-
t.filterSchema && t.filterSchema.length > 0 ? (
|
|
288
|
+
onClick: C
|
|
289
|
+
}, null, 8, ["title", "disabled"])) : f("", !0),
|
|
290
|
+
t.filterSchema && t.filterSchema.length > 0 ? (a(), c(Ae, {
|
|
295
291
|
key: 3,
|
|
296
292
|
schema: t.filterSchema,
|
|
297
293
|
type: t.filterType,
|
|
298
294
|
modelValue: R.value,
|
|
299
295
|
"onUpdate:modelValue": n[3] || (n[3] = (o) => R.value = o),
|
|
300
|
-
onChange:
|
|
301
|
-
}, null, 8, ["schema", "type", "modelValue"])) :
|
|
302
|
-
t.canSearch ? (
|
|
303
|
-
u(
|
|
296
|
+
onChange: C
|
|
297
|
+
}, null, 8, ["schema", "type", "modelValue"])) : f("", !0),
|
|
298
|
+
t.canSearch ? (a(), s("div", _e, [
|
|
299
|
+
u(Ve, {
|
|
304
300
|
lazy: "",
|
|
305
|
-
modelValue:
|
|
306
|
-
"onUpdate:modelValue": n[4] || (n[4] = (o) =>
|
|
301
|
+
modelValue: I.value,
|
|
302
|
+
"onUpdate:modelValue": n[4] || (n[4] = (o) => I.value = o),
|
|
307
303
|
icon: "lucide:search",
|
|
308
|
-
placeholder:
|
|
304
|
+
placeholder: fe.value,
|
|
309
305
|
variant: "outline",
|
|
310
306
|
class: "bg-background w-full",
|
|
311
307
|
"show-clear-button": !0
|
|
312
308
|
}, null, 8, ["modelValue", "placeholder"])
|
|
313
|
-
])) :
|
|
309
|
+
])) : f("", !0)
|
|
314
310
|
]),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
t.addComponent ? (
|
|
318
|
-
t.addBtn ? (
|
|
319
|
-
t.addBtn.modal ? (
|
|
311
|
+
x("div", et, [
|
|
312
|
+
w(e.$slots, "actions", {}, () => [
|
|
313
|
+
t.addComponent ? (a(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (a(), s(P, { key: 1 }, [
|
|
314
|
+
t.addBtn ? (a(), s(P, { key: 0 }, [
|
|
315
|
+
t.addBtn.modal ? (a(), c(J, g({
|
|
320
316
|
key: 0,
|
|
321
317
|
body: t.addBtn.modal
|
|
322
318
|
}, t.addBtn.modalProps, {
|
|
@@ -326,53 +322,53 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
326
322
|
loading: t.loading
|
|
327
323
|
}), {
|
|
328
324
|
trigger: d(() => [
|
|
329
|
-
u(
|
|
325
|
+
u(h, g({
|
|
330
326
|
class: "w-full",
|
|
331
327
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
332
328
|
variant: t.addBtn.variant || "primary"
|
|
333
329
|
}, t.addBtn.buttonProps), {
|
|
334
330
|
default: d(() => [
|
|
335
|
-
B(
|
|
331
|
+
B(m(b.value), 1)
|
|
336
332
|
]),
|
|
337
333
|
_: 1
|
|
338
334
|
}, 16, ["icon", "variant"])
|
|
339
335
|
]),
|
|
340
336
|
_: 1
|
|
341
|
-
}, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (
|
|
337
|
+
}, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (a(), c(ee, {
|
|
342
338
|
key: 1,
|
|
343
339
|
to: t.addBtn.to,
|
|
344
340
|
class: "inline-flex w-full sm:w-auto"
|
|
345
341
|
}, {
|
|
346
342
|
default: d(() => [
|
|
347
|
-
u(
|
|
343
|
+
u(h, g({
|
|
348
344
|
class: "w-full",
|
|
349
345
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
350
346
|
variant: t.addBtn.variant || "primary"
|
|
351
347
|
}, t.addBtn.buttonProps), {
|
|
352
348
|
default: d(() => [
|
|
353
|
-
B(
|
|
349
|
+
B(m(b.value), 1)
|
|
354
350
|
]),
|
|
355
351
|
_: 1
|
|
356
352
|
}, 16, ["icon", "variant"])
|
|
357
353
|
]),
|
|
358
354
|
_: 1
|
|
359
|
-
}, 8, ["to"])) : t.addBtn.href ? (
|
|
355
|
+
}, 8, ["to"])) : t.addBtn.href ? (a(), s("a", {
|
|
360
356
|
key: 2,
|
|
361
357
|
href: t.addBtn.href,
|
|
362
358
|
target: t.addBtn.target,
|
|
363
359
|
class: "inline-flex w-full sm:w-auto"
|
|
364
360
|
}, [
|
|
365
|
-
u(
|
|
361
|
+
u(h, g({
|
|
366
362
|
class: "w-full",
|
|
367
363
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
368
364
|
variant: t.addBtn.variant || "primary"
|
|
369
365
|
}, t.addBtn.buttonProps), {
|
|
370
366
|
default: d(() => [
|
|
371
|
-
B(
|
|
367
|
+
B(m(b.value), 1)
|
|
372
368
|
]),
|
|
373
369
|
_: 1
|
|
374
370
|
}, 16, ["icon", "variant"])
|
|
375
|
-
], 8,
|
|
371
|
+
], 8, tt)) : (a(), c(h, g({
|
|
376
372
|
key: 3,
|
|
377
373
|
class: "w-full sm:w-auto",
|
|
378
374
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
@@ -381,40 +377,40 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
381
377
|
onClick: n[5] || (n[5] = (o) => t.addBtn.onClick ? t.addBtn.onClick() : e.$emit("add"))
|
|
382
378
|
}), {
|
|
383
379
|
default: d(() => [
|
|
384
|
-
B(
|
|
380
|
+
B(m(b.value), 1)
|
|
385
381
|
]),
|
|
386
382
|
_: 1
|
|
387
383
|
}, 16, ["icon", "variant"]))
|
|
388
|
-
], 64)) :
|
|
389
|
-
], 64)) :
|
|
384
|
+
], 64)) : f("", !0)
|
|
385
|
+
], 64)) : f("", !0)
|
|
390
386
|
]),
|
|
391
|
-
|
|
387
|
+
Z.value ? (a(), c(Ne, {
|
|
392
388
|
key: 0,
|
|
393
389
|
closeOnSelect: "",
|
|
394
390
|
position: "bottom-end",
|
|
395
|
-
options:
|
|
391
|
+
options: xe.value,
|
|
396
392
|
onOnSelect: pe
|
|
397
393
|
}, {
|
|
398
394
|
trigger: d(() => [
|
|
399
|
-
u(
|
|
395
|
+
u(h, {
|
|
400
396
|
variant: "outline",
|
|
401
397
|
icon: "lucide:more-vertical",
|
|
402
398
|
class: "px-2!",
|
|
403
|
-
title:
|
|
399
|
+
title: p(r)("vlite.screen.moreOptions") !== "vlite.screen.moreOptions" ? p(r)("vlite.screen.moreOptions") : "More Options"
|
|
404
400
|
}, null, 8, ["title"])
|
|
405
401
|
]),
|
|
406
402
|
_: 1
|
|
407
|
-
}, 8, ["options"])) :
|
|
408
|
-
|
|
403
|
+
}, 8, ["options"])) : f("", !0),
|
|
404
|
+
w(e.$slots, "after-add")
|
|
409
405
|
])
|
|
410
406
|
])
|
|
411
407
|
], 2)),
|
|
412
|
-
|
|
413
|
-
|
|
408
|
+
w(e.$slots, "sub-header"),
|
|
409
|
+
x("div", {
|
|
414
410
|
class: A(["flex-1 w-full relative", t.containerClass])
|
|
415
411
|
}, [
|
|
416
|
-
!
|
|
417
|
-
u(
|
|
412
|
+
!re.value && !t.loading ? w(e.$slots, "empty", { key: 0 }, () => [
|
|
413
|
+
u(p(je), {
|
|
418
414
|
title: t.emptyTitle,
|
|
419
415
|
titleI18n: t.emptyTitleI18n,
|
|
420
416
|
description: t.emptyDescription,
|
|
@@ -422,59 +418,59 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
422
418
|
icon: t.emptyIcon
|
|
423
419
|
}, {
|
|
424
420
|
action: d(() => [
|
|
425
|
-
t.addComponent ? (
|
|
426
|
-
t.addBtn ? (
|
|
427
|
-
t.addBtn.modal ? (
|
|
421
|
+
t.addComponent ? (a(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (a(), s(P, { key: 1 }, [
|
|
422
|
+
t.addBtn ? (a(), s(P, { key: 0 }, [
|
|
423
|
+
t.addBtn.modal ? (a(), c(J, g({
|
|
428
424
|
key: 0,
|
|
429
425
|
body: t.addBtn.modal
|
|
430
426
|
}, t.addBtn.modalProps), {
|
|
431
427
|
trigger: d(() => [
|
|
432
|
-
u(
|
|
428
|
+
u(h, g({
|
|
433
429
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
434
430
|
variant: t.addBtn.variant || "primary",
|
|
435
431
|
rounded: "full",
|
|
436
432
|
class: "px-6!"
|
|
437
433
|
}, t.addBtn.buttonProps), {
|
|
438
434
|
default: d(() => [
|
|
439
|
-
B(
|
|
435
|
+
B(m(b.value), 1)
|
|
440
436
|
]),
|
|
441
437
|
_: 1
|
|
442
438
|
}, 16, ["icon", "variant"])
|
|
443
439
|
]),
|
|
444
440
|
_: 1
|
|
445
|
-
}, 16, ["body"])) : t.addBtn.to ? (
|
|
441
|
+
}, 16, ["body"])) : t.addBtn.to ? (a(), c(ee, {
|
|
446
442
|
key: 1,
|
|
447
443
|
to: t.addBtn.to,
|
|
448
444
|
class: "inline-flex"
|
|
449
445
|
}, {
|
|
450
446
|
default: d(() => [
|
|
451
|
-
u(
|
|
447
|
+
u(h, g({
|
|
452
448
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
453
449
|
variant: t.addBtn.variant || "outline"
|
|
454
450
|
}, t.addBtn.buttonProps), {
|
|
455
451
|
default: d(() => [
|
|
456
|
-
B(
|
|
452
|
+
B(m(b.value), 1)
|
|
457
453
|
]),
|
|
458
454
|
_: 1
|
|
459
455
|
}, 16, ["icon", "variant"])
|
|
460
456
|
]),
|
|
461
457
|
_: 1
|
|
462
|
-
}, 8, ["to"])) : t.addBtn.href ? (
|
|
458
|
+
}, 8, ["to"])) : t.addBtn.href ? (a(), s("a", {
|
|
463
459
|
key: 2,
|
|
464
460
|
href: t.addBtn.href,
|
|
465
461
|
target: t.addBtn.target,
|
|
466
462
|
class: "inline-flex"
|
|
467
463
|
}, [
|
|
468
|
-
u(
|
|
464
|
+
u(h, g({
|
|
469
465
|
icon: t.addBtn.icon || "lucide:plus",
|
|
470
466
|
variant: t.addBtn.variant || "outline"
|
|
471
467
|
}, t.addBtn.buttonProps), {
|
|
472
468
|
default: d(() => [
|
|
473
|
-
B(
|
|
469
|
+
B(m(b.value), 1)
|
|
474
470
|
]),
|
|
475
471
|
_: 1
|
|
476
472
|
}, 16, ["icon", "variant"])
|
|
477
|
-
], 8,
|
|
473
|
+
], 8, lt)) : (a(), c(h, g({
|
|
478
474
|
key: 3,
|
|
479
475
|
icon: t.addBtn.icon || "lucide:plus",
|
|
480
476
|
variant: t.addBtn.variant || "outline"
|
|
@@ -482,81 +478,81 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
482
478
|
onClick: n[6] || (n[6] = (o) => t.addBtn.onClick ? t.addBtn.onClick() : e.$emit("add"))
|
|
483
479
|
}), {
|
|
484
480
|
default: d(() => [
|
|
485
|
-
B(
|
|
481
|
+
B(m(b.value), 1)
|
|
486
482
|
]),
|
|
487
483
|
_: 1
|
|
488
484
|
}, 16, ["icon", "variant"]))
|
|
489
|
-
], 64)) : (
|
|
485
|
+
], 64)) : (a(), c(h, {
|
|
490
486
|
key: 1,
|
|
491
487
|
icon: "lucide:plus",
|
|
492
488
|
variant: "outline",
|
|
493
489
|
onClick: n[7] || (n[7] = (o) => e.$emit("add"))
|
|
494
490
|
}, {
|
|
495
491
|
default: d(() => [
|
|
496
|
-
B(
|
|
492
|
+
B(m(b.value), 1)
|
|
497
493
|
]),
|
|
498
494
|
_: 1
|
|
499
495
|
}))
|
|
500
|
-
], 64)) :
|
|
496
|
+
], 64)) : f("", !0)
|
|
501
497
|
]),
|
|
502
498
|
_: 1
|
|
503
499
|
}, 8, ["title", "titleI18n", "description", "descriptionI18n", "icon"])
|
|
504
|
-
]) : (
|
|
505
|
-
|
|
500
|
+
]) : (a(), s(P, { key: 1 }, [
|
|
501
|
+
p(k) === "table" && e.$slots.table ? w(e.$slots, "table", {
|
|
506
502
|
key: 0,
|
|
507
503
|
data: t.data,
|
|
508
504
|
loading: t.loading,
|
|
509
505
|
selectedRows: v.value,
|
|
510
|
-
delete:
|
|
506
|
+
delete: D,
|
|
511
507
|
updateSelectedRows: (o) => v.value = o
|
|
512
|
-
}) :
|
|
508
|
+
}) : p(k) === "list" && e.$slots.list ? w(e.$slots, "list", {
|
|
513
509
|
key: 1,
|
|
514
510
|
data: t.data,
|
|
515
511
|
loading: t.loading,
|
|
516
512
|
selectedRows: v.value,
|
|
517
|
-
delete:
|
|
513
|
+
delete: D,
|
|
518
514
|
updateSelectedRows: (o) => v.value = o
|
|
519
|
-
}) :
|
|
515
|
+
}) : p(k) === "list" && e.$slots.grid ? w(e.$slots, "grid", {
|
|
520
516
|
key: 2,
|
|
521
517
|
data: t.data,
|
|
522
518
|
loading: t.loading,
|
|
523
519
|
selectedRows: v.value,
|
|
524
|
-
delete:
|
|
520
|
+
delete: D,
|
|
525
521
|
updateSelectedRows: (o) => v.value = o
|
|
526
|
-
}) :
|
|
522
|
+
}) : Y.value ? (a(), c(K(Y.value), {
|
|
527
523
|
key: 3,
|
|
528
524
|
data: t.data,
|
|
529
525
|
loading: t.loading,
|
|
530
526
|
refetch: t.refetch,
|
|
531
527
|
selectedRows: v.value,
|
|
532
528
|
"onUpdate:selectedRows": n[8] || (n[8] = (o) => v.value = o),
|
|
533
|
-
delete:
|
|
534
|
-
onDelete:
|
|
535
|
-
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (
|
|
529
|
+
delete: D,
|
|
530
|
+
onDelete: ne
|
|
531
|
+
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (a(), s("div", at, m(ye.value), 1))
|
|
536
532
|
], 64))
|
|
537
533
|
], 2),
|
|
538
|
-
t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (
|
|
539
|
-
u(
|
|
534
|
+
t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (a(), s("div", nt, [
|
|
535
|
+
u(p(Oe), g({
|
|
540
536
|
"current-page": t.pageInfo.currentPage,
|
|
541
537
|
"total-pages": t.pageInfo.totalPages,
|
|
542
538
|
"total-items": t.pageInfo.totalItems
|
|
543
539
|
}, t.paginationProps, {
|
|
544
|
-
onChange:
|
|
545
|
-
"onUpdate:itemsPerPage":
|
|
540
|
+
onChange: oe,
|
|
541
|
+
"onUpdate:itemsPerPage": ie
|
|
546
542
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
547
|
-
])) :
|
|
548
|
-
u(
|
|
543
|
+
])) : f("", !0),
|
|
544
|
+
u(Ee, {
|
|
549
545
|
show: T.value,
|
|
550
546
|
"onUpdate:show": n[9] || (n[9] = (o) => T.value = o),
|
|
551
547
|
title: me.value,
|
|
552
|
-
description:
|
|
553
|
-
"confirm-text":
|
|
548
|
+
description: ve.value,
|
|
549
|
+
"confirm-text": ge.value,
|
|
554
550
|
"cancel-text": he.value,
|
|
555
551
|
variant: "danger",
|
|
556
552
|
onConfirm: ae,
|
|
557
553
|
onCancel: n[10] || (n[10] = (o) => T.value = !1)
|
|
558
554
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
|
|
559
|
-
O.value ? (
|
|
555
|
+
O.value ? (a(), c(J, {
|
|
560
556
|
key: 3,
|
|
561
557
|
show: O.value,
|
|
562
558
|
"onUpdate:show": n[11] || (n[11] = (o) => O.value = o),
|
|
@@ -564,36 +560,36 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
564
560
|
"max-width": "sm:max-w-[400px]"
|
|
565
561
|
}, {
|
|
566
562
|
default: d(({ close: o }) => [
|
|
567
|
-
u(
|
|
563
|
+
u(Fe, g({
|
|
568
564
|
ref_key: "exportDataRef",
|
|
569
565
|
ref: U,
|
|
570
566
|
data: t.data || [],
|
|
571
|
-
fields:
|
|
572
|
-
mode:
|
|
573
|
-
"on-export":
|
|
567
|
+
fields: be.value,
|
|
568
|
+
mode: De.value,
|
|
569
|
+
"on-export": Pe
|
|
574
570
|
}, typeof t.exportProps == "object" ? t.exportProps : {}, {
|
|
575
571
|
title: M.value,
|
|
576
572
|
class: "hidden!"
|
|
577
573
|
}), null, 16, ["data", "fields", "mode", "title"]),
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
(
|
|
574
|
+
x("div", ot, [
|
|
575
|
+
x("h6", it, m(p(r)("vlite.exportData.selectFormat") !== "vlite.exportData.selectFormat" ? p(r)("vlite.exportData.selectFormat") : "Select Export Format"), 1),
|
|
576
|
+
x("div", rt, [
|
|
577
|
+
(a(!0), s(P, null, Te(U.value?.availableFormats || [
|
|
582
578
|
{ value: "excel", label: "Excel (.xlsx)", icon: "lucide:file-spreadsheet" },
|
|
583
579
|
{ value: "csv", label: "CSV (.csv)", icon: "lucide:file-text" },
|
|
584
580
|
{ value: "json", label: "JSON (.json)", icon: "lucide:file-json" }
|
|
585
|
-
], (j) => (
|
|
581
|
+
], (j) => (a(), c(h, {
|
|
586
582
|
key: j.value,
|
|
587
583
|
variant: "outline",
|
|
588
584
|
class: "w-full flex items-center justify-start gap-3 h-12",
|
|
589
|
-
onClick: (
|
|
585
|
+
onClick: (ct) => U.value?.exportData(j.value, o)
|
|
590
586
|
}, {
|
|
591
587
|
default: d(() => [
|
|
592
588
|
u(N, {
|
|
593
589
|
icon: j.icon,
|
|
594
590
|
class: "text-muted-foreground h-5 w-5"
|
|
595
591
|
}, null, 8, ["icon"]),
|
|
596
|
-
|
|
592
|
+
x("span", null, m(j.label), 1)
|
|
597
593
|
]),
|
|
598
594
|
_: 2
|
|
599
595
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -601,25 +597,25 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
601
597
|
])
|
|
602
598
|
]),
|
|
603
599
|
_: 1
|
|
604
|
-
}, 8, ["show", "title"])) :
|
|
605
|
-
|
|
606
|
-
u(
|
|
600
|
+
}, 8, ["show", "title"])) : f("", !0),
|
|
601
|
+
Z.value ? (a(), s("div", dt, [
|
|
602
|
+
u(Le, g({
|
|
607
603
|
show: q.value,
|
|
608
604
|
"onUpdate:show": n[12] || (n[12] = (o) => q.value = o),
|
|
609
605
|
ref_key: "importDataRef",
|
|
610
|
-
ref:
|
|
611
|
-
fields:
|
|
612
|
-
processBatch:
|
|
613
|
-
onComplete:
|
|
606
|
+
ref: we,
|
|
607
|
+
fields: Be.value,
|
|
608
|
+
processBatch: ke,
|
|
609
|
+
onComplete: Ce
|
|
614
610
|
}, typeof t.importProps == "object" ? t.importProps : {}, {
|
|
615
|
-
title:
|
|
611
|
+
title: _.value,
|
|
616
612
|
class: "hidden!"
|
|
617
613
|
}), null, 16, ["show", "fields", "title"])
|
|
618
|
-
])) :
|
|
614
|
+
])) : f("", !0)
|
|
619
615
|
]);
|
|
620
616
|
};
|
|
621
617
|
}
|
|
622
618
|
});
|
|
623
619
|
export {
|
|
624
|
-
|
|
620
|
+
St as default
|
|
625
621
|
};
|