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