@soft-stech/bootsman-ui-shadcn 1.4.24 → 1.4.26

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 (27) hide show
  1. package/dist/BuiDataTableColumnList.vue_vue_type_script_setup_true_lang-DsrMMFKz.js +1338 -0
  2. package/dist/BuiTable.vue_vue_type_script_setup_true_lang-QoPGiEYZ.js +28 -0
  3. package/dist/{BuiTableHeader.vue_vue_type_script_setup_true_lang-B2getNR7.js → BuiTableHeader.vue_vue_type_script_setup_true_lang-BXgL487_.js} +1 -1
  4. package/dist/{BuiTooltipContent.vue_vue_type_script_setup_true_lang-ZfTnapKW.js → BuiTooltipContent.vue_vue_type_script_setup_true_lang-CZ1I3edy.js} +3 -3
  5. package/dist/assets/main.css +1 -1
  6. package/dist/components/ui/table/BuiDataTable.vue.d.ts +12 -2
  7. package/dist/components/ui/table/BuiDataTableColumnList.js +4 -0
  8. package/dist/components/ui/table/BuiDataTableColumnList.vue.d.ts +24 -0
  9. package/dist/components/ui/table/BuiTable.js +1 -1
  10. package/dist/components/ui/table/BuiTable.vue.d.ts +1 -0
  11. package/dist/components/ui/table/BuiTableHeader.js +1 -1
  12. package/dist/components/ui/table/index.d.ts +1 -0
  13. package/dist/components/ui/table/index.js +310 -190
  14. package/dist/components/ui/tooltip/BuiTooltipContent.js +1 -1
  15. package/dist/components/ui/tooltip/index.js +1 -1
  16. package/dist/index.js +18 -16
  17. package/dist/variables.css +1 -1
  18. package/package.json +7 -5
  19. package/src/assets/variables.css +9 -8
  20. package/src/components/stories/BuiDataTable.story.vue +20 -4
  21. package/src/components/ui/table/BuiDataTable.vue +136 -20
  22. package/src/components/ui/table/BuiDataTableColumnList.vue +32 -0
  23. package/src/components/ui/table/BuiTable.vue +1 -0
  24. package/src/components/ui/table/BuiTableHeader.vue +2 -2
  25. package/src/components/ui/table/index.ts +1 -0
  26. package/src/components/ui/tooltip/BuiTooltipContent.vue +1 -1
  27. package/dist/BuiTable.vue_vue_type_script_setup_true_lang-D8Tseif4.js +0 -27
