vlite3 0.4.4 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Accordion/AccordionItem.vue.js +33 -32
- package/components/Accordion/types.d.ts +2 -0
- package/components/Alert.vue.d.ts +2 -0
- package/components/Alert.vue.js +38 -36
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +37 -35
- package/components/CheckBox.vue.d.ts +1 -0
- package/components/CheckBox.vue.js +40 -40
- package/components/Chip/Chip.vue.js +55 -55
- package/components/Chip/types.d.ts +1 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
- package/components/ColorPicker/ColorPicker.vue.js +3 -2
- package/components/ConfirmationModal.vue.d.ts +4 -2
- package/components/ConfirmationModal.vue.js +48 -33
- package/components/DataList/DataList.vue.d.ts +0 -2
- package/components/DataList/DataList.vue.js +39 -35
- package/components/DataList/types.d.ts +2 -0
- package/components/DataTable/DataTable.vue.d.ts +0 -5
- package/components/DataTable/DataTable.vue.js +177 -158
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
- package/components/DataTable/DataTableToolbar.vue.js +30 -23
- package/components/DataTable/types.d.ts +4 -0
- package/components/DatePicker.vue.d.ts +1 -0
- package/components/DatePicker.vue.js +32 -25
- package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
- package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
- package/components/Dropdown/DropdownItem.vue.js +24 -23
- package/components/Dropdown/DropdownMenu.vue.js +100 -91
- package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
- package/components/Dropdown/composables/useDropdownSelection.js +19 -17
- package/components/Empty/Empty.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.js +32 -18
- package/components/FilePicker/FilePicker.vue.d.ts +3 -1
- package/components/FilePicker/FilePicker.vue.js +140 -127
- package/components/FileTree/FileTree.vue.js +68 -58
- package/components/FileTree/FileTreeNode.vue.js +35 -34
- package/components/FileTree/types.d.ts +3 -0
- package/components/Form/CustomFields.vue.d.ts +3 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +92 -80
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +60 -59
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +58 -57
- package/components/Form/composables/useForm.js +91 -88
- package/components/Form/types.d.ts +4 -0
- package/components/Form/utils/form.utils.js +104 -98
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.js +39 -32
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/IconPicker.vue.d.ts +2 -0
- package/components/IconPicker.vue.js +37 -29
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +96 -98
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +55 -54
- package/components/Kanban/types.d.ts +1 -0
- package/components/Masonry/Masonry.vue2.js +3 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +62 -57
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.vue.js +61 -54
- package/components/Navbar/Navbar.vue.js +46 -46
- package/components/Pagination/Pagination.vue.js +116 -97
- package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
- package/components/PricingPlan/types.d.ts +5 -0
- package/components/Screen/Screen.vue.d.ts +0 -4
- package/components/Screen/Screen.vue.js +231 -189
- package/components/Screen/ScreenFilter.vue.js +73 -63
- package/components/Screen/types.d.ts +5 -0
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +140 -5
- package/components/SidePanel.vue2.js +2 -135
- package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
- package/components/SidebarMenu/types.d.ts +1 -0
- package/components/Slider.vue.d.ts +1 -0
- package/components/Slider.vue.js +71 -69
- package/components/Switch.vue.d.ts +1 -0
- package/components/Switch.vue.js +23 -18
- package/components/Tabes/Tabes.vue.js +20 -19
- package/components/Tabes/types.d.ts +1 -0
- package/components/Textarea.vue.d.ts +1 -0
- package/components/Textarea.vue.js +18 -16
- package/components/ThemeToggle.vue.js +24 -14
- package/components/Timeline.vue.js +68 -82
- package/components/ToastNotification.vue.js +2 -2
- package/components/Tooltip.vue.d.ts +4 -3
- package/components/Tooltip.vue.js +17 -15
- package/components/Workbook/Sheet.vue.js +80 -71
- package/components/Workbook/WorkbookAddButton.vue.js +14 -10
- package/components/Workbook/types.d.ts +1 -0
- package/core/config.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +28 -26
- package/package.json +1 -1
- package/style.css +1 -2
- package/types/button.d.ts +1 -0
- package/types/config.type.d.ts +10 -0
- package/types/form.type.d.ts +2 -0
- package/types/styles.d.ts +3 -0
- package/types/timeline.type.d.ts +2 -0
- package/utils/i18n.d.ts +8 -0
- package/utils/i18n.js +5 -0
- package/utils/index.d.ts +1 -0
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { defineComponent as de, ref as b, computed as r, watch as h, openBlock as n, createElementBlock as d, createBlock as B, normalizeClass as I, createSlots as M, withCtx as S, renderSlot as T, createCommentVNode as D, createElementVNode as c, createVNode as R, Fragment as F, renderList as x, normalizeStyle as j, mergeProps as O, unref as L } from "vue";
|
|
2
|
+
import ce from "../CheckBox.vue.js";
|
|
3
|
+
import ue from "../Button.vue.js";
|
|
4
|
+
import me from "../ConfirmationModal.vue.js";
|
|
5
|
+
import fe from "../Pagination/Pagination.vue.js";
|
|
6
|
+
import ve from "../Empty/Empty.vue.js";
|
|
7
|
+
import he from "./DataTableHeader.vue.js";
|
|
8
|
+
import ge from "./DataTableRow.vue.js";
|
|
9
|
+
import be from "./DataTableToolbar.vue.js";
|
|
10
|
+
import { $t as w } from "../../utils/i18n.js";
|
|
11
|
+
const pe = { class: "space-y-6.5" }, ye = { class: "overflow-x-auto w-full" }, we = { class: "hover:bg-transparent" }, ke = {
|
|
11
12
|
key: 0,
|
|
12
13
|
scope: "col",
|
|
13
14
|
class: "w-[48px] px-0 text-center font-medium text-muted-foreground",
|
|
14
15
|
style: { width: "48px" }
|
|
15
|
-
},
|
|
16
|
+
}, Pe = { class: "flex items-center justify-center" }, Ce = { class: "[&_tr:last-child]:border-0" }, Ie = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
18
19
|
style: { width: "48px" }
|
|
19
|
-
},
|
|
20
|
+
}, Se = { key: 2 }, Te = ["colspan"], De = { key: 1 }, Ue = /* @__PURE__ */ de({
|
|
20
21
|
__name: "DataTable",
|
|
21
22
|
props: {
|
|
22
23
|
rows: { default: () => [] },
|
|
23
24
|
selectedRows: { default: () => [] },
|
|
24
25
|
search: { default: "" },
|
|
25
26
|
showSearch: { type: Boolean, default: !0 },
|
|
26
|
-
searchPlaceholder: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
searchPlaceholder: {},
|
|
28
|
+
searchPlaceholderI18n: {},
|
|
29
|
+
toolbarClass: {},
|
|
30
|
+
toolbarSearchClass: {},
|
|
29
31
|
headers: { default: () => [] },
|
|
30
32
|
keyField: { default: "_id" },
|
|
31
33
|
loading: { type: Boolean, default: !1 },
|
|
32
34
|
selectable: { type: Boolean, default: !1 },
|
|
33
|
-
emptyTitle: {
|
|
34
|
-
|
|
35
|
+
emptyTitle: {},
|
|
36
|
+
emptyTitleI18n: {},
|
|
37
|
+
emptyDescription: {},
|
|
38
|
+
emptyDescriptionI18n: {},
|
|
35
39
|
emptyIcon: { default: "lucide:inbox" },
|
|
36
40
|
showPagination: { type: Boolean, default: !0 },
|
|
37
41
|
paginationProps: { default: () => ({
|
|
@@ -52,20 +56,20 @@ const ue = { class: "space-y-6.5" }, fe = { class: "overflow-x-auto w-full" }, m
|
|
|
52
56
|
variant: { default: "default" }
|
|
53
57
|
},
|
|
54
58
|
emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
|
|
55
|
-
setup(a, { emit:
|
|
56
|
-
const
|
|
57
|
-
if (!(!e || !
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
),
|
|
59
|
+
setup(a, { emit: W }) {
|
|
60
|
+
const q = (e, l) => {
|
|
61
|
+
if (!(!e || !l))
|
|
62
|
+
return l.includes(".") ? l.split(".").reduce((o, m) => o?.[m], e) : e[l];
|
|
63
|
+
}, u = (e, l) => q(e, l), t = a, p = W, i = b({ field: "", order: "" }), k = b(
|
|
64
|
+
t.pageInfo?.itemsPerPage || t.paginationProps?.itemsPerPage || 10
|
|
65
|
+
), g = b(t.pageInfo?.currentPage || 1), y = b(t.search || ""), P = b(!1), C = b("initial"), G = r(() => t.loading);
|
|
62
66
|
h(
|
|
63
|
-
() =>
|
|
64
|
-
(e,
|
|
65
|
-
!e &&
|
|
67
|
+
() => t.loading,
|
|
68
|
+
(e, l) => {
|
|
69
|
+
!e && l && (C.value = "idle");
|
|
66
70
|
}
|
|
67
71
|
), h(
|
|
68
|
-
() =>
|
|
72
|
+
() => t.search,
|
|
69
73
|
(e) => {
|
|
70
74
|
e !== void 0 && e !== y.value && (y.value = e);
|
|
71
75
|
}
|
|
@@ -73,262 +77,277 @@ const ue = { class: "space-y-6.5" }, fe = { class: "overflow-x-auto w-full" }, m
|
|
|
73
77
|
let z = null;
|
|
74
78
|
h(y, (e) => {
|
|
75
79
|
z && clearTimeout(z), z = setTimeout(() => {
|
|
76
|
-
|
|
80
|
+
g.value = 1, C.value = "search", $();
|
|
77
81
|
}, 300);
|
|
78
82
|
}), h(
|
|
79
|
-
() =>
|
|
83
|
+
() => t.pageInfo?.itemsPerPage,
|
|
80
84
|
(e) => {
|
|
81
|
-
e !== void 0 && (
|
|
85
|
+
e !== void 0 && (k.value = e);
|
|
82
86
|
}
|
|
83
87
|
), h(
|
|
84
|
-
() =>
|
|
88
|
+
() => t.paginationProps?.itemsPerPage,
|
|
85
89
|
(e) => {
|
|
86
|
-
e !== void 0 && (
|
|
90
|
+
e !== void 0 && (k.value = e);
|
|
87
91
|
}
|
|
88
92
|
), h(
|
|
89
|
-
() =>
|
|
93
|
+
() => t.pageInfo?.currentPage,
|
|
90
94
|
(e) => {
|
|
91
|
-
e && (
|
|
95
|
+
e && (g.value = e);
|
|
92
96
|
}
|
|
93
97
|
);
|
|
94
|
-
const
|
|
98
|
+
const N = (e) => u(e, t.keyField), s = b(/* @__PURE__ */ new Set());
|
|
95
99
|
h(
|
|
96
|
-
() =>
|
|
100
|
+
() => t.selectedRows,
|
|
97
101
|
(e) => {
|
|
98
|
-
const
|
|
99
|
-
(
|
|
102
|
+
const l = new Set((e || []).map((o) => u(o, t.keyField)));
|
|
103
|
+
(l.size !== s.value.size || [...l].some((o) => !s.value.has(o))) && (s.value = l);
|
|
100
104
|
},
|
|
101
105
|
{ immediate: !0, deep: !0 }
|
|
102
106
|
);
|
|
103
|
-
const
|
|
104
|
-
const e = [...
|
|
105
|
-
return e.forEach((o) =>
|
|
106
|
-
}),
|
|
107
|
-
e ?
|
|
108
|
-
},
|
|
109
|
-
s.value.has(e) ? s.value.delete(e) : s.value.add(e),
|
|
110
|
-
},
|
|
111
|
-
const e =
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
s.value.has(
|
|
107
|
+
const E = r(() => t.rows.length === 0 ? !1 : t.rows.every((e) => s.value.has(u(e, t.keyField)))), U = r(() => s.value.size > 0 && !E.value), H = r(() => {
|
|
108
|
+
const e = [...t.selectedRows || [], ...t.rows], l = /* @__PURE__ */ new Map();
|
|
109
|
+
return e.forEach((o) => l.set(u(o, t.keyField), o)), Array.from(s.value).map((o) => l.get(o)).filter(Boolean);
|
|
110
|
+
}), J = (e) => {
|
|
111
|
+
e ? t.rows.forEach((l) => s.value.add(u(l, t.keyField))) : s.value.size > 0 && t.rows.forEach((l) => s.value.delete(u(l, t.keyField))), V();
|
|
112
|
+
}, K = (e) => {
|
|
113
|
+
s.value.has(e) ? s.value.delete(e) : s.value.add(e), V();
|
|
114
|
+
}, V = () => {
|
|
115
|
+
const e = t.selectedRows || [], l = /* @__PURE__ */ new Set(), o = [];
|
|
116
|
+
t.rows.forEach((f) => {
|
|
117
|
+
const v = u(f, t.keyField);
|
|
118
|
+
s.value.has(v) && (o.push(f), l.add(v));
|
|
115
119
|
}), e.forEach((f) => {
|
|
116
|
-
const
|
|
117
|
-
!
|
|
120
|
+
const v = u(f, t.keyField);
|
|
121
|
+
!l.has(v) && s.value.has(v) && (o.push(f), l.add(v));
|
|
118
122
|
});
|
|
119
|
-
const
|
|
123
|
+
const m = {
|
|
120
124
|
selected: o,
|
|
121
|
-
all:
|
|
122
|
-
indeterminate:
|
|
125
|
+
all: E.value,
|
|
126
|
+
indeterminate: U.value
|
|
123
127
|
};
|
|
124
|
-
|
|
125
|
-
}, K = (e) => {
|
|
126
|
-
r.value.field === e ? r.value.order === "asc" ? r.value.order = "desc" : r.value.order === "desc" ? (r.value.order = "", r.value.field = "") : r.value.order = "asc" : (r.value.field = e, r.value.order = "asc"), v.value = 1, P.value = "sort", R();
|
|
128
|
+
p("select", m), p("update:selectedRows", o);
|
|
127
129
|
}, Q = (e) => {
|
|
128
|
-
|
|
130
|
+
i.value.field === e ? i.value.order === "asc" ? i.value.order = "desc" : i.value.order === "desc" ? (i.value.order = "", i.value.field = "") : i.value.order = "asc" : (i.value.field = e, i.value.order = "asc"), g.value = 1, C.value = "sort", $();
|
|
129
131
|
}, X = (e) => {
|
|
130
|
-
|
|
132
|
+
g.value = e, C.value = "page", $();
|
|
131
133
|
}, Y = (e) => {
|
|
132
|
-
|
|
133
|
-
}, Z = () => {
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
k.value = e, g.value = 1, C.value = "limit", p("update:itemsPerPage", e), $();
|
|
135
|
+
}, Z = (e) => {
|
|
136
|
+
p("rowClick", e);
|
|
137
|
+
}, _ = () => {
|
|
138
|
+
const e = H.value;
|
|
139
|
+
p("delete", e), P.value = !1;
|
|
136
140
|
};
|
|
137
|
-
let
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
let A = null;
|
|
142
|
+
const $ = () => {
|
|
143
|
+
A && clearTimeout(A), A = setTimeout(() => {
|
|
144
|
+
p("change", {
|
|
141
145
|
pagination: {
|
|
142
|
-
page:
|
|
143
|
-
limit:
|
|
146
|
+
page: g.value,
|
|
147
|
+
limit: k.value
|
|
144
148
|
},
|
|
145
|
-
sorting: { ...
|
|
149
|
+
sorting: { ...i.value },
|
|
146
150
|
search: y.value
|
|
147
151
|
});
|
|
148
152
|
}, 10);
|
|
149
|
-
},
|
|
153
|
+
}, ee = r(() => [
|
|
150
154
|
"w-full flex flex-col",
|
|
151
|
-
|
|
155
|
+
t.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
|
|
152
156
|
"overflow-hidden",
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
].join(" ")),
|
|
156
|
-
|
|
157
|
-
() =>
|
|
157
|
+
t.bordered ? "border border-border" : "",
|
|
158
|
+
t.class
|
|
159
|
+
].join(" ")), te = r(() => ["w-full caption-bottom -text-fs-1", t.tableClass].join(" ")), le = (e) => e.width ? e.width : "auto";
|
|
160
|
+
h(
|
|
161
|
+
() => t.rows,
|
|
158
162
|
() => {
|
|
159
|
-
const e = new Set(
|
|
160
|
-
s.value = new Set([...s.value].filter((
|
|
163
|
+
const e = new Set(t.rows.map((l) => u(l, t.keyField)));
|
|
164
|
+
s.value = new Set([...s.value].filter((l) => e.has(l)));
|
|
161
165
|
}
|
|
162
|
-
)
|
|
163
|
-
|
|
166
|
+
);
|
|
167
|
+
const ae = r(() => t.emptyTitleI18n ? w(t.emptyTitleI18n) : t.emptyTitle), oe = r(() => t.emptyDescriptionI18n ? w(t.emptyDescriptionI18n) : t.emptyDescription), se = r(() => {
|
|
168
|
+
const e = w("vlite.dataTable.confirmDeleteTitle");
|
|
169
|
+
return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
170
|
+
}), ne = r(() => {
|
|
171
|
+
const e = w("vlite.dataTable.confirmDeleteDesc");
|
|
172
|
+
return e !== "vlite.dataTable.confirmDeleteDesc" ? e : "Are you sure you want to delete the selected items?";
|
|
173
|
+
}), re = r(() => {
|
|
174
|
+
const e = w("vlite.dataTable.deleteBtn");
|
|
175
|
+
return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
|
|
176
|
+
}), ie = r(() => {
|
|
177
|
+
const e = w("vlite.dataTable.cancelBtn");
|
|
178
|
+
return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
|
|
179
|
+
});
|
|
180
|
+
return (e, l) => (n(), d("div", pe, [
|
|
181
|
+
a.showSearch || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (n(), B(be, {
|
|
164
182
|
key: 0,
|
|
165
183
|
modelValue: y.value,
|
|
166
|
-
"onUpdate:modelValue":
|
|
184
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => y.value = o),
|
|
167
185
|
"show-search": a.showSearch,
|
|
168
186
|
placeholder: a.searchPlaceholder,
|
|
169
|
-
|
|
187
|
+
placeholderI18n: a.searchPlaceholderI18n,
|
|
188
|
+
class: I(a.toolbarClass),
|
|
170
189
|
"search-class": a.toolbarSearchClass
|
|
171
|
-
},
|
|
190
|
+
}, M({ _: 2 }, [
|
|
172
191
|
e.$slots?.["toolbar-left"] ? {
|
|
173
192
|
name: "left",
|
|
174
193
|
fn: S(() => [
|
|
175
|
-
|
|
194
|
+
T(e.$slots, "toolbar-left")
|
|
176
195
|
]),
|
|
177
196
|
key: "0"
|
|
178
197
|
} : void 0,
|
|
179
198
|
s.value.size > 0 ? {
|
|
180
199
|
name: "delete",
|
|
181
200
|
fn: S(() => [
|
|
182
|
-
s.value.size > 0 ? (n(), B(
|
|
201
|
+
s.value.size > 0 ? (n(), B(ue, {
|
|
183
202
|
key: 0,
|
|
184
203
|
rounded: "full",
|
|
185
204
|
variant: "outline",
|
|
186
205
|
size: "lg",
|
|
187
206
|
icon: "lucide:trash-2",
|
|
188
|
-
onClick:
|
|
189
|
-
})) :
|
|
207
|
+
onClick: l[0] || (l[0] = (o) => P.value = !0)
|
|
208
|
+
})) : D("", !0)
|
|
190
209
|
]),
|
|
191
210
|
key: "1"
|
|
192
211
|
} : void 0,
|
|
193
212
|
e.$slots?.["toolbar-right"] ? {
|
|
194
213
|
name: "right",
|
|
195
214
|
fn: S(() => [
|
|
196
|
-
|
|
215
|
+
T(e.$slots, "toolbar-right")
|
|
197
216
|
]),
|
|
198
217
|
key: "2"
|
|
199
218
|
} : void 0
|
|
200
|
-
]), 1032, ["modelValue", "show-search", "placeholder", "class", "search-class"])) :
|
|
201
|
-
|
|
202
|
-
class:
|
|
219
|
+
]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : D("", !0),
|
|
220
|
+
c("div", {
|
|
221
|
+
class: I(ee.value)
|
|
203
222
|
}, [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
class:
|
|
223
|
+
c("div", ye, [
|
|
224
|
+
c("table", {
|
|
225
|
+
class: I([te.value, "data-table"])
|
|
207
226
|
}, [
|
|
208
|
-
|
|
209
|
-
class:
|
|
227
|
+
c("thead", {
|
|
228
|
+
class: I([
|
|
210
229
|
"[&_tr]:border-b [&_tr]:border-border bg-muted",
|
|
211
230
|
a.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
212
231
|
])
|
|
213
232
|
}, [
|
|
214
|
-
|
|
215
|
-
a.selectable ? (n(),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"model-value":
|
|
219
|
-
indeterminate:
|
|
233
|
+
c("tr", we, [
|
|
234
|
+
a.selectable ? (n(), d("th", ke, [
|
|
235
|
+
c("div", Pe, [
|
|
236
|
+
R(ce, {
|
|
237
|
+
"model-value": E.value,
|
|
238
|
+
indeterminate: U.value,
|
|
220
239
|
size: "xs",
|
|
221
|
-
"onUpdate:modelValue":
|
|
240
|
+
"onUpdate:modelValue": J
|
|
222
241
|
}, null, 8, ["model-value", "indeterminate"])
|
|
223
242
|
])
|
|
224
|
-
])) :
|
|
225
|
-
(n(!0),
|
|
243
|
+
])) : D("", !0),
|
|
244
|
+
(n(!0), d(F, null, x(a.headers, (o) => (n(), B(he, {
|
|
226
245
|
key: o.field,
|
|
227
246
|
header: o,
|
|
228
|
-
"sort-config":
|
|
247
|
+
"sort-config": i.value,
|
|
229
248
|
compact: a.compact,
|
|
230
249
|
"table-sortable": a.sortable,
|
|
231
|
-
onSort:
|
|
250
|
+
onSort: Q,
|
|
232
251
|
class: "last:pr-5!",
|
|
233
|
-
style:
|
|
234
|
-
width:
|
|
252
|
+
style: j({
|
|
253
|
+
width: le(o)
|
|
235
254
|
})
|
|
236
255
|
}, null, 8, ["header", "sort-config", "compact", "table-sortable", "style"]))), 128))
|
|
237
256
|
])
|
|
238
257
|
], 2),
|
|
239
|
-
|
|
240
|
-
|
|
258
|
+
c("tbody", Ce, [
|
|
259
|
+
G.value ? (n(!0), d(F, { key: 0 }, x(Math.min(k.value, 15), (o) => (n(), d("tr", {
|
|
241
260
|
key: "skeleton-" + o,
|
|
242
261
|
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
243
262
|
}, [
|
|
244
|
-
a.selectable ? (n(),
|
|
245
|
-
|
|
246
|
-
|
|
263
|
+
a.selectable ? (n(), d("td", Ie, [...l[4] || (l[4] = [
|
|
264
|
+
c("div", { class: "flex items-center justify-center" }, [
|
|
265
|
+
c("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
247
266
|
], -1)
|
|
248
|
-
])])) :
|
|
249
|
-
(n(!0),
|
|
250
|
-
key:
|
|
251
|
-
class:
|
|
267
|
+
])])) : D("", !0),
|
|
268
|
+
(n(!0), d(F, null, x(a.headers, (m) => (n(), d("td", {
|
|
269
|
+
key: m.field,
|
|
270
|
+
class: I(["p-5! align-middle last:pr-6!", [m.hideOnMobile ? "hidden md:table-cell" : ""]])
|
|
252
271
|
}, [
|
|
253
|
-
|
|
272
|
+
c("div", {
|
|
254
273
|
class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
|
|
255
|
-
style:
|
|
274
|
+
style: j({
|
|
256
275
|
width: `${50 + Math.random() * 40}%`
|
|
257
276
|
})
|
|
258
277
|
}, null, 4)
|
|
259
278
|
], 2))), 128))
|
|
260
|
-
]))), 128)) : a.rows.length > 0 ? (n(!0),
|
|
261
|
-
key:
|
|
279
|
+
]))), 128)) : a.rows.length > 0 ? (n(!0), d(F, { key: 1 }, x(a.rows, (o, m) => (n(), B(ge, {
|
|
280
|
+
key: N(o),
|
|
262
281
|
row: o,
|
|
263
282
|
headers: a.headers,
|
|
264
|
-
index:
|
|
283
|
+
index: m,
|
|
265
284
|
"key-field": a.keyField,
|
|
266
285
|
selectable: a.selectable,
|
|
267
|
-
"is-selected": s.value.has(
|
|
286
|
+
"is-selected": s.value.has(N(o)),
|
|
268
287
|
hoverable: a.hoverable,
|
|
269
288
|
striped: a.striped,
|
|
270
289
|
compact: a.compact,
|
|
271
|
-
onSelect:
|
|
272
|
-
onRowClick:
|
|
290
|
+
onSelect: K,
|
|
291
|
+
onRowClick: Z,
|
|
273
292
|
class: "[&_td:last-child]:pr-3.5!"
|
|
274
|
-
},
|
|
293
|
+
}, M({ _: 2 }, [
|
|
275
294
|
x(a.headers, (f) => ({
|
|
276
295
|
name: f.field,
|
|
277
|
-
fn: S((
|
|
278
|
-
|
|
296
|
+
fn: S((v) => [
|
|
297
|
+
T(e.$slots, f.field, O({ ref_for: !0 }, v))
|
|
279
298
|
])
|
|
280
299
|
}))
|
|
281
|
-
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(),
|
|
282
|
-
|
|
300
|
+
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (n(), d("tr", Se, [
|
|
301
|
+
c("td", {
|
|
283
302
|
colspan: a.selectable ? a.headers.length + 1 : a.headers.length,
|
|
284
303
|
class: "align-middle hover:bg-transparent"
|
|
285
304
|
}, [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
title:
|
|
289
|
-
description:
|
|
305
|
+
T(e.$slots, "empty", {}, () => [
|
|
306
|
+
R(L(ve), {
|
|
307
|
+
title: ae.value,
|
|
308
|
+
description: oe.value,
|
|
290
309
|
icon: a.emptyIcon,
|
|
291
310
|
class: "border-none! bg-transparent! py-16!"
|
|
292
|
-
},
|
|
311
|
+
}, M({ _: 2 }, [
|
|
293
312
|
e.$slots["empty-action"] ? {
|
|
294
313
|
name: "action",
|
|
295
314
|
fn: S(() => [
|
|
296
|
-
|
|
315
|
+
T(e.$slots, "empty-action")
|
|
297
316
|
]),
|
|
298
317
|
key: "0"
|
|
299
318
|
} : void 0
|
|
300
319
|
]), 1032, ["title", "description", "icon"])
|
|
301
320
|
])
|
|
302
|
-
], 8,
|
|
321
|
+
], 8, Te)
|
|
303
322
|
]))
|
|
304
323
|
])
|
|
305
324
|
], 2)
|
|
306
325
|
])
|
|
307
326
|
], 2),
|
|
308
|
-
a.showPagination && a.pageInfo && a.pageInfo.totalPages > 1 ? (n(),
|
|
309
|
-
|
|
310
|
-
"current-page":
|
|
327
|
+
a.showPagination && a.pageInfo && a.pageInfo.totalPages > 1 ? (n(), d("div", De, [
|
|
328
|
+
R(L(fe), O({
|
|
329
|
+
"current-page": g.value,
|
|
311
330
|
"total-pages": a.pageInfo.totalPages,
|
|
312
331
|
"total-items": a.pageInfo.totalItems
|
|
313
332
|
}, a.paginationProps, {
|
|
314
|
-
onChange:
|
|
315
|
-
"onUpdate:itemsPerPage":
|
|
333
|
+
onChange: X,
|
|
334
|
+
"onUpdate:itemsPerPage": Y
|
|
316
335
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
317
|
-
])) :
|
|
318
|
-
|
|
319
|
-
show:
|
|
320
|
-
"onUpdate:show":
|
|
321
|
-
title:
|
|
322
|
-
description:
|
|
323
|
-
"confirm-text":
|
|
324
|
-
"cancel-text":
|
|
336
|
+
])) : D("", !0),
|
|
337
|
+
R(me, {
|
|
338
|
+
show: P.value,
|
|
339
|
+
"onUpdate:show": l[2] || (l[2] = (o) => P.value = o),
|
|
340
|
+
title: se.value,
|
|
341
|
+
description: ne.value,
|
|
342
|
+
"confirm-text": re.value,
|
|
343
|
+
"cancel-text": ie.value,
|
|
325
344
|
variant: "danger",
|
|
326
|
-
onConfirm:
|
|
327
|
-
onCancel:
|
|
328
|
-
}, null, 8, ["show"])
|
|
345
|
+
onConfirm: _,
|
|
346
|
+
onCancel: l[3] || (l[3] = (o) => P.value = !1)
|
|
347
|
+
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
|
|
329
348
|
]));
|
|
330
349
|
}
|
|
331
350
|
});
|
|
332
351
|
export {
|
|
333
|
-
|
|
352
|
+
Ue as default
|
|
334
353
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as p, computed as o, openBlock as a, createElementBlock as n, normalizeClass as r, createElementVNode as l, toDisplayString as g, createVNode as x, createCommentVNode as b } from "vue";
|
|
2
|
+
import y from "../Icon.vue.js";
|
|
3
|
+
import { $t as C } from "../../utils/i18n.js";
|
|
4
|
+
const v = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 truncate" }, w = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "w-4 h-4 shrink-0"
|
|
6
|
-
},
|
|
7
|
+
}, I = /* @__PURE__ */ p({
|
|
7
8
|
__name: "DataTableHeader",
|
|
8
9
|
props: {
|
|
9
10
|
header: {},
|
|
@@ -12,15 +13,15 @@ const y = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 tr
|
|
|
12
13
|
tableSortable: { type: Boolean, default: !0 }
|
|
13
14
|
},
|
|
14
15
|
emits: ["sort"],
|
|
15
|
-
setup(t, { emit:
|
|
16
|
-
const e = t,
|
|
17
|
-
e.tableSortable && e.header.sortable !== !1 &&
|
|
16
|
+
setup(t, { emit: i }) {
|
|
17
|
+
const e = t, s = i, c = o(() => e.sortConfig?.field === e.header.field && e.sortConfig?.order), d = o(() => !e.sortConfig || e.sortConfig.field !== e.header.field ? "lucide:chevrons-up-down" : e.sortConfig.order === "asc" ? "lucide:arrow-up" : e.sortConfig.order === "desc" ? "lucide:arrow-down" : "lucide:chevrons-up-down"), f = () => {
|
|
18
|
+
e.tableSortable && e.header.sortable !== !1 && s("sort", e.header.field);
|
|
18
19
|
}, u = o(() => ({
|
|
19
20
|
left: "justify-start text-left",
|
|
20
21
|
center: "justify-center text-center",
|
|
21
22
|
right: "justify-end text-right"
|
|
22
|
-
})[e.header.align || "left"]);
|
|
23
|
-
return (
|
|
23
|
+
})[e.header.align || "left"]), h = o(() => e.header.titleI18n ? C(e.header.titleI18n) : e.header.title);
|
|
24
|
+
return (m, k) => (a(), n("th", {
|
|
24
25
|
scope: "col",
|
|
25
26
|
class: r(["h-10 px-3 text-left align-middle font-medium text-muted-foreground transition-colors [&:has([role=checkbox])]:pr-0 overflow-hidden", [
|
|
26
27
|
t.compact ? "py-2" : "py-3!",
|
|
@@ -32,19 +33,19 @@ const y = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 tr
|
|
|
32
33
|
l("div", {
|
|
33
34
|
class: r(["flex items-center gap-2 space-x-2", u.value])
|
|
34
35
|
}, [
|
|
35
|
-
l("span",
|
|
36
|
-
t.tableSortable && t.header.sortable !== !1 ? (a(), n("span",
|
|
37
|
-
|
|
36
|
+
l("span", v, g(h.value), 1),
|
|
37
|
+
t.tableSortable && t.header.sortable !== !1 ? (a(), n("span", w, [
|
|
38
|
+
x(y, {
|
|
38
39
|
icon: d.value,
|
|
39
40
|
class: r(["w-3.5 h-3.5 transition-all text-muted-foreground mt-0.5", [
|
|
40
41
|
c.value ? "opacity-100 text-foreground" : "opacity-0 group-hover:opacity-100"
|
|
41
42
|
]])
|
|
42
43
|
}, null, 8, ["icon", "class"])
|
|
43
|
-
])) :
|
|
44
|
+
])) : b("", !0)
|
|
44
45
|
], 2)
|
|
45
46
|
], 2));
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
I as default
|
|
50
51
|
};
|
|
@@ -2,6 +2,7 @@ interface Props {
|
|
|
2
2
|
modelValue?: string;
|
|
3
3
|
showSearch?: boolean;
|
|
4
4
|
placeholder?: string;
|
|
5
|
+
placeholderI18n?: string;
|
|
5
6
|
class?: string;
|
|
6
7
|
searchClass?: string;
|
|
7
8
|
}
|
|
@@ -22,7 +23,6 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
22
23
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
23
24
|
}>, {
|
|
24
25
|
class: string;
|
|
25
|
-
placeholder: string;
|
|
26
26
|
modelValue: string;
|
|
27
27
|
showSearch: boolean;
|
|
28
28
|
searchClass: string;
|