@soft-stech/bootsman-ui-shadcn 2.0.20 → 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.
Files changed (45) hide show
  1. package/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-BOuWIF4c.js +179 -0
  2. package/dist/BuiScrollArea.vue_vue_type_script_setup_true_lang-lyWD8KAT.js +144 -0
  3. package/dist/{BuiScrollBar.vue_vue_type_script_setup_true_lang-cV0od8j0.js → BuiScrollBar.vue_vue_type_script_setup_true_lang-BCvjzEmb.js} +4 -4
  4. package/dist/BuiTable.vue_vue_type_script_setup_true_lang-BQRl7YR1.js +37 -0
  5. package/dist/{BuiTableEmpty.vue_vue_type_script_setup_true_lang-Da4qHIWo.js → BuiTableEmpty.vue_vue_type_script_setup_true_lang-CuffOAuP.js} +1 -1
  6. package/dist/BuiTableRow.vue_vue_type_script_setup_true_lang-BQnadEa7.js +51 -0
  7. package/dist/components/input/index.js +22 -22
  8. package/dist/components/pagination/BuiPaginationCommon.js +1 -1
  9. package/dist/components/pagination/BuiPaginationCommon.vue.d.ts +4 -0
  10. package/dist/components/pagination/index.js +1 -1
  11. package/dist/components/scroll-area/BuiScrollArea.js +1 -1
  12. package/dist/components/scroll-area/BuiScrollArea.vue.d.ts +256 -2
  13. package/dist/components/scroll-area/BuiScrollBar.js +1 -1
  14. package/dist/components/scroll-area/index.js +2 -2
  15. package/dist/components/table/BuiDataTable.vue.d.ts +9 -4
  16. package/dist/components/table/BuiTable.js +1 -1
  17. package/dist/components/table/BuiTable.vue.d.ts +1487 -2
  18. package/dist/components/table/BuiTableEmpty.js +1 -1
  19. package/dist/components/table/BuiTableRow.js +1 -1
  20. package/dist/components/table/index.d.ts +1 -0
  21. package/dist/components/table/index.js +726 -663
  22. package/dist/index.js +6 -6
  23. package/dist/lib/useGlobalCursor.d.ts +4 -0
  24. package/dist/lib/useGlobalCursor.js +15 -0
  25. package/dist/lib/useResizeColumns.d.ts +3812 -0
  26. package/dist/lib/useResizeColumns.js +97 -79
  27. package/dist/style.css +1 -1
  28. package/package.json +1 -1
  29. package/src/components/input/BuiInput.vue +1 -1
  30. package/src/components/pagination/BuiPaginationCommon.vue +16 -4
  31. package/src/components/scroll-area/BuiScrollArea.vue +9 -2
  32. package/src/components/scroll-area/BuiScrollBar.vue +4 -4
  33. package/src/components/table/BuiDataTable.vue +152 -34
  34. package/src/components/table/BuiTable.vue +12 -3
  35. package/src/components/table/BuiTableRow.vue +6 -0
  36. package/src/components/table/index.ts +2 -0
  37. package/src/lib/useGlobalCursor.ts +17 -0
  38. package/src/lib/useResizeColumns.ts +151 -42
  39. package/src/stories/BuiDataTable.stories.ts +13 -0
  40. package/src/stories/components/BuiDataTableStory.vue +4 -4
  41. package/src/stories/components/BuiDataTableWithScrollStory.vue +292 -0
  42. package/dist/BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DhSRYKth.js +0 -170
  43. package/dist/BuiScrollArea.vue_vue_type_script_setup_true_lang-XkIzRs-G.js +0 -141
  44. package/dist/BuiTable.vue_vue_type_script_setup_true_lang-Dd_dkcy4.js +0 -30
  45. 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,141 +0,0 @@