@@ -1,47 +1,66 @@
1
- import { _ as U } from "../../../BuiTable.vue_vue_type_script_setup_true_lang-D8Tseif4.js";
2
- import { _ as A } from "../../../BuiTableBody.vue_vue_type_script_setup_true_lang-DblqmDim.js";
3
- import { _ as h } from "../../../BuiTableCell.vue_vue_type_script_setup_true_lang-CYBx0oJL.js";
4
- import { _ as O } from "../../../BuiTableHead.vue_vue_type_script_setup_true_lang-BDSRArVd.js";
5
- import { _ as j } from "../../../BuiTableHeader.vue_vue_type_script_setup_true_lang-B2getNR7.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 t, 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 ze } 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
- import { _ as X } from "../../../BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-BiD89zzH.js";
14
- import { _ as Z } from "../../../variables-CtE99jPc.js";
15
- import "vee-validate";
16
- import { v as z } from "../../../utils-CwP7Up6y.js";
17
- import { FlexRender as H, useVueTable as ee, getCoreRowModel as oe, getPaginationRowModel as te, getSortedRowModel as ne } from "@tanstack/vue-table";
18
- const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
1
+ import { _ as J } from "../../../BuiTable.vue_vue_type_script_setup_true_lang-QoPGiEYZ.js";
2
+ import { _ as Q } from "../../../BuiTableBody.vue_vue_type_script_setup_true_lang-DblqmDim.js";
3
+ import { _ as O } from "../../../BuiTableCell.vue_vue_type_script_setup_true_lang-CYBx0oJL.js";
4
+ import { _ as X } from "../../../BuiTableHead.vue_vue_type_script_setup_true_lang-BDSRArVd.js";
5
+ import { _ as Z } from "../../../BuiTableHeader.vue_vue_type_script_setup_true_lang-BXgL487_.js";
6
+ import { _ as V } from "../../../BuiTableRow.vue_vue_type_script_setup_true_lang-Bl4nF6yV.js";
7
+ import { defineComponent as G, computed as w, openBlock as r, createElementBlock as d, Fragment as c, createBlock as f, unref as t, normalizeClass as ee, withCtx as a, renderSlot as y, renderList as z, normalizeStyle as K, createVNode as s, createCommentVNode as S, resolveDynamicComponent as oe, mergeModels as te, useModel as _, watchEffect as ne, ref as M, watch as le, createElementVNode as g, createTextVNode as h, toDisplayString as B } from "vue";
8
+ import { _ as so } from "../../../BuiTableCaption.vue_vue_type_script_setup_true_lang-CTEP1Sde.js";
9
+ import { _ as ae } from "../../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-BTyX0sT5.js";
10
+ import { _ as uo } from "../../../BuiTableFooter.vue_vue_type_script_setup_true_lang-CRyh8XF5.js";
11
+ import { _ as re } from "../../../BuiCollapsible.vue_vue_type_script_setup_true_lang-DjuQBjGZ.js";
12
+ import { _ as se } from "../../../BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-l-nmwAwq.js";
13
+ import { _ as ie } from "../../../BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-BiD89zzH.js";
14
+ import { _ as ue } from "../../../variables-CtE99jPc.js";
15
+ import { h as de, v as C, _ as me, g as ge } from "../../../utils-CwP7Up6y.js";
16
+ import { FlexRender as W, useVueTable as pe, getCoreRowModel as ce, getPaginationRowModel as fe, getSortedRowModel as be } from "@tanstack/vue-table";
17
+ import { _ as ye } from "../../../BuiCommand.vue_vue_type_script_setup_true_lang-BiBVfuW-.js";
18
+ import { _ as ve } from "../../../BuiCommandEmpty.vue_vue_type_script_setup_true_lang-BkPg_0iY.js";
19
+ import { _ as we } from "../../../BuiCommandInput.vue_vue_type_script_setup_true_lang-Dxua89Ba.js";
20
+ import { _ as Se } from "../../../BuiCommandList.vue_vue_type_script_setup_true_lang-CczssFsO.js";
21
+ import { _ as _e } from "../../../BuiPopover.vue_vue_type_script_setup_true_lang-CGkz30K2.js";
22
+ import { _ as Ce } from "../../../BuiPopoverTrigger.vue_vue_type_script_setup_true_lang-Du2ZN56l.js";
23
+ import { _ as he } from "../../../BuiPopoverContent.vue_vue_type_script_setup_true_lang-D5UGzl8u.js";
24
+ import { _ as ze } from "../../../BuiScrollArea.vue_vue_type_script_setup_true_lang-D-nqw_Ka.js";
25
+ import { _ as ke } from "../../../BuiDataTableColumnList.vue_vue_type_script_setup_true_lang-DsrMMFKz.js";
26
+ /**
27
+ * @license lucide-vue-next v0.441.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */
32
+ const $e = de("Settings2Icon", [
33
+ ["path", { d: "M20 7h-9", key: "3s1dr2" }],
34
+ ["path", { d: "M14 17H5", key: "gfn3mx" }],
35
+ ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
36
+ ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
37
+ ]), Be = "[!fake-empty!]", j = /* @__PURE__ */ G({
19
38
  __name: "BuiTableRowSubrow",
20
39
  props: {
21
40
  row: {},
22
41
  renderSubComponent: { type: Function },
23
42
  columns: {}
24
43
  },
25
- setup(f) {
26
- const o = f, C = v(() => o.row.original.name?.includes(ae));
27
- return (r, $) => (t(), u(d, null, [
28
- C.value ? S("", !0) : (t(), m(a(R), {
44
+ setup(p) {
45
+ const n = p, k = w(() => n.row.original.name?.includes(Be));
46
+ return (i, R) => (r(), d(c, null, [
47
+ k.value ? S("", !0) : (r(), f(t(V), {
29
48
  key: 0,
30
- "data-row-state": r.row.getIsSelected() ? "selected" : void 0,
31
- class: G(o.renderSubComponent?.(r.row) ? "border-b-0" : "")
49
+ "data-row-state": i.row.getIsSelected() ? "selected" : void 0,
50
+ class: ee(n.renderSubComponent?.(i.row) ? "border-b-0" : "")
32
51
  }, {
33
- actions: l(() => [
34
- c(r.$slots, "actions")
52
+ actions: a(() => [
53
+ y(i.$slots, "actions")
35
54
  ]),
36
- default: l(() => [
37
- (t(!0), u(d, null, y(r.row.getVisibleCells(), (w) => (t(), m(a(h), {
38
- key: w.id,
39
- style: F({ ...a(L)(w.column) })
55
+ default: a(() => [
56
+ (r(!0), d(c, null, z(i.row.getVisibleCells(), (v) => (r(), f(t(O), {
57
+ key: v.id,
58
+ style: K({ ...t(Y)(v.column) })
40
59
  }, {
41
- default: l(() => [
42
- p(a(H), {
43
- render: w.column.columnDef.cell,
44
- props: w.getContext()
60
+ default: a(() => [
61
+ s(t(W), {
62
+ render: v.column.columnDef.cell,
63
+ props: v.getContext()
45
64
  }, null, 8, ["render", "props"])
46
65
  ]),
47
66
  _: 2
@@ -49,20 +68,20 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
49
68
  ]),
50
69
  _: 3
51
70
  }, 8, ["data-row-state", "class"])),
52
- o.renderSubComponent?.(r.row) ? (t(), m(a(R), {
71
+ n.renderSubComponent?.(i.row) ? (r(), f(t(V), {
53
72
  key: 1,
54
- "data-row-state": r.row.getIsSelected() ? "selected" : void 0
73
+ "data-row-state": i.row.getIsSelected() ? "selected" : void 0
55
74
  }, {
56
- actions: l(() => [
57
- c(r.$slots, "actions")
75
+ actions: a(() => [
76
+ y(i.$slots, "actions")
58
77
  ]),
59
- default: l(() => [
60
- p(a(h), {
61
- colspan: r.columns.length,
78
+ default: a(() => [
79
+ s(t(O), {
80
+ colspan: i.columns.length,
62
81
  class: "pt-0"
63
82
  }, {
64
- default: l(() => [
65
- (t(), m(K(o.renderSubComponent?.(r.row)?.())))
83
+ default: a(() => [
84
+ (r(), f(oe(n.renderSubComponent?.(i.row)?.())))
66
85
  ]),
67
86
  _: 1
68
87
  }, 8, ["colspan"])
@@ -71,15 +90,15 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
71
90
  }, 8, ["data-row-state"])) : S("", !0)
72
91
  ], 64));
73
92
  }
74
- }), le = {
93
+ }), Re = {
75
94
  key: 0,
76
95
  class: "w-full py-3"
77
- }, re = { class: "mt-1 flex w-full items-center justify-between" }, se = { class: "relative -mb-[6px] inline-block rounded-t-lg bg-background px-4 py-2 text-sm font-medium shadow-top-shadow" }, ue = {
96
+ }, Ie = { class: "absolute right-0 top-0 z-10 h-10 bg-background" }, Pe = { class: "flex h-full items-center border-l border-border/[0.16] bg-foreground/[0.04] px-1" }, xe = ["onDblclick", "onMousedown", "className"], Me = { class: "mt-1 flex w-full items-center justify-between" }, Oe = { class: "relative -mb-[6px] inline-block rounded-t-lg bg-background px-4 py-2 text-sm font-medium shadow-top-shadow" }, Ve = {
78
97
  key: 1,
79
98
  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
- }, D = "#UNDEFINED#", _e = /* @__PURE__ */ x({
99
+ }, A = "#UNDEFINED#", lo = /* @__PURE__ */ G({
81
100
  __name: "BuiDataTable",
82
- props: /* @__PURE__ */ W({
101
+ props: /* @__PURE__ */ te({
83
102
  columns: {},
84
103
  data: {},
85
104
  pageSize: { default: 10 },
@@ -91,7 +110,9 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
91
110
  groupLabels: {},
92
111
  getRowId: {},
93
112
  renderSubComponent: {},
94
- freezeHeader: { type: Boolean }
113
+ freezeHeader: { type: Boolean },
114
+ columnSearchPlaceholder: { default: "Column name" },
115
+ columnSearchNotFound: { default: "Not found" }
95
116
  }, {
96
117
  sorting: {},
97
118
  sortingModifiers: {},
@@ -100,160 +121,258 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
100
121
  selection: {},
101
122
  selectionModifiers: {},
102
123
  columnVisibility: {},
103
- columnVisibilityModifiers: {}
124
+ columnVisibilityModifiers: {},
125
+ columnSizing: {},
126
+ columnSizingModifiers: {},
127
+ columnOrder: {},
128
+ columnOrderModifiers: {}
104
129
  }),
105
- emits: ["update:sorting", "update:pagination", "update:selection", "update:columnVisibility"],
106
- setup(f) {
107
- const o = f, C = k(f, "sorting"), r = k(f, "pagination"), $ = k(f, "selection"), w = k(f, "columnVisibility"), M = v(
108
- () => o.manualPagination ? o.totalItems : o.data.length
109
- ), g = ee({
130
+ emits: ["update:sorting", "update:pagination", "update:selection", "update:columnVisibility", "update:columnSizing", "update:columnOrder"],
131
+ setup(p) {
132
+ const n = p, k = _(p, "sorting"), i = _(p, "pagination"), R = _(p, "selection"), v = _(p, "columnVisibility"), T = _(p, "columnSizing"), b = _(p, "columnOrder"), N = w(
133
+ () => n.manualPagination ? n.totalItems : n.data.length
134
+ ), q = n.columns.map((e) => e.meta?.pinLeft && e.id ? e.id : "").filter(Boolean), u = pe({
110
135
  initialState: {
111
136
  // TODO: column freeze
112
- //columnPinning: { left: ['id'] },
113
- pagination: { pageSize: o.pageSize }
137
+ columnPinning: { left: q },
138
+ pagination: { pageSize: n.pageSize }
114
139
  },
115
140
  get data() {
116
- return o.data;
141
+ return n.data;
117
142
  },
118
143
  get columns() {
119
- return o.columns;
144
+ return n.columns;
120
145
  },
121
- getCoreRowModel: oe(),
122
- getPaginationRowModel: te(),
123
- getSortedRowModel: ne(),
146
+ getCoreRowModel: ce(),
147
+ getPaginationRowModel: fe(),
148
+ getSortedRowModel: be(),
124
149
  onSortingChange: (e) => {
125
- z(e, C);
150
+ C(e, k);
126
151
  },
127
152
  onPaginationChange: (e) => {
128
- z(e, r);
153
+ C(e, i);
129
154
  },
130
155
  onRowSelectionChange: (e) => {
131
- z(e, $);
156
+ C(e, R);
157
+ },
158
+ onColumnVisibilityChange: (e) => {
159
+ C(e, v);
160
+ },
161
+ onColumnSizingChange: (e) => {
162
+ C(e, T);
163
+ },
164
+ onColumnOrderChange: (e) => {
165
+ C(e, b);
132
166
  },
133
167
  autoResetPageIndex: !1,
134
- manualPagination: o.manualPagination,
168
+ manualPagination: n.manualPagination,
135
169
  // set to false to enable client-side pagination
136
- manualSorting: o.manualSorting,
170
+ manualSorting: n.manualSorting,
171
+ enableColumnResizing: !0,
172
+ columnResizeMode: "onChange",
173
+ columnResizeDirection: "ltr",
137
174
  state: {
138
175
  get sorting() {
139
- return C.value;
176
+ return k.value;
140
177
  },
141
178
  get pagination() {
142
- return r.value;
179
+ return i.value;
143
180
  },
144
181
  get rowSelection() {
145
- return $.value;
182
+ return R.value;
146
183
  },
147
184
  get columnVisibility() {
148
- return w.value;
185
+ return v.value;
186
+ },
187
+ get columnSizing() {
188
+ return T.value;
189
+ },
190
+ get columnOrder() {
191
+ return b.value;
149
192
  }
150
193
  },
151
- getRowId: o.getRowId
152
- }), T = v({
194
+ getRowId: n.getRowId
195
+ }), D = w({
153
196
  get() {
154
- return g.getState().pagination.pageSize;
197
+ return u.getState().pagination.pageSize;
155
198
  },
156
199
  set(e) {
157
- r.value && (r.value.pageSize = e, g.setPageSize(e), g.setPageIndex(0));
200
+ i.value && (i.value.pageSize = e, u.setPageSize(e), u.setPageIndex(0));
158
201
  }
159
- }), B = v({
202
+ }), $ = w({
160
203
  get() {
161
- return g.getState().pagination.pageIndex + 1;
204
+ return u.getState().pagination.pageIndex + 1;
162
205
  },
163
206
  set(e) {
164
- r.value && (r.value.pageIndex = e - 1, g.setPageIndex(e - 1));
207
+ i.value && (i.value.pageIndex = e - 1, u.setPageIndex(e - 1));
165
208
  }
166
209
  });
167
- Y(() => {
168
- const e = g.getPageCount();
169
- e && e < B.value && (B.value = e);
210
+ ne(() => {
211
+ const e = u.getPageCount();
212
+ e && e < $.value && ($.value = e);
170
213
  });
171
- const V = v(() => o.groupBy ? g.getRowModel().rows.reduce((e, n) => {
172
- const s = n.getValue(o.groupBy) ?? D;
173
- return e[s] = e[s] || [], e[s].push(n), e;
214
+ const H = w(() => n.groupBy ? u.getRowModel().rows.reduce((e, o) => {
215
+ const m = o.getValue(n.groupBy) ?? A;
216
+ return e[m] = e[m] || [], e[m].push(o), e;
174
217
  }, /* @__PURE__ */ Object.create(null)) : null);
175
- function N(e) {
176
- return (o.groupBy && o.groupLabels ? o.groupLabels[o.groupBy] || [] : [])[e];
218
+ function L(e) {
219
+ return (n.groupBy && n.groupLabels ? n.groupLabels[n.groupBy] || [] : [])[e];
177
220
  }
178
- return (e, n) => (t(), u(d, null, [
179
- e.$slots.caption ? (t(), u("div", le, [
180
- c(e.$slots, "caption", { table: a(g) })
221
+ const I = M(
222
+ u.getAllColumns().filter((e) => typeof e.accessorFn < "u" && e.getCanHide()).sort((e, o) => b.value ? b.value?.indexOf(e.id) < 0 && b.value?.indexOf(o.id) >= 0 ? 1 : b.value?.indexOf(e.id) >= 0 && b.value?.indexOf(o.id) < 0 ? -1 : b.value?.indexOf(e.id) - b.value?.indexOf(o.id) : 0)
223
+ ), E = w(() => I.value.map((e) => e.id)), F = M(!1), P = M(""), U = w(
224
+ () => u.getHeaderGroups().length > 0 ? u.getHeaderGroups()[0].headers : void 0
225
+ );
226
+ return le(E, () => {
227
+ u.setColumnOrder(E.value);
228
+ }), (e, o) => (r(), d(c, null, [
229
+ e.$slots.caption ? (r(), d("div", Re, [
230
+ y(e.$slots, "caption", { table: t(u) })
181
231
  ])) : S("", !0),
182
- p(a(U), null, {
183
- default: l(() => [
184
- p(a(j), {
185
- "freeze-header": o.freezeHeader
232
+ s(t(J), null, {
233
+ columnVisibility: a(() => [
234
+ s(t(_e), {
235
+ open: F.value,
236
+ "onUpdate:open": o[3] || (o[3] = (l) => F.value = l)
186
237
  }, {
187
- default: l(() => [
188
- (t(!0), u(d, null, y(a(g).getHeaderGroups(), (i) => (t(), m(a(R), {
189
- key: i.id
238
+ default: a(() => [
239
+ s(t(Ce), { "as-child": "" }, {
240
+ default: a(() => [
241
+ g("div", Ie, [
242
+ g("div", Pe, [
243
+ s(t(me), {
244
+ variant: "ghost",
245
+ class: "flex h-8 w-8 items-center justify-center text-foreground"
246
+ }, {
247
+ default: a(() => [
248
+ s(t($e), { class: "h-4 w-4 flex-shrink-0 opacity-50" })
249
+ ]),
250
+ _: 1
251
+ })
252
+ ])
253
+ ])
254
+ ]),
255
+ _: 1
256
+ }),
257
+ s(t(he), {
258
+ class: "w-[250px] p-0",
259
+ align: "start"
190
260
  }, {
191
- default: l(() => [
192
- (t(!0), u(d, null, y(i.headers, (s) => (t(), m(a(O), {
193
- key: s.id,
194
- style: F({ ...a(L)(s.column) }),
195
- "freeze-header": o.freezeHeader
196
- }, {
197
- default: l(() => [
198
- s.isPlaceholder ? S("", !0) : (t(), m(a(H), {
199
- key: 0,
200
- render: s.column.columnDef.header,
201
- props: s.getContext()
202
- }, null, 8, ["render", "props"]))
261
+ default: a(() => [
262
+ s(t(ye), null, {
263
+ default: a(() => [
264
+ s(t(we), {
265
+ placeholder: e.columnSearchPlaceholder,
266
+ modelValue: P.value,
267
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => P.value = l),
268
+ onInput: o[1] || (o[1] = (l) => P.value = l.target.value)
269
+ }, null, 8, ["placeholder", "modelValue"]),
270
+ s(t(Se), null, {
271
+ default: a(() => [
272
+ s(t(ze), { class: "h-[300px]" }, {
273
+ default: a(() => [
274
+ s(t(ve), null, {
275
+ default: a(() => [
276
+ h(B(e.columnSearchNotFound), 1)
277
+ ]),
278
+ _: 1
279
+ }),
280
+ s(t(ke), {
281
+ "columns-list": I.value,
282
+ "onUpdate:columnsList": o[2] || (o[2] = (l) => I.value = l)
283
+ }, null, 8, ["columns-list"])
284
+ ]),
285
+ _: 1
286
+ })
287
+ ]),
288
+ _: 1
289
+ })
203
290
  ]),
204
- _: 2
205
- }, 1032, ["style", "freeze-header"]))), 128))
291
+ _: 1
292
+ })
293
+ ]),
294
+ _: 1
295
+ })
296
+ ]),
297
+ _: 1
298
+ }, 8, ["open"])
299
+ ]),
300
+ default: a(() => [
301
+ U.value ? (r(), f(t(Z), {
302
+ key: 0,
303
+ "freeze-header": n.freezeHeader
304
+ }, {
305
+ default: a(() => [
306
+ (r(!0), d(c, null, z(U.value, (l) => (r(), f(t(X), {
307
+ key: l.id,
308
+ style: K({ ...t(Y)(l.column), width: l.getSize() + "px" }),
309
+ "freeze-header": n.freezeHeader
310
+ }, {
311
+ default: a(() => [
312
+ l.isPlaceholder ? S("", !0) : (r(), f(t(W), {
313
+ key: 0,
314
+ render: l.column.columnDef.header,
315
+ props: l.getContext()
316
+ }, null, 8, ["render", "props"])),
317
+ g("div", {
318
+ onDblclick: () => l.column.resetSize(),
319
+ onMousedown: (m) => l.getResizeHandler()?.(m),
320
+ className: t(ge)(
321
+ "absolute top-0 right-0 h-full w-1 bg-muted-foreground opacity-0 cursor-col-resize select-none touch-none hover:opacity-50",
322
+ l.column.getIsResizing() ? "bg-primary opacity-50" : ""
323
+ )
324
+ }, null, 40, xe)
206
325
  ]),
207
326
  _: 2
208
- }, 1024))), 128))
327
+ }, 1032, ["style", "freeze-header"]))), 128))
209
328
  ]),
210
329
  _: 1
211
- }, 8, ["freeze-header"]),
212
- p(a(A), null, {
213
- default: l(() => [
214
- a(g).getRowModel().rows?.length ? (t(), u(d, { key: 0 }, [
215
- o.groupBy && V.value ? (t(!0), u(d, { key: 0 }, y(V.value, (i, s) => (t(), m(a(J), {
330
+ }, 8, ["freeze-header"])) : S("", !0),
331
+ s(t(Q), null, {
332
+ default: a(() => [
333
+ t(u).getRowModel().rows?.length ? (r(), d(c, { key: 0 }, [
334
+ n.groupBy && H.value ? (r(!0), d(c, { key: 0 }, z(H.value, (l, m) => (r(), f(t(re), {
216
335
  asChild: "",
217
- key: s,
336
+ key: m,
218
337
  open: !0
219
338
  }, {
220
- default: l(() => [
221
- p(a(Q), { asChild: "" }, {
222
- default: l(() => [
223
- p(a(R), { class: "bg-foreground/[0.04]" }, {
224
- actions: l(() => [
225
- c(e.$slots, "groupActions", { group: s })
339
+ default: a(() => [
340
+ s(t(se), { asChild: "" }, {
341
+ default: a(() => [
342
+ s(t(V), { class: "bg-foreground/[0.04]" }, {
343
+ actions: a(() => [
344
+ y(e.$slots, "groupActions", { group: m })
226
345
  ]),
227
- default: l(() => [
228
- p(a(h), {
346
+ default: a(() => [
347
+ s(t(O), {
229
348
  colspan: e.columns.length,
230
349
  class: "!pb-0"
231
350
  }, {
232
- default: l(() => [
233
- b("div", re, [
234
- b("div", se, [
235
- n[2] || (n[2] = b("div", { class: "absolute -left-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
236
- n[3] || (n[3] = b("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
237
- n[4] || (n[4] = b("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
238
- n[5] || (n[5] = b("div", { class: "absolute -right-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
239
- n[6] || (n[6] = b("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
240
- n[7] || (n[7] = b("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
241
- n[8] || (n[8] = b("div", null, null, -1)),
242
- s === D ? (t(), u(d, { key: 0 }, [
243
- _(I(N(1)), 1)
244
- ], 64)) : (t(), u(d, { key: 1 }, [
245
- _(I(N(0)) + ": ", 1),
246
- e.$slots.groupName ? c(e.$slots, "groupName", {
351
+ default: a(() => [
352
+ g("div", Me, [
353
+ g("div", Oe, [
354
+ o[6] || (o[6] = g("div", { class: "absolute -left-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
355
+ o[7] || (o[7] = g("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
356
+ o[8] || (o[8] = g("div", { class: "absolute -left-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
357
+ o[9] || (o[9] = g("div", { class: "absolute -right-2 bottom-0 h-2 w-2 bg-background" }, null, -1)),
358
+ o[10] || (o[10] = g("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-background" }, null, -1)),
359
+ o[11] || (o[11] = g("div", { class: "absolute -right-4 bottom-0 h-4 w-4 rounded-lg bg-foreground/[0.04]" }, null, -1)),
360
+ o[12] || (o[12] = g("div", null, null, -1)),
361
+ m === A ? (r(), d(c, { key: 0 }, [
362
+ h(B(L(1)), 1)
363
+ ], 64)) : (r(), d(c, { key: 1 }, [
364
+ h(B(L(0)) + ": ", 1),
365
+ e.$slots.groupName ? y(e.$slots, "groupName", {
247
366
  key: 0,
248
- group: s
249
- }) : (t(), u(d, { key: 1 }, [
250
- _(I(s), 1)
367
+ group: m
368
+ }) : (r(), d(c, { key: 1 }, [
369
+ h(B(m), 1)
251
370
  ], 64))
252
371
  ], 64))
253
372
  ]),
254
- e.$slots.groupByRow ? c(e.$slots, "groupByRow", {
373
+ e.$slots.groupByRow ? y(e.$slots, "groupByRow", {
255
374
  key: 0,
256
- group: s
375
+ group: m
257
376
  }) : S("", !0)
258
377
  ])
259
378
  ]),
@@ -265,17 +384,17 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
265
384
  ]),
266
385
  _: 2
267
386
  }, 1024),
268
- p(a(X), { asChild: "" }, {
269
- default: l(() => [
270
- (t(!0), u(d, null, y(i, (P) => (t(), m(E, {
271
- key: P.id,
272
- columns: o.columns,
273
- row: P,
274
- renderSubComponent: o.renderSubComponent
387
+ s(t(ie), { asChild: "" }, {
388
+ default: a(() => [
389
+ (r(!0), d(c, null, z(l, (x) => (r(), f(j, {
390
+ key: x.id,
391
+ columns: n.columns,
392
+ row: x,
393
+ renderSubComponent: n.renderSubComponent
275
394
  }, {
276
- actions: l(() => [
277
- c(e.$slots, "rowActions", {
278
- row: P.original
395
+ actions: a(() => [
396
+ y(e.$slots, "rowActions", {
397
+ row: x.original
279
398
  })
280
399
  ]),
281
400
  _: 2
@@ -285,26 +404,26 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
285
404
  }, 1024)
286
405
  ]),
287
406
  _: 2
288
- }, 1024))), 128)) : (t(!0), u(d, { key: 1 }, y(a(g).getRowModel().rows, (i) => (t(), m(E, {
289
- key: i.id,
290
- columns: o.columns,
291
- row: i,
292
- renderSubComponent: o.renderSubComponent
407
+ }, 1024))), 128)) : (r(!0), d(c, { key: 1 }, z(t(u).getRowModel().rows, (l) => (r(), f(j, {
408
+ key: l.id,
409
+ columns: n.columns,
410
+ row: l,
411
+ renderSubComponent: n.renderSubComponent
293
412
  }, {
294
- actions: l(() => [
295
- c(e.$slots, "rowActions", {
296
- row: i.original
413
+ actions: a(() => [
414
+ y(e.$slots, "rowActions", {
415
+ row: l.original
297
416
  })
298
417
  ]),
299
418
  _: 2
300
419
  }, 1032, ["columns", "row", "renderSubComponent"]))), 128))
301
- ], 64)) : (t(), m(a(q), {
420
+ ], 64)) : (r(), f(t(ae), {
302
421
  key: 1,
303
422
  colspan: e.columns.length
304
423
  }, {
305
- default: l(() => [
306
- c(e.$slots, "nodata", {}, () => [
307
- n[9] || (n[9] = _("No data"))
424
+ default: a(() => [
425
+ y(e.$slots, "nodata", {}, () => [
426
+ o[13] || (o[13] = h("No data"))
308
427
  ])
309
428
  ]),
310
429
  _: 3
@@ -315,37 +434,38 @@ const ae = "[!fake-empty!]", E = /* @__PURE__ */ x({
315
434
  ]),
316
435
  _: 3
317
436
  }),
318
- e.showPagination && M.value > 0 ? (t(), u("div", ue, [
319
- p(a(Z), {
320
- total: M.value,
321
- pageIndex: B.value,
322
- "onUpdate:pageIndex": n[0] || (n[0] = (i) => B.value = i),
323
- pageSize: T.value,
324
- "onUpdate:pageSize": n[1] || (n[1] = (i) => T.value = i)
437
+ e.showPagination && N.value > 0 ? (r(), d("div", Ve, [
438
+ s(t(ue), {
439
+ total: N.value,
440
+ pageIndex: $.value,
441
+ "onUpdate:pageIndex": o[4] || (o[4] = (l) => $.value = l),
442
+ pageSize: D.value,
443
+ "onUpdate:pageSize": o[5] || (o[5] = (l) => D.value = l)
325
444
  }, null, 8, ["total", "pageIndex", "pageSize"])
326
445
  ])) : S("", !0)
327
446
  ], 64));
328
447
  }
329
448
  });
330
- function L(f) {
331
- const o = f.getIsPinned();
449
+ function Y(p) {
450
+ const n = p.getIsPinned();
332
451
  return {
333
- left: o === "left" ? "0" : void 0,
334
- position: o ? "sticky" : "relative",
335
- zIndex: o ? "1" : "0"
452
+ left: n === "left" ? "0" : void 0,
453
+ position: n ? "sticky" : "relative",
454
+ zIndex: n ? "1" : "0"
336
455
  };
337
456
  }
338
457
  export {
339
- _e as BuiDataTable,
340
- U as BuiTable,
341
- A as BuiTableBody,
342
- Pe as BuiTableCaption,
343
- h as BuiTableCell,
344
- q as BuiTableEmpty,
345
- ze as BuiTableFooter,
346
- O as BuiTableHead,
347
- j as BuiTableHeader,
348
- R as BuiTableRow,
349
- E as BuiTableRowSubrow,
350
- L as getPinningStyle
458
+ lo as BuiDataTable,
459
+ ke as BuiDataTableColumnList,
460
+ J as BuiTable,
461
+ Q as BuiTableBody,
462
+ so as BuiTableCaption,
463
+ O as BuiTableCell,
464
+ ae as BuiTableEmpty,
465
+ uo as BuiTableFooter,
466
+ X as BuiTableHead,
467
+ Z as BuiTableHeader,
468
+ V as BuiTableRow,
469
+ j as BuiTableRowSubrow,
470
+ Y as getPinningStyle
351
471
  };