vlite3 0.7.3 → 0.7.6
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.
|
@@ -165,8 +165,9 @@ const Ie = { class: "space-y-6.5" }, Se = { class: "overflow-x-auto w-full" }, T
|
|
|
165
165
|
page: p.value,
|
|
166
166
|
limit: C.value
|
|
167
167
|
},
|
|
168
|
-
|
|
169
|
-
search: w.value
|
|
168
|
+
sort: { ...d.value },
|
|
169
|
+
search: w.value,
|
|
170
|
+
filter: {}
|
|
170
171
|
});
|
|
171
172
|
}, 10);
|
|
172
173
|
};
|
|
@@ -10,16 +10,17 @@ export interface SortConfig {
|
|
|
10
10
|
}
|
|
11
11
|
export interface TableState {
|
|
12
12
|
pagination: PaginationConfig;
|
|
13
|
-
|
|
13
|
+
sort: SortConfig;
|
|
14
14
|
search: string;
|
|
15
|
+
filter: Record<string, any>;
|
|
15
16
|
}
|
|
16
17
|
export interface FilterConfig {
|
|
17
|
-
search: string;
|
|
18
|
-
sorting: SortConfig;
|
|
19
18
|
[key: string]: any;
|
|
20
19
|
}
|
|
21
20
|
export interface TableFilter {
|
|
22
21
|
pagination: PaginationConfig;
|
|
22
|
+
search: string;
|
|
23
|
+
sort: SortConfig;
|
|
23
24
|
filter: FilterConfig;
|
|
24
25
|
}
|
|
25
26
|
export interface TableHeader {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, ref as f, onMounted as W, nextTick as y, onUnmounted as j, watch as z, openBlock as s, createElementBlock as b, normalizeClass as c, createVNode as v, Transition as L, withCtx as k, createElementVNode as l, createCommentVNode as g, Fragment as A, renderList as _, createBlock as w, unref as S, withModifiers as D, toDisplayString as F } from "vue";
|
|
2
2
|
import { useRoute as H, RouterLink as P } from "vue-router";
|
|
3
3
|
import p from "../Icon.vue.js";
|
|
4
|
-
|
|
4
|
+
import { $t as U } from "../../utils/i18n.js";
|
|
5
|
+
const q = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "absolute left-0 top-0 bottom-0 z-10 flex items-center pointer-events-none"
|
|
7
|
-
},
|
|
8
|
+
}, G = { class: "truncate" }, J = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "absolute right-0 top-0 bottom-0 z-10 flex items-center justify-end pointer-events-none"
|
|
10
|
-
},
|
|
11
|
+
}, Y = /* @__PURE__ */ T({
|
|
11
12
|
__name: "NavbarTabs",
|
|
12
13
|
props: {
|
|
13
14
|
items: {},
|
|
@@ -18,32 +19,32 @@ const U = {
|
|
|
18
19
|
class: { default: "" }
|
|
19
20
|
},
|
|
20
21
|
setup(a) {
|
|
21
|
-
const n = a, i = f(null), C = f(!1),
|
|
22
|
+
const n = a, i = f(null), C = f(!1), I = f(!1), u = () => {
|
|
22
23
|
const o = i.value;
|
|
23
|
-
o && (C.value = o.scrollLeft > 2,
|
|
24
|
-
},
|
|
24
|
+
o && (C.value = o.scrollLeft > 2, I.value = o.scrollLeft + o.clientWidth < o.scrollWidth - 2);
|
|
25
|
+
}, R = (o) => {
|
|
25
26
|
const t = i.value;
|
|
26
27
|
if (!t) return;
|
|
27
28
|
const e = t.clientWidth * 0.6;
|
|
28
29
|
t.scrollBy({ left: o === "right" ? e : -e, behavior: "smooth" });
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
W(() => {
|
|
31
32
|
y(() => {
|
|
32
33
|
u(), i.value?.addEventListener("scroll", u, { passive: !0 });
|
|
33
34
|
});
|
|
34
|
-
}),
|
|
35
|
+
}), j(() => {
|
|
35
36
|
i.value?.removeEventListener("scroll", u);
|
|
36
37
|
});
|
|
37
38
|
const h = H();
|
|
38
|
-
|
|
39
|
+
z(
|
|
39
40
|
() => h.path,
|
|
40
41
|
() => y(u)
|
|
41
42
|
);
|
|
42
|
-
const m = f(/* @__PURE__ */ new Map()),
|
|
43
|
+
const m = f(/* @__PURE__ */ new Map()), $ = (o, t) => {
|
|
43
44
|
const e = o?.$el ?? o;
|
|
44
45
|
e instanceof HTMLElement ? m.value.set(t, e) : m.value.delete(t);
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
z(
|
|
47
48
|
() => h.path,
|
|
48
49
|
(o) => {
|
|
49
50
|
y(() => {
|
|
@@ -59,16 +60,16 @@ const U = {
|
|
|
59
60
|
pill: "flex gap-1 p-1 bg-secondary/80 rounded-lg",
|
|
60
61
|
solid: "flex gap-0",
|
|
61
62
|
ghost: "flex gap-1"
|
|
62
|
-
},
|
|
63
|
+
}, E = {
|
|
63
64
|
sm: "px-2.5 py-1.5 text-xs",
|
|
64
65
|
md: "px-3.5 py-2 text-sm",
|
|
65
66
|
lg: "px-5 py-2.5 text-base"
|
|
66
|
-
},
|
|
67
|
+
}, V = {
|
|
67
68
|
line: "text-primary border-b-2 border-primary -mb-px",
|
|
68
69
|
pill: "bg-background text-foreground shadow-sm",
|
|
69
70
|
solid: "bg-primary-light text-primary-dark",
|
|
70
71
|
ghost: "bg-accent text-accent-foreground"
|
|
71
|
-
},
|
|
72
|
+
}, M = {
|
|
72
73
|
line: "text-muted-foreground border-b-2 border-transparent hover:text-foreground hover:border-border",
|
|
73
74
|
pill: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
74
75
|
solid: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
@@ -86,23 +87,23 @@ const U = {
|
|
|
86
87
|
return r === "/" || r === "?" || r === "#" || r === void 0;
|
|
87
88
|
}
|
|
88
89
|
return !1;
|
|
89
|
-
},
|
|
90
|
-
const t = "group relative inline-flex items-center justify-center gap-2 font-medium whitespace-nowrap shrink-0 select-none cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-1", e = o.disabled ? "opacity-50 pointer-events-none cursor-not-allowed" : "", d = x(o) ? n.activeClass ||
|
|
91
|
-
return [t,
|
|
90
|
+
}, N = (o) => {
|
|
91
|
+
const t = "group relative inline-flex items-center justify-center gap-2 font-medium whitespace-nowrap shrink-0 select-none cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-1", e = o.disabled ? "opacity-50 pointer-events-none cursor-not-allowed" : "", d = x(o) ? n.activeClass || V[n.variant] : n.inactiveClass || M[n.variant];
|
|
92
|
+
return [t, E[n.size], d, e].filter(Boolean).join(" ");
|
|
92
93
|
};
|
|
93
94
|
return (o, t) => (s(), b("div", {
|
|
94
95
|
class: c(["relative flex items-center w-full min-w-0 border-b", n.class])
|
|
95
96
|
}, [
|
|
96
97
|
v(L, { name: "fade-x" }, {
|
|
97
98
|
default: k(() => [
|
|
98
|
-
C.value ? (s(), b("div",
|
|
99
|
+
C.value ? (s(), b("div", q, [
|
|
99
100
|
t[2] || (t[2] = l("div", { class: "w-8 h-full bg-gradient-to-r from-background to-transparent" }, null, -1)),
|
|
100
101
|
l("button", {
|
|
101
102
|
type: "button",
|
|
102
103
|
class: "pointer-events-auto absolute left-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
|
|
103
104
|
"aria-label": "Scroll tabs left",
|
|
104
105
|
tabindex: "-1",
|
|
105
|
-
onClick: t[0] || (t[0] = (e) =>
|
|
106
|
+
onClick: t[0] || (t[0] = (e) => R("left"))
|
|
106
107
|
}, [
|
|
107
108
|
v(p, {
|
|
108
109
|
icon: "lucide:chevron-left",
|
|
@@ -123,16 +124,16 @@ const U = {
|
|
|
123
124
|
]),
|
|
124
125
|
"aria-label": "Page tabs"
|
|
125
126
|
}, [
|
|
126
|
-
(s(!0), b(
|
|
127
|
+
(s(!0), b(A, null, _(a.items, (e, r) => (s(), w(S(P), {
|
|
127
128
|
key: r,
|
|
128
129
|
ref_for: !0,
|
|
129
|
-
ref: (d) =>
|
|
130
|
+
ref: (d) => $(d, r),
|
|
130
131
|
to: e.to || "",
|
|
131
132
|
role: "tab",
|
|
132
133
|
"aria-selected": x(e),
|
|
133
134
|
"aria-disabled": e.disabled || void 0,
|
|
134
135
|
tabindex: e.disabled ? -1 : 0,
|
|
135
|
-
class: c(
|
|
136
|
+
class: c(N(e)),
|
|
136
137
|
onClick: D((d) => !e.disabled && e.to && o.$router.push(e.to), ["prevent"])
|
|
137
138
|
}, {
|
|
138
139
|
default: k(() => [
|
|
@@ -141,7 +142,7 @@ const U = {
|
|
|
141
142
|
icon: e.icon,
|
|
142
143
|
class: c(["shrink-0", a.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4"])
|
|
143
144
|
}, null, 8, ["icon", "class"])) : g("", !0),
|
|
144
|
-
l("span",
|
|
145
|
+
l("span", G, F(e.labelI18n ? S(U)(e.labelI18n) : e.label), 1),
|
|
145
146
|
e.iconRight ? (s(), w(p, {
|
|
146
147
|
key: 1,
|
|
147
148
|
icon: e.iconRight,
|
|
@@ -153,14 +154,14 @@ const U = {
|
|
|
153
154
|
], 2),
|
|
154
155
|
v(L, { name: "fade-x" }, {
|
|
155
156
|
default: k(() => [
|
|
156
|
-
|
|
157
|
+
I.value ? (s(), b("div", J, [
|
|
157
158
|
t[3] || (t[3] = l("div", { class: "w-8 h-full bg-gradient-to-l from-background to-transparent" }, null, -1)),
|
|
158
159
|
l("button", {
|
|
159
160
|
type: "button",
|
|
160
161
|
class: "pointer-events-auto absolute right-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
|
|
161
162
|
"aria-label": "Scroll tabs right",
|
|
162
163
|
tabindex: "-1",
|
|
163
|
-
onClick: t[1] || (t[1] = (e) =>
|
|
164
|
+
onClick: t[1] || (t[1] = (e) => R("right"))
|
|
164
165
|
}, [
|
|
165
166
|
v(p, {
|
|
166
167
|
icon: "lucide:chevron-right",
|
|
@@ -175,5 +176,5 @@ const U = {
|
|
|
175
176
|
}
|
|
176
177
|
});
|
|
177
178
|
export {
|
|
178
|
-
|
|
179
|
+
Y as default
|
|
179
180
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Pe, provide as
|
|
1
|
+
import { defineComponent as Pe, provide as z, useSlots as Ie, computed as i, ref as x, watch as H, resolveComponent as $e, openBlock as l, createElementBlock as s, normalizeClass as A, createElementVNode as y, renderSlot as p, toDisplayString as f, createBlock as c, withCtx as d, createVNode as u, createCommentVNode as m, unref as w, resolveDynamicComponent as K, Fragment as P, mergeProps as h, createTextVNode as B, renderList as Se } from "vue";
|
|
2
2
|
import Te from "../Input.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
4
|
+
import g from "../Button.vue.js";
|
|
5
5
|
import N from "../Icon.vue.js";
|
|
6
6
|
import Ve from "../Tooltip.vue.js";
|
|
7
|
-
import
|
|
7
|
+
import J from "../Modal.vue.js";
|
|
8
8
|
import Re from "../ConfirmationModal.vue.js";
|
|
9
9
|
import Ee from "../Pagination/Pagination.vue.js";
|
|
10
10
|
import Oe from "../Empty/Empty.vue.js";
|
|
@@ -81,60 +81,57 @@ 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 a = t,
|
|
86
|
-
|
|
84
|
+
setup(t, { emit: ee }) {
|
|
85
|
+
const a = t, I = Me(), Q = ee;
|
|
86
|
+
z(Ue, {
|
|
87
87
|
disableSearch: !0,
|
|
88
88
|
forceSelectable: !0
|
|
89
89
|
});
|
|
90
|
-
const
|
|
90
|
+
const V = Ie(), te = i(() => a.name || a.title || "default-screen"), k = Le(
|
|
91
91
|
`view-mode-${te.value}`,
|
|
92
|
-
a.table ||
|
|
93
|
-
),
|
|
94
|
-
|
|
95
|
-
const
|
|
92
|
+
a.table || V.table ? "table" : "list"
|
|
93
|
+
), $ = x(""), R = x({}), S = x(a.pageInfo?.currentPage || 1), F = x(a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10), v = x([]), E = x([]), T = x(!1);
|
|
94
|
+
z("screen-selected-rows", v), z("screen-request-delete", (e) => C(e));
|
|
95
|
+
const C = (e) => {
|
|
96
96
|
E.value = e, T.value = !0;
|
|
97
97
|
}, ae = () => {
|
|
98
|
-
|
|
98
|
+
Q("delete", E.value), T.value = !1, v.value = [];
|
|
99
99
|
}, le = (e) => {
|
|
100
|
-
|
|
100
|
+
Q("delete", e), v.value = [];
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
H(
|
|
103
103
|
() => a.pageInfo?.currentPage,
|
|
104
104
|
(e) => {
|
|
105
|
-
e && (
|
|
105
|
+
e && (S.value = e);
|
|
106
106
|
}
|
|
107
|
-
),
|
|
107
|
+
), H(
|
|
108
108
|
() => a.pageInfo?.itemsPerPage,
|
|
109
109
|
(e) => {
|
|
110
|
-
e && (
|
|
110
|
+
e && (F.value = e);
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
|
-
let
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
let L = null;
|
|
114
|
+
H($, () => {
|
|
115
|
+
L && clearTimeout(L), L = setTimeout(() => {
|
|
116
|
+
S.value = 1, D();
|
|
117
117
|
}, 300);
|
|
118
118
|
});
|
|
119
119
|
const ne = (e) => {
|
|
120
|
-
|
|
120
|
+
S.value = e, D();
|
|
121
121
|
}, oe = (e) => {
|
|
122
|
-
|
|
123
|
-
},
|
|
122
|
+
F.value = e, S.value = 1, D();
|
|
123
|
+
}, D = () => {
|
|
124
124
|
const e = {
|
|
125
|
-
pageinfo: {
|
|
126
|
-
page: C.value,
|
|
127
|
-
limit: R.value
|
|
128
|
-
},
|
|
129
125
|
pagination: {
|
|
130
|
-
page:
|
|
131
|
-
limit:
|
|
126
|
+
page: S.value,
|
|
127
|
+
limit: F.value
|
|
132
128
|
},
|
|
133
|
-
search:
|
|
134
|
-
|
|
129
|
+
search: $.value,
|
|
130
|
+
sort: {},
|
|
131
|
+
filter: R.value
|
|
135
132
|
};
|
|
136
133
|
a.refetch && a.refetch(e);
|
|
137
|
-
},
|
|
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(
|
|
138
135
|
() => a.descriptionI18n ? r(a.descriptionI18n) : a.description
|
|
139
136
|
), re = i(() => {
|
|
140
137
|
const e = r("vlite.screen.deleteSelected");
|
|
@@ -160,10 +157,10 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
160
157
|
}), ve = i(() => {
|
|
161
158
|
const e = r("vlite.screen.confirmDeleteBtn");
|
|
162
159
|
return e !== "vlite.screen.confirmDeleteBtn" ? e : "Delete";
|
|
163
|
-
}),
|
|
160
|
+
}), he = i(() => {
|
|
164
161
|
const e = r("vlite.screen.cancelBtn");
|
|
165
162
|
return e !== "vlite.screen.cancelBtn" ? e : "Cancel";
|
|
166
|
-
}),
|
|
163
|
+
}), ge = i(() => {
|
|
167
164
|
const e = r("vlite.screen.missingView");
|
|
168
165
|
return e !== "vlite.screen.missingView" ? e : "Please provide a `:list` or `:table` component or slot.";
|
|
169
166
|
}), b = i(() => {
|
|
@@ -171,20 +168,20 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
171
168
|
if (a.addBtn?.label) return a.addBtn.label;
|
|
172
169
|
const e = r("vlite.screen.addNew");
|
|
173
170
|
return e !== "vlite.screen.addNew" ? e : "Add New";
|
|
174
|
-
}),
|
|
171
|
+
}), W = i(() => {
|
|
175
172
|
const e = a.exportSchema && a.exportSchema.length > 0 && a.exportProps !== !1, n = a.importSchema && a.importSchema.length > 0 && a.importProps !== !1;
|
|
176
173
|
return e || n;
|
|
177
|
-
}),
|
|
174
|
+
}), M = i(() => {
|
|
178
175
|
const e = r("vlite.screen.exportData");
|
|
179
176
|
return e !== "vlite.screen.exportData" ? e : "Export Data";
|
|
180
|
-
}),
|
|
177
|
+
}), Z = i(() => {
|
|
181
178
|
const e = r("vlite.screen.importData");
|
|
182
179
|
return e !== "vlite.screen.importData" ? e : "Import Data";
|
|
183
180
|
}), ye = i(() => {
|
|
184
181
|
const e = [];
|
|
185
|
-
return a.exportProps !== !1 && e.push({ value: "export", label:
|
|
186
|
-
}),
|
|
187
|
-
e.value === "export" ? O.value = !0 : e.value === "import" && (
|
|
182
|
+
return a.exportProps !== !1 && e.push({ value: "export", label: M.value, icon: "lucide:download" }), a.importProps !== !1 && e.push({ value: "import", label: Z.value, icon: "lucide:upload" }), e;
|
|
183
|
+
}), U = x(null), xe = x(null), O = x(!1), q = x(!1), pe = (e) => {
|
|
184
|
+
e.value === "export" ? O.value = !0 : e.value === "import" && (q.value = !0);
|
|
188
185
|
}, we = i(() => a.exportSchema ? a.exportSchema.map((e) => ({
|
|
189
186
|
field: e.name || e.field,
|
|
190
187
|
title: e.label || e.title || e.name || e.field
|
|
@@ -192,7 +189,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
192
189
|
field: e.name || e.field,
|
|
193
190
|
title: e.label || e.title || e.name || e.field,
|
|
194
191
|
required: e.required || !1
|
|
195
|
-
})) : []), Be = async (e) =>
|
|
192
|
+
})) : []), Be = async (e) => I?.services?.importApi && a.importType ? await I.services.importApi(a.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,
|
|
@@ -202,22 +199,22 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
202
199
|
failed: 0,
|
|
203
200
|
errors: []
|
|
204
201
|
}), ke = () => {
|
|
205
|
-
|
|
206
|
-
}, Ce = i(() => a.exportMode ||
|
|
207
|
-
if (
|
|
202
|
+
D();
|
|
203
|
+
}, Ce = i(() => a.exportMode || I?.exportData?.mode || "frontend"), De = async (e) => {
|
|
204
|
+
if (I?.services?.exportApi && a.exportType) {
|
|
208
205
|
const n = {
|
|
209
206
|
format: e,
|
|
210
|
-
search:
|
|
211
|
-
filter:
|
|
207
|
+
search: $.value,
|
|
208
|
+
filter: R.value
|
|
212
209
|
};
|
|
213
|
-
await
|
|
210
|
+
await I.services.exportApi(a.exportType, n);
|
|
214
211
|
} else
|
|
215
212
|
console.warn(
|
|
216
213
|
"VLite Screen: No exportApi configured or no exportType provided for generic backend export."
|
|
217
214
|
);
|
|
218
215
|
};
|
|
219
216
|
return (e, n) => {
|
|
220
|
-
const
|
|
217
|
+
const _ = $e("router-link");
|
|
221
218
|
return l(), s("div", qe, [
|
|
222
219
|
t.customHeader ? p(e.$slots, "custom-header", { key: 1 }) : (l(), s("div", {
|
|
223
220
|
key: 0,
|
|
@@ -225,8 +222,8 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
225
222
|
}, [
|
|
226
223
|
y("div", ze, [
|
|
227
224
|
p(e.$slots, "title", {}, () => [
|
|
228
|
-
|
|
229
|
-
y("h1", Ke, f(
|
|
225
|
+
Y.value ? (l(), s("div", He, [
|
|
226
|
+
y("h1", Ke, f(Y.value), 1),
|
|
230
227
|
t.info || t.infoI18n ? (l(), c(Ve, {
|
|
231
228
|
key: 0,
|
|
232
229
|
content: t.info,
|
|
@@ -244,18 +241,18 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
244
241
|
])) : m("", !0)
|
|
245
242
|
]),
|
|
246
243
|
p(e.$slots, "description", {}, () => [
|
|
247
|
-
|
|
244
|
+
G.value ? (l(), s("p", Je, f(G.value), 1)) : m("", !0)
|
|
248
245
|
])
|
|
249
246
|
]),
|
|
250
247
|
y("div", Qe, [
|
|
251
248
|
y("div", Xe, [
|
|
252
|
-
v.value.length > 0 ? (l(), c(
|
|
249
|
+
v.value.length > 0 ? (l(), c(g, {
|
|
253
250
|
key: 0,
|
|
254
251
|
variant: "outline",
|
|
255
252
|
class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
|
|
256
253
|
icon: "lucide:trash-2",
|
|
257
254
|
title: re.value,
|
|
258
|
-
onClick: n[0] || (n[0] = (o) =>
|
|
255
|
+
onClick: n[0] || (n[0] = (o) => C(v.value))
|
|
259
256
|
}, null, 8, ["title"])) : m("", !0),
|
|
260
257
|
(t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (l(), s("div", Ye, [
|
|
261
258
|
y("button", {
|
|
@@ -284,7 +281,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
284
281
|
], 10, We)
|
|
285
282
|
])) : m("", !0),
|
|
286
283
|
p(e.$slots, "before-search"),
|
|
287
|
-
t.showRefresh ? (l(), c(
|
|
284
|
+
t.showRefresh ? (l(), c(g, {
|
|
288
285
|
key: 2,
|
|
289
286
|
variant: "outline",
|
|
290
287
|
icon: "lucide:refresh-cw",
|
|
@@ -292,21 +289,21 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
292
289
|
class: "shrink-0 h-9! w-9!",
|
|
293
290
|
title: ce.value,
|
|
294
291
|
disabled: t.loading,
|
|
295
|
-
onClick:
|
|
292
|
+
onClick: D
|
|
296
293
|
}, null, 8, ["title", "disabled"])) : m("", !0),
|
|
297
294
|
t.filterSchema && t.filterSchema.length > 0 ? (l(), c(je, {
|
|
298
295
|
key: 3,
|
|
299
296
|
schema: t.filterSchema,
|
|
300
297
|
type: t.filterType,
|
|
301
|
-
modelValue:
|
|
302
|
-
"onUpdate:modelValue": n[3] || (n[3] = (o) =>
|
|
303
|
-
onChange:
|
|
298
|
+
modelValue: R.value,
|
|
299
|
+
"onUpdate:modelValue": n[3] || (n[3] = (o) => R.value = o),
|
|
300
|
+
onChange: D
|
|
304
301
|
}, null, 8, ["schema", "type", "modelValue"])) : m("", !0),
|
|
305
302
|
t.canSearch ? (l(), s("div", Ze, [
|
|
306
303
|
u(Te, {
|
|
307
304
|
lazy: "",
|
|
308
|
-
modelValue:
|
|
309
|
-
"onUpdate:modelValue": n[4] || (n[4] = (o) =>
|
|
305
|
+
modelValue: $.value,
|
|
306
|
+
"onUpdate:modelValue": n[4] || (n[4] = (o) => $.value = o),
|
|
310
307
|
icon: "lucide:search",
|
|
311
308
|
placeholder: ue.value,
|
|
312
309
|
variant: "outline",
|
|
@@ -317,9 +314,9 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
317
314
|
]),
|
|
318
315
|
y("div", _e, [
|
|
319
316
|
p(e.$slots, "actions", {}, () => [
|
|
320
|
-
t.addComponent ? (l(), c(
|
|
321
|
-
t.addBtn ? (l(), s(
|
|
322
|
-
t.addBtn.modal ? (l(), c(
|
|
317
|
+
t.addComponent ? (l(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(P, { key: 1 }, [
|
|
318
|
+
t.addBtn ? (l(), s(P, { key: 0 }, [
|
|
319
|
+
t.addBtn.modal ? (l(), c(J, h({
|
|
323
320
|
key: 0,
|
|
324
321
|
body: t.addBtn.modal
|
|
325
322
|
}, t.addBtn.modalProps, {
|
|
@@ -329,7 +326,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
329
326
|
loading: t.loading
|
|
330
327
|
}), {
|
|
331
328
|
trigger: d(() => [
|
|
332
|
-
u(
|
|
329
|
+
u(g, h({
|
|
333
330
|
class: "w-full",
|
|
334
331
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
335
332
|
variant: t.addBtn.variant || "primary"
|
|
@@ -341,13 +338,13 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
341
338
|
}, 16, ["icon", "variant"])
|
|
342
339
|
]),
|
|
343
340
|
_: 1
|
|
344
|
-
}, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (l(), c(
|
|
341
|
+
}, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (l(), c(_, {
|
|
345
342
|
key: 1,
|
|
346
343
|
to: t.addBtn.to,
|
|
347
344
|
class: "inline-flex w-full sm:w-auto"
|
|
348
345
|
}, {
|
|
349
346
|
default: d(() => [
|
|
350
|
-
u(
|
|
347
|
+
u(g, h({
|
|
351
348
|
class: "w-full",
|
|
352
349
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
353
350
|
variant: t.addBtn.variant || "primary"
|
|
@@ -365,7 +362,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
365
362
|
target: t.addBtn.target,
|
|
366
363
|
class: "inline-flex w-full sm:w-auto"
|
|
367
364
|
}, [
|
|
368
|
-
u(
|
|
365
|
+
u(g, h({
|
|
369
366
|
class: "w-full",
|
|
370
367
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
371
368
|
variant: t.addBtn.variant || "primary"
|
|
@@ -375,7 +372,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
375
372
|
]),
|
|
376
373
|
_: 1
|
|
377
374
|
}, 16, ["icon", "variant"])
|
|
378
|
-
], 8, et)) : (l(), c(
|
|
375
|
+
], 8, et)) : (l(), c(g, h({
|
|
379
376
|
key: 3,
|
|
380
377
|
class: "w-full sm:w-auto",
|
|
381
378
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
@@ -391,7 +388,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
391
388
|
], 64)) : m("", !0)
|
|
392
389
|
], 64)) : m("", !0)
|
|
393
390
|
]),
|
|
394
|
-
|
|
391
|
+
W.value ? (l(), c(Ae, {
|
|
395
392
|
key: 0,
|
|
396
393
|
closeOnSelect: "",
|
|
397
394
|
position: "bottom-end",
|
|
@@ -399,7 +396,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
399
396
|
onOnSelect: pe
|
|
400
397
|
}, {
|
|
401
398
|
trigger: d(() => [
|
|
402
|
-
u(
|
|
399
|
+
u(g, {
|
|
403
400
|
variant: "outline",
|
|
404
401
|
icon: "lucide:more-vertical",
|
|
405
402
|
class: "px-2!",
|
|
@@ -425,14 +422,14 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
425
422
|
icon: t.emptyIcon
|
|
426
423
|
}, {
|
|
427
424
|
action: d(() => [
|
|
428
|
-
t.addComponent ? (l(), c(
|
|
429
|
-
t.addBtn ? (l(), s(
|
|
430
|
-
t.addBtn.modal ? (l(), c(
|
|
425
|
+
t.addComponent ? (l(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(P, { key: 1 }, [
|
|
426
|
+
t.addBtn ? (l(), s(P, { key: 0 }, [
|
|
427
|
+
t.addBtn.modal ? (l(), c(J, h({
|
|
431
428
|
key: 0,
|
|
432
429
|
body: t.addBtn.modal
|
|
433
430
|
}, t.addBtn.modalProps), {
|
|
434
431
|
trigger: d(() => [
|
|
435
|
-
u(
|
|
432
|
+
u(g, h({
|
|
436
433
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
437
434
|
variant: t.addBtn.variant || "primary",
|
|
438
435
|
rounded: "full",
|
|
@@ -445,13 +442,13 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
445
442
|
}, 16, ["icon", "variant"])
|
|
446
443
|
]),
|
|
447
444
|
_: 1
|
|
448
|
-
}, 16, ["body"])) : t.addBtn.to ? (l(), c(
|
|
445
|
+
}, 16, ["body"])) : t.addBtn.to ? (l(), c(_, {
|
|
449
446
|
key: 1,
|
|
450
447
|
to: t.addBtn.to,
|
|
451
448
|
class: "inline-flex"
|
|
452
449
|
}, {
|
|
453
450
|
default: d(() => [
|
|
454
|
-
u(
|
|
451
|
+
u(g, h({
|
|
455
452
|
icon: t.addBtn.icon || "fluent:add-16-filled",
|
|
456
453
|
variant: t.addBtn.variant || "outline"
|
|
457
454
|
}, t.addBtn.buttonProps), {
|
|
@@ -468,7 +465,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
468
465
|
target: t.addBtn.target,
|
|
469
466
|
class: "inline-flex"
|
|
470
467
|
}, [
|
|
471
|
-
u(
|
|
468
|
+
u(g, h({
|
|
472
469
|
icon: t.addBtn.icon || "lucide:plus",
|
|
473
470
|
variant: t.addBtn.variant || "outline"
|
|
474
471
|
}, t.addBtn.buttonProps), {
|
|
@@ -477,7 +474,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
477
474
|
]),
|
|
478
475
|
_: 1
|
|
479
476
|
}, 16, ["icon", "variant"])
|
|
480
|
-
], 8, tt)) : (l(), c(
|
|
477
|
+
], 8, tt)) : (l(), c(g, h({
|
|
481
478
|
key: 3,
|
|
482
479
|
icon: t.addBtn.icon || "lucide:plus",
|
|
483
480
|
variant: t.addBtn.variant || "outline"
|
|
@@ -489,7 +486,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
489
486
|
]),
|
|
490
487
|
_: 1
|
|
491
488
|
}, 16, ["icon", "variant"]))
|
|
492
|
-
], 64)) : (l(), c(
|
|
489
|
+
], 64)) : (l(), c(g, {
|
|
493
490
|
key: 1,
|
|
494
491
|
icon: "lucide:plus",
|
|
495
492
|
variant: "outline",
|
|
@@ -504,42 +501,42 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
504
501
|
]),
|
|
505
502
|
_: 1
|
|
506
503
|
}, 8, ["title", "titleI18n", "description", "descriptionI18n", "icon"])
|
|
507
|
-
]) : (l(), s(
|
|
504
|
+
]) : (l(), s(P, { key: 1 }, [
|
|
508
505
|
w(k) === "table" && e.$slots.table ? p(e.$slots, "table", {
|
|
509
506
|
key: 0,
|
|
510
507
|
data: t.data,
|
|
511
508
|
loading: t.loading,
|
|
512
509
|
selectedRows: v.value,
|
|
513
|
-
delete:
|
|
510
|
+
delete: C,
|
|
514
511
|
updateSelectedRows: (o) => v.value = o
|
|
515
512
|
}) : w(k) === "list" && e.$slots.list ? p(e.$slots, "list", {
|
|
516
513
|
key: 1,
|
|
517
514
|
data: t.data,
|
|
518
515
|
loading: t.loading,
|
|
519
516
|
selectedRows: v.value,
|
|
520
|
-
delete:
|
|
517
|
+
delete: C,
|
|
521
518
|
updateSelectedRows: (o) => v.value = o
|
|
522
519
|
}) : w(k) === "list" && e.$slots.grid ? p(e.$slots, "grid", {
|
|
523
520
|
key: 2,
|
|
524
521
|
data: t.data,
|
|
525
522
|
loading: t.loading,
|
|
526
523
|
selectedRows: v.value,
|
|
527
|
-
delete:
|
|
524
|
+
delete: C,
|
|
528
525
|
updateSelectedRows: (o) => v.value = o
|
|
529
|
-
}) :
|
|
526
|
+
}) : X.value ? (l(), c(K(X.value), {
|
|
530
527
|
key: 3,
|
|
531
528
|
data: t.data,
|
|
532
529
|
loading: t.loading,
|
|
533
530
|
refetch: t.refetch,
|
|
534
531
|
selectedRows: v.value,
|
|
535
532
|
"onUpdate:selectedRows": n[8] || (n[8] = (o) => v.value = o),
|
|
536
|
-
delete:
|
|
533
|
+
delete: C,
|
|
537
534
|
onDelete: le
|
|
538
|
-
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (l(), s("div", at, f(
|
|
535
|
+
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (l(), s("div", at, f(ge.value), 1))
|
|
539
536
|
], 64))
|
|
540
537
|
], 2),
|
|
541
538
|
t.pagination && t.pageInfo && t.pageInfo.totalPages > 1 ? (l(), s("div", lt, [
|
|
542
|
-
u(w(Ee),
|
|
539
|
+
u(w(Ee), h({
|
|
543
540
|
"current-page": t.pageInfo.currentPage,
|
|
544
541
|
"total-pages": t.pageInfo.totalPages,
|
|
545
542
|
"total-items": t.pageInfo.totalItems
|
|
@@ -554,42 +551,42 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
554
551
|
title: me.value,
|
|
555
552
|
description: fe.value,
|
|
556
553
|
"confirm-text": ve.value,
|
|
557
|
-
"cancel-text":
|
|
554
|
+
"cancel-text": he.value,
|
|
558
555
|
variant: "danger",
|
|
559
556
|
onConfirm: ae,
|
|
560
557
|
onCancel: n[10] || (n[10] = (o) => T.value = !1)
|
|
561
558
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
|
|
562
|
-
O.value ? (l(), c(
|
|
559
|
+
O.value ? (l(), c(J, {
|
|
563
560
|
key: 3,
|
|
564
561
|
show: O.value,
|
|
565
562
|
"onUpdate:show": n[11] || (n[11] = (o) => O.value = o),
|
|
566
|
-
title:
|
|
563
|
+
title: M.value,
|
|
567
564
|
"max-width": "sm:max-w-[400px]"
|
|
568
565
|
}, {
|
|
569
566
|
default: d(({ close: o }) => [
|
|
570
|
-
u(Ne,
|
|
567
|
+
u(Ne, h({
|
|
571
568
|
ref_key: "exportDataRef",
|
|
572
|
-
ref:
|
|
569
|
+
ref: U,
|
|
573
570
|
data: t.data || [],
|
|
574
571
|
fields: we.value,
|
|
575
572
|
mode: Ce.value,
|
|
576
573
|
"on-export": De
|
|
577
574
|
}, typeof t.exportProps == "object" ? t.exportProps : {}, {
|
|
578
|
-
title:
|
|
575
|
+
title: M.value,
|
|
579
576
|
class: "hidden!"
|
|
580
577
|
}), null, 16, ["data", "fields", "mode", "title"]),
|
|
581
578
|
y("div", nt, [
|
|
582
579
|
y("h6", ot, f(w(r)("vlite.exportData.selectFormat") !== "vlite.exportData.selectFormat" ? w(r)("vlite.exportData.selectFormat") : "Select Export Format"), 1),
|
|
583
580
|
y("div", it, [
|
|
584
|
-
(l(!0), s(
|
|
581
|
+
(l(!0), s(P, null, Se(U.value?.availableFormats || [
|
|
585
582
|
{ value: "excel", label: "Excel (.xlsx)", icon: "lucide:file-spreadsheet" },
|
|
586
583
|
{ value: "csv", label: "CSV (.csv)", icon: "lucide:file-text" },
|
|
587
584
|
{ value: "json", label: "JSON (.json)", icon: "lucide:file-json" }
|
|
588
|
-
], (j) => (l(), c(
|
|
585
|
+
], (j) => (l(), c(g, {
|
|
589
586
|
key: j.value,
|
|
590
587
|
variant: "outline",
|
|
591
588
|
class: "w-full flex items-center justify-start gap-3 h-12",
|
|
592
|
-
onClick: (st) =>
|
|
589
|
+
onClick: (st) => U.value?.exportData(j.value, o)
|
|
593
590
|
}, {
|
|
594
591
|
default: d(() => [
|
|
595
592
|
u(N, {
|
|
@@ -605,17 +602,17 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
605
602
|
]),
|
|
606
603
|
_: 1
|
|
607
604
|
}, 8, ["show", "title"])) : m("", !0),
|
|
608
|
-
|
|
609
|
-
u(Fe,
|
|
610
|
-
show:
|
|
611
|
-
"onUpdate:show": n[12] || (n[12] = (o) =>
|
|
605
|
+
W.value ? (l(), s("div", rt, [
|
|
606
|
+
u(Fe, h({
|
|
607
|
+
show: q.value,
|
|
608
|
+
"onUpdate:show": n[12] || (n[12] = (o) => q.value = o),
|
|
612
609
|
ref_key: "importDataRef",
|
|
613
610
|
ref: xe,
|
|
614
611
|
fields: be.value,
|
|
615
612
|
processBatch: Be,
|
|
616
613
|
onComplete: ke
|
|
617
614
|
}, typeof t.importProps == "object" ? t.importProps : {}, {
|
|
618
|
-
title:
|
|
615
|
+
title: Z.value,
|
|
619
616
|
class: "hidden!"
|
|
620
617
|
}), null, 16, ["show", "fields", "title"])
|
|
621
618
|
])) : m("", !0)
|
|
@@ -31,15 +31,12 @@ export interface ScreenProps {
|
|
|
31
31
|
data?: any[];
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
refetch?: (payload: {
|
|
34
|
-
pageinfo: {
|
|
35
|
-
page: number;
|
|
36
|
-
limit: number;
|
|
37
|
-
};
|
|
38
34
|
pagination: {
|
|
39
35
|
page: number;
|
|
40
36
|
limit: number;
|
|
41
37
|
};
|
|
42
38
|
search: string;
|
|
39
|
+
sort: Record<string, any>;
|
|
43
40
|
filter: Record<string, any>;
|
|
44
41
|
}) => void;
|
|
45
42
|
paginationProps?: ScreenPaginationProps;
|