@soft-stech/bootsman-ui-shadcn 2.0.15 → 2.0.16
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/{BuiTableHeader.vue_vue_type_script_setup_true_lang-B6wyr0bg.js → BuiTableHeader.vue_vue_type_script_setup_true_lang-Di2FKUwD.js} +10 -12
- package/dist/components/table/BuiTableHeader.js +1 -1
- package/dist/components/table/index.js +133 -128
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/table/BuiDataTable.vue +53 -49
- package/src/components/table/BuiTableHeader.vue +1 -3
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as s, ref as a, createElementBlock as i, openBlock as o, normalizeClass as c, unref as n, renderSlot as h } from "vue";
|
|
2
|
+
import { g as p } from "./utils-DhVytAXN.js";
|
|
3
|
+
const v = /* @__PURE__ */ s({
|
|
4
4
|
__name: "BuiTableHeader",
|
|
5
5
|
props: {
|
|
6
6
|
class: {},
|
|
7
7
|
freezeHeader: { type: Boolean }
|
|
8
8
|
},
|
|
9
|
-
setup(t, { expose:
|
|
10
|
-
const e =
|
|
11
|
-
|
|
9
|
+
setup(t, { expose: l }) {
|
|
10
|
+
const e = a(null);
|
|
11
|
+
l({ headRef: e });
|
|
12
12
|
const r = t;
|
|
13
|
-
return (
|
|
13
|
+
return (d, f) => (o(), i("thead", {
|
|
14
14
|
ref_key: "headRef",
|
|
15
15
|
ref: e,
|
|
16
16
|
class: c(
|
|
17
|
-
n(
|
|
17
|
+
n(p)(
|
|
18
18
|
r.class,
|
|
19
19
|
r.freezeHeader ? "sticky top-0 z-1 [&_th:first-child>div>div]:pl-3 [&_th:last-child>div>div]:border-r-0 [&_th:last-child>div>div]:pr-14 [&_tr:last-child]:border-b-0" : "[&_th:first-child>div]:pl-3 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-14"
|
|
20
20
|
)
|
|
21
21
|
)
|
|
22
22
|
}, [
|
|
23
|
-
h("
|
|
24
|
-
p(l.$slots, "default")
|
|
25
|
-
])
|
|
23
|
+
h(d.$slots, "default")
|
|
26
24
|
], 2));
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
v as _
|
|
31
29
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as Rt } from "../../BuiTable.vue_vue_type_script_setup_true_lang-Dd_dkcy4.js";
|
|
2
2
|
import { _ as It } from "../../BuiTableBody.vue_vue_type_script_setup_true_lang-CZvFJVkb.js";
|
|
3
|
-
import { _ as
|
|
3
|
+
import { _ as $e } from "../../BuiTableCell.vue_vue_type_script_setup_true_lang-BzFROkZg.js";
|
|
4
4
|
import { _ as Mt } from "../../BuiTableHead.vue_vue_type_script_setup_true_lang-DA2KX8Pg.js";
|
|
5
|
-
import { _ as zt } from "../../BuiTableHeader.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as
|
|
7
|
-
import { defineComponent as rt, computed as F, ref as Y, createElementBlock as S, openBlock as c, Fragment as z, createBlock as O, createCommentVNode as I, unref as s, normalizeClass as
|
|
5
|
+
import { _ as zt } from "../../BuiTableHeader.vue_vue_type_script_setup_true_lang-Di2FKUwD.js";
|
|
6
|
+
import { _ as fe } from "../../BuiTableRow.vue_vue_type_script_setup_true_lang-BJk8Yk1B.js";
|
|
7
|
+
import { defineComponent as rt, computed as F, ref as Y, createElementBlock as S, openBlock as c, Fragment as z, createBlock as O, createCommentVNode as I, unref as s, normalizeClass as ce, withCtx as f, renderList as J, normalizeStyle as Ce, createVNode as v, renderSlot as x, resolveDynamicComponent as xt, mergeModels as Et, useModel as q, nextTick as Bt, watchEffect as _e, watch as xe, onBeforeMount as Dt, onMounted as Lt, createSlots as Ht, withModifiers as Ee, createTextVNode as W, toDisplayString as X, createElementVNode as P } from "vue";
|
|
8
8
|
import { _ as Ja } from "../../BuiTableCaption.vue_vue_type_script_setup_true_lang-Bgo7ZNsM.js";
|
|
9
9
|
import { _ as Ft } from "../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-Da4qHIWo.js";
|
|
10
10
|
import { _ as Qa } from "../../BuiTableFooter.vue_vue_type_script_setup_true_lang-CRD-qr8I.js";
|
|
@@ -51,10 +51,10 @@ const bn = kt("settings-2", [
|
|
|
51
51
|
setup(e) {
|
|
52
52
|
const t = e, n = F(() => t.row.original.name?.includes(vn)), o = Y(!1);
|
|
53
53
|
return (l, i) => (c(), S(z, null, [
|
|
54
|
-
n.value ? I("", !0) : (c(), O(s(
|
|
54
|
+
n.value ? I("", !0) : (c(), O(s(fe), {
|
|
55
55
|
key: 0,
|
|
56
56
|
"data-row-state": l.row.getIsSelected() ? "selected" : void 0,
|
|
57
|
-
class:
|
|
57
|
+
class: ce(
|
|
58
58
|
s(Te)(t.renderSubComponent?.(l.row) ? "border-b-0" : "", o.value ? "bg-accent/4!" : "")
|
|
59
59
|
),
|
|
60
60
|
onMouseenter: i[0] || (i[0] = (u) => o.value = !0),
|
|
@@ -64,12 +64,12 @@ const bn = kt("settings-2", [
|
|
|
64
64
|
x(l.$slots, "actions")
|
|
65
65
|
]),
|
|
66
66
|
default: f(() => [
|
|
67
|
-
(c(!0), S(z, null, J(l.row.getVisibleCells(), (u) => (c(), O(s(
|
|
67
|
+
(c(!0), S(z, null, J(l.row.getVisibleCells(), (u) => (c(), O(s($e), {
|
|
68
68
|
key: u.id,
|
|
69
69
|
style: Ce({ ...s(vt)(u.column) })
|
|
70
70
|
}, {
|
|
71
71
|
default: f(() => [
|
|
72
|
-
|
|
72
|
+
v(s(ot), {
|
|
73
73
|
render: u.column.columnDef.cell,
|
|
74
74
|
props: u.getContext()
|
|
75
75
|
}, null, 8, ["render", "props"])
|
|
@@ -79,10 +79,10 @@ const bn = kt("settings-2", [
|
|
|
79
79
|
]),
|
|
80
80
|
_: 3
|
|
81
81
|
}, 8, ["data-row-state", "class"])),
|
|
82
|
-
t.renderSubComponent?.(l.row) ? (c(), O(s(
|
|
82
|
+
t.renderSubComponent?.(l.row) ? (c(), O(s(fe), {
|
|
83
83
|
key: 1,
|
|
84
84
|
"data-row-state": l.row.getIsSelected() ? "selected" : void 0,
|
|
85
|
-
class:
|
|
85
|
+
class: ce(s(Te)(o.value ? "bg-accent/4!" : "")),
|
|
86
86
|
onMouseenter: i[2] || (i[2] = (u) => o.value = !0),
|
|
87
87
|
onMouseleave: i[3] || (i[3] = (u) => o.value = !1)
|
|
88
88
|
}, {
|
|
@@ -90,7 +90,7 @@ const bn = kt("settings-2", [
|
|
|
90
90
|
x(l.$slots, "actions")
|
|
91
91
|
]),
|
|
92
92
|
default: f(() => [
|
|
93
|
-
|
|
93
|
+
v(s($e), {
|
|
94
94
|
colspan: l.columns.length,
|
|
95
95
|
class: "pt-0"
|
|
96
96
|
}, {
|
|
@@ -127,7 +127,7 @@ function se(e) {
|
|
|
127
127
|
function oe(e) {
|
|
128
128
|
return e != null && typeof e == "object";
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var pe = Array.isArray;
|
|
131
131
|
function st(e) {
|
|
132
132
|
var t = typeof e;
|
|
133
133
|
return e != null && (t == "object" || t == "function");
|
|
@@ -139,8 +139,8 @@ function lt(e) {
|
|
|
139
139
|
var t = se(e);
|
|
140
140
|
return t == Pn || t == jn || t == An || t == Rn;
|
|
141
141
|
}
|
|
142
|
-
var
|
|
143
|
-
var e = /[^.]+$/.exec(
|
|
142
|
+
var he = B["__core-js_shared__"], Le = (function() {
|
|
143
|
+
var e = /[^.]+$/.exec(he && he.keys && he.keys.IE_PROTO || "");
|
|
144
144
|
return e ? "Symbol(src)_1." + e : "";
|
|
145
145
|
})();
|
|
146
146
|
function In(e) {
|
|
@@ -224,21 +224,21 @@ function jr(e) {
|
|
|
224
224
|
return e(t);
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
var pt = typeof exports == "object" && exports && !exports.nodeType && exports, re = pt && typeof module == "object" && module && !module.nodeType && module, Rr = re && re.exports === pt,
|
|
227
|
+
var pt = typeof exports == "object" && exports && !exports.nodeType && exports, re = pt && typeof module == "object" && module && !module.nodeType && module, Rr = re && re.exports === pt, we = Rr && at.process, Ne = (function() {
|
|
228
228
|
try {
|
|
229
229
|
var e = re && re.require && re.require("util").types;
|
|
230
|
-
return e ||
|
|
230
|
+
return e || we && we.binding && we.binding("util");
|
|
231
231
|
} catch {
|
|
232
232
|
}
|
|
233
233
|
})(), Ue = Ne && Ne.isTypedArray, gt = Ue ? jr(Ue) : Pr, Ir = Object.prototype, Mr = Ir.hasOwnProperty;
|
|
234
234
|
function zr(e, t) {
|
|
235
|
-
var n =
|
|
235
|
+
var n = pe(e), o = !n && er(e), l = !n && !o && Ae(e), i = !n && !o && !l && gt(e), u = n || o || l || i, p = u ? Yn(e.length, String) : [], y = p.length;
|
|
236
236
|
for (var m in e)
|
|
237
237
|
Mr.call(e, m) && !(u && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
238
238
|
(m == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
239
239
|
l && (m == "offset" || m == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
240
240
|
i && (m == "buffer" || m == "byteLength" || m == "byteOffset") || // Skip index properties.
|
|
241
|
-
kn(m,
|
|
241
|
+
kn(m, y))) && p.push(m);
|
|
242
242
|
return p;
|
|
243
243
|
}
|
|
244
244
|
function xr(e, t) {
|
|
@@ -300,7 +300,7 @@ U.prototype.set = Yr;
|
|
|
300
300
|
function Jr() {
|
|
301
301
|
this.__data__ = [], this.size = 0;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function me(e, t) {
|
|
304
304
|
for (var n = e.length; n--; )
|
|
305
305
|
if (ut(e[n][0], t))
|
|
306
306
|
return n;
|
|
@@ -308,21 +308,21 @@ function ge(e, t) {
|
|
|
308
308
|
}
|
|
309
309
|
var Zr = Array.prototype, Qr = Zr.splice;
|
|
310
310
|
function eo(e) {
|
|
311
|
-
var t = this.__data__, n =
|
|
311
|
+
var t = this.__data__, n = me(t, e);
|
|
312
312
|
if (n < 0)
|
|
313
313
|
return !1;
|
|
314
314
|
var o = t.length - 1;
|
|
315
315
|
return n == o ? t.pop() : Qr.call(t, n, 1), --this.size, !0;
|
|
316
316
|
}
|
|
317
317
|
function to(e) {
|
|
318
|
-
var t = this.__data__, n =
|
|
318
|
+
var t = this.__data__, n = me(t, e);
|
|
319
319
|
return n < 0 ? void 0 : t[n][1];
|
|
320
320
|
}
|
|
321
321
|
function no(e) {
|
|
322
|
-
return
|
|
322
|
+
return me(this.__data__, e) > -1;
|
|
323
323
|
}
|
|
324
324
|
function ro(e, t) {
|
|
325
|
-
var n = this.__data__, o =
|
|
325
|
+
var n = this.__data__, o = me(n, e);
|
|
326
326
|
return o < 0 ? (++this.size, n.push([e, t])) : n[o][1] = t, this;
|
|
327
327
|
}
|
|
328
328
|
function D(e) {
|
|
@@ -349,22 +349,22 @@ function ao(e) {
|
|
|
349
349
|
var t = typeof e;
|
|
350
350
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function be(e, t) {
|
|
353
353
|
var n = e.__data__;
|
|
354
354
|
return ao(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
|
|
355
355
|
}
|
|
356
356
|
function io(e) {
|
|
357
|
-
var t =
|
|
357
|
+
var t = be(this, e).delete(e);
|
|
358
358
|
return this.size -= t ? 1 : 0, t;
|
|
359
359
|
}
|
|
360
360
|
function so(e) {
|
|
361
|
-
return
|
|
361
|
+
return be(this, e).get(e);
|
|
362
362
|
}
|
|
363
363
|
function lo(e) {
|
|
364
|
-
return
|
|
364
|
+
return be(this, e).has(e);
|
|
365
365
|
}
|
|
366
366
|
function uo(e, t) {
|
|
367
|
-
var n =
|
|
367
|
+
var n = be(this, e), o = n.size;
|
|
368
368
|
return n.set(e, t), this.size += n.size == o ? 0 : 1, this;
|
|
369
369
|
}
|
|
370
370
|
function k(e) {
|
|
@@ -434,7 +434,7 @@ var ho = Object.prototype, wo = ho.propertyIsEnumerable, Ve = Object.getOwnPrope
|
|
|
434
434
|
} : _o;
|
|
435
435
|
function $o(e, t, n) {
|
|
436
436
|
var o = t(e);
|
|
437
|
-
return
|
|
437
|
+
return pe(e) ? o : fo(o, n(e));
|
|
438
438
|
}
|
|
439
439
|
function ke(e) {
|
|
440
440
|
return $o(e, Hr, So);
|
|
@@ -464,13 +464,13 @@ function Io(e) {
|
|
|
464
464
|
function Mo(e) {
|
|
465
465
|
return this.__data__.has(e);
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function ge(e) {
|
|
468
468
|
var t = -1, n = e == null ? 0 : e.length;
|
|
469
469
|
for (this.__data__ = new k(); ++t < n; )
|
|
470
470
|
this.add(e[t]);
|
|
471
471
|
}
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
ge.prototype.add = ge.prototype.push = Io;
|
|
473
|
+
ge.prototype.has = Mo;
|
|
474
474
|
function zo(e, t) {
|
|
475
475
|
for (var n = -1, o = e == null ? 0 : e.length; ++n < o; )
|
|
476
476
|
if (t(e[n], n, e))
|
|
@@ -482,13 +482,13 @@ function xo(e, t) {
|
|
|
482
482
|
}
|
|
483
483
|
var Eo = 1, Bo = 2;
|
|
484
484
|
function mt(e, t, n, o, l, i) {
|
|
485
|
-
var u = n & Eo, p = e.length,
|
|
486
|
-
if (p !=
|
|
485
|
+
var u = n & Eo, p = e.length, y = t.length;
|
|
486
|
+
if (p != y && !(u && y > p))
|
|
487
487
|
return !1;
|
|
488
488
|
var m = i.get(e), j = i.get(t);
|
|
489
489
|
if (m && j)
|
|
490
490
|
return m == t && j == e;
|
|
491
|
-
var g = -1, _ = !0, C = n & Bo ? new
|
|
491
|
+
var g = -1, _ = !0, C = n & Bo ? new ge() : void 0;
|
|
492
492
|
for (i.set(e, t), i.set(t, e); ++g < p; ) {
|
|
493
493
|
var h = e[g], T = t[g];
|
|
494
494
|
if (o)
|
|
@@ -526,7 +526,7 @@ function Lo(e) {
|
|
|
526
526
|
n[++t] = o;
|
|
527
527
|
}), n;
|
|
528
528
|
}
|
|
529
|
-
var Ho = 1, Fo = 2, Go = "[object Boolean]", No = "[object Date]", Uo = "[object Error]", Vo = "[object Map]", ko = "[object Number]", Ko = "[object RegExp]", qo = "[object Set]", Wo = "[object String]", Xo = "[object Symbol]", Yo = "[object ArrayBuffer]", Jo = "[object DataView]", Ze = Z ? Z.prototype : void 0,
|
|
529
|
+
var Ho = 1, Fo = 2, Go = "[object Boolean]", No = "[object Date]", Uo = "[object Error]", Vo = "[object Map]", ko = "[object Number]", Ko = "[object RegExp]", qo = "[object Set]", Wo = "[object String]", Xo = "[object Symbol]", Yo = "[object ArrayBuffer]", Jo = "[object DataView]", Ze = Z ? Z.prototype : void 0, Se = Ze ? Ze.valueOf : void 0;
|
|
530
530
|
function Zo(e, t, n, o, l, i, u) {
|
|
531
531
|
switch (n) {
|
|
532
532
|
case Jo:
|
|
@@ -547,8 +547,8 @@ function Zo(e, t, n, o, l, i, u) {
|
|
|
547
547
|
case Vo:
|
|
548
548
|
var p = Do;
|
|
549
549
|
case qo:
|
|
550
|
-
var
|
|
551
|
-
if (p || (p = Lo), e.size != t.size && !
|
|
550
|
+
var y = o & Ho;
|
|
551
|
+
if (p || (p = Lo), e.size != t.size && !y)
|
|
552
552
|
return !1;
|
|
553
553
|
var m = u.get(e);
|
|
554
554
|
if (m)
|
|
@@ -557,17 +557,17 @@ function Zo(e, t, n, o, l, i, u) {
|
|
|
557
557
|
var j = mt(p(e), p(t), o, l, i, u);
|
|
558
558
|
return u.delete(e), j;
|
|
559
559
|
case Xo:
|
|
560
|
-
if (
|
|
561
|
-
return
|
|
560
|
+
if (Se)
|
|
561
|
+
return Se.call(e) == Se.call(t);
|
|
562
562
|
}
|
|
563
563
|
return !1;
|
|
564
564
|
}
|
|
565
565
|
var Qo = 1, ea = Object.prototype, ta = ea.hasOwnProperty;
|
|
566
566
|
function na(e, t, n, o, l, i) {
|
|
567
|
-
var u = n & Qo, p = ke(e),
|
|
568
|
-
if (
|
|
567
|
+
var u = n & Qo, p = ke(e), y = p.length, m = ke(t), j = m.length;
|
|
568
|
+
if (y != j && !u)
|
|
569
569
|
return !1;
|
|
570
|
-
for (var g =
|
|
570
|
+
for (var g = y; g--; ) {
|
|
571
571
|
var _ = p[g];
|
|
572
572
|
if (!(u ? _ in t : ta.call(t, _)))
|
|
573
573
|
return !1;
|
|
@@ -577,7 +577,7 @@ function na(e, t, n, o, l, i) {
|
|
|
577
577
|
return C == t && h == e;
|
|
578
578
|
var T = !0;
|
|
579
579
|
i.set(e, t), i.set(t, e);
|
|
580
|
-
for (var R = u; ++g <
|
|
580
|
+
for (var R = u; ++g < y; ) {
|
|
581
581
|
_ = p[g];
|
|
582
582
|
var M = e[_], E = t[_];
|
|
583
583
|
if (o)
|
|
@@ -596,16 +596,16 @@ function na(e, t, n, o, l, i) {
|
|
|
596
596
|
}
|
|
597
597
|
var ra = 1, Qe = "[object Arguments]", et = "[object Array]", de = "[object Object]", oa = Object.prototype, tt = oa.hasOwnProperty;
|
|
598
598
|
function aa(e, t, n, o, l, i) {
|
|
599
|
-
var u =
|
|
600
|
-
|
|
601
|
-
var j =
|
|
599
|
+
var u = pe(e), p = pe(t), y = u ? et : G(e), m = p ? et : G(t);
|
|
600
|
+
y = y == Qe ? de : y, m = m == Qe ? de : m;
|
|
601
|
+
var j = y == de, g = m == de, _ = y == m;
|
|
602
602
|
if (_ && Ae(e)) {
|
|
603
603
|
if (!Ae(t))
|
|
604
604
|
return !1;
|
|
605
605
|
u = !0, j = !1;
|
|
606
606
|
}
|
|
607
607
|
if (_ && !j)
|
|
608
|
-
return i || (i = new N()), u || gt(e) ? mt(e, t, n, o, l, i) : Zo(e, t,
|
|
608
|
+
return i || (i = new N()), u || gt(e) ? mt(e, t, n, o, l, i) : Zo(e, t, y, n, o, l, i);
|
|
609
609
|
if (!(n & ra)) {
|
|
610
610
|
var C = j && tt.call(e, "__wrapped__"), h = g && tt.call(t, "__wrapped__");
|
|
611
611
|
if (C || h) {
|
|
@@ -674,7 +674,7 @@ const sa = {
|
|
|
674
674
|
resetSize: "Reset size",
|
|
675
675
|
sortAsc: "Sort ascending",
|
|
676
676
|
sortDesc: "Sort descending"
|
|
677
|
-
}, n = e, o = q(e, "sorting"), l = q(e, "pagination"), i = q(e, "selection"), u = q(e, "columnVisibility"), p = q(e, "columnOrder"),
|
|
677
|
+
}, n = e, o = q(e, "sorting"), l = q(e, "pagination"), i = q(e, "selection"), u = q(e, "columnVisibility"), p = q(e, "columnOrder"), y = q(e, "columnSizing"), m = F(
|
|
678
678
|
() => n.manualPagination ? n.totalItems : n.data.length
|
|
679
679
|
), j = n.columns.map((r) => r.meta?.pinLeft && r.id ? r.id : "").filter(Boolean), g = qt({
|
|
680
680
|
initialState: {
|
|
@@ -743,7 +743,7 @@ const sa = {
|
|
|
743
743
|
l.value && (l.value.pageIndex = r - 1, g.setPageIndex(r - 1));
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
|
-
|
|
746
|
+
_e(() => {
|
|
747
747
|
const r = g.getPageCount();
|
|
748
748
|
r && r < C.value && (C.value = r);
|
|
749
749
|
});
|
|
@@ -766,7 +766,7 @@ const sa = {
|
|
|
766
766
|
});
|
|
767
767
|
const le = Y(null), { height: yt } = dn(le), {
|
|
768
768
|
tableHeaderElement: Ie,
|
|
769
|
-
calculatedColumnSizing:
|
|
769
|
+
calculatedColumnSizing: ve,
|
|
770
770
|
isResizing: _t,
|
|
771
771
|
resizingCellId: ht,
|
|
772
772
|
resetCells: ue,
|
|
@@ -778,17 +778,17 @@ const sa = {
|
|
|
778
778
|
isMouseUpOnHandler: Tt
|
|
779
779
|
} = pn();
|
|
780
780
|
Dt(() => {
|
|
781
|
-
|
|
781
|
+
ve.value = y.value;
|
|
782
782
|
}), Lt(() => {
|
|
783
|
-
le.value && (Ie.value = le.value, $t(
|
|
784
|
-
}),
|
|
785
|
-
ia(
|
|
783
|
+
le.value && (Ie.value = le.value, $t(y.value), Me()), K.value = {};
|
|
784
|
+
}), _e(() => {
|
|
785
|
+
ia(ve.value, y.value) || (y.value = ve.value);
|
|
786
786
|
}), cn(document, "mouseup", St);
|
|
787
|
-
const
|
|
787
|
+
const ye = (r) => Ie.value?.headRef?.querySelector(
|
|
788
788
|
`th[id="${r.id}_cell"]`
|
|
789
789
|
)?.querySelector("button[sorting-enabled]"), ze = (r) => {
|
|
790
790
|
const a = [];
|
|
791
|
-
return n.manualSorting &&
|
|
791
|
+
return n.manualSorting && ye(r) && a.push("sortAsc", "sortDesc"), n.enableColumnListControl && r.column.getCanHide() && a.push("hideColumn"), n.enableColumnResizing && a.push("resetSize"), a;
|
|
792
792
|
}, Ot = (r, a) => {
|
|
793
793
|
switch (a) {
|
|
794
794
|
case "hideColumn":
|
|
@@ -809,7 +809,7 @@ const sa = {
|
|
|
809
809
|
), At = (r, a) => {
|
|
810
810
|
K.value = { ...A.value, [a]: r };
|
|
811
811
|
};
|
|
812
|
-
|
|
812
|
+
_e(() => {
|
|
813
813
|
n.groupBy && h.value ? (A.value = Object.keys(h.value).reduce((r, a) => (r[a] = !0, r), /* @__PURE__ */ Object.create(null)), n.enableGroupFolding && K.value && (A.value = { ...A.value, ...K.value })) : A.value = /* @__PURE__ */ Object.create(null);
|
|
814
814
|
}), xe(
|
|
815
815
|
() => n.enableGroupFolding,
|
|
@@ -822,13 +822,13 @@ const sa = {
|
|
|
822
822
|
const Pt = (r) => {
|
|
823
823
|
if (Ct.value && !Tt.value)
|
|
824
824
|
return !1;
|
|
825
|
-
|
|
825
|
+
ye(r) && r.column.toggleSorting(r.column.getIsSorted() === "asc");
|
|
826
826
|
};
|
|
827
827
|
return (r, a) => (c(), S(z, null, [
|
|
828
828
|
r.$slots.caption ? (c(), S("div", sa, [
|
|
829
829
|
x(r.$slots, "caption", { table: s(g) })
|
|
830
830
|
])) : I("", !0),
|
|
831
|
-
|
|
831
|
+
v(s(Rt), null, Ht({
|
|
832
832
|
default: f(() => [
|
|
833
833
|
H.value ? (c(), O(s(zt), {
|
|
834
834
|
key: 0,
|
|
@@ -837,61 +837,66 @@ const sa = {
|
|
|
837
837
|
ref: le
|
|
838
838
|
}, {
|
|
839
839
|
default: f(() => [
|
|
840
|
-
(
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
onClick: (va) => Ot(d, w),
|
|
856
|
-
key: jt
|
|
857
|
-
}, {
|
|
840
|
+
v(s(fe), { class: "h-10" }, {
|
|
841
|
+
default: f(() => [
|
|
842
|
+
(c(!0), S(z, null, J(H.value, (d, $) => (c(), O(s(Mt), {
|
|
843
|
+
key: d.id,
|
|
844
|
+
id: `${d.id}_cell`,
|
|
845
|
+
style: Ce({
|
|
846
|
+
...s(vt)(d.column),
|
|
847
|
+
cursor: ye(d) ? "pointer" : "auto"
|
|
848
|
+
}),
|
|
849
|
+
"freeze-header": n.freezeHeader,
|
|
850
|
+
"can-resize": d.column.getCanResize() ? !0 : void 0,
|
|
851
|
+
onClick: (w) => Pt(d)
|
|
852
|
+
}, {
|
|
853
|
+
actions: f(() => [
|
|
854
|
+
ze(d).length > 0 ? (c(), O(s(rn), { key: 0 }, {
|
|
858
855
|
default: f(() => [
|
|
859
|
-
|
|
856
|
+
(c(!0), S(z, null, J(ze(d), (w, jt) => (c(), O(s(on), {
|
|
857
|
+
onClick: (va) => Ot(d, w),
|
|
858
|
+
key: jt
|
|
859
|
+
}, {
|
|
860
|
+
default: f(() => [
|
|
861
|
+
W(X(r.headerContextMenuTranslations && r.headerContextMenuTranslations[w] ? r.headerContextMenuTranslations[w] : t[w]), 1)
|
|
862
|
+
]),
|
|
863
|
+
_: 2
|
|
864
|
+
}, 1032, ["onClick"]))), 128))
|
|
860
865
|
]),
|
|
861
866
|
_: 2
|
|
862
|
-
},
|
|
867
|
+
}, 1024)) : I("", !0)
|
|
868
|
+
]),
|
|
869
|
+
default: f(() => [
|
|
870
|
+
d.isPlaceholder ? I("", !0) : (c(), O(s(ot), {
|
|
871
|
+
key: 0,
|
|
872
|
+
render: d.column.columnDef.header,
|
|
873
|
+
props: d.getContext()
|
|
874
|
+
}, null, 8, ["render", "props"])),
|
|
875
|
+
r.enableColumnResizing && $ < H.value.length - 1 && d.column.getCanResize() ? (c(), S("div", {
|
|
876
|
+
key: 1,
|
|
877
|
+
onDblclick: a[5] || (a[5] = //@ts-ignore
|
|
878
|
+
(...w) => s(ue) && s(ue)(...w)),
|
|
879
|
+
onMousedown: Ee(
|
|
880
|
+
(w) => s(wt)(w, d.id, n.enableColumnResizing),
|
|
881
|
+
["self"]
|
|
882
|
+
),
|
|
883
|
+
onClick: a[6] || (a[6] = Ee(() => {
|
|
884
|
+
}, ["stop"])),
|
|
885
|
+
className: s(Te)(
|
|
886
|
+
"resize-handler absolute top-0 right-0 h-full w-1 bg-muted-foreground opacity-0 cursor-col-resize select-none touch-none hover:opacity-50",
|
|
887
|
+
s(_t) && s(ht) === d.id ? "bg-primary opacity-50" : ""
|
|
888
|
+
)
|
|
889
|
+
}, null, 40, ua)) : I("", !0)
|
|
863
890
|
]),
|
|
864
891
|
_: 2
|
|
865
|
-
},
|
|
866
|
-
]),
|
|
867
|
-
default: f(() => [
|
|
868
|
-
d.isPlaceholder ? I("", !0) : (c(), O(s(ot), {
|
|
869
|
-
key: 0,
|
|
870
|
-
render: d.column.columnDef.header,
|
|
871
|
-
props: d.getContext()
|
|
872
|
-
}, null, 8, ["render", "props"])),
|
|
873
|
-
r.enableColumnResizing && $ < H.value.length - 1 && d.column.getCanResize() ? (c(), S("div", {
|
|
874
|
-
key: 1,
|
|
875
|
-
onDblclick: a[5] || (a[5] = //@ts-ignore
|
|
876
|
-
(...w) => s(ue) && s(ue)(...w)),
|
|
877
|
-
onMousedown: Ee(
|
|
878
|
-
(w) => s(wt)(w, d.id, n.enableColumnResizing),
|
|
879
|
-
["self"]
|
|
880
|
-
),
|
|
881
|
-
onClick: a[6] || (a[6] = Ee(() => {
|
|
882
|
-
}, ["stop"])),
|
|
883
|
-
className: s(Te)(
|
|
884
|
-
"resize-handler absolute top-0 right-0 h-full w-1 bg-muted-foreground opacity-0 cursor-col-resize select-none touch-none hover:opacity-50",
|
|
885
|
-
s(_t) && s(ht) === d.id ? "bg-primary opacity-50" : ""
|
|
886
|
-
)
|
|
887
|
-
}, null, 40, ua)) : I("", !0)
|
|
892
|
+
}, 1032, ["id", "style", "freeze-header", "can-resize", "onClick"]))), 128))
|
|
888
893
|
]),
|
|
889
|
-
_:
|
|
890
|
-
}
|
|
894
|
+
_: 1
|
|
895
|
+
})
|
|
891
896
|
]),
|
|
892
897
|
_: 1
|
|
893
898
|
}, 8, ["freeze-header"])) : I("", !0),
|
|
894
|
-
|
|
899
|
+
v(s(It), null, {
|
|
895
900
|
default: f(() => [
|
|
896
901
|
s(g).getRowModel().rows?.length ? (c(), S(z, { key: 0 }, [
|
|
897
902
|
n.groupBy && h.value && A.value ? (c(!0), S(z, { key: 0 }, J(h.value, (d, $) => (c(), O(s(Gt), {
|
|
@@ -902,22 +907,22 @@ const sa = {
|
|
|
902
907
|
"onUpdate:open": [(w) => A.value[$] = w, (w) => At(w, $)]
|
|
903
908
|
}, {
|
|
904
909
|
default: f(() => [
|
|
905
|
-
|
|
910
|
+
v(s(fe), { class: "bg-foreground/4 border-b-0" }, {
|
|
906
911
|
actions: f(() => [
|
|
907
912
|
x(r.$slots, "groupActions", { group: $ })
|
|
908
913
|
]),
|
|
909
914
|
default: f(() => [
|
|
910
|
-
|
|
915
|
+
v(s($e), {
|
|
911
916
|
colspan: r.columns.length,
|
|
912
917
|
class: "pb-0!"
|
|
913
918
|
}, {
|
|
914
919
|
default: f(() => [
|
|
915
|
-
|
|
920
|
+
v(s(Nt), { class: "group w-full" }, {
|
|
916
921
|
default: f(() => [
|
|
917
922
|
P("div", da, [
|
|
918
923
|
P("div", fa, [
|
|
919
924
|
P("div", {
|
|
920
|
-
class:
|
|
925
|
+
class: ce(["bg-background shadow-top relative inline-block rounded-t-lg px-6 py-2 text-sm font-medium", r.enableGroupFolding ? "-mb-[1px]" : "-mb-[6px]"])
|
|
921
926
|
}, [
|
|
922
927
|
a[9] || (a[9] = P("div", { class: "bg-background absolute bottom-0 -left-2 h-2 w-2" }, null, -1)),
|
|
923
928
|
a[10] || (a[10] = P("div", { class: "bg-background absolute bottom-0 -left-4 h-4 w-4 rounded-lg" }, null, -1)),
|
|
@@ -937,7 +942,7 @@ const sa = {
|
|
|
937
942
|
], 64))
|
|
938
943
|
])),
|
|
939
944
|
r.enableGroupFolding ? (c(), S("div", ma, [
|
|
940
|
-
|
|
945
|
+
v(s(gn), {
|
|
941
946
|
"stroke-width": 3,
|
|
942
947
|
class: "text-primary h-4 w-4 shrink-0"
|
|
943
948
|
})
|
|
@@ -959,7 +964,7 @@ const sa = {
|
|
|
959
964
|
]),
|
|
960
965
|
_: 2
|
|
961
966
|
}, 1024),
|
|
962
|
-
|
|
967
|
+
v(s(Ut), { "as-child": "" }, {
|
|
963
968
|
default: f(() => [
|
|
964
969
|
(c(!0), S(z, null, J(d, (w) => (c(), O(Be, {
|
|
965
970
|
key: w.id,
|
|
@@ -1012,24 +1017,24 @@ const sa = {
|
|
|
1012
1017
|
r.enableColumnListControl ? {
|
|
1013
1018
|
name: "columnVisibility",
|
|
1014
1019
|
fn: f(() => [
|
|
1015
|
-
|
|
1020
|
+
v(s(an), {
|
|
1016
1021
|
open: ee.value,
|
|
1017
1022
|
"onUpdate:open": a[4] || (a[4] = (d) => ee.value = d)
|
|
1018
1023
|
}, {
|
|
1019
1024
|
default: f(() => [
|
|
1020
|
-
|
|
1025
|
+
v(s(sn), { "as-child": "" }, {
|
|
1021
1026
|
default: f(() => [
|
|
1022
1027
|
P("div", {
|
|
1023
1028
|
class: "bg-background absolute top-0 right-0 z-10",
|
|
1024
1029
|
style: Ce({ height: `${s(yt).toFixed(1)}px` })
|
|
1025
1030
|
}, [
|
|
1026
1031
|
P("div", la, [
|
|
1027
|
-
|
|
1032
|
+
v(s(Kt), {
|
|
1028
1033
|
variant: "ghost",
|
|
1029
1034
|
class: "text-foreground/50 hover:text-primary flex h-8 w-8 items-center justify-center hover:bg-transparent"
|
|
1030
1035
|
}, {
|
|
1031
1036
|
default: f(() => [
|
|
1032
|
-
|
|
1037
|
+
v(s(bn), { class: "h-4 w-4 shrink-0" })
|
|
1033
1038
|
]),
|
|
1034
1039
|
_: 1
|
|
1035
1040
|
})
|
|
@@ -1038,35 +1043,35 @@ const sa = {
|
|
|
1038
1043
|
]),
|
|
1039
1044
|
_: 1
|
|
1040
1045
|
}),
|
|
1041
|
-
|
|
1046
|
+
v(s(ln), {
|
|
1042
1047
|
class: "w-[250px] p-0",
|
|
1043
1048
|
align: "start"
|
|
1044
1049
|
}, {
|
|
1045
1050
|
default: f(() => [
|
|
1046
|
-
|
|
1051
|
+
v(s(Jt), null, {
|
|
1047
1052
|
default: f(() => [
|
|
1048
|
-
|
|
1053
|
+
v(s(Qt), {
|
|
1049
1054
|
placeholder: r.columnSearchPlaceholder,
|
|
1050
1055
|
modelValue: L.value,
|
|
1051
1056
|
"onUpdate:modelValue": a[0] || (a[0] = (d) => L.value = d),
|
|
1052
1057
|
onInput: a[1] || (a[1] = (d) => L.value = d.target?.value)
|
|
1053
1058
|
}, null, 8, ["placeholder", "modelValue"]),
|
|
1054
|
-
|
|
1059
|
+
v(s(tn), null, {
|
|
1055
1060
|
default: f(() => [
|
|
1056
|
-
|
|
1061
|
+
v(s(un), { class: "h-[300px]" }, {
|
|
1057
1062
|
default: f(() => [
|
|
1058
|
-
|
|
1063
|
+
v(s(Zt), null, {
|
|
1059
1064
|
default: f(() => [
|
|
1060
1065
|
W(X(r.columnSearchNotFound), 1)
|
|
1061
1066
|
]),
|
|
1062
1067
|
_: 1
|
|
1063
1068
|
}),
|
|
1064
|
-
|
|
1069
|
+
v(s(mn), {
|
|
1065
1070
|
"columns-list": R.value,
|
|
1066
1071
|
"onUpdate:columnsList": a[2] || (a[2] = (d) => R.value = d)
|
|
1067
1072
|
}, null, 8, ["columns-list"]),
|
|
1068
|
-
|
|
1069
|
-
|
|
1073
|
+
v(s(nn), { class: "my-1" }),
|
|
1074
|
+
v(s(en), {
|
|
1070
1075
|
value: "reset_columns_visibility",
|
|
1071
1076
|
key: "reset_columns_visibility",
|
|
1072
1077
|
class: "text-muted-foreground px-2 py-1.5 font-medium",
|
|
@@ -1098,7 +1103,7 @@ const sa = {
|
|
|
1098
1103
|
]), 1024),
|
|
1099
1104
|
(r.showPagination || r.$slots.numberOfItems) && m.value > 0 ? (c(), S("div", {
|
|
1100
1105
|
key: 1,
|
|
1101
|
-
class:
|
|
1106
|
+
class: ce(["border-border/16 bg-primary/4 text-muted-foreground flex w-full border-x border-b px-2.5 py-1 text-sm", {
|
|
1102
1107
|
"justify-between": r.showPagination && r.$slots.numberOfItems,
|
|
1103
1108
|
"justify-start": r.$slots.numberOfItems && !r.showPagination,
|
|
1104
1109
|
"justify-end": r.showPagination && !r.$slots.numberOfItems
|
|
@@ -1129,12 +1134,12 @@ export {
|
|
|
1129
1134
|
Rt as BuiTable,
|
|
1130
1135
|
It as BuiTableBody,
|
|
1131
1136
|
Ja as BuiTableCaption,
|
|
1132
|
-
|
|
1137
|
+
$e as BuiTableCell,
|
|
1133
1138
|
Ft as BuiTableEmpty,
|
|
1134
1139
|
Qa as BuiTableFooter,
|
|
1135
1140
|
Mt as BuiTableHead,
|
|
1136
1141
|
zt as BuiTableHeader,
|
|
1137
|
-
|
|
1142
|
+
fe as BuiTableRow,
|
|
1138
1143
|
Be as BuiTableRowSubrow,
|
|
1139
1144
|
vt as getPinningStyle
|
|
1140
1145
|
};
|
package/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ import { _ as Va } from "./BuiTable.vue_vue_type_script_setup_true_lang-Dd_dkcy4
|
|
|
133
133
|
import { _ as La } from "./BuiTableBody.vue_vue_type_script_setup_true_lang-CZvFJVkb.js";
|
|
134
134
|
import { _ as Ra } from "./BuiTableCell.vue_vue_type_script_setup_true_lang-BzFROkZg.js";
|
|
135
135
|
import { _ as ka } from "./BuiTableHead.vue_vue_type_script_setup_true_lang-DA2KX8Pg.js";
|
|
136
|
-
import { _ as Ea } from "./BuiTableHeader.vue_vue_type_script_setup_true_lang-
|
|
136
|
+
import { _ as Ea } from "./BuiTableHeader.vue_vue_type_script_setup_true_lang-Di2FKUwD.js";
|
|
137
137
|
import { _ as Oa } from "./BuiTableRow.vue_vue_type_script_setup_true_lang-BJk8Yk1B.js";
|
|
138
138
|
import { _ as Ja } from "./BuiTableCaption.vue_vue_type_script_setup_true_lang-Bgo7ZNsM.js";
|
|
139
139
|
import { _ as Ua } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-Da4qHIWo.js";
|
package/package.json
CHANGED
|
@@ -450,55 +450,59 @@ const handleHeaderCellSorting = (header: Header<TData, unknown>) => {
|
|
|
450
450
|
</BuiPopover>
|
|
451
451
|
</template>
|
|
452
452
|
<BuiTableHeader v-if="tableHeaders" :freeze-header="props.freezeHeader" ref="tableHeaderRef">
|
|
453
|
-
<
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
453
|
+
<BuiTableRow class="h-10">
|
|
454
|
+
<BuiTableHead
|
|
455
|
+
v-for="(header, index) in tableHeaders"
|
|
456
|
+
:key="header.id"
|
|
457
|
+
:id="`${header.id}_cell`"
|
|
458
|
+
:style="{
|
|
459
|
+
...getPinningStyle(header.column),
|
|
460
|
+
cursor: getHeaderCellSortingButton(header) ? 'pointer' : 'auto'
|
|
461
|
+
}"
|
|
462
|
+
:freeze-header="props.freezeHeader"
|
|
463
|
+
:can-resize="header.column.getCanResize() ? true : undefined"
|
|
464
|
+
@click="handleHeaderCellSorting(header)"
|
|
465
|
+
>
|
|
466
|
+
<FlexRender
|
|
467
|
+
v-if="!header.isPlaceholder"
|
|
468
|
+
:render="header.column.columnDef.header"
|
|
469
|
+
:props="header.getContext()"
|
|
470
|
+
/>
|
|
471
|
+
<div
|
|
472
|
+
v-if="
|
|
473
|
+
enableColumnResizing &&
|
|
474
|
+
index < tableHeaders.length - 1 &&
|
|
475
|
+
header.column.getCanResize()
|
|
476
|
+
"
|
|
477
|
+
@dblclick="resetCells"
|
|
478
|
+
@mousedown.self="
|
|
479
|
+
(e: Event) => handleResizeControlMouseDown(e, header.id, props.enableColumnResizing)
|
|
480
|
+
"
|
|
481
|
+
@click.stop
|
|
482
|
+
:className="
|
|
483
|
+
cn(
|
|
484
|
+
'resize-handler absolute top-0 right-0 h-full w-1 bg-muted-foreground opacity-0 cursor-col-resize select-none touch-none hover:opacity-50',
|
|
485
|
+
isResizing && resizingCellId === header.id ? 'bg-primary opacity-50' : ''
|
|
486
|
+
)
|
|
487
|
+
"
|
|
488
|
+
/>
|
|
489
|
+
<template #actions>
|
|
490
|
+
<BuiContextMenuContent v-if="availableHeaderCellActions(header).length > 0">
|
|
491
|
+
<BuiContextMenuItem
|
|
492
|
+
v-for="(action, idx) in availableHeaderCellActions(header)"
|
|
493
|
+
@click="onHeaderCellAction(header, action)"
|
|
494
|
+
:key="idx"
|
|
495
|
+
>
|
|
496
|
+
{{
|
|
497
|
+
headerContextMenuTranslations && headerContextMenuTranslations[action]
|
|
498
|
+
? headerContextMenuTranslations[action]
|
|
499
|
+
: defaultColumnContextMenuTranslations[action]
|
|
500
|
+
}}
|
|
501
|
+
</BuiContextMenuItem>
|
|
502
|
+
</BuiContextMenuContent>
|
|
503
|
+
</template>
|
|
504
|
+
</BuiTableHead>
|
|
505
|
+
</BuiTableRow>
|
|
502
506
|
</BuiTableHeader>
|
|
503
507
|
<BuiTableBody>
|
|
504
508
|
<template v-if="table.getRowModel().rows?.length">
|