@versini/ui-table 3.1.3 → 3.1.4
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/index.js +42 -42
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import o from "clsx";
|
|
2
2
|
import { jsx as i, jsxs as _, Fragment as se } from "react/jsx-runtime";
|
|
3
|
-
import I, { useRef as w, useLayoutEffect as
|
|
3
|
+
import I, { useRef as w, useLayoutEffect as $, useMemo as H, useState as oe, useEffect as q, useCallback as le, useContext as N } from "react";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-table v3.1.
|
|
5
|
+
@versini/ui-table v3.1.4
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
|
|
10
|
-
version: "3.1.
|
|
11
|
-
buildTime: "01/
|
|
10
|
+
version: "3.1.4",
|
|
11
|
+
buildTime: "01/29/2025 03:18 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
@@ -129,7 +129,7 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
129
129
|
)
|
|
130
130
|
}), he = ({
|
|
131
131
|
buttonClassName: e
|
|
132
|
-
}) => o("rounded-none text-sm", e),
|
|
132
|
+
}) => o("rounded-none text-sm", e), F = "av-button", S = "icon", G = "button", O = "link", be = ({
|
|
133
133
|
type: e,
|
|
134
134
|
size: a,
|
|
135
135
|
labelRight: t,
|
|
@@ -139,7 +139,7 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
139
139
|
}) => {
|
|
140
140
|
const n = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
|
|
141
141
|
switch (e) {
|
|
142
|
-
case
|
|
142
|
+
case G:
|
|
143
143
|
case O:
|
|
144
144
|
return o({
|
|
145
145
|
[n]: a === "small",
|
|
@@ -173,7 +173,7 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
173
173
|
}) => {
|
|
174
174
|
const s = "text-sm font-medium", l = "text-base font-medium", n = "text-lg font-medium";
|
|
175
175
|
switch (e) {
|
|
176
|
-
case
|
|
176
|
+
case G:
|
|
177
177
|
case O:
|
|
178
178
|
return o({
|
|
179
179
|
"text-center": e === O,
|
|
@@ -254,13 +254,13 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
254
254
|
if (t === "selected")
|
|
255
255
|
return "bg-action-selected-dark";
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, fe = ({
|
|
258
258
|
radius: e
|
|
259
259
|
}) => o({
|
|
260
260
|
"rounded-full": e === "large",
|
|
261
261
|
"rounded-md": e === "medium",
|
|
262
262
|
"rounded-sm": e === "small"
|
|
263
|
-
}),
|
|
263
|
+
}), ke = ({
|
|
264
264
|
mode: e,
|
|
265
265
|
disabled: a,
|
|
266
266
|
variant: t
|
|
@@ -391,8 +391,8 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
391
391
|
align: E,
|
|
392
392
|
radius: z,
|
|
393
393
|
animated: C
|
|
394
|
-
}) => (b || (b = "primary"), t ? o(
|
|
395
|
-
|
|
394
|
+
}) => (b || (b = "primary"), t ? o(F, a) : o(
|
|
395
|
+
F,
|
|
396
396
|
ue({
|
|
397
397
|
mode: r,
|
|
398
398
|
variant: b,
|
|
@@ -400,7 +400,7 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
400
400
|
noTruncate: y
|
|
401
401
|
}),
|
|
402
402
|
ye({ mode: r, noBackground: h, variant: b }),
|
|
403
|
-
|
|
403
|
+
fe({ radius: z }),
|
|
404
404
|
be({
|
|
405
405
|
type: e,
|
|
406
406
|
size: d,
|
|
@@ -412,7 +412,7 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
412
412
|
me({ type: e, size: d, labelRight: g, labelLeft: m }),
|
|
413
413
|
pe({ mode: r, variant: b, noBorder: c }),
|
|
414
414
|
_e({ focusMode: s }),
|
|
415
|
-
|
|
415
|
+
ke({ mode: r, variant: b, disabled: l }),
|
|
416
416
|
ve({ mode: r, variant: b, disabled: l }),
|
|
417
417
|
{
|
|
418
418
|
"w-full": n,
|
|
@@ -441,12 +441,12 @@ const R = "thead", P = "tfoot", p = "tbody", B = {
|
|
|
441
441
|
X.displayName = "BaseButton";
|
|
442
442
|
function Te() {
|
|
443
443
|
const e = w(!1);
|
|
444
|
-
return
|
|
444
|
+
return q(() => (e.current = !0, () => {
|
|
445
445
|
e.current = !1;
|
|
446
446
|
}), []), le(() => e.current, []);
|
|
447
447
|
}
|
|
448
448
|
function Be(e) {
|
|
449
|
-
return
|
|
449
|
+
return H(() => e.every((a) => a == null) ? () => {
|
|
450
450
|
} : (a) => {
|
|
451
451
|
e.forEach((t) => {
|
|
452
452
|
typeof t == "function" ? t(a) : t != null && (t.current = a);
|
|
@@ -464,13 +464,13 @@ const Ie = {
|
|
|
464
464
|
right: 0
|
|
465
465
|
};
|
|
466
466
|
function A(e) {
|
|
467
|
-
const a = Te(), t = w(0), r = w(null), [s, l] = oe(Ie), n =
|
|
467
|
+
const a = Te(), t = w(0), r = w(null), [s, l] = oe(Ie), n = H(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
|
|
468
468
|
const c = d[0];
|
|
469
469
|
c && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
470
470
|
r.current && a() && l(c.contentRect);
|
|
471
471
|
}));
|
|
472
472
|
}), [a]);
|
|
473
|
-
return
|
|
473
|
+
return q(() => (r.current && (n == null || n.observe(r.current, e)), () => {
|
|
474
474
|
n == null || n.disconnect(), t.current && cancelAnimationFrame(t.current);
|
|
475
475
|
}), [n, e]), [r, s];
|
|
476
476
|
}
|
|
@@ -509,7 +509,7 @@ const Re = {
|
|
|
509
509
|
radius: C = "large",
|
|
510
510
|
variant: J = "primary",
|
|
511
511
|
iconClassName: K,
|
|
512
|
-
animated:
|
|
512
|
+
animated: f = !1,
|
|
513
513
|
...Q
|
|
514
514
|
}, ee) => {
|
|
515
515
|
const te = Ne({
|
|
@@ -528,21 +528,21 @@ const Re = {
|
|
|
528
528
|
align: z,
|
|
529
529
|
radius: C,
|
|
530
530
|
variant: J,
|
|
531
|
-
animated:
|
|
532
|
-
}), ae = xe({ mode: t, raw: d, iconClassName: K }), j = we({ animated:
|
|
533
|
-
return
|
|
534
|
-
T && T.current &&
|
|
535
|
-
}, [W, T, h, c,
|
|
536
|
-
v && v.current &&
|
|
531
|
+
animated: f
|
|
532
|
+
}), ae = xe({ mode: t, raw: d, iconClassName: K }), j = we({ animated: f }), [u, V] = A(), [k, M] = A(), [T, W] = A(), L = w(0), v = w(null), re = Be([ee, v]);
|
|
533
|
+
return $(() => {
|
|
534
|
+
T && T.current && f && (L.current = W.width + Se[h] + (c ? 0 : Ee));
|
|
535
|
+
}, [W, T, h, c, f]), $(() => {
|
|
536
|
+
v && v.current && f && (b && u && V.width > 0 ? (u.current && (u.current.style.opacity = "100"), v.current.style.width = `${V.width + L.current}px`) : y && M.width > 0 ? (k.current && (k.current.style.opacity = "100"), v.current.style.width = `${M.width + L.current}px`) : (u.current && (u.current.style.opacity = "0"), k.current && (k.current.style.opacity = "0"), v.current.style.width = `${Re[h]}px`));
|
|
537
537
|
}, [
|
|
538
538
|
V,
|
|
539
539
|
b,
|
|
540
540
|
u,
|
|
541
541
|
M,
|
|
542
542
|
y,
|
|
543
|
-
|
|
543
|
+
k,
|
|
544
544
|
h,
|
|
545
|
-
|
|
545
|
+
f
|
|
546
546
|
]), /* @__PURE__ */ _(
|
|
547
547
|
X,
|
|
548
548
|
{
|
|
@@ -554,17 +554,17 @@ const Re = {
|
|
|
554
554
|
...Q,
|
|
555
555
|
children: [
|
|
556
556
|
/* @__PURE__ */ i(
|
|
557
|
-
|
|
557
|
+
D,
|
|
558
558
|
{
|
|
559
559
|
label: y,
|
|
560
|
-
labelRef:
|
|
560
|
+
labelRef: k,
|
|
561
561
|
labelClass: j,
|
|
562
562
|
labelInnerClass: "pr-2"
|
|
563
563
|
}
|
|
564
564
|
),
|
|
565
565
|
/* @__PURE__ */ i("span", { ref: T, className: ae, children: e }),
|
|
566
566
|
/* @__PURE__ */ i(
|
|
567
|
-
|
|
567
|
+
D,
|
|
568
568
|
{
|
|
569
569
|
label: b,
|
|
570
570
|
labelRef: u,
|
|
@@ -576,7 +576,7 @@ const Re = {
|
|
|
576
576
|
}
|
|
577
577
|
);
|
|
578
578
|
}
|
|
579
|
-
),
|
|
579
|
+
), D = ({
|
|
580
580
|
labelRef: e,
|
|
581
581
|
labelClass: a,
|
|
582
582
|
label: t,
|
|
@@ -584,13 +584,13 @@ const Re = {
|
|
|
584
584
|
}) => /* @__PURE__ */ i("span", { ref: e, className: a, children: t && /* @__PURE__ */ i("span", { className: r, children: t }) });
|
|
585
585
|
Y.displayName = "ButtonIcon";
|
|
586
586
|
/*!
|
|
587
|
-
@versini/ui-button v4.2.
|
|
587
|
+
@versini/ui-button v4.2.4
|
|
588
588
|
© 2025 gizmette.com
|
|
589
589
|
*/
|
|
590
590
|
try {
|
|
591
591
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
592
|
-
version: "4.2.
|
|
593
|
-
buildTime: "01/
|
|
592
|
+
version: "4.2.4",
|
|
593
|
+
buildTime: "01/29/2025 03:18 PM EST",
|
|
594
594
|
homepage: "https://github.com/aversini/ui-components",
|
|
595
595
|
license: "MIT"
|
|
596
596
|
});
|
|
@@ -758,13 +758,13 @@ const ze = ({
|
|
|
758
758
|
}
|
|
759
759
|
);
|
|
760
760
|
/*!
|
|
761
|
-
@versini/ui-icons v4.6.
|
|
761
|
+
@versini/ui-icons v4.6.1
|
|
762
762
|
© 2025 gizmette.com
|
|
763
763
|
*/
|
|
764
764
|
try {
|
|
765
765
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
766
|
-
version: "4.6.
|
|
767
|
-
buildTime: "01/
|
|
766
|
+
version: "4.6.1",
|
|
767
|
+
buildTime: "01/21/2025 01:33 PM EST",
|
|
768
768
|
homepage: "https://github.com/aversini/ui-components",
|
|
769
769
|
license: "MIT"
|
|
770
770
|
});
|
|
@@ -841,10 +841,10 @@ const x = I.createContext({
|
|
|
841
841
|
stickyFooter: r.stickyFooter
|
|
842
842
|
});
|
|
843
843
|
return /* @__PURE__ */ i("tfoot", { className: s, ...t, children: e });
|
|
844
|
-
},
|
|
844
|
+
}, $e = ({ children: e, ...a }) => {
|
|
845
845
|
const t = N(x);
|
|
846
846
|
return t.cellWrapper = p, /* @__PURE__ */ i("tbody", { ...a, children: e });
|
|
847
|
-
},
|
|
847
|
+
}, Fe = ({
|
|
848
848
|
children: e,
|
|
849
849
|
className: a,
|
|
850
850
|
...t
|
|
@@ -870,7 +870,7 @@ const x = I.createContext({
|
|
|
870
870
|
align: r
|
|
871
871
|
});
|
|
872
872
|
return r ? /* @__PURE__ */ i(n, { className: d, ...s, children: /* @__PURE__ */ i("div", { className: c, children: e }) }) : /* @__PURE__ */ i(n, { className: d, ...s, children: e });
|
|
873
|
-
},
|
|
873
|
+
}, De = ({
|
|
874
874
|
align: e,
|
|
875
875
|
children: a,
|
|
876
876
|
buttonClassName: t,
|
|
@@ -913,11 +913,11 @@ const x = I.createContext({
|
|
|
913
913
|
};
|
|
914
914
|
export {
|
|
915
915
|
Ue as Table,
|
|
916
|
-
|
|
916
|
+
$e as TableBody,
|
|
917
917
|
Le as TableCell,
|
|
918
|
-
|
|
918
|
+
De as TableCellSort,
|
|
919
919
|
B as TableCellSortDirections,
|
|
920
920
|
We as TableFooter,
|
|
921
921
|
je as TableHead,
|
|
922
|
-
|
|
922
|
+
Fe as TableRow
|
|
923
923
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-table",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@tailwindcss/typography": "0.5.16",
|
|
46
|
-
"@versini/ui-button": "4.2.
|
|
47
|
-
"@versini/ui-icons": "4.6.
|
|
46
|
+
"@versini/ui-button": "4.2.4",
|
|
47
|
+
"@versini/ui-icons": "4.6.1",
|
|
48
48
|
"clsx": "2.1.1",
|
|
49
49
|
"tailwindcss": "3.4.17"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": [
|
|
52
52
|
"**/*.css"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "7924430ddd05d614e8d16256c5dcc14564c91c14"
|
|
55
55
|
}
|