vlite3 0.7.4 → 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.
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DataTable/DataTable.vue.js +3 -2
- package/components/DataTable/types.d.ts +4 -3
- package/components/Navbar/NavbarTabs.vue.js +28 -27
- package/components/Screen/Screen.vue.js +82 -85
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Screen/types.d.ts +1 -4
- package/package.json +1 -1
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -5,8 +5,8 @@ import O from "../Input.vue.js";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
import y from "../Button.vue.js";
|
|
8
|
-
import E from "./ColorIro.
|
|
9
|
-
/* empty css
|
|
8
|
+
import E from "./ColorIro.vue.js";
|
|
9
|
+
/* empty css */
|
|
10
10
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
11
11
|
const I = {
|
|
12
12
|
key: 0,
|
|
@@ -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,8 +1,8 @@
|
|
|
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
|
|
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
|
|
5
|
-
import
|
|
4
|
+
import g from "../Button.vue.js";
|
|
5
|
+
import N from "../Icon.vue.js";
|
|
6
6
|
import Ve from "../Tooltip.vue.js";
|
|
7
7
|
import J from "../Modal.vue.js";
|
|
8
8
|
import Re from "../ConfirmationModal.vue.js";
|
|
@@ -82,7 +82,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
82
82
|
},
|
|
83
83
|
emits: ["add", "delete"],
|
|
84
84
|
setup(t, { emit: ee }) {
|
|
85
|
-
const a = t,
|
|
85
|
+
const a = t, I = Me(), Q = ee;
|
|
86
86
|
z(Ue, {
|
|
87
87
|
disableSearch: !0,
|
|
88
88
|
forceSelectable: !0
|
|
@@ -90,47 +90,44 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
90
90
|
const V = Ie(), te = i(() => a.name || a.title || "default-screen"), k = Le(
|
|
91
91
|
`view-mode-${te.value}`,
|
|
92
92
|
a.table || V.table ? "table" : "list"
|
|
93
|
-
),
|
|
94
|
-
z("screen-selected-rows", v), z("screen-request-delete", (e) =>
|
|
95
|
-
const
|
|
96
|
-
|
|
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
|
+
E.value = e, T.value = !0;
|
|
97
97
|
}, ae = () => {
|
|
98
|
-
Q("delete",
|
|
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
113
|
let L = null;
|
|
114
|
-
H(
|
|
114
|
+
H($, () => {
|
|
115
115
|
L && clearTimeout(L), L = setTimeout(() => {
|
|
116
|
-
|
|
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: E.value
|
|
128
|
-
},
|
|
129
125
|
pagination: {
|
|
130
|
-
page:
|
|
131
|
-
limit:
|
|
126
|
+
page: S.value,
|
|
127
|
+
limit: F.value
|
|
132
128
|
},
|
|
133
|
-
search:
|
|
129
|
+
search: $.value,
|
|
130
|
+
sort: {},
|
|
134
131
|
filter: R.value
|
|
135
132
|
};
|
|
136
133
|
a.refetch && a.refetch(e);
|
|
@@ -155,15 +152,15 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
155
152
|
const e = r("vlite.screen.confirmDeleteTitle");
|
|
156
153
|
return e !== "vlite.screen.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
157
154
|
}), fe = i(() => {
|
|
158
|
-
const e = r("vlite.screen.confirmDeleteDesc", { count:
|
|
159
|
-
return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${
|
|
155
|
+
const e = r("vlite.screen.confirmDeleteDesc", { count: E.value.length });
|
|
156
|
+
return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${E.value.length > 1 ? "items" : "item"}?`;
|
|
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(() => {
|
|
@@ -183,8 +180,8 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
183
180
|
}), ye = i(() => {
|
|
184
181
|
const e = [];
|
|
185
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;
|
|
186
|
-
}), U = x(null), xe = x(null),
|
|
187
|
-
e.value === "export" ?
|
|
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,15 +199,15 @@ 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:
|
|
207
|
+
search: $.value,
|
|
211
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."
|
|
@@ -221,7 +218,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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,
|
|
224
|
-
class:
|
|
221
|
+
class: A([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
|
|
225
222
|
}, [
|
|
226
223
|
y("div", ze, [
|
|
227
224
|
p(e.$slots, "title", {}, () => [
|
|
@@ -234,7 +231,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
234
231
|
placement: "right"
|
|
235
232
|
}, {
|
|
236
233
|
default: d(() => [
|
|
237
|
-
u(
|
|
234
|
+
u(N, {
|
|
238
235
|
icon: "lucide:info",
|
|
239
236
|
class: "w-[18px] h-[18px] mt-3! text-muted-foreground hover:text-foreground cursor-pointer transition-colors outline-none"
|
|
240
237
|
})
|
|
@@ -249,42 +246,42 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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", {
|
|
262
259
|
onClick: n[1] || (n[1] = (o) => k.value = "list"),
|
|
263
|
-
class:
|
|
260
|
+
class: A(["p-1.5 rounded", [
|
|
264
261
|
w(k) === "list" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
265
262
|
]]),
|
|
266
263
|
title: de.value
|
|
267
264
|
}, [
|
|
268
|
-
u(
|
|
265
|
+
u(N, {
|
|
269
266
|
icon: "lucide:layout-grid",
|
|
270
267
|
class: "w-4 h-4"
|
|
271
268
|
})
|
|
272
269
|
], 10, Ge),
|
|
273
270
|
y("button", {
|
|
274
271
|
onClick: n[2] || (n[2] = (o) => k.value = "table"),
|
|
275
|
-
class:
|
|
272
|
+
class: A(["p-1.5 rounded", [
|
|
276
273
|
w(k) === "table" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
277
274
|
]]),
|
|
278
275
|
title: se.value
|
|
279
276
|
}, [
|
|
280
|
-
u(
|
|
277
|
+
u(N, {
|
|
281
278
|
icon: "lucide:list",
|
|
282
279
|
class: "w-4 h-4"
|
|
283
280
|
})
|
|
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,7 +289,7 @@ 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,
|
|
@@ -300,13 +297,13 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
300
297
|
type: t.filterType,
|
|
301
298
|
modelValue: R.value,
|
|
302
299
|
"onUpdate:modelValue": n[3] || (n[3] = (o) => R.value = o),
|
|
303
|
-
onChange:
|
|
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(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(
|
|
321
|
-
t.addBtn ? (l(), s(
|
|
322
|
-
t.addBtn.modal ? (l(), c(J,
|
|
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"
|
|
@@ -347,7 +344,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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",
|
|
@@ -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!",
|
|
@@ -414,7 +411,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
414
411
|
], 2)),
|
|
415
412
|
p(e.$slots, "sub-header"),
|
|
416
413
|
y("div", {
|
|
417
|
-
class:
|
|
414
|
+
class: A(["flex-1 w-full relative", t.containerClass])
|
|
418
415
|
}, [
|
|
419
416
|
!ie.value && !t.loading ? p(e.$slots, "empty", { key: 0 }, () => [
|
|
420
417
|
u(w(Oe), {
|
|
@@ -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(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(
|
|
429
|
-
t.addBtn ? (l(), s(
|
|
430
|
-
t.addBtn.modal ? (l(), c(J,
|
|
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",
|
|
@@ -451,7 +448,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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,27 +501,27 @@ 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,
|
|
@@ -533,13 +530,13 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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,20 +551,20 @@ 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
|
-
|
|
559
|
+
O.value ? (l(), c(J, {
|
|
563
560
|
key: 3,
|
|
564
|
-
show:
|
|
565
|
-
"onUpdate:show": n[11] || (n[11] = (o) =>
|
|
561
|
+
show: O.value,
|
|
562
|
+
"onUpdate:show": n[11] || (n[11] = (o) => O.value = o),
|
|
566
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
569
|
ref: U,
|
|
573
570
|
data: t.data || [],
|
|
@@ -581,22 +578,22 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
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
|
-
], (
|
|
589
|
-
key:
|
|
585
|
+
], (j) => (l(), c(g, {
|
|
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) => U.value?.exportData(
|
|
589
|
+
onClick: (st) => U.value?.exportData(j.value, o)
|
|
593
590
|
}, {
|
|
594
591
|
default: d(() => [
|
|
595
|
-
u(
|
|
596
|
-
icon:
|
|
592
|
+
u(N, {
|
|
593
|
+
icon: j.icon,
|
|
597
594
|
class: "text-muted-foreground h-5 w-5"
|
|
598
595
|
}, null, 8, ["icon"]),
|
|
599
|
-
y("span", null, f(
|
|
596
|
+
y("span", null, f(j.label), 1)
|
|
600
597
|
]),
|
|
601
598
|
_: 2
|
|
602
599
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -606,7 +603,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
|
|
|
606
603
|
_: 1
|
|
607
604
|
}, 8, ["show", "title"])) : m("", !0),
|
|
608
605
|
W.value ? (l(), s("div", rt, [
|
|
609
|
-
u(Fe,
|
|
606
|
+
u(Fe, h({
|
|
610
607
|
show: q.value,
|
|
611
608
|
"onUpdate:show": n[12] || (n[12] = (o) => q.value = o),
|
|
612
609
|
ref_key: "importDataRef",
|
|
@@ -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;
|
package/package.json
CHANGED
|
File without changes
|