@trackunit/react-table-base-components 1.14.9 → 1.15.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/index.cjs.js +4 -4
- package/index.esm.js +4 -4
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -311,7 +311,7 @@ const IdentityCell = ({ link, className, "data-testid": dataTestId, ref, title,
|
|
|
311
311
|
link.href().then(setHref);
|
|
312
312
|
}
|
|
313
313
|
}, [link]);
|
|
314
|
-
return (jsxRuntime.jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail:
|
|
314
|
+
return (jsxRuntime.jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: thumbnail !== undefined && thumbnail !== null }), "data-testid": dataTestId, ref: ref, children: [thumbnail !== undefined && thumbnail !== null ? (jsxRuntime.jsx("div", { className: "mr-1 flex h-8 w-8 items-center justify-center overflow-hidden rounded-md", children: thumbnail })) : null, jsxRuntime.jsxs("div", { className: "grid grid-rows-[min-content_auto] items-center text-sm", children: [jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center truncate text-sm", children: jsxRuntime.jsx(reactComponents.Heading, { className: "truncate text-sm", "data-testid": dataTestId ? `${dataTestId}-name` : undefined, variant: "tertiary", children: !link ? (jsxRuntime.jsx("span", { className: "truncate", children: title })) : (jsxRuntime.jsx(reactComponents.ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
315
315
|
// Allow Cmd/Ctrl+Click, Shift+Click, or middle-click to open in new tab
|
|
316
316
|
const hasModifierKey = e.ctrlKey || e.metaKey || e.shiftKey;
|
|
317
317
|
const isMiddleClick = e.button === 1;
|
|
@@ -478,7 +478,7 @@ const cvaSecondaryRowText = cssClassVarianceUtilities.cvaMerge(["overflow-hidden
|
|
|
478
478
|
* @returns {ReactElement} MultiRowTableCell component
|
|
479
479
|
*/
|
|
480
480
|
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, }) => {
|
|
481
|
-
return (jsxRuntime.jsx("div", { className: cvaMultiRowTableCell({ className }), children: jsxRuntime.jsxs("section", { className: cvaMultiRowTableCellSection(), "data-testid": dataTestId, children: [typeof main === "string" ? jsxRuntime.jsx("div", { className: cvaMainRowText(), children: main }) : main,
|
|
481
|
+
return (jsxRuntime.jsx("div", { className: cvaMultiRowTableCell({ className }), children: jsxRuntime.jsxs("section", { className: cvaMultiRowTableCellSection(), "data-testid": dataTestId, children: [typeof main === "string" ? jsxRuntime.jsx("div", { className: cvaMainRowText(), children: main }) : main, typeof secondary === "string" && secondary !== "" ? (jsxRuntime.jsx("div", { className: cvaSecondaryRowText(), children: secondary })) : (secondary)] }) }));
|
|
482
482
|
};
|
|
483
483
|
|
|
484
484
|
/**
|
|
@@ -546,7 +546,7 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
546
546
|
const updateTooltipVisibility = (element) => {
|
|
547
547
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
548
548
|
};
|
|
549
|
-
return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: jsxRuntime.jsx("span", { className: "inline-flex items-center", children: icon }) })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsxRuntime.jsx(reactComponents.Text, { className: "inline", children: content ?? "" }) }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled:
|
|
549
|
+
return count !== null && count !== undefined && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: jsxRuntime.jsx("span", { className: "inline-flex items-center", children: icon }) })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsxRuntime.jsx(reactComponents.Text, { className: "inline", children: content ?? "" }) }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: countTooltip === undefined || countTooltip === null, label: countTooltip ?? "", placement: "bottom", children: jsxRuntime.jsxs(reactComponents.Tag, { className: "inline", color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
550
550
|
};
|
|
551
551
|
|
|
552
552
|
/**
|
|
@@ -623,7 +623,7 @@ const cvaNumberCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-1", "slas
|
|
|
623
623
|
* @returns {ReactElement} A React JSX element representing the NumberCell component.
|
|
624
624
|
*/
|
|
625
625
|
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId, ref }) => {
|
|
626
|
-
return (jsxRuntime.jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("span", { children: value }), value && unit ? jsxRuntime.jsx("span", { children: unit }) : null] }));
|
|
626
|
+
return (jsxRuntime.jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("span", { children: value }), value !== null && value !== "" && unit !== undefined && unit !== null && unit !== "" ? jsxRuntime.jsx("span", { children: unit }) : null] }));
|
|
627
627
|
};
|
|
628
628
|
|
|
629
629
|
const cvaPlainDateCell = cssClassVarianceUtilities.cvaMerge([""]);
|
package/index.esm.js
CHANGED
|
@@ -309,7 +309,7 @@ const IdentityCell = ({ link, className, "data-testid": dataTestId, ref, title,
|
|
|
309
309
|
link.href().then(setHref);
|
|
310
310
|
}
|
|
311
311
|
}, [link]);
|
|
312
|
-
return (jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail:
|
|
312
|
+
return (jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: thumbnail !== undefined && thumbnail !== null }), "data-testid": dataTestId, ref: ref, children: [thumbnail !== undefined && thumbnail !== null ? (jsx("div", { className: "mr-1 flex h-8 w-8 items-center justify-center overflow-hidden rounded-md", children: thumbnail })) : null, jsxs("div", { className: "grid grid-rows-[min-content_auto] items-center text-sm", children: [jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center truncate text-sm", children: jsx(Heading, { className: "truncate text-sm", "data-testid": dataTestId ? `${dataTestId}-name` : undefined, variant: "tertiary", children: !link ? (jsx("span", { className: "truncate", children: title })) : (jsx(ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
313
313
|
// Allow Cmd/Ctrl+Click, Shift+Click, or middle-click to open in new tab
|
|
314
314
|
const hasModifierKey = e.ctrlKey || e.metaKey || e.shiftKey;
|
|
315
315
|
const isMiddleClick = e.button === 1;
|
|
@@ -476,7 +476,7 @@ const cvaSecondaryRowText = cvaMerge(["overflow-hidden", "text-ellipsis", "text-
|
|
|
476
476
|
* @returns {ReactElement} MultiRowTableCell component
|
|
477
477
|
*/
|
|
478
478
|
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, }) => {
|
|
479
|
-
return (jsx("div", { className: cvaMultiRowTableCell({ className }), children: jsxs("section", { className: cvaMultiRowTableCellSection(), "data-testid": dataTestId, children: [typeof main === "string" ? jsx("div", { className: cvaMainRowText(), children: main }) : main,
|
|
479
|
+
return (jsx("div", { className: cvaMultiRowTableCell({ className }), children: jsxs("section", { className: cvaMultiRowTableCellSection(), "data-testid": dataTestId, children: [typeof main === "string" ? jsx("div", { className: cvaMainRowText(), children: main }) : main, typeof secondary === "string" && secondary !== "" ? (jsx("div", { className: cvaSecondaryRowText(), children: secondary })) : (secondary)] }) }));
|
|
480
480
|
};
|
|
481
481
|
|
|
482
482
|
/**
|
|
@@ -544,7 +544,7 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
544
544
|
const updateTooltipVisibility = (element) => {
|
|
545
545
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
546
546
|
};
|
|
547
|
-
return count && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: jsx("span", { className: "inline-flex items-center", children: icon }) })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsx(Text, { className: "inline", children: content ?? "" }) }) }), count > 1 ? (jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled:
|
|
547
|
+
return count !== null && count !== undefined && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: jsx("span", { className: "inline-flex items-center", children: icon }) })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsx(Text, { className: "inline", children: content ?? "" }) }) }), count > 1 ? (jsx(Tooltip, { "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: countTooltip === undefined || countTooltip === null, label: countTooltip ?? "", placement: "bottom", children: jsxs(Tag, { className: "inline", color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
548
548
|
};
|
|
549
549
|
|
|
550
550
|
/**
|
|
@@ -621,7 +621,7 @@ const cvaNumberCell = cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "tex
|
|
|
621
621
|
* @returns {ReactElement} A React JSX element representing the NumberCell component.
|
|
622
622
|
*/
|
|
623
623
|
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId, ref }) => {
|
|
624
|
-
return (jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsx("span", { children: value }), value && unit ? jsx("span", { children: unit }) : null] }));
|
|
624
|
+
return (jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsx("span", { children: value }), value !== null && value !== "" && unit !== undefined && unit !== null && unit !== "" ? jsx("span", { children: unit }) : null] }));
|
|
625
625
|
};
|
|
626
626
|
|
|
627
627
|
const cvaPlainDateCell = cvaMerge([""]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"@trackunit/react-components": "1.18.9",
|
|
12
12
|
"@trackunit/ui-icons": "1.11.66",
|
|
13
|
-
"@trackunit/react-form-components": "1.
|
|
13
|
+
"@trackunit/react-form-components": "1.16.0",
|
|
14
14
|
"@trackunit/css-class-variance-utilities": "1.11.68",
|
|
15
|
-
"@trackunit/date-and-time-utils": "1.11.
|
|
15
|
+
"@trackunit/date-and-time-utils": "1.11.70",
|
|
16
16
|
"@trackunit/shared-utils": "1.13.68",
|
|
17
17
|
"tailwind-merge": "^2.0.0"
|
|
18
18
|
},
|