@soft-stech/bootsman-ui-shadcn 1.3.1 → 1.3.2
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-CBCScilf.js → BuiDataTable.vue_vue_type_script_setup_true_lang-BBdRXWLA.js} +49 -49
- package/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DjLAqoa-.js +109 -0
- package/dist/components/ui/pagination/BuiPaginationCommon.js +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/table/BuiDataTable.js +1 -1
- package/dist/components/ui/table/index.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/components/ui/pagination/BuiPaginationCommon.vue +8 -6
- package/src/components/ui/table/BuiDataTable.vue +1 -1
- package/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-6BhiWgI6.js +0 -107
@@ -1,21 +1,21 @@
|
|
1
|
-
import { defineComponent as V, mergeModels as D, useModel as b, computed as S, watchEffect as L, openBlock as n, createBlock as i, unref as t, withCtx as a, renderSlot as
|
1
|
+
import { defineComponent as V, mergeModels as D, useModel as b, computed as S, watchEffect as L, openBlock as n, createBlock as i, unref as t, withCtx as a, renderSlot as z, createCommentVNode as v, createVNode as g, createElementBlock as d, Fragment as m, renderList as f, createElementVNode as U, createTextVNode as w, toDisplayString as y } from "vue";
|
2
2
|
import { _ as F } from "./BuiCollapsible.vue_vue_type_script_setup_true_lang-BfgRYJts.js";
|
3
3
|
import { _ as O } from "./BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-DJ8YMCCp.js";
|
4
4
|
import { _ as T } from "./BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-eieHE5yV.js";
|
5
|
-
import { _ as G } from "./BuiPaginationCommon.vue_vue_type_script_setup_true_lang-
|
5
|
+
import { _ as G } from "./BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DjLAqoa-.js";
|
6
6
|
import { v as C } from "./utils-DPuEjrVV.js";
|
7
|
-
import { _ as
|
7
|
+
import { _ as x } from "./BuiTableRowSubrow.vue_vue_type_script_setup_true_lang-Ch5gemw2.js";
|
8
8
|
import { useVueTable as j, getCoreRowModel as H, getPaginationRowModel as K, getSortedRowModel as Y, FlexRender as q } from "@tanstack/vue-table";
|
9
9
|
import { _ as A } from "./BuiTable.vue_vue_type_script_setup_true_lang-CUPSwE5z.js";
|
10
10
|
import { _ as J } from "./BuiTableBody.vue_vue_type_script_setup_true_lang-CWT4u-Ma.js";
|
11
|
-
import { _ as
|
11
|
+
import { _ as N } from "./BuiTableCell.vue_vue_type_script_setup_true_lang-BrTQJCiZ.js";
|
12
12
|
import { _ as Q } from "./BuiTableHead.vue_vue_type_script_setup_true_lang-bRr43VQ9.js";
|
13
13
|
import { _ as W } from "./BuiTableHeader.vue_vue_type_script_setup_true_lang-DZOqi3dp.js";
|
14
14
|
import { _ as P } from "./BuiTableRow.vue_vue_type_script_setup_true_lang-CpEilJsW.js";
|
15
15
|
import { _ as X } from "./BuiTableCaption.vue_vue_type_script_setup_true_lang-053YvtXp.js";
|
16
16
|
import { _ as Z } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-BJDYHpRG.js";
|
17
17
|
import { _ as ee } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-Cfxlxsbh.js";
|
18
|
-
const te = { class: "inline-block rounded-t bg-background px-4 py-3" },
|
18
|
+
const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, E = "#UNDEFINED#", ve = /* @__PURE__ */ V({
|
19
19
|
__name: "BuiDataTable",
|
20
20
|
props: /* @__PURE__ */ D({
|
21
21
|
columns: {},
|
@@ -39,9 +39,9 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
39
39
|
}),
|
40
40
|
emits: ["update:sorting", "update:pagination", "update:selection"],
|
41
41
|
setup(c) {
|
42
|
-
const o = c, R = b(c, "sorting"), p = b(c, "pagination"), $ = b(c, "selection"),
|
42
|
+
const o = c, R = b(c, "sorting"), p = b(c, "pagination"), $ = b(c, "selection"), k = S(
|
43
43
|
() => o.manualPagination ? o.totalItems : o.data.length
|
44
|
-
),
|
44
|
+
), u = j({
|
45
45
|
initialState: { pagination: { pageSize: o.pageSize } },
|
46
46
|
get data() {
|
47
47
|
return o.data;
|
@@ -77,54 +77,54 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
77
77
|
}
|
78
78
|
},
|
79
79
|
getRowId: o.getRowId
|
80
|
-
}),
|
80
|
+
}), I = S({
|
81
81
|
get() {
|
82
|
-
return
|
82
|
+
return u.getState().pagination.pageSize;
|
83
83
|
},
|
84
84
|
set(e) {
|
85
|
-
p.value && (p.value.pageSize = e,
|
85
|
+
p.value && (p.value.pageSize = e, u.setPageSize(e), u.setPageIndex(0));
|
86
86
|
}
|
87
87
|
}), _ = S({
|
88
88
|
get() {
|
89
|
-
return
|
89
|
+
return u.getState().pagination.pageIndex + 1;
|
90
90
|
},
|
91
91
|
set(e) {
|
92
|
-
p.value && (p.value.pageIndex = e - 1,
|
92
|
+
p.value && (p.value.pageIndex = e - 1, u.setPageIndex(e - 1));
|
93
93
|
}
|
94
94
|
});
|
95
95
|
L(() => {
|
96
|
-
const e =
|
96
|
+
const e = u.getPageCount();
|
97
97
|
e && e < _.value && (_.value = e);
|
98
98
|
});
|
99
|
-
const
|
100
|
-
const
|
101
|
-
return e[
|
99
|
+
const M = S(() => o.groupBy ? u.getRowModel().rows.reduce((e, s) => {
|
100
|
+
const r = s.getValue(o.groupBy) ?? E;
|
101
|
+
return e[r] = e[r] || [], e[r].push(s), e;
|
102
102
|
}, /* @__PURE__ */ Object.create(null)) : null);
|
103
|
-
function
|
103
|
+
function B(e) {
|
104
104
|
return (o.groupBy && o.groupLabels ? o.groupLabels[o.groupBy] || [] : [])[e];
|
105
105
|
}
|
106
106
|
return (e, s) => (n(), i(t(A), null, {
|
107
107
|
default: a(() => [
|
108
108
|
e.$slots.caption ? (n(), i(t(X), { key: 0 }, {
|
109
109
|
default: a(() => [
|
110
|
-
|
110
|
+
z(e.$slots, "caption", { table: t(u) })
|
111
111
|
]),
|
112
112
|
_: 3
|
113
|
-
})) :
|
113
|
+
})) : v("", !0),
|
114
114
|
g(t(W), null, {
|
115
115
|
default: a(() => [
|
116
|
-
(n(!0), d(m, null, f(t(
|
117
|
-
key:
|
116
|
+
(n(!0), d(m, null, f(t(u).getHeaderGroups(), (l) => (n(), i(t(P), {
|
117
|
+
key: l.id
|
118
118
|
}, {
|
119
119
|
default: a(() => [
|
120
|
-
(n(!0), d(m, null, f(
|
121
|
-
key:
|
120
|
+
(n(!0), d(m, null, f(l.headers, (r) => (n(), i(t(Q), {
|
121
|
+
key: r.id
|
122
122
|
}, {
|
123
123
|
default: a(() => [
|
124
|
-
|
124
|
+
r.isPlaceholder ? v("", !0) : (n(), i(t(q), {
|
125
125
|
key: 0,
|
126
|
-
render:
|
127
|
-
props:
|
126
|
+
render: r.column.columnDef.header,
|
127
|
+
props: r.getContext()
|
128
128
|
}, null, 8, ["render", "props"]))
|
129
129
|
]),
|
130
130
|
_: 2
|
@@ -137,10 +137,10 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
137
137
|
}),
|
138
138
|
g(t(J), null, {
|
139
139
|
default: a(() => [
|
140
|
-
t(
|
141
|
-
o.groupBy &&
|
140
|
+
t(u).getRowModel().rows?.length ? (n(), d(m, { key: 0 }, [
|
141
|
+
o.groupBy && M.value ? (n(!0), d(m, { key: 0 }, f(M.value, (l, r) => (n(), i(t(F), {
|
142
142
|
asChild: "",
|
143
|
-
key:
|
143
|
+
key: r,
|
144
144
|
open: !0
|
145
145
|
}, {
|
146
146
|
default: a(() => [
|
@@ -148,16 +148,16 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
148
148
|
default: a(() => [
|
149
149
|
g(t(P), { class: "bg-foreground/[0.04]" }, {
|
150
150
|
default: a(() => [
|
151
|
-
g(t(
|
151
|
+
g(t(N), {
|
152
152
|
colspan: e.columns.length,
|
153
153
|
class: "!pb-0"
|
154
154
|
}, {
|
155
155
|
default: a(() => [
|
156
156
|
U("div", te, [
|
157
|
-
|
158
|
-
y(
|
157
|
+
r === E ? (n(), d(m, { key: 0 }, [
|
158
|
+
w(y(B(1)), 1)
|
159
159
|
], 64)) : (n(), d(m, { key: 1 }, [
|
160
|
-
y(
|
160
|
+
w(y(B(0)) + ": " + y(r), 1)
|
161
161
|
], 64))
|
162
162
|
])
|
163
163
|
]),
|
@@ -171,10 +171,10 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
171
171
|
}, 1024),
|
172
172
|
g(t(T), { asChild: "" }, {
|
173
173
|
default: a(() => [
|
174
|
-
(n(!0), d(m, null, f(
|
175
|
-
key:
|
174
|
+
(n(!0), d(m, null, f(l, (h) => (n(), i(x, {
|
175
|
+
key: h.id,
|
176
176
|
columns: o.columns,
|
177
|
-
row:
|
177
|
+
row: h,
|
178
178
|
renderSubComponent: o.renderSubComponent
|
179
179
|
}, null, 8, ["columns", "row", "renderSubComponent"]))), 128))
|
180
180
|
]),
|
@@ -182,10 +182,10 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
182
182
|
}, 1024)
|
183
183
|
]),
|
184
184
|
_: 2
|
185
|
-
}, 1024))), 128)) : (n(!0), d(m, { key: 1 }, f(t(
|
186
|
-
key:
|
185
|
+
}, 1024))), 128)) : (n(!0), d(m, { key: 1 }, f(t(u).getRowModel().rows, (l) => (n(), i(x, {
|
186
|
+
key: l.id,
|
187
187
|
columns: o.columns,
|
188
|
-
row:
|
188
|
+
row: l,
|
189
189
|
renderSubComponent: o.renderSubComponent
|
190
190
|
}, null, 8, ["columns", "row", "renderSubComponent"]))), 128))
|
191
191
|
], 64)) : (n(), i(t(Z), {
|
@@ -193,8 +193,8 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
193
193
|
colspan: e.columns.length
|
194
194
|
}, {
|
195
195
|
default: a(() => [
|
196
|
-
|
197
|
-
s[2] || (s[2] =
|
196
|
+
z(e.$slots, "nodata", {}, () => [
|
197
|
+
s[2] || (s[2] = w("No data"))
|
198
198
|
])
|
199
199
|
]),
|
200
200
|
_: 3
|
@@ -202,21 +202,21 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
202
202
|
]),
|
203
203
|
_: 3
|
204
204
|
}),
|
205
|
-
e.showPagination &&
|
205
|
+
e.showPagination && k.value > 0 ? (n(), i(t(ee), { key: 1 }, {
|
206
206
|
default: a(() => [
|
207
207
|
g(t(P), null, {
|
208
208
|
default: a(() => [
|
209
|
-
g(t(
|
209
|
+
g(t(N), {
|
210
210
|
colspan: e.columns.length
|
211
211
|
}, {
|
212
212
|
default: a(() => [
|
213
213
|
g(t(G), {
|
214
214
|
class: "float-right",
|
215
|
-
total:
|
215
|
+
total: k.value,
|
216
216
|
pageIndex: _.value,
|
217
|
-
"onUpdate:pageIndex": s[0] || (s[0] = (
|
218
|
-
pageSize:
|
219
|
-
"onUpdate:pageSize": s[1] || (s[1] = (
|
217
|
+
"onUpdate:pageIndex": s[0] || (s[0] = (l) => _.value = l),
|
218
|
+
pageSize: I.value,
|
219
|
+
"onUpdate:pageSize": s[1] || (s[1] = (l) => I.value = l)
|
220
220
|
}, null, 8, ["total", "pageIndex", "pageSize"])
|
221
221
|
]),
|
222
222
|
_: 1
|
@@ -226,12 +226,12 @@ const te = { class: "inline-block rounded-t bg-background px-4 py-3" }, N = "#UN
|
|
226
226
|
})
|
227
227
|
]),
|
228
228
|
_: 1
|
229
|
-
})) :
|
229
|
+
})) : v("", !0)
|
230
230
|
]),
|
231
231
|
_: 3
|
232
232
|
}));
|
233
233
|
}
|
234
234
|
});
|
235
235
|
export {
|
236
|
-
|
236
|
+
ve as _
|
237
237
|
};
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { defineComponent as $, mergeModels as y, useModel as c, computed as v, openBlock as n, createElementBlock as p, createVNode as e, unref as t, withCtx as r, createElementVNode as x, Fragment as S, renderList as I, createTextVNode as P, toDisplayString as u, createCommentVNode as M } from "vue";
|
2
|
+
/* empty css */
|
3
|
+
import { f as z, y as k } from "./index-uA4l4INt.js";
|
4
|
+
import "@vueuse/core";
|
5
|
+
import "./BuiCalendar.vue_vue_type_style_index_0_lang-DK4yUiXC.js";
|
6
|
+
import "vee-validate";
|
7
|
+
import { BuiInput as B } from "./components/ui/input/index.js";
|
8
|
+
import { _ as C } from "./BuiSelect.vue_vue_type_script_setup_true_lang-YVZaZc0x.js";
|
9
|
+
import { _ as N } from "./BuiSelectValue.vue_vue_type_script_setup_true_lang-CseYU299.js";
|
10
|
+
import { _ as w } from "./BuiSelectTrigger.vue_vue_type_script_setup_true_lang-Dh-1xzuh.js";
|
11
|
+
import { _ as U } from "./BuiSelectContent.vue_vue_type_script_setup_true_lang-CX82dW-X.js";
|
12
|
+
import { _ as b } from "./BuiSelectItem.vue_vue_type_script_setup_true_lang-DsWD84S8.js";
|
13
|
+
import "@tanstack/vue-table";
|
14
|
+
import "./components/ui/toast/use-toast.js";
|
15
|
+
import "@vee-validate/zod";
|
16
|
+
import "zod";
|
17
|
+
import "./index-BGsblnmA.js";
|
18
|
+
/* empty css */
|
19
|
+
import { _ as q } from "./BuiPaginationFirst.vue_vue_type_script_setup_true_lang-CvMVo3wC.js";
|
20
|
+
import { _ as E } from "./BuiPaginationLast.vue_vue_type_script_setup_true_lang-BTNEZSgQ.js";
|
21
|
+
import { _ as j } from "./BuiPaginationNext.vue_vue_type_script_setup_true_lang-DcwRaAYo.js";
|
22
|
+
import { _ as D } from "./BuiPaginationPrev.vue_vue_type_script_setup_true_lang-DkK8mnKY.js";
|
23
|
+
const F = { class: "m-2" }, L = { class: "text-sm text-muted-foreground" }, se = /* @__PURE__ */ $({
|
24
|
+
__name: "BuiPaginationCommon",
|
25
|
+
props: /* @__PURE__ */ y({
|
26
|
+
total: {}
|
27
|
+
}, {
|
28
|
+
pageSize: { default: 10, required: !0 },
|
29
|
+
pageSizeModifiers: {},
|
30
|
+
pageIndex: { default: 1, required: !0 },
|
31
|
+
pageIndexModifiers: {}
|
32
|
+
}),
|
33
|
+
emits: ["update:pageSize", "update:pageIndex"],
|
34
|
+
setup(l) {
|
35
|
+
const V = [10, 20, 30, 40, 50], d = l, m = c(l, "pageSize"), i = c(l, "pageIndex"), f = v(() => Math.ceil(d.total / m.value)), _ = v({
|
36
|
+
get() {
|
37
|
+
return String(m.value);
|
38
|
+
},
|
39
|
+
set(g) {
|
40
|
+
m.value = parseInt(g);
|
41
|
+
}
|
42
|
+
});
|
43
|
+
return (g, a) => (n(), p("div", F, [
|
44
|
+
e(t(z), {
|
45
|
+
total: d.total,
|
46
|
+
itemsPerPage: m.value,
|
47
|
+
page: i.value,
|
48
|
+
"onUpdate:page": a[2] || (a[2] = (s) => i.value = s)
|
49
|
+
}, {
|
50
|
+
default: r(({ page: s }) => [
|
51
|
+
e(t(k), { class: "relative flex items-center justify-center gap-2" }, {
|
52
|
+
default: r(() => [
|
53
|
+
a[3] || (a[3] = x("p", { class: "text-sm text-muted-foreground" }, "Items per page", -1)),
|
54
|
+
e(t(C), {
|
55
|
+
modelValue: _.value,
|
56
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => _.value = o),
|
57
|
+
modelModifiers: { number: !0 }
|
58
|
+
}, {
|
59
|
+
default: r(() => [
|
60
|
+
e(t(w), { class: "mr-2 w-[70px]" }, {
|
61
|
+
default: r(() => [
|
62
|
+
e(t(N), {
|
63
|
+
placeholder: m.value.toString()
|
64
|
+
}, null, 8, ["placeholder"])
|
65
|
+
]),
|
66
|
+
_: 1
|
67
|
+
}),
|
68
|
+
e(t(U), { side: "top" }, {
|
69
|
+
default: r(() => [
|
70
|
+
(n(), p(S, null, I(V, (o) => e(t(b), {
|
71
|
+
key: o,
|
72
|
+
value: o.toString()
|
73
|
+
}, {
|
74
|
+
default: r(() => [
|
75
|
+
P(u(o), 1)
|
76
|
+
]),
|
77
|
+
_: 2
|
78
|
+
}, 1032, ["value"])), 64))
|
79
|
+
]),
|
80
|
+
_: 1
|
81
|
+
})
|
82
|
+
]),
|
83
|
+
_: 1
|
84
|
+
}, 8, ["modelValue"]),
|
85
|
+
f.value > 1 ? (n(), p(S, { key: 0 }, [
|
86
|
+
x("p", L, "Page " + u(s) + " of " + u(f.value), 1),
|
87
|
+
e(t(q)),
|
88
|
+
e(t(D)),
|
89
|
+
e(t(B), {
|
90
|
+
modelValue: i.value,
|
91
|
+
"onUpdate:modelValue": a[1] || (a[1] = (o) => i.value = o),
|
92
|
+
class: "w-28",
|
93
|
+
placeholder: "Page number"
|
94
|
+
}, null, 8, ["modelValue"]),
|
95
|
+
e(t(j)),
|
96
|
+
e(t(E))
|
97
|
+
], 64)) : M("", !0)
|
98
|
+
]),
|
99
|
+
_: 2
|
100
|
+
}, 1024)
|
101
|
+
]),
|
102
|
+
_: 1
|
103
|
+
}, 8, ["total", "itemsPerPage", "page"])
|
104
|
+
]));
|
105
|
+
}
|
106
|
+
});
|
107
|
+
export {
|
108
|
+
se as _
|
109
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as o } from "../../../BuiPaginationCommon.vue_vue_type_script_setup_true_lang-
|
1
|
+
import { _ as o } from "../../../BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DjLAqoa-.js";
|
2
2
|
import { f as n, y as r, g as s } from "../../../index-uA4l4INt.js";
|
3
3
|
import { _ as g } from "../../../BuiPaginationFirst.vue_vue_type_script_setup_true_lang-CvMVo3wC.js";
|
4
4
|
import { _ as P } from "../../../BuiPaginationLast.vue_vue_type_script_setup_true_lang-BTNEZSgQ.js";
|
@@ -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-BBdRXWLA.js";
|
12
12
|
export {
|
13
13
|
R as BuiDataTable,
|
14
14
|
e as BuiTable,
|
package/dist/index.js
CHANGED
@@ -82,7 +82,7 @@ import { _ as Ce } from "./BuiHoverCardTrigger.vue_vue_type_script_setup_true_la
|
|
82
82
|
import { _ as Fe } from "./BuiHoverCardContent.vue_vue_type_script_setup_true_lang-DsSfafrp.js";
|
83
83
|
import { BuiBadgedInput as be, BuiInput as De, BuiPasswordInput as Ae, inputVariants as Se } from "./components/ui/input/index.js";
|
84
84
|
import { _ as we } from "./BuiLabel.vue_vue_type_script_setup_true_lang-DQH-AF9N.js";
|
85
|
-
import { _ as Pe } from "./BuiPaginationCommon.vue_vue_type_script_setup_true_lang-
|
85
|
+
import { _ as Pe } from "./BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DjLAqoa-.js";
|
86
86
|
import { _ as ve } from "./BuiPaginationFirst.vue_vue_type_script_setup_true_lang-CvMVo3wC.js";
|
87
87
|
import { _ as Le } from "./BuiPaginationLast.vue_vue_type_script_setup_true_lang-BTNEZSgQ.js";
|
88
88
|
import { _ as Ge } from "./BuiPaginationNext.vue_vue_type_script_setup_true_lang-DcwRaAYo.js";
|
@@ -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-BBdRXWLA.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
@@ -62,12 +62,14 @@ const pageSizeString = computed({
|
|
62
62
|
</BuiSelectItem>
|
63
63
|
</BuiSelectContent>
|
64
64
|
</BuiSelect>
|
65
|
-
<
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
65
|
+
<template v-if="totalPages > 1">
|
66
|
+
<p class="text-sm text-muted-foreground">Page {{ page }} of {{ totalPages }}</p>
|
67
|
+
<BuiPaginationFirst />
|
68
|
+
<BuiPaginationPrev />
|
69
|
+
<BuiInput v-model="pageIndex" class="w-28" placeholder="Page number" />
|
70
|
+
<BuiPaginationNext />
|
71
|
+
<BuiPaginationLast />
|
72
|
+
</template>
|
71
73
|
</BuiPaginationList>
|
72
74
|
</BuiPagination>
|
73
75
|
</div>
|
@@ -201,7 +201,7 @@ function getGroupLabel(index: number) {
|
|
201
201
|
</BuiTableEmpty>
|
202
202
|
</template>
|
203
203
|
</BuiTableBody>
|
204
|
-
<BuiTableFooter v-if="showPagination &&
|
204
|
+
<BuiTableFooter v-if="showPagination && computedItems > 0">
|
205
205
|
<BuiTableRow>
|
206
206
|
<BuiTableCell :colspan="columns.length">
|
207
207
|
<BuiPaginationCommon
|
@@ -1,107 +0,0 @@
|
|
1
|
-
import { defineComponent as $, mergeModels as V, useModel as f, computed as _, openBlock as g, createElementBlock as c, createVNode as e, unref as t, withCtx as r, createElementVNode as v, Fragment as I, renderList as P, createTextVNode as y, toDisplayString as n } from "vue";
|
2
|
-
/* empty css */
|
3
|
-
import { f as M, y as z } from "./index-uA4l4INt.js";
|
4
|
-
import "@vueuse/core";
|
5
|
-
import "./BuiCalendar.vue_vue_type_style_index_0_lang-DK4yUiXC.js";
|
6
|
-
import "vee-validate";
|
7
|
-
import { BuiInput as B } from "./components/ui/input/index.js";
|
8
|
-
import { _ as k } from "./BuiSelect.vue_vue_type_script_setup_true_lang-YVZaZc0x.js";
|
9
|
-
import { _ as w } from "./BuiSelectValue.vue_vue_type_script_setup_true_lang-CseYU299.js";
|
10
|
-
import { _ as C } from "./BuiSelectTrigger.vue_vue_type_script_setup_true_lang-Dh-1xzuh.js";
|
11
|
-
import { _ as N } from "./BuiSelectContent.vue_vue_type_script_setup_true_lang-CX82dW-X.js";
|
12
|
-
import { _ as U } from "./BuiSelectItem.vue_vue_type_script_setup_true_lang-DsWD84S8.js";
|
13
|
-
import "@tanstack/vue-table";
|
14
|
-
import "./components/ui/toast/use-toast.js";
|
15
|
-
import "@vee-validate/zod";
|
16
|
-
import "zod";
|
17
|
-
import "./index-BGsblnmA.js";
|
18
|
-
/* empty css */
|
19
|
-
import { _ as b } from "./BuiPaginationFirst.vue_vue_type_script_setup_true_lang-CvMVo3wC.js";
|
20
|
-
import { _ as q } from "./BuiPaginationLast.vue_vue_type_script_setup_true_lang-BTNEZSgQ.js";
|
21
|
-
import { _ as E } from "./BuiPaginationNext.vue_vue_type_script_setup_true_lang-DcwRaAYo.js";
|
22
|
-
import { _ as j } from "./BuiPaginationPrev.vue_vue_type_script_setup_true_lang-DkK8mnKY.js";
|
23
|
-
const D = { class: "m-2" }, F = { class: "text-sm text-muted-foreground" }, le = /* @__PURE__ */ $({
|
24
|
-
__name: "BuiPaginationCommon",
|
25
|
-
props: /* @__PURE__ */ V({
|
26
|
-
total: {}
|
27
|
-
}, {
|
28
|
-
pageSize: { default: 10, required: !0 },
|
29
|
-
pageSizeModifiers: {},
|
30
|
-
pageIndex: { default: 1, required: !0 },
|
31
|
-
pageIndexModifiers: {}
|
32
|
-
}),
|
33
|
-
emits: ["update:pageSize", "update:pageIndex"],
|
34
|
-
setup(l) {
|
35
|
-
const x = [10, 20, 30, 40, 50], p = l, m = f(l, "pageSize"), i = f(l, "pageIndex"), S = _(() => Math.ceil(p.total / m.value)), u = _({
|
36
|
-
get() {
|
37
|
-
return String(m.value);
|
38
|
-
},
|
39
|
-
set(d) {
|
40
|
-
m.value = parseInt(d);
|
41
|
-
}
|
42
|
-
});
|
43
|
-
return (d, a) => (g(), c("div", D, [
|
44
|
-
e(t(M), {
|
45
|
-
total: p.total,
|
46
|
-
itemsPerPage: m.value,
|
47
|
-
page: i.value,
|
48
|
-
"onUpdate:page": a[2] || (a[2] = (s) => i.value = s)
|
49
|
-
}, {
|
50
|
-
default: r(({ page: s }) => [
|
51
|
-
e(t(z), { class: "relative flex items-center justify-center gap-2" }, {
|
52
|
-
default: r(() => [
|
53
|
-
a[3] || (a[3] = v("p", { class: "text-sm text-muted-foreground" }, "Items per page", -1)),
|
54
|
-
e(t(k), {
|
55
|
-
modelValue: u.value,
|
56
|
-
"onUpdate:modelValue": a[0] || (a[0] = (o) => u.value = o),
|
57
|
-
modelModifiers: { number: !0 }
|
58
|
-
}, {
|
59
|
-
default: r(() => [
|
60
|
-
e(t(C), { class: "mr-2 w-[70px]" }, {
|
61
|
-
default: r(() => [
|
62
|
-
e(t(w), {
|
63
|
-
placeholder: m.value.toString()
|
64
|
-
}, null, 8, ["placeholder"])
|
65
|
-
]),
|
66
|
-
_: 1
|
67
|
-
}),
|
68
|
-
e(t(N), { side: "top" }, {
|
69
|
-
default: r(() => [
|
70
|
-
(g(), c(I, null, P(x, (o) => e(t(U), {
|
71
|
-
key: o,
|
72
|
-
value: o.toString()
|
73
|
-
}, {
|
74
|
-
default: r(() => [
|
75
|
-
y(n(o), 1)
|
76
|
-
]),
|
77
|
-
_: 2
|
78
|
-
}, 1032, ["value"])), 64))
|
79
|
-
]),
|
80
|
-
_: 1
|
81
|
-
})
|
82
|
-
]),
|
83
|
-
_: 1
|
84
|
-
}, 8, ["modelValue"]),
|
85
|
-
v("p", F, "Page " + n(s) + " of " + n(S.value), 1),
|
86
|
-
e(t(b)),
|
87
|
-
e(t(j)),
|
88
|
-
e(t(B), {
|
89
|
-
modelValue: i.value,
|
90
|
-
"onUpdate:modelValue": a[1] || (a[1] = (o) => i.value = o),
|
91
|
-
class: "w-28",
|
92
|
-
placeholder: "Page number"
|
93
|
-
}, null, 8, ["modelValue"]),
|
94
|
-
e(t(E)),
|
95
|
-
e(t(q))
|
96
|
-
]),
|
97
|
-
_: 2
|
98
|
-
}, 1024)
|
99
|
-
]),
|
100
|
-
_: 1
|
101
|
-
}, 8, ["total", "itemsPerPage", "page"])
|
102
|
-
]));
|
103
|
-
}
|
104
|
-
});
|
105
|
-
export {
|
106
|
-
le as _
|
107
|
-
};
|