@soft-stech/bootsman-ui-shadcn 1.4.15 → 1.4.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,31 +1,31 @@
|
|
1
|
-
import { _ as
|
2
|
-
import { _ as
|
1
|
+
import { _ as A } from "../../../BuiTable.vue_vue_type_script_setup_true_lang-CKRiQHpD.js";
|
2
|
+
import { _ as O } from "../../../BuiTableBody.vue_vue_type_script_setup_true_lang-DblqmDim.js";
|
3
3
|
import { _ as T } from "../../../BuiTableCell.vue_vue_type_script_setup_true_lang-CYBx0oJL.js";
|
4
|
-
import { _ as
|
5
|
-
import { _ as
|
6
|
-
import { _ as
|
7
|
-
import { defineComponent as x, computed as
|
8
|
-
import { _ as
|
9
|
-
import { _ as
|
10
|
-
import { _ as
|
11
|
-
import { _ as
|
12
|
-
import { _ as
|
4
|
+
import { _ as j } from "../../../BuiTableHead.vue_vue_type_script_setup_true_lang-uE4Py8ky.js";
|
5
|
+
import { _ as H } from "../../../BuiTableHeader.vue_vue_type_script_setup_true_lang-BcnB4-3x.js";
|
6
|
+
import { _ as R } from "../../../BuiTableRow.vue_vue_type_script_setup_true_lang-Bl4nF6yV.js";
|
7
|
+
import { defineComponent as x, computed as v, openBlock as o, createElementBlock as u, Fragment as d, createBlock as m, unref as a, normalizeClass as G, withCtx as l, renderSlot as c, renderList as y, normalizeStyle as F, createVNode as p, createCommentVNode as S, resolveDynamicComponent as K, mergeModels as W, useModel as k, watchEffect as Y, createElementVNode as b, createTextVNode as _, toDisplayString as I } from "vue";
|
8
|
+
import { _ as Pe } from "../../../BuiTableCaption.vue_vue_type_script_setup_true_lang-CTEP1Sde.js";
|
9
|
+
import { _ as q } from "../../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-BTyX0sT5.js";
|
10
|
+
import { _ as Me } from "../../../BuiTableFooter.vue_vue_type_script_setup_true_lang-CRyh8XF5.js";
|
11
|
+
import { _ as J } from "../../../BuiCollapsible.vue_vue_type_script_setup_true_lang-DjuQBjGZ.js";
|
12
|
+
import { _ as Q } from "../../../BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-l-nmwAwq.js";
|
13
13
|
import { _ as X } from "../../../BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-BiD89zzH.js";
|
14
14
|
import { _ as Z } from "../../../variables-Dw5mPbg_.js";
|
15
15
|
import "vee-validate";
|
16
16
|
import { v as M } from "../../../utils-CwP7Up6y.js";
|
17
17
|
import { FlexRender as L, useVueTable as ee, getCoreRowModel as te, getPaginationRowModel as oe, getSortedRowModel as ne } from "@tanstack/vue-table";
|
18
|
-
const
|
18
|
+
const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
|
19
19
|
__name: "BuiTableRowSubrow",
|
20
20
|
props: {
|
21
21
|
row: {},
|
22
22
|
renderSubComponent: { type: Function },
|
23
23
|
columns: {}
|
24
24
|
},
|
25
|
-
setup(
|
26
|
-
const t =
|
27
|
-
return (r,
|
28
|
-
C.value ?
|
25
|
+
setup(f) {
|
26
|
+
const t = f, C = v(() => t.row.original.name.includes(ae));
|
27
|
+
return (r, $) => (o(), u(d, null, [
|
28
|
+
C.value ? S("", !0) : (o(), m(a(R), {
|
29
29
|
key: 0,
|
30
30
|
"data-row-state": r.row.getIsSelected() ? "selected" : void 0,
|
31
31
|
class: G(t.renderSubComponent?.(r.row) ? "border-b-0" : "")
|
@@ -49,7 +49,7 @@ const D = /* @__PURE__ */ x({
|
|
49
49
|
]),
|
50
50
|
_: 3
|
51
51
|
}, 8, ["data-row-state", "class"])),
|
52
|
-
t.renderSubComponent?.(r.row) ? (o(), m(a(
|
52
|
+
t.renderSubComponent?.(r.row) ? (o(), m(a(R), {
|
53
53
|
key: 1,
|
54
54
|
"data-row-state": r.row.getIsSelected() ? "selected" : void 0
|
55
55
|
}, {
|
@@ -68,18 +68,18 @@ const D = /* @__PURE__ */ x({
|
|
68
68
|
}, 8, ["colspan"])
|
69
69
|
]),
|
70
70
|
_: 3
|
71
|
-
}, 8, ["data-row-state"])) :
|
71
|
+
}, 8, ["data-row-state"])) : S("", !0)
|
72
72
|
], 64));
|
73
73
|
}
|
74
|
-
}),
|
74
|
+
}), le = {
|
75
75
|
key: 0,
|
76
76
|
class: "w-full py-3"
|
77
|
-
},
|
77
|
+
}, re = { class: "mt-1 flex w-full items-center justify-between" }, se = { class: "relative -mb-[5px] inline-block rounded-t-lg bg-background px-4 py-2 text-sm font-medium shadow-top-shadow" }, ue = {
|
78
78
|
key: 1,
|
79
79
|
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"
|
80
|
-
},
|
80
|
+
}, D = "#UNDEFINED#", _e = /* @__PURE__ */ x({
|
81
81
|
__name: "BuiDataTable",
|
82
|
-
props: /* @__PURE__ */
|
82
|
+
props: /* @__PURE__ */ W({
|
83
83
|
columns: {},
|
84
84
|
data: {},
|
85
85
|
pageSize: { default: 10 },
|
@@ -102,8 +102,8 @@ const D = /* @__PURE__ */ x({
|
|
102
102
|
columnVisibilityModifiers: {}
|
103
103
|
}),
|
104
104
|
emits: ["update:sorting", "update:pagination", "update:selection", "update:columnVisibility"],
|
105
|
-
setup(
|
106
|
-
const t =
|
105
|
+
setup(f) {
|
106
|
+
const t = f, C = k(f, "sorting"), r = k(f, "pagination"), $ = k(f, "selection"), w = k(f, "columnVisibility"), V = v(
|
107
107
|
() => t.manualPagination ? t.totalItems : t.data.length
|
108
108
|
), g = ee({
|
109
109
|
initialState: {
|
@@ -127,7 +127,7 @@ const D = /* @__PURE__ */ x({
|
|
127
127
|
M(e, r);
|
128
128
|
},
|
129
129
|
onRowSelectionChange: (e) => {
|
130
|
-
M(e,
|
130
|
+
M(e, $);
|
131
131
|
},
|
132
132
|
autoResetPageIndex: !1,
|
133
133
|
manualPagination: t.manualPagination,
|
@@ -141,21 +141,21 @@ const D = /* @__PURE__ */ x({
|
|
141
141
|
return r.value;
|
142
142
|
},
|
143
143
|
get rowSelection() {
|
144
|
-
return
|
144
|
+
return $.value;
|
145
145
|
},
|
146
146
|
get columnVisibility() {
|
147
147
|
return w.value;
|
148
148
|
}
|
149
149
|
},
|
150
150
|
getRowId: t.getRowId
|
151
|
-
}), z =
|
151
|
+
}), z = v({
|
152
152
|
get() {
|
153
153
|
return g.getState().pagination.pageSize;
|
154
154
|
},
|
155
155
|
set(e) {
|
156
156
|
r.value && (r.value.pageSize = e, g.setPageSize(e), g.setPageIndex(0));
|
157
157
|
}
|
158
|
-
}), B =
|
158
|
+
}), B = v({
|
159
159
|
get() {
|
160
160
|
return g.getState().pagination.pageIndex + 1;
|
161
161
|
},
|
@@ -163,35 +163,35 @@ const D = /* @__PURE__ */ x({
|
|
163
163
|
r.value && (r.value.pageIndex = e - 1, g.setPageIndex(e - 1));
|
164
164
|
}
|
165
165
|
});
|
166
|
-
|
166
|
+
Y(() => {
|
167
167
|
const e = g.getPageCount();
|
168
168
|
e && e < B.value && (B.value = e);
|
169
169
|
});
|
170
|
-
const h =
|
171
|
-
const s = n.getValue(t.groupBy) ??
|
170
|
+
const h = v(() => t.groupBy ? g.getRowModel().rows.reduce((e, n) => {
|
171
|
+
const s = n.getValue(t.groupBy) ?? D;
|
172
172
|
return e[s] = e[s] || [], e[s].push(n), e;
|
173
173
|
}, /* @__PURE__ */ Object.create(null)) : null);
|
174
174
|
function N(e) {
|
175
175
|
return (t.groupBy && t.groupLabels ? t.groupLabels[t.groupBy] || [] : [])[e];
|
176
176
|
}
|
177
177
|
return (e, n) => (o(), u(d, null, [
|
178
|
-
e.$slots.caption ? (o(), u("div",
|
178
|
+
e.$slots.caption ? (o(), u("div", le, [
|
179
179
|
c(e.$slots, "caption", { table: a(g) })
|
180
|
-
])) :
|
181
|
-
p(a(
|
180
|
+
])) : S("", !0),
|
181
|
+
p(a(A), null, {
|
182
182
|
default: l(() => [
|
183
|
-
p(a(
|
183
|
+
p(a(H), null, {
|
184
184
|
default: l(() => [
|
185
|
-
(o(!0), u(d, null, y(a(g).getHeaderGroups(), (i) => (o(), m(a(
|
185
|
+
(o(!0), u(d, null, y(a(g).getHeaderGroups(), (i) => (o(), m(a(R), {
|
186
186
|
key: i.id
|
187
187
|
}, {
|
188
188
|
default: l(() => [
|
189
|
-
(o(!0), u(d, null, y(i.headers, (s) => (o(), m(a(
|
189
|
+
(o(!0), u(d, null, y(i.headers, (s) => (o(), m(a(j), {
|
190
190
|
key: s.id,
|
191
191
|
style: F({ ...a(U)(s.column) })
|
192
192
|
}, {
|
193
193
|
default: l(() => [
|
194
|
-
s.isPlaceholder ?
|
194
|
+
s.isPlaceholder ? S("", !0) : (o(), m(a(L), {
|
195
195
|
key: 0,
|
196
196
|
render: s.column.columnDef.header,
|
197
197
|
props: s.getContext()
|
@@ -205,18 +205,18 @@ const D = /* @__PURE__ */ x({
|
|
205
205
|
]),
|
206
206
|
_: 1
|
207
207
|
}),
|
208
|
-
p(a(
|
208
|
+
p(a(O), null, {
|
209
209
|
default: l(() => [
|
210
210
|
a(g).getRowModel().rows?.length ? (o(), u(d, { key: 0 }, [
|
211
|
-
t.groupBy && h.value ? (o(!0), u(d, { key: 0 }, y(h.value, (i, s) => (o(), m(a(
|
211
|
+
t.groupBy && h.value ? (o(!0), u(d, { key: 0 }, y(h.value, (i, s) => (o(), m(a(J), {
|
212
212
|
asChild: "",
|
213
213
|
key: s,
|
214
214
|
open: !0
|
215
215
|
}, {
|
216
216
|
default: l(() => [
|
217
|
-
p(a(
|
217
|
+
p(a(Q), { asChild: "" }, {
|
218
218
|
default: l(() => [
|
219
|
-
p(a(
|
219
|
+
p(a(R), { class: "bg-foreground/[0.04]" }, {
|
220
220
|
actions: l(() => [
|
221
221
|
c(e.$slots, "groupActions", { group: s })
|
222
222
|
]),
|
@@ -226,16 +226,16 @@ const D = /* @__PURE__ */ x({
|
|
226
226
|
class: "!pb-0"
|
227
227
|
}, {
|
228
228
|
default: l(() => [
|
229
|
-
|
230
|
-
|
231
|
-
n[2] || (n[2] =
|
232
|
-
n[3] || (n[3] =
|
233
|
-
n[4] || (n[4] =
|
234
|
-
n[5] || (n[5] =
|
235
|
-
n[6] || (n[6] =
|
236
|
-
n[7] || (n[7] =
|
237
|
-
n[8] || (n[8] =
|
238
|
-
s ===
|
229
|
+
b("div", re, [
|
230
|
+
b("div", se, [
|
231
|
+
n[2] || (n[2] = b("div", { class: "absolute -left-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
|
232
|
+
n[3] || (n[3] = b("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
|
233
|
+
n[4] || (n[4] = b("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
|
234
|
+
n[5] || (n[5] = b("div", { class: "absolute -right-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
|
235
|
+
n[6] || (n[6] = b("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
|
236
|
+
n[7] || (n[7] = b("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
|
237
|
+
n[8] || (n[8] = b("div", null, null, -1)),
|
238
|
+
s === D ? (o(), u(d, { key: 0 }, [
|
239
239
|
_(I(N(1)), 1)
|
240
240
|
], 64)) : (o(), u(d, { key: 1 }, [
|
241
241
|
_(I(N(0)) + ": ", 1),
|
@@ -250,7 +250,7 @@ const D = /* @__PURE__ */ x({
|
|
250
250
|
e.$slots.groupByRow ? c(e.$slots, "groupByRow", {
|
251
251
|
key: 0,
|
252
252
|
group: s
|
253
|
-
}) :
|
253
|
+
}) : S("", !0)
|
254
254
|
])
|
255
255
|
]),
|
256
256
|
_: 2
|
@@ -263,7 +263,7 @@ const D = /* @__PURE__ */ x({
|
|
263
263
|
}, 1024),
|
264
264
|
p(a(X), { asChild: "" }, {
|
265
265
|
default: l(() => [
|
266
|
-
(o(!0), u(d, null, y(i, (P) => (o(), m(
|
266
|
+
(o(!0), u(d, null, y(i, (P) => (o(), m(E, {
|
267
267
|
key: P.id,
|
268
268
|
columns: t.columns,
|
269
269
|
row: P,
|
@@ -281,7 +281,7 @@ const D = /* @__PURE__ */ x({
|
|
281
281
|
}, 1024)
|
282
282
|
]),
|
283
283
|
_: 2
|
284
|
-
}, 1024))), 128)) : (o(!0), u(d, { key: 1 }, y(a(g).getRowModel().rows, (i) => (o(), m(
|
284
|
+
}, 1024))), 128)) : (o(!0), u(d, { key: 1 }, y(a(g).getRowModel().rows, (i) => (o(), m(E, {
|
285
285
|
key: i.id,
|
286
286
|
columns: t.columns,
|
287
287
|
row: i,
|
@@ -294,7 +294,7 @@ const D = /* @__PURE__ */ x({
|
|
294
294
|
]),
|
295
295
|
_: 2
|
296
296
|
}, 1032, ["columns", "row", "renderSubComponent"]))), 128))
|
297
|
-
], 64)) : (o(), m(a(
|
297
|
+
], 64)) : (o(), m(a(q), {
|
298
298
|
key: 1,
|
299
299
|
colspan: e.columns.length
|
300
300
|
}, {
|
@@ -311,7 +311,7 @@ const D = /* @__PURE__ */ x({
|
|
311
311
|
]),
|
312
312
|
_: 3
|
313
313
|
}),
|
314
|
-
e.showPagination && V.value > 0 ? (o(), u("div",
|
314
|
+
e.showPagination && V.value > 0 ? (o(), u("div", ue, [
|
315
315
|
p(a(Z), {
|
316
316
|
total: V.value,
|
317
317
|
pageIndex: B.value,
|
@@ -319,12 +319,12 @@ const D = /* @__PURE__ */ x({
|
|
319
319
|
pageSize: z.value,
|
320
320
|
"onUpdate:pageSize": n[1] || (n[1] = (i) => z.value = i)
|
321
321
|
}, null, 8, ["total", "pageIndex", "pageSize"])
|
322
|
-
])) :
|
322
|
+
])) : S("", !0)
|
323
323
|
], 64));
|
324
324
|
}
|
325
325
|
});
|
326
|
-
function U(
|
327
|
-
const t =
|
326
|
+
function U(f) {
|
327
|
+
const t = f.getIsPinned();
|
328
328
|
return {
|
329
329
|
left: t === "left" ? "0" : void 0,
|
330
330
|
position: t ? "sticky" : "relative",
|
@@ -332,16 +332,16 @@ function U(b) {
|
|
332
332
|
};
|
333
333
|
}
|
334
334
|
export {
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
335
|
+
_e as BuiDataTable,
|
336
|
+
A as BuiTable,
|
337
|
+
O as BuiTableBody,
|
338
|
+
Pe as BuiTableCaption,
|
339
339
|
T as BuiTableCell,
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
340
|
+
q as BuiTableEmpty,
|
341
|
+
Me as BuiTableFooter,
|
342
|
+
j as BuiTableHead,
|
343
|
+
H as BuiTableHeader,
|
344
|
+
R as BuiTableRow,
|
345
|
+
E as BuiTableRowSubrow,
|
346
346
|
U as getPinningStyle
|
347
347
|
};
|
package/package.json
CHANGED
@@ -11,8 +11,10 @@ const props = defineProps<{
|
|
11
11
|
}>()
|
12
12
|
|
13
13
|
// иногда мы используем фейковые строки с пустыми значениями, лучше их скрыть
|
14
|
+
const FAKE_ROW = '[!fake-empty!]'
|
14
15
|
const isEmptyRow = computed(() => {
|
15
|
-
|
16
|
+
// @ts-expect-error name с таким значением это наше внутреннее соглашение. См. Боцман Дашборд, таблицу Projects/Namespaces
|
17
|
+
return props.row.original.name.includes(FAKE_ROW)
|
16
18
|
})
|
17
19
|
</script>
|
18
20
|
|