@soft-stech/bootsman-ui-shadcn 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{BuiDataTable.vue_vue_type_script_setup_true_lang-B38w7sKR.js → BuiDataTable.vue_vue_type_script_setup_true_lang-CUH3nl15.js} +35 -37
- package/dist/components/ui/table/BuiDataTable.js +1 -1
- package/dist/components/ui/table/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ui/table/BuiDataTable.vue +1 -3
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent as L, mergeModels as U, useModel as b, computed as y, watchEffect as F, openBlock as n, createElementBlock as
|
1
|
+
import { defineComponent as L, mergeModels as U, useModel as b, computed as y, watchEffect as F, openBlock as n, createElementBlock as s, Fragment as d, renderSlot as w, unref as o, createCommentVNode as S, createVNode as g, withCtx as a, renderList as f, createBlock as m, createElementVNode as z, createTextVNode as v, toDisplayString as C } from "vue";
|
2
2
|
import { _ as O } from "./BuiCollapsible.vue_vue_type_script_setup_true_lang-BfgRYJts.js";
|
3
3
|
import { _ as T } from "./BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-DJ8YMCCp.js";
|
4
4
|
import { _ as j } from "./BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-eieHE5yV.js";
|
@@ -17,10 +17,7 @@ import { _ as ee } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-Cf
|
|
17
17
|
const te = {
|
18
18
|
key: 0,
|
19
19
|
class: "w-full py-4"
|
20
|
-
}, oe = { class: "flex w-full items-center justify-between" }, ne = { class: "inline-block rounded-t bg-background px-4 py-3" },
|
21
|
-
key: 0,
|
22
|
-
class: ""
|
23
|
-
}, E = "#UNDEFINED#", ve = /* @__PURE__ */ L({
|
20
|
+
}, oe = { class: "flex w-full items-center justify-between" }, ne = { class: "inline-block rounded-t bg-background px-4 py-3" }, E = "#UNDEFINED#", we = /* @__PURE__ */ L({
|
24
21
|
__name: "BuiDataTable",
|
25
22
|
props: /* @__PURE__ */ U({
|
26
23
|
columns: {},
|
@@ -48,7 +45,7 @@ const te = {
|
|
48
45
|
setup(c) {
|
49
46
|
const t = c, $ = b(c, "sorting"), p = b(c, "pagination"), k = b(c, "selection"), D = b(c, "columnVisibility"), I = y(
|
50
47
|
() => t.manualPagination ? t.totalItems : t.data.length
|
51
|
-
),
|
48
|
+
), u = H({
|
52
49
|
initialState: { pagination: { pageSize: t.pageSize } },
|
53
50
|
get data() {
|
54
51
|
return t.data;
|
@@ -87,45 +84,45 @@ const te = {
|
|
87
84
|
}
|
88
85
|
},
|
89
86
|
getRowId: t.getRowId
|
90
|
-
}),
|
87
|
+
}), B = y({
|
91
88
|
get() {
|
92
|
-
return
|
89
|
+
return u.getState().pagination.pageSize;
|
93
90
|
},
|
94
91
|
set(e) {
|
95
|
-
p.value && (p.value.pageSize = e,
|
92
|
+
p.value && (p.value.pageSize = e, u.setPageSize(e), u.setPageIndex(0));
|
96
93
|
}
|
97
94
|
}), _ = y({
|
98
95
|
get() {
|
99
|
-
return
|
96
|
+
return u.getState().pagination.pageIndex + 1;
|
100
97
|
},
|
101
98
|
set(e) {
|
102
|
-
p.value && (p.value.pageIndex = e - 1,
|
99
|
+
p.value && (p.value.pageIndex = e - 1, u.setPageIndex(e - 1));
|
103
100
|
}
|
104
101
|
});
|
105
102
|
F(() => {
|
106
|
-
const e =
|
103
|
+
const e = u.getPageCount();
|
107
104
|
e && e < _.value && (_.value = e);
|
108
105
|
});
|
109
|
-
const
|
110
|
-
const l =
|
111
|
-
return e[l] = e[l] || [], e[l].push(
|
106
|
+
const M = y(() => t.groupBy ? u.getRowModel().rows.reduce((e, i) => {
|
107
|
+
const l = i.getValue(t.groupBy) ?? E;
|
108
|
+
return e[l] = e[l] || [], e[l].push(i), e;
|
112
109
|
}, /* @__PURE__ */ Object.create(null)) : null);
|
113
|
-
function
|
110
|
+
function h(e) {
|
114
111
|
return (t.groupBy && t.groupLabels ? t.groupLabels[t.groupBy] || [] : [])[e];
|
115
112
|
}
|
116
|
-
return (e,
|
117
|
-
e.$slots.caption ? (n(),
|
118
|
-
w(e.$slots, "caption", { table: o(
|
113
|
+
return (e, i) => (n(), s(d, null, [
|
114
|
+
e.$slots.caption ? (n(), s("div", te, [
|
115
|
+
w(e.$slots, "caption", { table: o(u) })
|
119
116
|
])) : S("", !0),
|
120
117
|
g(o(J), null, {
|
121
118
|
default: a(() => [
|
122
119
|
g(o(X), null, {
|
123
120
|
default: a(() => [
|
124
|
-
(n(!0),
|
121
|
+
(n(!0), s(d, null, f(o(u).getHeaderGroups(), (r) => (n(), m(o(P), {
|
125
122
|
key: r.id
|
126
123
|
}, {
|
127
124
|
default: a(() => [
|
128
|
-
(n(!0),
|
125
|
+
(n(!0), s(d, null, f(r.headers, (l) => (n(), m(o(W), {
|
129
126
|
key: l.id
|
130
127
|
}, {
|
131
128
|
default: a(() => [
|
@@ -145,8 +142,8 @@ const te = {
|
|
145
142
|
}),
|
146
143
|
g(o(Q), null, {
|
147
144
|
default: a(() => [
|
148
|
-
o(
|
149
|
-
t.groupBy &&
|
145
|
+
o(u).getRowModel().rows?.length ? (n(), s(d, { key: 0 }, [
|
146
|
+
t.groupBy && M.value ? (n(!0), s(d, { key: 0 }, f(M.value, (r, l) => (n(), m(o(O), {
|
150
147
|
asChild: "",
|
151
148
|
key: l,
|
152
149
|
open: !0
|
@@ -163,15 +160,16 @@ const te = {
|
|
163
160
|
default: a(() => [
|
164
161
|
z("div", oe, [
|
165
162
|
z("div", ne, [
|
166
|
-
l === E ? (n(),
|
167
|
-
v(C(
|
168
|
-
], 64)) : (n(),
|
169
|
-
v(C(
|
163
|
+
l === E ? (n(), s(d, { key: 0 }, [
|
164
|
+
v(C(h(1)), 1)
|
165
|
+
], 64)) : (n(), s(d, { key: 1 }, [
|
166
|
+
v(C(h(0)) + ": " + C(l), 1)
|
170
167
|
], 64))
|
171
168
|
]),
|
172
|
-
e.$slots.groupByRow ? (
|
173
|
-
|
174
|
-
|
169
|
+
e.$slots.groupByRow ? w(e.$slots, "groupByRow", {
|
170
|
+
key: 0,
|
171
|
+
group: l
|
172
|
+
}) : S("", !0)
|
175
173
|
])
|
176
174
|
]),
|
177
175
|
_: 2
|
@@ -184,7 +182,7 @@ const te = {
|
|
184
182
|
}, 1024),
|
185
183
|
g(o(j), { asChild: "" }, {
|
186
184
|
default: a(() => [
|
187
|
-
(n(!0),
|
185
|
+
(n(!0), s(d, null, f(r, (V) => (n(), m(N, {
|
188
186
|
key: V.id,
|
189
187
|
columns: t.columns,
|
190
188
|
row: V,
|
@@ -195,7 +193,7 @@ const te = {
|
|
195
193
|
}, 1024)
|
196
194
|
]),
|
197
195
|
_: 2
|
198
|
-
}, 1024))), 128)) : (n(!0),
|
196
|
+
}, 1024))), 128)) : (n(!0), s(d, { key: 1 }, f(o(u).getRowModel().rows, (r) => (n(), m(N, {
|
199
197
|
key: r.id,
|
200
198
|
columns: t.columns,
|
201
199
|
row: r,
|
@@ -207,7 +205,7 @@ const te = {
|
|
207
205
|
}, {
|
208
206
|
default: a(() => [
|
209
207
|
w(e.$slots, "nodata", {}, () => [
|
210
|
-
|
208
|
+
i[2] || (i[2] = v("No data"))
|
211
209
|
])
|
212
210
|
]),
|
213
211
|
_: 3
|
@@ -227,9 +225,9 @@ const te = {
|
|
227
225
|
class: "float-right",
|
228
226
|
total: I.value,
|
229
227
|
pageIndex: _.value,
|
230
|
-
"onUpdate:pageIndex":
|
231
|
-
pageSize:
|
232
|
-
"onUpdate:pageSize":
|
228
|
+
"onUpdate:pageIndex": i[0] || (i[0] = (r) => _.value = r),
|
229
|
+
pageSize: B.value,
|
230
|
+
"onUpdate:pageSize": i[1] || (i[1] = (r) => B.value = r)
|
233
231
|
}, null, 8, ["total", "pageIndex", "pageSize"])
|
234
232
|
]),
|
235
233
|
_: 1
|
@@ -247,5 +245,5 @@ const te = {
|
|
247
245
|
}
|
248
246
|
});
|
249
247
|
export {
|
250
|
-
|
248
|
+
we as _
|
251
249
|
};
|
@@ -8,7 +8,7 @@ import { _ as x } from "../../../BuiTableRowSubrow.vue_vue_type_script_setup_tru
|
|
8
8
|
import { _ } from "../../../BuiTableCaption.vue_vue_type_script_setup_true_lang-053YvtXp.js";
|
9
9
|
import { _ as w } from "../../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-BJDYHpRG.js";
|
10
10
|
import { _ as C } from "../../../BuiTableFooter.vue_vue_type_script_setup_true_lang-Cfxlxsbh.js";
|
11
|
-
import { _ as R } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-
|
11
|
+
import { _ as R } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-CUH3nl15.js";
|
12
12
|
export {
|
13
13
|
R as BuiDataTable,
|
14
14
|
e as BuiTable,
|
package/dist/index.js
CHANGED
@@ -116,7 +116,7 @@ import { _ as jt } from "./BuiTableRowSubrow.vue_vue_type_script_setup_true_lang
|
|
116
116
|
import { _ as Ot } from "./BuiTableCaption.vue_vue_type_script_setup_true_lang-053YvtXp.js";
|
117
117
|
import { _ as qt } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-BJDYHpRG.js";
|
118
118
|
import { _ as Jt } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-Cfxlxsbh.js";
|
119
|
-
import { _ as Qt } from "./BuiDataTable.vue_vue_type_script_setup_true_lang-
|
119
|
+
import { _ as Qt } from "./BuiDataTable.vue_vue_type_script_setup_true_lang-CUH3nl15.js";
|
120
120
|
import { BuiTabsList as Xt, BuiTabsTrigger as Yt, tabsListVariants as Zt, tabsTriggerVariants as $t } from "./components/ui/tabs/index.js";
|
121
121
|
import { BuiTextarea as ra, textareaVariants as ea } from "./components/ui/textarea/index.js";
|
122
122
|
import { BuiToast as aa, BuiToaster as ia, toastVariants as ua } from "./components/ui/toast/index.js";
|
package/package.json
CHANGED
@@ -177,9 +177,7 @@ function getGroupLabel(index: number) {
|
|
177
177
|
</template>
|
178
178
|
<template v-else> {{ getGroupLabel(0) }}: {{ key }} </template>
|
179
179
|
</div>
|
180
|
-
<
|
181
|
-
<slot name="groupByRow" :group="key" />
|
182
|
-
</div>
|
180
|
+
<slot v-if="$slots.groupByRow" name="groupByRow" :group="key" />
|
183
181
|
</div>
|
184
182
|
</BuiTableCell>
|
185
183
|
</BuiTableRow>
|