@soft-stech/bootsman-ui-shadcn 2.0.21 → 2.0.22
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/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-BOuWIF4c.js +179 -0
- package/dist/{BuiScrollArea.vue_vue_type_script_setup_true_lang-O7VUcRC4.js → BuiScrollArea.vue_vue_type_script_setup_true_lang-lyWD8KAT.js} +1 -1
- package/dist/{BuiScrollBar.vue_vue_type_script_setup_true_lang-cV0od8j0.js → BuiScrollBar.vue_vue_type_script_setup_true_lang-BCvjzEmb.js} +4 -4
- package/dist/BuiTable.vue_vue_type_script_setup_true_lang-BQRl7YR1.js +37 -0
- package/dist/{BuiTableEmpty.vue_vue_type_script_setup_true_lang-Da4qHIWo.js → BuiTableEmpty.vue_vue_type_script_setup_true_lang-CuffOAuP.js} +1 -1
- package/dist/BuiTableRow.vue_vue_type_script_setup_true_lang-BQnadEa7.js +51 -0
- package/dist/components/pagination/BuiPaginationCommon.js +1 -1
- package/dist/components/pagination/BuiPaginationCommon.vue.d.ts +4 -0
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/scroll-area/BuiScrollArea.js +1 -1
- package/dist/components/scroll-area/BuiScrollBar.js +1 -1
- package/dist/components/scroll-area/index.js +2 -2
- package/dist/components/table/BuiDataTable.vue.d.ts +8 -4
- package/dist/components/table/BuiTable.js +1 -1
- package/dist/components/table/BuiTableEmpty.js +1 -1
- package/dist/components/table/BuiTableRow.js +1 -1
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.js +713 -672
- package/dist/index.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/pagination/BuiPaginationCommon.vue +16 -4
- package/src/components/scroll-area/BuiScrollBar.vue +4 -4
- package/src/components/table/BuiDataTable.vue +113 -23
- package/src/components/table/BuiTable.vue +1 -0
- package/src/components/table/BuiTableRow.vue +6 -0
- package/src/components/table/index.ts +2 -0
- package/src/stories/BuiDataTable.stories.ts +13 -0
- package/src/stories/components/BuiDataTableStory.vue +3 -3
- package/src/stories/components/BuiDataTableWithScrollStory.vue +292 -0
- package/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DhSRYKth.js +0 -170
- package/dist/BuiTable.vue_vue_type_script_setup_true_lang-CQpc0Sr1.js +0 -36
- package/dist/BuiTableRow.vue_vue_type_script_setup_true_lang-BJk8Yk1B.js +0 -54
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, computed as I, createBlock as $, openBlock as x, unref as n, normalizeProps as V, guardReactiveProps as w, withCtx as g, renderSlot as E, mergeModels as L, useModel as h, createVNode as i, createElementVNode as S, createElementBlock as M, createCommentVNode as b, toDisplayString as c, Fragment as R, renderList as z, createTextVNode as B } from "vue";
|
|
2
|
-
import { BuiInput as N } from "./components/input/index.js";
|
|
3
|
-
import "vee-validate";
|
|
4
|
-
import { i as k, P as q } from "./PaginationRoot-Xehp56La.js";
|
|
5
|
-
import { u as U } from "./useForwardExpose-DmyWSR4F.js";
|
|
6
|
-
import { P as j } from "./Primitive-EBuBc72_.js";
|
|
7
|
-
import "@vueuse/core";
|
|
8
|
-
import "./colorUtils-BgA4kYw8.js";
|
|
9
|
-
import { _ as C } from "./BuiSelect.vue_vue_type_script_setup_true_lang-BYtbdIZS.js";
|
|
10
|
-
import { _ as F } from "./BuiSelectValue.vue_vue_type_script_setup_true_lang-C3SieHyq.js";
|
|
11
|
-
import { _ as A } from "./BuiSelectTrigger.vue_vue_type_script_setup_true_lang-YgwOKyQg.js";
|
|
12
|
-
import { _ as D } from "./BuiSelectContent.vue_vue_type_script_setup_true_lang-DedLPTOu.js";
|
|
13
|
-
import { _ as T } from "./BuiSelectItem.vue_vue_type_script_setup_true_lang-LEr6XwVT.js";
|
|
14
|
-
import { _ as G } from "./BuiPaginationFirst.vue_vue_type_script_setup_true_lang-CQIWuH4J.js";
|
|
15
|
-
import { _ as H } from "./BuiPaginationLast.vue_vue_type_script_setup_true_lang-DPHBc8bO.js";
|
|
16
|
-
import { _ as J } from "./BuiPaginationNext.vue_vue_type_script_setup_true_lang-CiVMJM-x.js";
|
|
17
|
-
import { _ as K } from "./BuiPaginationPrev.vue_vue_type_script_setup_true_lang-C95kepR5.js";
|
|
18
|
-
function d(a, r) {
|
|
19
|
-
const e = r - a + 1;
|
|
20
|
-
return Array.from({ length: e }, (l, m) => m + a);
|
|
21
|
-
}
|
|
22
|
-
function O(a) {
|
|
23
|
-
return a.map((r) => typeof r == "number" ? {
|
|
24
|
-
type: "page",
|
|
25
|
-
value: r
|
|
26
|
-
} : { type: "ellipsis" });
|
|
27
|
-
}
|
|
28
|
-
const P = "ellipsis";
|
|
29
|
-
function Q(a, r, e, l) {
|
|
30
|
-
const t = r, p = Math.max(a - e, 1), u = Math.min(a + e, t);
|
|
31
|
-
if (l) {
|
|
32
|
-
const f = Math.min(2 * e + 5, r) - 2, s = p > 3 && Math.abs(t - f - 1 + 1) > 2 && Math.abs(p - 1) > 2, v = u < t - 2 && Math.abs(t - f) > 2 && Math.abs(t - u) > 2;
|
|
33
|
-
if (!s && v)
|
|
34
|
-
return [
|
|
35
|
-
...d(1, f),
|
|
36
|
-
P,
|
|
37
|
-
t
|
|
38
|
-
];
|
|
39
|
-
if (s && !v) {
|
|
40
|
-
const _ = d(t - f + 1, t);
|
|
41
|
-
return [
|
|
42
|
-
1,
|
|
43
|
-
P,
|
|
44
|
-
..._
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
if (s && v) {
|
|
48
|
-
const _ = d(p, u);
|
|
49
|
-
return [
|
|
50
|
-
1,
|
|
51
|
-
P,
|
|
52
|
-
..._,
|
|
53
|
-
P,
|
|
54
|
-
t
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
return d(1, t);
|
|
58
|
-
} else {
|
|
59
|
-
const o = e * 2 + 1;
|
|
60
|
-
return r < o ? d(1, t) : a <= e + 1 ? d(1, o) : r - a <= e ? d(r - o + 1, t) : d(p, u);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
var W = /* @__PURE__ */ y({
|
|
64
|
-
__name: "PaginationList",
|
|
65
|
-
props: {
|
|
66
|
-
asChild: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
required: !1
|
|
69
|
-
},
|
|
70
|
-
as: {
|
|
71
|
-
type: null,
|
|
72
|
-
required: !1
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
setup(a) {
|
|
76
|
-
const r = a;
|
|
77
|
-
U();
|
|
78
|
-
const e = k(), l = I(() => O(Q(e.page.value, e.pageCount.value, e.siblingCount.value, e.showEdges.value)));
|
|
79
|
-
return (m, t) => (x(), $(n(j), V(w(r)), {
|
|
80
|
-
default: g(() => [E(m.$slots, "default", { items: l.value })]),
|
|
81
|
-
_: 3
|
|
82
|
-
}, 16));
|
|
83
|
-
}
|
|
84
|
-
}), X = W;
|
|
85
|
-
const Y = { class: "text-muted-foreground text-sm" }, Z = { class: "text-muted-foreground text-sm" }, xe = /* @__PURE__ */ y({
|
|
86
|
-
__name: "BuiPaginationCommon",
|
|
87
|
-
props: /* @__PURE__ */ L({
|
|
88
|
-
total: {},
|
|
89
|
-
translations: {}
|
|
90
|
-
}, {
|
|
91
|
-
pageSize: { default: 10, required: !0 },
|
|
92
|
-
pageSizeModifiers: {},
|
|
93
|
-
pageIndex: { default: 1, required: !0 },
|
|
94
|
-
pageIndexModifiers: {}
|
|
95
|
-
}),
|
|
96
|
-
emits: ["update:pageSize", "update:pageIndex"],
|
|
97
|
-
setup(a) {
|
|
98
|
-
const r = [10, 20, 30, 40, 50], e = a, l = h(a, "pageSize"), m = h(a, "pageIndex"), t = I(() => Math.ceil(e.total / l.value)), p = I({
|
|
99
|
-
get() {
|
|
100
|
-
return String(l.value);
|
|
101
|
-
},
|
|
102
|
-
set(u) {
|
|
103
|
-
l.value = parseInt(u);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
return (u, o) => (x(), $(n(q), {
|
|
107
|
-
total: e.total,
|
|
108
|
-
itemsPerPage: l.value,
|
|
109
|
-
page: m.value,
|
|
110
|
-
"onUpdate:page": o[2] || (o[2] = (f) => m.value = f)
|
|
111
|
-
}, {
|
|
112
|
-
default: g(({ page: f }) => [
|
|
113
|
-
i(n(X), { class: "relative flex items-center justify-center gap-2" }, {
|
|
114
|
-
default: g(() => [
|
|
115
|
-
S("p", Y, c(u.translations?.itemsPerPage || "Items per page"), 1),
|
|
116
|
-
i(n(C), {
|
|
117
|
-
modelValue: p.value,
|
|
118
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) => p.value = s)
|
|
119
|
-
}, {
|
|
120
|
-
default: g(() => [
|
|
121
|
-
i(n(A), { class: "mr-2 w-[70px]" }, {
|
|
122
|
-
default: g(() => [
|
|
123
|
-
i(n(F), {
|
|
124
|
-
placeholder: l.value.toString()
|
|
125
|
-
}, null, 8, ["placeholder"])
|
|
126
|
-
]),
|
|
127
|
-
_: 1
|
|
128
|
-
}),
|
|
129
|
-
i(n(D), { side: "top" }, {
|
|
130
|
-
default: g(() => [
|
|
131
|
-
(x(), M(R, null, z(r, (s) => i(n(T), {
|
|
132
|
-
key: s,
|
|
133
|
-
value: s.toString()
|
|
134
|
-
}, {
|
|
135
|
-
default: g(() => [
|
|
136
|
-
B(c(s), 1)
|
|
137
|
-
]),
|
|
138
|
-
_: 2
|
|
139
|
-
}, 1032, ["value"])), 64))
|
|
140
|
-
]),
|
|
141
|
-
_: 1
|
|
142
|
-
})
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["modelValue"]),
|
|
146
|
-
t.value > 1 ? (x(), M(R, { key: 0 }, [
|
|
147
|
-
S("p", Z, c(u.translations?.page || "Page") + " " + c(f) + " " + c(u.translations?.of || "of") + " " + c(t.value), 1),
|
|
148
|
-
i(n(G)),
|
|
149
|
-
i(n(K)),
|
|
150
|
-
i(n(N), {
|
|
151
|
-
modelValue: m.value,
|
|
152
|
-
"onUpdate:modelValue": o[1] || (o[1] = (s) => m.value = s),
|
|
153
|
-
class: "w-28",
|
|
154
|
-
placeholder: "Page number"
|
|
155
|
-
}, null, 8, ["modelValue"]),
|
|
156
|
-
i(n(J)),
|
|
157
|
-
i(n(H))
|
|
158
|
-
], 64)) : b("", !0)
|
|
159
|
-
]),
|
|
160
|
-
_: 2
|
|
161
|
-
}, 1024)
|
|
162
|
-
]),
|
|
163
|
-
_: 1
|
|
164
|
-
}, 8, ["total", "itemsPerPage", "page"]));
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
export {
|
|
168
|
-
X as P,
|
|
169
|
-
xe as _
|
|
170
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineComponent as i, ref as t, createBlock as m, openBlock as p, unref as e, withCtx as _, renderSlot as s, createElementVNode as a, createVNode as d, normalizeClass as u } from "vue";
|
|
2
|
-
import { _ as b } from "./BuiScrollArea.vue_vue_type_script_setup_true_lang-O7VUcRC4.js";
|
|
3
|
-
import { _ as h } from "./BuiScrollBar.vue_vue_type_script_setup_true_lang-cV0od8j0.js";
|
|
4
|
-
import { g as w } from "./utils-DhVytAXN.js";
|
|
5
|
-
const x = { class: "flex min-h-[90px] w-full grow flex-col" }, y = /* @__PURE__ */ i({
|
|
6
|
-
__name: "BuiTable",
|
|
7
|
-
props: {
|
|
8
|
-
class: {}
|
|
9
|
-
},
|
|
10
|
-
setup(n, { expose: f }) {
|
|
11
|
-
const c = n, o = t(void 0), r = t(null);
|
|
12
|
-
return f({ tableRef: o, scrollAreaElementRef: r }), (l, k) => (p(), m(e(b), {
|
|
13
|
-
ref_key: "scrollAreaElementRef",
|
|
14
|
-
ref: r,
|
|
15
|
-
class: "border-border/16 w-full grow overflow-auto rounded-sm border"
|
|
16
|
-
}, {
|
|
17
|
-
default: _(() => [
|
|
18
|
-
s(l.$slots, "columnVisibility"),
|
|
19
|
-
a("div", x, [
|
|
20
|
-
a("table", {
|
|
21
|
-
ref_key: "tableRef",
|
|
22
|
-
ref: o,
|
|
23
|
-
class: u(e(w)("h-full caption-top text-sm", c.class))
|
|
24
|
-
}, [
|
|
25
|
-
s(l.$slots, "default")
|
|
26
|
-
], 2)
|
|
27
|
-
]),
|
|
28
|
-
d(e(h), { orientation: "horizontal" })
|
|
29
|
-
]),
|
|
30
|
-
_: 3
|
|
31
|
-
}, 512));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
export {
|
|
35
|
-
y as _
|
|
36
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineComponent as f, createBlock as p, createElementBlock as $, openBlock as l, unref as s, withCtx as d, createVNode as b, renderSlot as a, createElementVNode as w, normalizeClass as m } from "vue";
|
|
2
|
-
import { _ as v } from "./BuiContextMenu.vue_vue_type_script_setup_true_lang-CGtCNQsI.js";
|
|
3
|
-
import { _ as k } from "./BuiContextMenuTrigger.vue_vue_type_script_setup_true_lang-hfu_w_27.js";
|
|
4
|
-
import { g as i } from "./utils-DhVytAXN.js";
|
|
5
|
-
const _ = ["data-row-state"], B = ["data-row-state"], E = /* @__PURE__ */ f({
|
|
6
|
-
__name: "BuiTableRow",
|
|
7
|
-
props: {
|
|
8
|
-
class: {}
|
|
9
|
-
},
|
|
10
|
-
emits: ["mouseenter", "mouseleave"],
|
|
11
|
-
setup(u, { emit: c }) {
|
|
12
|
-
const n = u, o = c;
|
|
13
|
-
return (t, e) => t.$slots.actions ? (l(), p(s(v), { key: 0 }, {
|
|
14
|
-
default: d(() => [
|
|
15
|
-
b(s(k), { "as-child": "" }, {
|
|
16
|
-
default: d(() => [
|
|
17
|
-
w("tr", {
|
|
18
|
-
class: m(
|
|
19
|
-
s(i)(
|
|
20
|
-
"border-border/8 data-[row-state=selected]:bg-accent/8 border-b transition-colors",
|
|
21
|
-
n.class
|
|
22
|
-
)
|
|
23
|
-
),
|
|
24
|
-
"data-row-state": t.$attrs["data-row-state"],
|
|
25
|
-
onMouseenter: e[0] || (e[0] = (r) => o("mouseenter")),
|
|
26
|
-
onMouseleave: e[1] || (e[1] = (r) => o("mouseleave"))
|
|
27
|
-
}, [
|
|
28
|
-
a(t.$slots, "default")
|
|
29
|
-
], 42, _)
|
|
30
|
-
]),
|
|
31
|
-
_: 3
|
|
32
|
-
}),
|
|
33
|
-
a(t.$slots, "actions")
|
|
34
|
-
]),
|
|
35
|
-
_: 3
|
|
36
|
-
})) : (l(), $("tr", {
|
|
37
|
-
key: 1,
|
|
38
|
-
class: m(
|
|
39
|
-
s(i)(
|
|
40
|
-
"border-border/8 data-[row-state=selected]:bg-accent/8 border-b transition-colors",
|
|
41
|
-
n.class
|
|
42
|
-
)
|
|
43
|
-
),
|
|
44
|
-
"data-row-state": t.$attrs["data-row-state"],
|
|
45
|
-
onMouseenter: e[2] || (e[2] = (r) => o("mouseenter")),
|
|
46
|
-
onMouseleave: e[3] || (e[3] = (r) => o("mouseleave"))
|
|
47
|
-
}, [
|
|
48
|
-
a(t.$slots, "default")
|
|
49
|
-
], 42, B));
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
E as _
|
|
54
|
-
};
|