@luscii-healthtech/web-ui 42.5.2 → 42.7.0
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.development.js +24 -8
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/TableNew/TableNew.d.ts +8 -3
- package/dist/stories/TableNew.stories.d.ts +4 -2
- package/dist/web-ui-tailwind.css +12 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -3685,14 +3685,15 @@ function Table(_a) {
|
|
|
3685
3685
|
const isPlainText = (node) => {
|
|
3686
3686
|
return typeof node === "string" || typeof node === "number";
|
|
3687
3687
|
};
|
|
3688
|
-
|
|
3688
|
+
const TableRoot = React__namespace.default.forwardRef((_a, wrapperRef) => {
|
|
3689
3689
|
var { className, children, sticky, headerBackground = "none" } = _a, attrs = __rest(_a, ["className", "children", "sticky", "headerBackground"]);
|
|
3690
3690
|
const stickyHeader = sticky === "header" || sticky === "header-and-first-column";
|
|
3691
3691
|
const stickyFirstColumn = sticky === "first-column" || sticky === "header-and-first-column";
|
|
3692
3692
|
const firstColBg = headerBackground === "first-column" || headerBackground === "first-row-and-column" ? "#f8fafc" : "#ffffff";
|
|
3693
3693
|
const firstRowBg = headerBackground === "first-row" || headerBackground === "first-row-and-column" ? "#f8fafc" : "#ffffff";
|
|
3694
3694
|
const cornerCellBg = headerBackground !== "none" ? "#f8fafc" : "#ffffff";
|
|
3695
|
-
|
|
3695
|
+
const hasTFoot = React__namespace.default.Children.toArray(children).some((child) => React__namespace.default.isValidElement(child) && child.type === TFoot);
|
|
3696
|
+
return jsxRuntime.jsx("div", { className: classNames__default.default("ui:rounded-2xl ui:overflow-auto ui:border ui:border-neutral-border-high-contrast ui:w-fit", className), ref: wrapperRef, children: jsxRuntime.jsxs("table", Object.assign({ className: classNames__default.default("ui:table-auto ui:bg-white", "ui:border-separate ui:border-spacing-0", {
|
|
3696
3697
|
/**
|
|
3697
3698
|
* Apply sticky positioning to first column cells in tbody (both th and td)
|
|
3698
3699
|
* with proper z-index layering
|
|
@@ -3725,9 +3726,12 @@ function TableRoot(_a) {
|
|
|
3725
3726
|
if (child.type === Thead) {
|
|
3726
3727
|
return jsxRuntime.jsx(Thead, Object.assign({}, child.props, { stickyHeader, children: child.props.children }));
|
|
3727
3728
|
}
|
|
3729
|
+
if (child.type === Tbody) {
|
|
3730
|
+
return jsxRuntime.jsx(Tbody, Object.assign({}, child.props, { hasTFoot, children: child.props.children }));
|
|
3731
|
+
}
|
|
3728
3732
|
return child;
|
|
3729
3733
|
})] })) });
|
|
3730
|
-
}
|
|
3734
|
+
});
|
|
3731
3735
|
function Thead(_a) {
|
|
3732
3736
|
var { className, children, stickyHeader } = _a, attrs = __rest(_a, ["className", "children", "stickyHeader"]);
|
|
3733
3737
|
return jsxRuntime.jsx("thead", Object.assign({ className: classNames__default.default(
|
|
@@ -3747,20 +3751,31 @@ function Thead(_a) {
|
|
|
3747
3751
|
) }, attrs, { children }));
|
|
3748
3752
|
}
|
|
3749
3753
|
function Tbody(_a) {
|
|
3750
|
-
var { className, children } = _a, attrs = __rest(_a, ["className", "children"]);
|
|
3754
|
+
var { className, children, hasTFoot } = _a, attrs = __rest(_a, ["className", "children", "hasTFoot"]);
|
|
3751
3755
|
return jsxRuntime.jsx("tbody", Object.assign({ className: classNames__default.default(
|
|
3752
3756
|
// setting border color across all cells
|
|
3753
3757
|
"ui:[&>tr>td]:border-neutral-border-high-contrast ui:[&>tr>th]:border-neutral-border-high-contrast",
|
|
3754
3758
|
// Top border for all rows except the first one
|
|
3755
3759
|
"ui:[&>tr~tr>td]:border-t ui:[&>tr~tr>th]:border-t",
|
|
3760
|
+
// Add bottom border on last row to separate from tfoot
|
|
3761
|
+
// Add bottom border only if tfoot exists
|
|
3762
|
+
{
|
|
3763
|
+
"ui:[&>tr:last-child>td]:border-b ui:[&>tr:last-child>th]:border-b": hasTFoot
|
|
3764
|
+
},
|
|
3756
3765
|
// Rounded corners for the first and last row
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3766
|
+
{
|
|
3767
|
+
"ui:[&>tr:first-child>td:first-child]:rounded-tl-2xl": !hasTFoot,
|
|
3768
|
+
"ui:[&>tr:first-child>td:last-child]:rounded-tr-2xl": !hasTFoot,
|
|
3769
|
+
"ui:[&>tr:last-child>td:first-child]:rounded-bl-2xl": !hasTFoot,
|
|
3770
|
+
"ui:[&>tr:last-child>td:last-child]:rounded-br-2xl": !hasTFoot
|
|
3771
|
+
},
|
|
3761
3772
|
className
|
|
3762
3773
|
) }, attrs, { children }));
|
|
3763
3774
|
}
|
|
3775
|
+
function TFoot(_a) {
|
|
3776
|
+
var { className, children } = _a, attrs = __rest(_a, ["className", "children"]);
|
|
3777
|
+
return jsxRuntime.jsx("tfoot", Object.assign({ className: classNames__default.default(className) }, attrs, { children }));
|
|
3778
|
+
}
|
|
3764
3779
|
function Tr(_a) {
|
|
3765
3780
|
var { className, children } = _a, attrs = __rest(_a, ["className", "children"]);
|
|
3766
3781
|
return jsxRuntime.jsx("tr", Object.assign({ className: classNames__default.default(className) }, attrs, { children }));
|
|
@@ -3783,6 +3798,7 @@ function Td(_a) {
|
|
|
3783
3798
|
const TableNew = Object.assign(TableRoot, {
|
|
3784
3799
|
Thead,
|
|
3785
3800
|
Tbody,
|
|
3801
|
+
TFoot,
|
|
3786
3802
|
Tr,
|
|
3787
3803
|
Th,
|
|
3788
3804
|
Td
|