1
- import { defineComponent as p, ref as m, computed as d, watch as S, createBlock as C, createCommentVNode as k, openBlock as f, unref as r, mergeProps as v, withCtx as u, renderSlot as _, toRefs as $, onMounted as x, createElementBlock as V, Fragment as B, createElementVNode as X, createVNode as i, normalizeStyle as H, createTextVNode as N } from "vue";
2
- import { i as w, S as R, _ as Y } from "./BuiScrollBar.vue_vue_type_script_setup_true_lang-cV0od8j0.js";
3
- import { u as E } from "./useForwardExpose-DmyWSR4F.js";
4
- import { P as b } from "./Primitive-EBuBc72_.js";
5
- import { useResizeObserver as A } from "@vueuse/core";
6
- import { u as q } from "./useNonce-DM9DidHz.js";
7
- import { g as W } from "./utils-DhVytAXN.js";
8
- var P = /* @__PURE__ */ p({
9
- __name: "ScrollAreaCornerImpl",
10
- setup(c) {
11
- const e = w(), l = m(0), o = m(0), s = d(() => !!l.value && !!o.value);
12
- function a() {
13
- const t = e.scrollbarX.value?.offsetHeight || 0;
14
- e.onCornerHeightChange(t), o.value = t;
15
- }
16
- function n() {
17
- const t = e.scrollbarY.value?.offsetWidth || 0;
18
- e.onCornerWidthChange(t), l.value = t;
19
- }
20
- return A(e.scrollbarX.value, a), A(e.scrollbarY.value, n), S(() => e.scrollbarX.value, a), S(() => e.scrollbarY.value, n), (t, y) => s.value ? (f(), C(r(b), v({
21
- key: 0,
22
- style: {
23
- width: `${l.value}px`,
24
- height: `${o.value}px`,
25
- position: "absolute",
26
- right: r(e).dir.value === "ltr" ? 0 : void 0,
27
- left: r(e).dir.value === "rtl" ? 0 : void 0,
28
- bottom: 0
29
- }
30
- }, t.$parent?.$props), {
31
- default: u(() => [_(t.$slots, "default")]),
32
- _: 3
33
- }, 16, ["style"])) : k("v-if", !0);
34
- }
35
- }), z = P, I = /* @__PURE__ */ p({
36
- __name: "ScrollAreaCorner",
37
- props: {
38
- asChild: {
39
- type: Boolean,
40
- required: !1
41
- },
42
- as: {
43
- type: null,
44
- required: !1
45
- }
46
- },
47
- setup(c) {
48
- const e = c, { forwardRef: l } = E(), o = w(), s = d(() => !!o.scrollbarX.value && !!o.scrollbarY.value), a = d(() => o.type.value !== "scroll" && s.value);
49
- return (n, t) => a.value ? (f(), C(z, v({ key: 0 }, e, { ref: r(l) }), {
50
- default: u(() => [_(n.$slots, "default")]),
51
- _: 3
52
- }, 16)) : k("v-if", !0);
53
- }
54
- }), F = I, j = /* @__PURE__ */ p({
55
- inheritAttrs: !1,
56
- __name: "ScrollAreaViewport",
57
- props: {
58
- nonce: {
59
- type: String,
60
- required: !1
61
- },
62
- asChild: {
63
- type: Boolean,
64
- required: !1
65
- },
66
- as: {
67
- type: null,
68
- required: !1
69
- }
70
- },
71
- setup(c, { expose: e }) {
72
- const l = c, { nonce: o } = $(l), s = q(o), a = w(), n = m();
73
- x(() => {
74
- a.onViewportChange(n.value), a.onContentChange(y.value);
75
- }), e({ viewportElement: n });
76
- const { forwardRef: t, currentElement: y } = E();
77
- return (h, g) => (f(), V(B, null, [X("div", v({
78
- ref_key: "viewportElement",
79
- ref: n,
80
- "data-reka-scroll-area-viewport": "",
81
- style: {
82
- overflowX: r(a).scrollbarXEnabled.value ? "scroll" : "hidden",
83
- overflowY: r(a).scrollbarYEnabled.value ? "scroll" : "hidden"
84
- }
85
- }, h.$attrs, { tabindex: 0 }), [i(r(b), {
86
- ref: r(t),
87
- style: H({ minWidth: r(a).scrollbarXEnabled.value ? "fit-content" : void 0 }),
88
- "as-child": l.asChild,
89
- as: h.as
90
- }, {
91
- default: u(() => [_(h.$slots, "default")]),
92
- _: 3
93
- }, 8, [
94
- "style",
95
- "as-child",
96
- "as"
97
- ])], 16), i(r(b), {
98
- as: "style",
99
- nonce: r(s)
100
- }, {
101
- default: u(() => g[0] || (g[0] = [N(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-scroll-area-viewport] { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; } [data-reka-scroll-area-viewport]::-webkit-scrollbar { display:none; } ")])),
102
- _: 1,
103
- __: [0]
104
- }, 8, ["nonce"])], 64));
105
- }
106
- }), D = j;
107
- const Q = /* @__PURE__ */ p({
108
- __name: "BuiScrollArea",
109
- props: {
110
- type: {},
111
- dir: {},
112
- scrollHideDelay: {},
113
- asChild: { type: Boolean },
114
- as: {},
115
- class: {}
116
- },
117
- setup(c) {
118
- const e = c, l = d(() => {
119
- const { class: o, ...s } = e;
120
- return s;
121
- });
122
- return (o, s) => (f(), C(r(R), v(l.value, {
123
- class: r(W)("relative overflow-hidden", e.class)
124
- }), {
125
- default: u(() => [
126
- i(r(D), { class: "h-full w-full rounded-[inherit]" }, {
127
- default: u(() => [
128
- _(o.$slots, "default")
129
- ]),
130
- _: 3
131
- }),
132
- i(Y),
133
- i(r(F))
134
- ]),
135
- _: 3
136
- }, 16, ["class"]));
137
- }
138
- });
139
- export {
140
- Q as _
141
- };
@@ -1,30 +0,0 @@
1
- import { defineComponent as a, createBlock as n, openBlock as i, unref as o, withCtx as c, renderSlot as r, createElementVNode as s, createVNode as m, normalizeClass as f } from "vue";
2
- import { _ as p } from "./BuiScrollArea.vue_vue_type_script_setup_true_lang-XkIzRs-G.js";
3
- import { _ } from "./BuiScrollBar.vue_vue_type_script_setup_true_lang-cV0od8j0.js";
4
- import { g as d } from "./utils-DhVytAXN.js";
5
- const u = { class: "flex min-h-[90px] grow flex-col" }, g = /* @__PURE__ */ a({
6
- __name: "BuiTable",
7
- props: {
8
- class: {}
9
- },
10
- setup(t) {
11
- const l = t;
12
- return (e, b) => (i(), n(o(p), { class: "border-border/16 w-full grow overflow-auto rounded-sm border" }, {
13
- default: c(() => [
14
- r(e.$slots, "columnVisibility"),
15
- s("div", u, [
16
- s("table", {
17
- class: f(o(d)("h-full w-full caption-top text-sm", l.class))
18
- }, [
19
- r(e.$slots, "default")
20
- ], 2)
21
- ]),
22
- m(o(_), { orientation: "horizontal" })
23
- ]),
24
- _: 3
25
- }));
26
- }
27
- });
28
- export {
29
- g as _
30
- };
@@ -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
- };