@soft-stech/bootsman-ui-shadcn 1.4.28 → 1.4.29
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.
@@ -37,6 +37,7 @@ declare const _default: <TData, TValue>(__VLS_props: NonNullable<Awaited<typeof
|
|
37
37
|
enableColumnListControl?: boolean;
|
38
38
|
columnSearchPlaceholder?: string;
|
39
39
|
columnSearchNotFound?: string;
|
40
|
+
columnResetVisibility?: string;
|
40
41
|
})> & import('vue').PublicProps;
|
41
42
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
42
43
|
attrs: any;
|
@@ -1,40 +1,41 @@
|
|
1
|
-
import { _ as
|
2
|
-
import { _ as
|
1
|
+
import { _ as Q } from "../../../BuiTable.vue_vue_type_script_setup_true_lang-QoPGiEYZ.js";
|
2
|
+
import { _ as X } from "../../../BuiTableBody.vue_vue_type_script_setup_true_lang-DblqmDim.js";
|
3
3
|
import { _ as O } from "../../../BuiTableCell.vue_vue_type_script_setup_true_lang-CYBx0oJL.js";
|
4
|
-
import { _ as
|
5
|
-
import { _ as
|
6
|
-
import { _ as
|
7
|
-
import { defineComponent as G, computed as w, openBlock as r, createElementBlock as d, Fragment as p, createBlock as c, unref as t, normalizeClass as
|
8
|
-
import { _ as
|
9
|
-
import { _ as
|
10
|
-
import { _ as
|
11
|
-
import { _ as
|
12
|
-
import { _ as
|
13
|
-
import { _ as
|
14
|
-
import { _ as
|
15
|
-
import { h as
|
16
|
-
import { FlexRender as W, useVueTable as
|
17
|
-
import { _ as
|
18
|
-
import { _ as
|
19
|
-
import { _ as
|
20
|
-
import { _ as
|
21
|
-
import { _ as
|
22
|
-
import { _ as
|
23
|
-
import { _ as ke } from "../../../
|
24
|
-
import { _ as ze } from "../../../
|
25
|
-
import { _ as
|
4
|
+
import { _ as Z } from "../../../BuiTableHead.vue_vue_type_script_setup_true_lang-BDSRArVd.js";
|
5
|
+
import { _ as ee } from "../../../BuiTableHeader.vue_vue_type_script_setup_true_lang-BXgL487_.js";
|
6
|
+
import { _ as T } from "../../../BuiTableRow.vue_vue_type_script_setup_true_lang-Bl4nF6yV.js";
|
7
|
+
import { defineComponent as G, computed as w, openBlock as r, createElementBlock as d, Fragment as p, createBlock as c, unref as t, normalizeClass as oe, withCtx as l, renderSlot as y, renderList as k, normalizeStyle as K, createVNode as s, createCommentVNode as S, resolveDynamicComponent as te, mergeModels as ne, useModel as _, watchEffect as le, ref as x, watch as ae, createSlots as re, createElementVNode as g, createTextVNode as C, toDisplayString as $ } from "vue";
|
8
|
+
import { _ as go } from "../../../BuiTableCaption.vue_vue_type_script_setup_true_lang-CTEP1Sde.js";
|
9
|
+
import { _ as se } from "../../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-BTyX0sT5.js";
|
10
|
+
import { _ as co } from "../../../BuiTableFooter.vue_vue_type_script_setup_true_lang-CRyh8XF5.js";
|
11
|
+
import { _ as ie } from "../../../BuiCollapsible.vue_vue_type_script_setup_true_lang-DjuQBjGZ.js";
|
12
|
+
import { _ as ue } from "../../../BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-l-nmwAwq.js";
|
13
|
+
import { _ as de } from "../../../BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-BiD89zzH.js";
|
14
|
+
import { _ as me } from "../../../variables-Ct6TXY_l.js";
|
15
|
+
import { h as ge, v as h, g as pe, _ as ce } from "../../../utils-CwP7Up6y.js";
|
16
|
+
import { FlexRender as W, useVueTable as fe, getCoreRowModel as be, getPaginationRowModel as ye, getSortedRowModel as ve } from "@tanstack/vue-table";
|
17
|
+
import { _ as we } from "../../../BuiCommand.vue_vue_type_script_setup_true_lang-BiBVfuW-.js";
|
18
|
+
import { _ as Se } from "../../../BuiCommandEmpty.vue_vue_type_script_setup_true_lang-BkPg_0iY.js";
|
19
|
+
import { _ as _e } from "../../../BuiCommandInput.vue_vue_type_script_setup_true_lang-Dxua89Ba.js";
|
20
|
+
import { _ as Ce } from "../../../BuiCommandItem.vue_vue_type_script_setup_true_lang--K56eLIm.js";
|
21
|
+
import { _ as he } from "../../../BuiCommandList.vue_vue_type_script_setup_true_lang-CczssFsO.js";
|
22
|
+
import { _ as $e } from "../../../BuiPopover.vue_vue_type_script_setup_true_lang-CGkz30K2.js";
|
23
|
+
import { _ as ke } from "../../../BuiPopoverTrigger.vue_vue_type_script_setup_true_lang-Du2ZN56l.js";
|
24
|
+
import { _ as ze } from "../../../BuiPopoverContent.vue_vue_type_script_setup_true_lang-D5UGzl8u.js";
|
25
|
+
import { _ as Be } from "../../../BuiScrollArea.vue_vue_type_script_setup_true_lang-D-nqw_Ka.js";
|
26
|
+
import { _ as Re } from "../../../BuiDataTableColumnList.vue_vue_type_script_setup_true_lang-BOdkTG0_.js";
|
26
27
|
/**
|
27
28
|
* @license lucide-vue-next v0.441.0 - ISC
|
28
29
|
*
|
29
30
|
* This source code is licensed under the ISC license.
|
30
31
|
* See the LICENSE file in the root directory of this source tree.
|
31
32
|
*/
|
32
|
-
const
|
33
|
+
const Ie = ge("Settings2Icon", [
|
33
34
|
["path", { d: "M20 7h-9", key: "3s1dr2" }],
|
34
35
|
["path", { d: "M14 17H5", key: "gfn3mx" }],
|
35
36
|
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
|
36
37
|
["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
|
37
|
-
]),
|
38
|
+
]), Me = "[!fake-empty!]", j = /* @__PURE__ */ G({
|
38
39
|
__name: "BuiTableRowSubrow",
|
39
40
|
props: {
|
40
41
|
row: {},
|
@@ -42,22 +43,22 @@ const Be = me("Settings2Icon", [
|
|
42
43
|
columns: {}
|
43
44
|
},
|
44
45
|
setup(f) {
|
45
|
-
const
|
46
|
+
const a = f, z = w(() => a.row.original.name?.includes(Me));
|
46
47
|
return (i, R) => (r(), d(p, null, [
|
47
|
-
z.value ? S("", !0) : (r(), c(t(
|
48
|
+
z.value ? S("", !0) : (r(), c(t(T), {
|
48
49
|
key: 0,
|
49
50
|
"data-row-state": i.row.getIsSelected() ? "selected" : void 0,
|
50
|
-
class:
|
51
|
+
class: oe(a.renderSubComponent?.(i.row) ? "border-b-0" : "")
|
51
52
|
}, {
|
52
|
-
actions:
|
53
|
+
actions: l(() => [
|
53
54
|
y(i.$slots, "actions")
|
54
55
|
]),
|
55
|
-
default:
|
56
|
+
default: l(() => [
|
56
57
|
(r(!0), d(p, null, k(i.row.getVisibleCells(), (v) => (r(), c(t(O), {
|
57
58
|
key: v.id,
|
58
59
|
style: K({ ...t(Y)(v.column) })
|
59
60
|
}, {
|
60
|
-
default:
|
61
|
+
default: l(() => [
|
61
62
|
s(t(W), {
|
62
63
|
render: v.column.columnDef.cell,
|
63
64
|
props: v.getContext()
|
@@ -68,20 +69,20 @@ const Be = me("Settings2Icon", [
|
|
68
69
|
]),
|
69
70
|
_: 3
|
70
71
|
}, 8, ["data-row-state", "class"])),
|
71
|
-
|
72
|
+
a.renderSubComponent?.(i.row) ? (r(), c(t(T), {
|
72
73
|
key: 1,
|
73
74
|
"data-row-state": i.row.getIsSelected() ? "selected" : void 0
|
74
75
|
}, {
|
75
|
-
actions:
|
76
|
+
actions: l(() => [
|
76
77
|
y(i.$slots, "actions")
|
77
78
|
]),
|
78
|
-
default:
|
79
|
+
default: l(() => [
|
79
80
|
s(t(O), {
|
80
81
|
colspan: i.columns.length,
|
81
82
|
class: "pt-0"
|
82
83
|
}, {
|
83
|
-
default:
|
84
|
-
(r(), c(
|
84
|
+
default: l(() => [
|
85
|
+
(r(), c(te(a.renderSubComponent?.(i.row)?.())))
|
85
86
|
]),
|
86
87
|
_: 1
|
87
88
|
}, 8, ["colspan"])
|
@@ -90,15 +91,15 @@ const Be = me("Settings2Icon", [
|
|
90
91
|
}, 8, ["data-row-state"])) : S("", !0)
|
91
92
|
], 64));
|
92
93
|
}
|
93
|
-
}),
|
94
|
+
}), Pe = {
|
94
95
|
key: 0,
|
95
96
|
class: "w-full py-3"
|
96
|
-
},
|
97
|
+
}, Ve = { class: "absolute right-0 top-0 z-10 h-10 bg-background" }, xe = { class: "flex h-full items-center border-l border-border/[0.16] bg-foreground/[0.04] px-1" }, Oe = ["onDblclick", "onMousedown", "className"], Te = { class: "mt-1 flex w-full items-center justify-between" }, Ne = { class: "relative -mb-[6px] inline-block rounded-t-lg bg-background px-4 py-2 text-sm font-medium shadow-top-shadow" }, Le = {
|
97
98
|
key: 1,
|
98
99
|
class: "flex w-full justify-end border-x border-b border-border/[0.16] bg-primary/[0.04] px-4 py-1 text-base text-muted-foreground"
|
99
|
-
}, A = "#UNDEFINED#",
|
100
|
+
}, A = "#UNDEFINED#", io = /* @__PURE__ */ G({
|
100
101
|
__name: "BuiDataTable",
|
101
|
-
props: /* @__PURE__ */
|
102
|
+
props: /* @__PURE__ */ ne({
|
102
103
|
columns: {},
|
103
104
|
data: {},
|
104
105
|
pageSize: { default: 10 },
|
@@ -113,7 +114,8 @@ const Be = me("Settings2Icon", [
|
|
113
114
|
freezeHeader: { type: Boolean },
|
114
115
|
enableColumnListControl: { type: Boolean },
|
115
116
|
columnSearchPlaceholder: { default: "Column name" },
|
116
|
-
columnSearchNotFound: { default: "Not found" }
|
117
|
+
columnSearchNotFound: { default: "Not found" },
|
118
|
+
columnResetVisibility: { default: "Reset column visibility" }
|
117
119
|
}, {
|
118
120
|
sorting: {},
|
119
121
|
sortingModifiers: {},
|
@@ -130,45 +132,45 @@ const Be = me("Settings2Icon", [
|
|
130
132
|
}),
|
131
133
|
emits: ["update:sorting", "update:pagination", "update:selection", "update:columnVisibility", "update:columnSizing", "update:columnOrder"],
|
132
134
|
setup(f) {
|
133
|
-
const
|
134
|
-
() =>
|
135
|
-
), q =
|
135
|
+
const a = f, z = _(f, "sorting"), i = _(f, "pagination"), R = _(f, "selection"), v = _(f, "columnVisibility"), N = _(f, "columnSizing"), b = _(f, "columnOrder"), L = w(
|
136
|
+
() => a.manualPagination ? a.totalItems : a.data.length
|
137
|
+
), q = a.columns.map((e) => e.meta?.pinLeft && e.id ? e.id : "").filter(Boolean), u = fe({
|
136
138
|
initialState: {
|
137
139
|
// TODO: column freeze
|
138
140
|
columnPinning: { left: q },
|
139
|
-
pagination: { pageSize:
|
141
|
+
pagination: { pageSize: a.pageSize }
|
140
142
|
},
|
141
143
|
get data() {
|
142
|
-
return
|
144
|
+
return a.data;
|
143
145
|
},
|
144
146
|
get columns() {
|
145
|
-
return
|
147
|
+
return a.columns;
|
146
148
|
},
|
147
|
-
getCoreRowModel:
|
148
|
-
getPaginationRowModel:
|
149
|
-
getSortedRowModel:
|
149
|
+
getCoreRowModel: be(),
|
150
|
+
getPaginationRowModel: ye(),
|
151
|
+
getSortedRowModel: ve(),
|
150
152
|
onSortingChange: (e) => {
|
151
|
-
|
153
|
+
h(e, z);
|
152
154
|
},
|
153
155
|
onPaginationChange: (e) => {
|
154
|
-
|
156
|
+
h(e, i);
|
155
157
|
},
|
156
158
|
onRowSelectionChange: (e) => {
|
157
|
-
|
159
|
+
h(e, R);
|
158
160
|
},
|
159
161
|
onColumnVisibilityChange: (e) => {
|
160
|
-
|
162
|
+
h(e, v);
|
161
163
|
},
|
162
164
|
onColumnSizingChange: (e) => {
|
163
|
-
|
165
|
+
h(e, N);
|
164
166
|
},
|
165
167
|
onColumnOrderChange: (e) => {
|
166
|
-
|
168
|
+
h(e, b);
|
167
169
|
},
|
168
170
|
autoResetPageIndex: !1,
|
169
|
-
manualPagination:
|
171
|
+
manualPagination: a.manualPagination,
|
170
172
|
// set to false to enable client-side pagination
|
171
|
-
manualSorting:
|
173
|
+
manualSorting: a.manualSorting,
|
172
174
|
enableColumnResizing: !0,
|
173
175
|
columnResizeMode: "onChange",
|
174
176
|
columnResizeDirection: "ltr",
|
@@ -186,21 +188,21 @@ const Be = me("Settings2Icon", [
|
|
186
188
|
return v.value;
|
187
189
|
},
|
188
190
|
get columnSizing() {
|
189
|
-
return
|
191
|
+
return N.value;
|
190
192
|
},
|
191
193
|
get columnOrder() {
|
192
194
|
return b.value;
|
193
195
|
}
|
194
196
|
},
|
195
|
-
getRowId:
|
196
|
-
}),
|
197
|
+
getRowId: a.getRowId
|
198
|
+
}), D = w({
|
197
199
|
get() {
|
198
200
|
return u.getState().pagination.pageSize;
|
199
201
|
},
|
200
202
|
set(e) {
|
201
203
|
i.value && (i.value.pageSize = e, u.setPageSize(e), u.setPageIndex(0));
|
202
204
|
}
|
203
|
-
}),
|
205
|
+
}), B = w({
|
204
206
|
get() {
|
205
207
|
return u.getState().pagination.pageIndex + 1;
|
206
208
|
},
|
@@ -208,99 +210,101 @@ const Be = me("Settings2Icon", [
|
|
208
210
|
i.value && (i.value.pageIndex = e - 1, u.setPageIndex(e - 1));
|
209
211
|
}
|
210
212
|
});
|
211
|
-
|
213
|
+
le(() => {
|
212
214
|
const e = u.getPageCount();
|
213
|
-
e && e <
|
215
|
+
e && e < B.value && (B.value = e);
|
214
216
|
});
|
215
|
-
const
|
216
|
-
const m = o.getValue(
|
217
|
+
const H = w(() => a.groupBy ? u.getRowModel().rows.reduce((e, o) => {
|
218
|
+
const m = o.getValue(a.groupBy) ?? A;
|
217
219
|
return e[m] = e[m] || [], e[m].push(o), e;
|
218
220
|
}, /* @__PURE__ */ Object.create(null)) : null);
|
219
|
-
function
|
220
|
-
return (
|
221
|
+
function E(e) {
|
222
|
+
return (a.groupBy && a.groupLabels ? a.groupLabels[a.groupBy] || [] : [])[e];
|
221
223
|
}
|
222
224
|
const I = x(
|
223
225
|
u.getAllColumns().filter((e) => typeof e.accessorFn < "u" && e.getCanHide()).sort((e, o) => b.value ? b.value?.indexOf(e.id) < 0 && b.value?.indexOf(o.id) >= 0 ? 1 : b.value?.indexOf(e.id) >= 0 && b.value?.indexOf(o.id) < 0 ? -1 : b.value?.indexOf(e.id) - b.value?.indexOf(o.id) : 0)
|
224
|
-
),
|
226
|
+
), M = w(() => I.value.map((e) => e.id)), J = w(
|
227
|
+
() => M.value.reduce((e, o) => ({ ...e, [o]: !0 }), {})
|
228
|
+
), F = x(!1), P = x(""), U = w(
|
225
229
|
() => u.getHeaderGroups().length > 0 ? u.getHeaderGroups()[0].headers : void 0
|
226
230
|
);
|
227
|
-
return
|
228
|
-
u.setColumnOrder(
|
231
|
+
return ae(M, () => {
|
232
|
+
u.setColumnOrder(M.value);
|
229
233
|
}), (e, o) => (r(), d(p, null, [
|
230
|
-
e.$slots.caption ? (r(), d("div",
|
234
|
+
e.$slots.caption ? (r(), d("div", Pe, [
|
231
235
|
y(e.$slots, "caption", { table: t(u) })
|
232
236
|
])) : S("", !0),
|
233
|
-
s(t(
|
234
|
-
default:
|
235
|
-
U.value ? (r(), c(t(
|
237
|
+
s(t(Q), null, re({
|
238
|
+
default: l(() => [
|
239
|
+
U.value ? (r(), c(t(ee), {
|
236
240
|
key: 0,
|
237
|
-
"freeze-header":
|
241
|
+
"freeze-header": a.freezeHeader
|
238
242
|
}, {
|
239
|
-
default:
|
240
|
-
(r(!0), d(p, null, k(U.value, (
|
241
|
-
key:
|
242
|
-
style: K({ ...t(Y)(
|
243
|
-
"freeze-header":
|
243
|
+
default: l(() => [
|
244
|
+
(r(!0), d(p, null, k(U.value, (n) => (r(), c(t(Z), {
|
245
|
+
key: n.id,
|
246
|
+
style: K({ ...t(Y)(n.column), width: n.getSize() + "px" }),
|
247
|
+
"freeze-header": a.freezeHeader
|
244
248
|
}, {
|
245
|
-
default:
|
246
|
-
|
249
|
+
default: l(() => [
|
250
|
+
n.isPlaceholder ? S("", !0) : (r(), c(t(W), {
|
247
251
|
key: 0,
|
248
|
-
render:
|
249
|
-
props:
|
252
|
+
render: n.column.columnDef.header,
|
253
|
+
props: n.getContext()
|
250
254
|
}, null, 8, ["render", "props"])),
|
251
255
|
g("div", {
|
252
|
-
onDblclick: () =>
|
253
|
-
onMousedown: (m) =>
|
254
|
-
className: t(
|
256
|
+
onDblclick: () => n.column.resetSize(),
|
257
|
+
onMousedown: (m) => n.getResizeHandler()?.(m),
|
258
|
+
className: t(pe)(
|
255
259
|
"absolute top-0 right-0 h-full w-1 bg-muted-foreground opacity-0 cursor-col-resize select-none touch-none hover:opacity-50",
|
256
|
-
|
260
|
+
n.column.getIsResizing() ? "bg-primary opacity-50" : ""
|
257
261
|
)
|
258
|
-
}, null, 40,
|
262
|
+
}, null, 40, Oe)
|
259
263
|
]),
|
260
264
|
_: 2
|
261
265
|
}, 1032, ["style", "freeze-header"]))), 128))
|
262
266
|
]),
|
263
267
|
_: 1
|
264
268
|
}, 8, ["freeze-header"])) : S("", !0),
|
265
|
-
s(t(
|
266
|
-
default:
|
269
|
+
s(t(X), null, {
|
270
|
+
default: l(() => [
|
267
271
|
t(u).getRowModel().rows?.length ? (r(), d(p, { key: 0 }, [
|
268
|
-
|
272
|
+
a.groupBy && H.value ? (r(!0), d(p, { key: 0 }, k(H.value, (n, m) => (r(), c(t(ie), {
|
269
273
|
asChild: "",
|
270
274
|
key: m,
|
271
275
|
open: !0
|
272
276
|
}, {
|
273
|
-
default:
|
274
|
-
s(t(
|
275
|
-
default:
|
276
|
-
s(t(
|
277
|
-
actions:
|
277
|
+
default: l(() => [
|
278
|
+
s(t(ue), { asChild: "" }, {
|
279
|
+
default: l(() => [
|
280
|
+
s(t(T), { class: "bg-foreground/[0.04]" }, {
|
281
|
+
actions: l(() => [
|
278
282
|
y(e.$slots, "groupActions", { group: m })
|
279
283
|
]),
|
280
|
-
default:
|
284
|
+
default: l(() => [
|
281
285
|
s(t(O), {
|
282
286
|
colspan: e.columns.length,
|
283
287
|
class: "!pb-0"
|
284
288
|
}, {
|
285
|
-
default:
|
286
|
-
g("div",
|
287
|
-
g("div",
|
288
|
-
o[
|
289
|
-
o[
|
290
|
-
o[
|
291
|
-
o[
|
292
|
-
o[
|
293
|
-
o[
|
294
|
-
o[
|
289
|
+
default: l(() => [
|
290
|
+
g("div", Te, [
|
291
|
+
g("div", Ne, [
|
292
|
+
o[7] || (o[7] = g("div", { class: "absolute -left-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
|
293
|
+
o[8] || (o[8] = g("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
|
294
|
+
o[9] || (o[9] = g("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
|
295
|
+
o[10] || (o[10] = g("div", { class: "absolute -right-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
|
296
|
+
o[11] || (o[11] = g("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
|
297
|
+
o[12] || (o[12] = g("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
|
298
|
+
o[13] || (o[13] = g("div", null, null, -1)),
|
295
299
|
m === A ? (r(), d(p, { key: 0 }, [
|
296
|
-
|
300
|
+
C($(E(1)), 1)
|
297
301
|
], 64)) : (r(), d(p, { key: 1 }, [
|
298
|
-
|
302
|
+
C($(E(0)) + ": ", 1),
|
299
303
|
e.$slots.groupName ? y(e.$slots, "groupName", {
|
300
304
|
key: 0,
|
301
305
|
group: m
|
302
306
|
}) : (r(), d(p, { key: 1 }, [
|
303
|
-
|
307
|
+
C($(m), 1)
|
304
308
|
], 64))
|
305
309
|
], 64))
|
306
310
|
]),
|
@@ -318,17 +322,17 @@ const Be = me("Settings2Icon", [
|
|
318
322
|
]),
|
319
323
|
_: 2
|
320
324
|
}, 1024),
|
321
|
-
s(t(
|
322
|
-
default:
|
323
|
-
(r(!0), d(p, null, k(
|
324
|
-
key:
|
325
|
-
columns:
|
326
|
-
row:
|
327
|
-
renderSubComponent:
|
325
|
+
s(t(de), { asChild: "" }, {
|
326
|
+
default: l(() => [
|
327
|
+
(r(!0), d(p, null, k(n, (V) => (r(), c(j, {
|
328
|
+
key: V.id,
|
329
|
+
columns: a.columns,
|
330
|
+
row: V,
|
331
|
+
renderSubComponent: a.renderSubComponent
|
328
332
|
}, {
|
329
|
-
actions:
|
333
|
+
actions: l(() => [
|
330
334
|
y(e.$slots, "rowActions", {
|
331
|
-
row:
|
335
|
+
row: V.original
|
332
336
|
})
|
333
337
|
]),
|
334
338
|
_: 2
|
@@ -338,26 +342,26 @@ const Be = me("Settings2Icon", [
|
|
338
342
|
}, 1024)
|
339
343
|
]),
|
340
344
|
_: 2
|
341
|
-
}, 1024))), 128)) : (r(!0), d(p, { key: 1 }, k(t(u).getRowModel().rows, (
|
342
|
-
key:
|
343
|
-
columns:
|
344
|
-
row:
|
345
|
-
renderSubComponent:
|
345
|
+
}, 1024))), 128)) : (r(!0), d(p, { key: 1 }, k(t(u).getRowModel().rows, (n) => (r(), c(j, {
|
346
|
+
key: n.id,
|
347
|
+
columns: a.columns,
|
348
|
+
row: n,
|
349
|
+
renderSubComponent: a.renderSubComponent
|
346
350
|
}, {
|
347
|
-
actions:
|
351
|
+
actions: l(() => [
|
348
352
|
y(e.$slots, "rowActions", {
|
349
|
-
row:
|
353
|
+
row: n.original
|
350
354
|
})
|
351
355
|
]),
|
352
356
|
_: 2
|
353
357
|
}, 1032, ["columns", "row", "renderSubComponent"]))), 128))
|
354
|
-
], 64)) : (r(), c(t(
|
358
|
+
], 64)) : (r(), c(t(se), {
|
355
359
|
key: 1,
|
356
360
|
colspan: e.columns.length
|
357
361
|
}, {
|
358
|
-
default:
|
362
|
+
default: l(() => [
|
359
363
|
y(e.$slots, "nodata", {}, () => [
|
360
|
-
o[
|
364
|
+
o[14] || (o[14] = C("No data"))
|
361
365
|
])
|
362
366
|
]),
|
363
367
|
_: 3
|
@@ -370,22 +374,22 @@ const Be = me("Settings2Icon", [
|
|
370
374
|
}, [
|
371
375
|
e.enableColumnListControl ? {
|
372
376
|
name: "columnVisibility",
|
373
|
-
fn:
|
374
|
-
s(t(
|
377
|
+
fn: l(() => [
|
378
|
+
s(t($e), {
|
375
379
|
open: F.value,
|
376
|
-
"onUpdate:open": o[
|
380
|
+
"onUpdate:open": o[4] || (o[4] = (n) => F.value = n)
|
377
381
|
}, {
|
378
|
-
default:
|
379
|
-
s(t(
|
380
|
-
default:
|
381
|
-
g("div",
|
382
|
-
g("div",
|
383
|
-
s(t(
|
382
|
+
default: l(() => [
|
383
|
+
s(t(ke), { "as-child": "" }, {
|
384
|
+
default: l(() => [
|
385
|
+
g("div", Ve, [
|
386
|
+
g("div", xe, [
|
387
|
+
s(t(ce), {
|
384
388
|
variant: "ghost",
|
385
389
|
class: "flex h-8 w-8 items-center justify-center text-foreground"
|
386
390
|
}, {
|
387
|
-
default:
|
388
|
-
s(t(
|
391
|
+
default: l(() => [
|
392
|
+
s(t(Ie), { class: "h-4 w-4 flex-shrink-0 opacity-50" })
|
389
393
|
]),
|
390
394
|
_: 1
|
391
395
|
})
|
@@ -394,33 +398,43 @@ const Be = me("Settings2Icon", [
|
|
394
398
|
]),
|
395
399
|
_: 1
|
396
400
|
}),
|
397
|
-
s(t(
|
401
|
+
s(t(ze), {
|
398
402
|
class: "w-[250px] p-0",
|
399
403
|
align: "start"
|
400
404
|
}, {
|
401
|
-
default:
|
402
|
-
s(t(
|
403
|
-
default:
|
404
|
-
s(t(
|
405
|
+
default: l(() => [
|
406
|
+
s(t(we), null, {
|
407
|
+
default: l(() => [
|
408
|
+
s(t(_e), {
|
405
409
|
placeholder: e.columnSearchPlaceholder,
|
406
|
-
modelValue:
|
407
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
408
|
-
onInput: o[1] || (o[1] = (
|
410
|
+
modelValue: P.value,
|
411
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => P.value = n),
|
412
|
+
onInput: o[1] || (o[1] = (n) => P.value = n.target.value)
|
409
413
|
}, null, 8, ["placeholder", "modelValue"]),
|
410
|
-
s(t(
|
411
|
-
default:
|
412
|
-
s(t(
|
413
|
-
default:
|
414
|
-
s(t(
|
415
|
-
default:
|
416
|
-
|
414
|
+
s(t(he), null, {
|
415
|
+
default: l(() => [
|
416
|
+
s(t(Be), { class: "h-[300px]" }, {
|
417
|
+
default: l(() => [
|
418
|
+
s(t(Se), null, {
|
419
|
+
default: l(() => [
|
420
|
+
C($(e.columnSearchNotFound), 1)
|
417
421
|
]),
|
418
422
|
_: 1
|
419
423
|
}),
|
420
|
-
s(t(
|
424
|
+
s(t(Re), {
|
421
425
|
"columns-list": I.value,
|
422
|
-
"onUpdate:columnsList": o[2] || (o[2] = (
|
423
|
-
}, null, 8, ["columns-list"])
|
426
|
+
"onUpdate:columnsList": o[2] || (o[2] = (n) => I.value = n)
|
427
|
+
}, null, 8, ["columns-list"]),
|
428
|
+
s(t(Ce), {
|
429
|
+
value: "reset_columns_visibility",
|
430
|
+
class: "px-2 py-1.5 font-medium text-muted-foreground",
|
431
|
+
onSelect: o[3] || (o[3] = (n) => t(u).setColumnVisibility({ ...v.value, ...J.value }))
|
432
|
+
}, {
|
433
|
+
default: l(() => [
|
434
|
+
C($(e.columnResetVisibility), 1)
|
435
|
+
]),
|
436
|
+
_: 1
|
437
|
+
})
|
424
438
|
]),
|
425
439
|
_: 1
|
426
440
|
})
|
@@ -440,13 +454,13 @@ const Be = me("Settings2Icon", [
|
|
440
454
|
key: "0"
|
441
455
|
} : void 0
|
442
456
|
]), 1024),
|
443
|
-
e.showPagination &&
|
444
|
-
s(t(
|
445
|
-
total:
|
446
|
-
pageIndex:
|
447
|
-
"onUpdate:pageIndex": o[
|
448
|
-
pageSize:
|
449
|
-
"onUpdate:pageSize": o[
|
457
|
+
e.showPagination && L.value > 0 ? (r(), d("div", Le, [
|
458
|
+
s(t(me), {
|
459
|
+
total: L.value,
|
460
|
+
pageIndex: B.value,
|
461
|
+
"onUpdate:pageIndex": o[5] || (o[5] = (n) => B.value = n),
|
462
|
+
pageSize: D.value,
|
463
|
+
"onUpdate:pageSize": o[6] || (o[6] = (n) => D.value = n)
|
450
464
|
}, null, 8, ["total", "pageIndex", "pageSize"])
|
451
465
|
])) : S("", !0)
|
452
466
|
], 64));
|
@@ -456,17 +470,17 @@ function Y(f) {
|
|
456
470
|
return { position: "relative" };
|
457
471
|
}
|
458
472
|
export {
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
473
|
+
io as BuiDataTable,
|
474
|
+
Re as BuiDataTableColumnList,
|
475
|
+
Q as BuiTable,
|
476
|
+
X as BuiTableBody,
|
477
|
+
go as BuiTableCaption,
|
464
478
|
O as BuiTableCell,
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
479
|
+
se as BuiTableEmpty,
|
480
|
+
co as BuiTableFooter,
|
481
|
+
Z as BuiTableHead,
|
482
|
+
ee as BuiTableHeader,
|
483
|
+
T as BuiTableRow,
|
470
484
|
j as BuiTableRowSubrow,
|
471
485
|
Y as getPinningStyle
|
472
486
|
};
|
package/package.json
CHANGED
@@ -41,7 +41,8 @@ import {
|
|
41
41
|
BuiCommand,
|
42
42
|
BuiCommandEmpty,
|
43
43
|
BuiCommandInput,
|
44
|
-
BuiCommandList
|
44
|
+
BuiCommandList,
|
45
|
+
BuiCommandItem
|
45
46
|
} from '@/components/ui/command'
|
46
47
|
import { BuiPopover, BuiPopoverContent, BuiPopoverTrigger } from '@/components/ui/popover'
|
47
48
|
import { BuiScrollArea } from '@/components/ui/scroll-area'
|
@@ -67,6 +68,7 @@ const props = withDefaults(
|
|
67
68
|
enableColumnListControl?: boolean
|
68
69
|
columnSearchPlaceholder?: string
|
69
70
|
columnSearchNotFound?: string
|
71
|
+
columnResetVisibility?: string
|
70
72
|
}>(),
|
71
73
|
{
|
72
74
|
pageSize: 10,
|
@@ -75,7 +77,8 @@ const props = withDefaults(
|
|
75
77
|
manualSorting: true,
|
76
78
|
totalItems: 0,
|
77
79
|
columnSearchPlaceholder: 'Column name',
|
78
|
-
columnSearchNotFound: 'Not found'
|
80
|
+
columnSearchNotFound: 'Not found',
|
81
|
+
columnResetVisibility: 'Reset column visibility'
|
79
82
|
}
|
80
83
|
)
|
81
84
|
|
@@ -214,6 +217,11 @@ const columnsList = ref<Column<TData, unknown>[]>(
|
|
214
217
|
})
|
215
218
|
)
|
216
219
|
const columnsListIds = computed(() => columnsList.value.map((col) => col.id))
|
220
|
+
const allVisibleColumns = computed(() =>
|
221
|
+
columnsListIds.value.reduce<VisibilityState>((acc, id) => {
|
222
|
+
return { ...acc, [id]: true }
|
223
|
+
}, {})
|
224
|
+
)
|
217
225
|
const open = ref(false)
|
218
226
|
const searchColumn = ref('')
|
219
227
|
|
@@ -260,6 +268,13 @@ watch(columnsListIds, () => {
|
|
260
268
|
<BuiDataTableColumnList
|
261
269
|
v-model:columns-list="columnsList as Column<TData, unknown>[]"
|
262
270
|
/>
|
271
|
+
<BuiCommandItem
|
272
|
+
value="reset_columns_visibility"
|
273
|
+
class="px-2 py-1.5 font-medium text-muted-foreground"
|
274
|
+
@select="table.setColumnVisibility({ ...columnVisibility, ...allVisibleColumns })"
|
275
|
+
>
|
276
|
+
{{ columnResetVisibility }}
|
277
|
+
</BuiCommandItem>
|
263
278
|
</BuiScrollArea>
|
264
279
|
</BuiCommandList>
|
265
280
|
</BuiCommand>
|