@trackunit/react-table-base-components 1.13.19 → 1.13.23
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 +37 -35
- package/index.esm.js +38 -36
- package/package.json +7 -7
- package/src/components/ButtonCell/ButtonCell.d.ts +2 -2
- package/src/components/DateTimeCell/DateTimeCell.d.ts +2 -2
- package/src/components/HighlightCell/HighlightCell.d.ts +3 -3
- package/src/components/IdentityCell/IdentityCell.d.ts +3 -3
- package/src/components/ImageCell/ImageCell.d.ts +3 -3
- package/src/components/IndicatorCell/IndicatorCell.d.ts +3 -3
- package/src/components/LinkCell/LinkCell.d.ts +3 -3
- package/src/components/MultiValueTextCell/MultiValueTextCell.d.ts +3 -3
- package/src/components/NoticeCell/NoticeCell.d.ts +1 -1
- package/src/components/NumberCell/NumberCell.d.ts +3 -3
- package/src/components/PlainDateCell/PlainDateCell.d.ts +3 -3
- package/src/components/ResizeHandle.d.ts +3 -3
- package/src/components/SortIndicator.d.ts +4 -3
- package/src/components/TagsCell/TagsCell.d.ts +3 -3
- package/src/components/Td.d.ts +3 -3
- package/src/components/TextCell/TextCell.d.ts +3 -3
- package/src/components/Tfoot.d.ts +3 -3
- package/src/components/Th.d.ts +3 -3
- package/src/components/Thead.d.ts +3 -3
- package/src/components/Tr.d.ts +3 -3
package/index.cjs.js
CHANGED
|
@@ -186,8 +186,8 @@ const cvaHighlightCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-2"]);
|
|
|
186
186
|
* @param {HighlightCellProps} props - The props for the HighlightCell component
|
|
187
187
|
* @returns {ReactElement} HighlightCell component
|
|
188
188
|
*/
|
|
189
|
-
const HighlightCell = ({ className, highlights, "data-testid": dataTestId }) => {
|
|
190
|
-
return (jsxRuntime.jsx("div", { className: cvaHighlightCell({ className }), "data-testid": dataTestId, children: highlights.map((highlight, index) => (jsxRuntime.jsx(reactComponents.Highlight, { color: "warning",
|
|
189
|
+
const HighlightCell = ({ className, highlights, "data-testid": dataTestId, ref }) => {
|
|
190
|
+
return (jsxRuntime.jsx("div", { className: cvaHighlightCell({ className }), "data-testid": dataTestId, ref: ref, children: highlights.map((highlight, index) => (jsxRuntime.jsx(reactComponents.Highlight, { color: "warning",
|
|
191
191
|
size: "medium",
|
|
192
192
|
"data-testid": `${dataTestId}-${index}`,
|
|
193
193
|
...(typeof highlight === "string" ? { children: highlight } : highlight) }, index))) }));
|
|
@@ -274,14 +274,14 @@ const cvaIdentityCell = cssClassVarianceUtilities.cvaMerge(["grid", "items-cente
|
|
|
274
274
|
* @param {IdentityCellProps} props - The props for the IdentityCell component
|
|
275
275
|
* @returns {ReactElement} IdentityCell component
|
|
276
276
|
*/
|
|
277
|
-
const IdentityCell = ({ link, className, "data-testid": dataTestId, title, details = [], thumbnail, }) => {
|
|
277
|
+
const IdentityCell = ({ link, className, "data-testid": dataTestId, ref, title, details = [], thumbnail, }) => {
|
|
278
278
|
const [href, setHref] = react.useState(undefined);
|
|
279
279
|
react.useEffect(() => {
|
|
280
280
|
if (link) {
|
|
281
281
|
link.href().then(setHref);
|
|
282
282
|
}
|
|
283
283
|
}, [link]);
|
|
284
|
-
return (jsxRuntime.jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: !!thumbnail }), "data-testid": dataTestId, children: [thumbnail ? (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 ? (title) : (jsxRuntime.jsx(reactComponents.ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
284
|
+
return (jsxRuntime.jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: !!thumbnail }), "data-testid": dataTestId, ref: ref, children: [thumbnail ? (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 ? (title) : (jsxRuntime.jsx(reactComponents.ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
285
285
|
// Allow Cmd/Ctrl+Click, Shift+Click, or middle-click to open in new tab
|
|
286
286
|
const hasModifierKey = e.ctrlKey || e.metaKey || e.shiftKey;
|
|
287
287
|
const isMiddleClick = e.button === 1;
|
|
@@ -301,8 +301,8 @@ const IdentityCell = ({ link, className, "data-testid": dataTestId, title, detai
|
|
|
301
301
|
* @param {ImageCellProps} props - The props for the Image component.
|
|
302
302
|
* @returns {ReactElement} The Image component.
|
|
303
303
|
*/
|
|
304
|
-
const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid": dataTestId, ...rest }) => {
|
|
305
|
-
return jsxRuntime.jsx("img", { alt: alt, "data-testid": dataTestId, height: height, src: imageUrl, width: width, ...rest });
|
|
304
|
+
const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid": dataTestId, ref, ...rest }) => {
|
|
305
|
+
return jsxRuntime.jsx("img", { alt: alt, "data-testid": dataTestId, height: height, ref: ref, src: imageUrl, width: width, ...rest });
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
/**
|
|
@@ -311,8 +311,8 @@ const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid
|
|
|
311
311
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
312
312
|
* @returns {ReactElement} LinkCell component
|
|
313
313
|
*/
|
|
314
|
-
const IndicatorCell = ({ withBackground = false, weight = "normal", ...rest }) => {
|
|
315
|
-
return jsxRuntime.jsx(reactComponents.Indicator, { weight: weight, withBackground: withBackground, ...rest });
|
|
314
|
+
const IndicatorCell = ({ withBackground = false, weight = "normal", ref, ...rest }) => {
|
|
315
|
+
return jsxRuntime.jsx(reactComponents.Indicator, { ref: ref, weight: weight, withBackground: withBackground, ...rest });
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
const cvaLinkCell = cssClassVarianceUtilities.cvaMerge(["text-sm"]);
|
|
@@ -376,12 +376,12 @@ const cvaLinkCell = cssClassVarianceUtilities.cvaMerge(["text-sm"]);
|
|
|
376
376
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
377
377
|
* @returns {ReactElement} LinkCell component
|
|
378
378
|
*/
|
|
379
|
-
const LinkCell = ({ link, type, className, ...rest }) => {
|
|
379
|
+
const LinkCell = ({ link, type, className, ref, ...rest }) => {
|
|
380
380
|
const linkPrefix = type === "LINK" ? "" : type === "PHONE" ? "tel:" : "mailto:";
|
|
381
381
|
const handleClick = event => {
|
|
382
382
|
event.stopPropagation();
|
|
383
383
|
};
|
|
384
|
-
return (jsxRuntime.jsx(reactComponents.ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ...rest, color: "neutral", onClick: handleClick, children: link }));
|
|
384
|
+
return (jsxRuntime.jsx(reactComponents.ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ref: ref, ...rest, color: "neutral", onClick: handleClick, children: link }));
|
|
385
385
|
};
|
|
386
386
|
|
|
387
387
|
const cvaMultiRowTableCellSection = cssClassVarianceUtilities.cvaMerge(["flex", "flex-col", "justify-center", "overflow-hidden"]);
|
|
@@ -459,12 +459,12 @@ const cvaMultiValueTextCellTooltip = cssClassVarianceUtilities.cvaMerge(["whites
|
|
|
459
459
|
* @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
|
|
460
460
|
* @returns {ReactElement} MultiValueTextCell component
|
|
461
461
|
*/
|
|
462
|
-
const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, }) => {
|
|
462
|
+
const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, ref, }) => {
|
|
463
463
|
const [isTooltipVisible, setIsTooltipVisible] = react.useState(false);
|
|
464
464
|
const updateTooltipVisibility = (element) => {
|
|
465
465
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
466
466
|
};
|
|
467
|
-
return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline-flex items-center", "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
467
|
+
return count && count > 0 ? (jsxRuntime.jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline-flex items-center", "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsxRuntime.jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsxRuntime.jsx("span", { children: content ?? "" }) }) }), count > 1 ? (jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxRuntime.jsxs(reactComponents.Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
468
468
|
};
|
|
469
469
|
|
|
470
470
|
/**
|
|
@@ -473,8 +473,8 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
473
473
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
474
474
|
* @returns {ReactElement} NoticeCell component
|
|
475
475
|
*/
|
|
476
|
-
const NoticeCell = ({ ...rest }) => {
|
|
477
|
-
return jsxRuntime.jsx(reactComponents.Notice, { ...rest });
|
|
476
|
+
const NoticeCell = ({ ref, ...rest }) => {
|
|
477
|
+
return jsxRuntime.jsx(reactComponents.Notice, { ref: ref, ...rest });
|
|
478
478
|
};
|
|
479
479
|
|
|
480
480
|
const cvaNumberCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
|
|
@@ -526,8 +526,8 @@ const cvaNumberCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-1", "slas
|
|
|
526
526
|
* @param {NumberCellProps} props - The props for the NumberCell component.
|
|
527
527
|
* @returns {ReactElement} A React JSX element representing the NumberCell component.
|
|
528
528
|
*/
|
|
529
|
-
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId }) => {
|
|
530
|
-
return (jsxRuntime.jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("span", { children: value }), value && unit ? jsxRuntime.jsx("span", { children: unit }) : null] }));
|
|
529
|
+
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId, ref }) => {
|
|
530
|
+
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] }));
|
|
531
531
|
};
|
|
532
532
|
|
|
533
533
|
const cvaPlainDateCell = cssClassVarianceUtilities.cvaMerge([""]);
|
|
@@ -540,12 +540,12 @@ const cvaDateTimeSince = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "te
|
|
|
540
540
|
* @param {PlainDateCellProps} props - The props for the PlainDateCell component
|
|
541
541
|
* @returns {ReactElement} PlainDateCell component
|
|
542
542
|
*/
|
|
543
|
-
const PlainDateCell = ({ locale, date, withDaysSince = true, className, "data-testid": dataTestId, }) => {
|
|
543
|
+
const PlainDateCell = ({ locale, date, withDaysSince = true, className, "data-testid": dataTestId, ref, }) => {
|
|
544
544
|
if (!date) {
|
|
545
545
|
return null;
|
|
546
546
|
}
|
|
547
547
|
const formattedDate = dateAndTimeUtils.formatDateUtil(date.toZonedDateTime("UTC"), sharedUtils.DateTimeFormat.DATE_SHORT, "UTC", locale);
|
|
548
|
-
return (jsxRuntime.jsxs("div", { className: cvaPlainDateCell({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("p", { className: cvaDateTime(), children: formattedDate }), withDaysSince ? jsxRuntime.jsx(DaysSince, { date: date, locale: locale }) : null] }));
|
|
548
|
+
return (jsxRuntime.jsxs("div", { className: cvaPlainDateCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsxRuntime.jsx("p", { className: cvaDateTime(), children: formattedDate }), withDaysSince ? jsxRuntime.jsx(DaysSince, { date: date, locale: locale }) : null] }));
|
|
549
549
|
};
|
|
550
550
|
const DaysSince = ({ date, locale }) => {
|
|
551
551
|
let timeSince = null;
|
|
@@ -570,7 +570,7 @@ const DaysSince = ({ date, locale }) => {
|
|
|
570
570
|
* @param {string} [props.className] - Additional CSS classes to apply to the handle.
|
|
571
571
|
* @returns {ReactElement} A React element representing the resizable handle.
|
|
572
572
|
*/
|
|
573
|
-
const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ...rest }) => {
|
|
573
|
+
const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ref, ...rest }) => {
|
|
574
574
|
const onMouseDown = event => {
|
|
575
575
|
const resizeCursorClass = "cursor-col-resize";
|
|
576
576
|
document.addEventListener("mouseup", () => {
|
|
@@ -764,10 +764,11 @@ const IconWithLoader = ({ action, size }) => {
|
|
|
764
764
|
* @param {boolean} [props.sortingState=false] - Indicates the sorting state (ascending/descending).
|
|
765
765
|
* @param {string} [props."data-testid"] - A data-testid attribute for testing purposes.
|
|
766
766
|
* @param {string} [props.className] - Additional CSS classes to apply to the sorting indicator.
|
|
767
|
+
* @param {import('react').Ref<HTMLDivElement>} [props.ref] - Ref forwarded to the root DOM element.
|
|
767
768
|
* @returns {ReactElement} A React element representing the sorting indicator.
|
|
768
769
|
*/
|
|
769
|
-
const SortIndicator = ({ sortingState = false, "data-testid": dataTestId, className, ...rest }) => {
|
|
770
|
-
return (jsxRuntime.jsx("div", { className: cvaSortIndicator({ sortingState, className }), "data-testid": dataTestId, role: "separator", ...rest }));
|
|
770
|
+
const SortIndicator = ({ sortingState = false, "data-testid": dataTestId, className, ref, ...rest }) => {
|
|
771
|
+
return (jsxRuntime.jsx("div", { className: cvaSortIndicator({ sortingState, className }), "data-testid": dataTestId, ref: ref, role: "separator", ...rest }));
|
|
771
772
|
};
|
|
772
773
|
const cvaSortIndicator = cssClassVarianceUtilities.cvaMerge([
|
|
773
774
|
"before:block",
|
|
@@ -864,8 +865,8 @@ const cvaTagsCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-2"]);
|
|
|
864
865
|
* @param {TagsCellProps} props - The props for the TagsCell component
|
|
865
866
|
* @returns {ReactElement} TagsCell component
|
|
866
867
|
*/
|
|
867
|
-
const TagsCell = ({ className, tags, "data-testid": dataTestId }) => {
|
|
868
|
-
return (jsxRuntime.jsx("div", { className: cvaTagsCell({ className }), "data-testid": dataTestId, children: tags.map((tag, index) => (jsxRuntime.jsx(reactComponents.Tag, { color: "primary",
|
|
868
|
+
const TagsCell = ({ className, tags, "data-testid": dataTestId, ref }) => {
|
|
869
|
+
return (jsxRuntime.jsx("div", { className: cvaTagsCell({ className }), "data-testid": dataTestId, ref: ref, children: tags.map((tag, index) => (jsxRuntime.jsx(reactComponents.Tag, { color: "primary",
|
|
869
870
|
"data-testid": `${dataTestId}-${index}`,
|
|
870
871
|
...(typeof tag === "string" ? { children: tag } : tag) }, index))) }));
|
|
871
872
|
};
|
|
@@ -894,8 +895,8 @@ const Tbody = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
|
894
895
|
* @param {TdProps} props - The props for the Td component
|
|
895
896
|
* @returns {ReactElement} Td component
|
|
896
897
|
*/
|
|
897
|
-
const Td = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
898
|
-
return (jsxRuntime.jsx("td", { className: cvaTd({ className }), "data-testid": dataTestId, ...rest, children: Array.isArray(children)
|
|
898
|
+
const Td = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
899
|
+
return (jsxRuntime.jsx("td", { className: cvaTd({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: Array.isArray(children)
|
|
899
900
|
? children
|
|
900
901
|
.filter(Boolean)
|
|
901
902
|
.map((child, index) => (react.isValidElement(child) ? react.cloneElement(child, { key: index }) : child))
|
|
@@ -958,12 +959,13 @@ const cvaTextCellTooltip = cssClassVarianceUtilities.cvaMerge(["grid"]);
|
|
|
958
959
|
* @param {TextCellProps} props - The props for the TextCell component
|
|
959
960
|
* @returns {ReactElement} TextCell component
|
|
960
961
|
*/
|
|
961
|
-
const TextCell = ({ content = "", className, "data-testid": dataTestId }) => {
|
|
962
|
+
const TextCell = ({ content = "", className, "data-testid": dataTestId, ref }) => {
|
|
962
963
|
const [isTooltipVisible, setIsTooltipVisible] = react.useState(false);
|
|
963
964
|
const updateTooltipVisibility = (element) => {
|
|
964
965
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
965
966
|
};
|
|
966
|
-
|
|
967
|
+
const mergedRef = reactComponents.useMergeRefs([ref, (elementRef) => updateTooltipVisibility(elementRef)]);
|
|
968
|
+
return (jsxRuntime.jsx(reactComponents.Tooltip, { asChild: false, className: cvaTextCellTooltip(), disabled: !isTooltipVisible, label: content, placement: "bottom", children: jsxRuntime.jsx("span", { className: cvaTextCell({ className }), "data-testid": dataTestId, ref: mergedRef, children: content }) }));
|
|
967
969
|
};
|
|
968
970
|
|
|
969
971
|
/**
|
|
@@ -976,8 +978,8 @@ const TextCell = ({ content = "", className, "data-testid": dataTestId }) => {
|
|
|
976
978
|
* @param {TfootProps} props - The props for the Tfoot component
|
|
977
979
|
* @returns {ReactElement} Tfoot component
|
|
978
980
|
*/
|
|
979
|
-
const Tfoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
980
|
-
return (jsxRuntime.jsx("tfoot", { className: className, "data-testid": dataTestId, ...rest, children: children }));
|
|
981
|
+
const Tfoot = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
982
|
+
return (jsxRuntime.jsx("tfoot", { className: className, "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
981
983
|
};
|
|
982
984
|
|
|
983
985
|
/**
|
|
@@ -990,8 +992,8 @@ const Tfoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
|
990
992
|
* @param {ThProps} props - The props for the Th component
|
|
991
993
|
* @returns {ReactElement} Th component
|
|
992
994
|
*/
|
|
993
|
-
const Th = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
994
|
-
return (jsxRuntime.jsx("th", { className: cvaTh({ className }), "data-testid": dataTestId, ...rest, children: jsxRuntime.jsx("div", { className: cvaChildrenContainer(), children: Array.isArray(children)
|
|
995
|
+
const Th = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
996
|
+
return (jsxRuntime.jsx("th", { className: cvaTh({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: jsxRuntime.jsx("div", { className: cvaChildrenContainer(), children: Array.isArray(children)
|
|
995
997
|
? children
|
|
996
998
|
.filter(Boolean)
|
|
997
999
|
.map((child, index) => (react.isValidElement(child) ? react.cloneElement(child, { key: index }) : child))
|
|
@@ -1031,8 +1033,8 @@ const cvaChildrenContainer = cssClassVarianceUtilities.cvaMerge([
|
|
|
1031
1033
|
* @param {TheadProps} props - The props for the Thead component
|
|
1032
1034
|
* @returns {ReactElement} Thead component
|
|
1033
1035
|
*/
|
|
1034
|
-
const Thead = ({ "data-testid": dataTestId, className, children, sticky = true, ...rest }) => {
|
|
1035
|
-
return (jsxRuntime.jsx("thead", { className: cvaThead({ sticky, className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
1036
|
+
const Thead = ({ "data-testid": dataTestId, className, children, sticky = true, ref, ...rest }) => {
|
|
1037
|
+
return (jsxRuntime.jsx("thead", { className: cvaThead({ sticky, className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
1036
1038
|
};
|
|
1037
1039
|
const cvaThead = cssClassVarianceUtilities.cvaMerge(["bg-neutral-100", "text-left"], {
|
|
1038
1040
|
variants: {
|
|
@@ -1056,8 +1058,8 @@ const cvaThead = cssClassVarianceUtilities.cvaMerge(["bg-neutral-100", "text-lef
|
|
|
1056
1058
|
* @param {TrProps} props - The props for the Tr component
|
|
1057
1059
|
* @returns {ReactElement} Tr component
|
|
1058
1060
|
*/
|
|
1059
|
-
const Tr = ({ "data-testid": dataTestId, className, children, layout = "default", ...rest }) => {
|
|
1060
|
-
return (jsxRuntime.jsx("tr", { className: cvaTr({ layout, className }), "data-testid": dataTestId, role: "row", ...rest, children: children }));
|
|
1061
|
+
const Tr = ({ "data-testid": dataTestId, className, children, layout = "default", ref, ...rest }) => {
|
|
1062
|
+
return (jsxRuntime.jsx("tr", { className: cvaTr({ layout, className }), "data-testid": dataTestId, ref: ref, role: "row", ...rest, children: children }));
|
|
1061
1063
|
};
|
|
1062
1064
|
const cvaTr = cssClassVarianceUtilities.cvaMerge(["w-full", "h-max", "border-b", "border-neutral-200"], {
|
|
1063
1065
|
variants: {
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Button, Icon, Highlight, Heading, ExternalLink, DetailsList, Indicator, Spinner, Tooltip, Tag, Notice, IconButton, MoreMenu, MenuList, MenuItem, MenuDivider } from '@trackunit/react-components';
|
|
2
|
+
import { Button, Icon, Highlight, Heading, ExternalLink, DetailsList, Indicator, Spinner, Tooltip, Tag, Notice, IconButton, MoreMenu, MenuList, MenuItem, MenuDivider, useMergeRefs } from '@trackunit/react-components';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import { Checkbox } from '@trackunit/react-form-components';
|
|
5
5
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
@@ -184,8 +184,8 @@ const cvaHighlightCell = cvaMerge(["flex", "gap-2"]);
|
|
|
184
184
|
* @param {HighlightCellProps} props - The props for the HighlightCell component
|
|
185
185
|
* @returns {ReactElement} HighlightCell component
|
|
186
186
|
*/
|
|
187
|
-
const HighlightCell = ({ className, highlights, "data-testid": dataTestId }) => {
|
|
188
|
-
return (jsx("div", { className: cvaHighlightCell({ className }), "data-testid": dataTestId, children: highlights.map((highlight, index) => (jsx(Highlight, { color: "warning",
|
|
187
|
+
const HighlightCell = ({ className, highlights, "data-testid": dataTestId, ref }) => {
|
|
188
|
+
return (jsx("div", { className: cvaHighlightCell({ className }), "data-testid": dataTestId, ref: ref, children: highlights.map((highlight, index) => (jsx(Highlight, { color: "warning",
|
|
189
189
|
size: "medium",
|
|
190
190
|
"data-testid": `${dataTestId}-${index}`,
|
|
191
191
|
...(typeof highlight === "string" ? { children: highlight } : highlight) }, index))) }));
|
|
@@ -272,14 +272,14 @@ const cvaIdentityCell = cvaMerge(["grid", "items-center", "text-sm", "gap-2"], {
|
|
|
272
272
|
* @param {IdentityCellProps} props - The props for the IdentityCell component
|
|
273
273
|
* @returns {ReactElement} IdentityCell component
|
|
274
274
|
*/
|
|
275
|
-
const IdentityCell = ({ link, className, "data-testid": dataTestId, title, details = [], thumbnail, }) => {
|
|
275
|
+
const IdentityCell = ({ link, className, "data-testid": dataTestId, ref, title, details = [], thumbnail, }) => {
|
|
276
276
|
const [href, setHref] = useState(undefined);
|
|
277
277
|
useEffect(() => {
|
|
278
278
|
if (link) {
|
|
279
279
|
link.href().then(setHref);
|
|
280
280
|
}
|
|
281
281
|
}, [link]);
|
|
282
|
-
return (jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: !!thumbnail }), "data-testid": dataTestId, children: [thumbnail ? (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 ? (title) : (jsx(ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
282
|
+
return (jsxs("div", { className: cvaIdentityCell({ className, hasThumbnail: !!thumbnail }), "data-testid": dataTestId, ref: ref, children: [thumbnail ? (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 ? (title) : (jsx(ExternalLink, { className: "truncate", color: "neutral", href: href ?? "", onClick: async (e) => {
|
|
283
283
|
// Allow Cmd/Ctrl+Click, Shift+Click, or middle-click to open in new tab
|
|
284
284
|
const hasModifierKey = e.ctrlKey || e.metaKey || e.shiftKey;
|
|
285
285
|
const isMiddleClick = e.button === 1;
|
|
@@ -299,8 +299,8 @@ const IdentityCell = ({ link, className, "data-testid": dataTestId, title, detai
|
|
|
299
299
|
* @param {ImageCellProps} props - The props for the Image component.
|
|
300
300
|
* @returns {ReactElement} The Image component.
|
|
301
301
|
*/
|
|
302
|
-
const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid": dataTestId, ...rest }) => {
|
|
303
|
-
return jsx("img", { alt: alt, "data-testid": dataTestId, height: height, src: imageUrl, width: width, ...rest });
|
|
302
|
+
const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid": dataTestId, ref, ...rest }) => {
|
|
303
|
+
return jsx("img", { alt: alt, "data-testid": dataTestId, height: height, ref: ref, src: imageUrl, width: width, ...rest });
|
|
304
304
|
};
|
|
305
305
|
|
|
306
306
|
/**
|
|
@@ -309,8 +309,8 @@ const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, "data-testid
|
|
|
309
309
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
310
310
|
* @returns {ReactElement} LinkCell component
|
|
311
311
|
*/
|
|
312
|
-
const IndicatorCell = ({ withBackground = false, weight = "normal", ...rest }) => {
|
|
313
|
-
return jsx(Indicator, { weight: weight, withBackground: withBackground, ...rest });
|
|
312
|
+
const IndicatorCell = ({ withBackground = false, weight = "normal", ref, ...rest }) => {
|
|
313
|
+
return jsx(Indicator, { ref: ref, weight: weight, withBackground: withBackground, ...rest });
|
|
314
314
|
};
|
|
315
315
|
|
|
316
316
|
const cvaLinkCell = cvaMerge(["text-sm"]);
|
|
@@ -374,12 +374,12 @@ const cvaLinkCell = cvaMerge(["text-sm"]);
|
|
|
374
374
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
375
375
|
* @returns {ReactElement} LinkCell component
|
|
376
376
|
*/
|
|
377
|
-
const LinkCell = ({ link, type, className, ...rest }) => {
|
|
377
|
+
const LinkCell = ({ link, type, className, ref, ...rest }) => {
|
|
378
378
|
const linkPrefix = type === "LINK" ? "" : type === "PHONE" ? "tel:" : "mailto:";
|
|
379
379
|
const handleClick = event => {
|
|
380
380
|
event.stopPropagation();
|
|
381
381
|
};
|
|
382
|
-
return (jsx(ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ...rest, color: "neutral", onClick: handleClick, children: link }));
|
|
382
|
+
return (jsx(ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ref: ref, ...rest, color: "neutral", onClick: handleClick, children: link }));
|
|
383
383
|
};
|
|
384
384
|
|
|
385
385
|
const cvaMultiRowTableCellSection = cvaMerge(["flex", "flex-col", "justify-center", "overflow-hidden"]);
|
|
@@ -457,12 +457,12 @@ const cvaMultiValueTextCellTooltip = cvaMerge(["whitespace-no-wrap", "overflow-h
|
|
|
457
457
|
* @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
|
|
458
458
|
* @returns {ReactElement} MultiValueTextCell component
|
|
459
459
|
*/
|
|
460
|
-
const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, }) => {
|
|
460
|
+
const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, ref, }) => {
|
|
461
461
|
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
|
|
462
462
|
const updateTooltipVisibility = (element) => {
|
|
463
463
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
464
464
|
};
|
|
465
|
-
return count && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, children: [icon ? (jsx(Tooltip, { asChild: false, className: "inline-flex items-center", "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: content ?? "" }) }), count > 1 ? (jsx(Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxs(Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
465
|
+
return count && count > 0 ? (jsxs("div", { className: cvaMultiValueTextCellWrapper({ className }), "data-testid": dataTestId, ref: ref, children: [icon ? (jsx(Tooltip, { asChild: false, className: "inline-flex items-center", "data-testid": dataTestId ? `${dataTestId}-icon-tooltip` : undefined, disabled: !iconTooltip, label: iconTooltip ?? "", placement: "bottom", children: icon })) : null, jsx("span", { className: cvaMultiValueTextCellTooltip(), ref: elementRef => updateTooltipVisibility(elementRef), children: jsx(Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-content-tooltip` : undefined, disabled: !isTooltipVisible, label: content ?? "", placement: "bottom", children: jsx("span", { children: content ?? "" }) }) }), count > 1 ? (jsx(Tooltip, { asChild: false, className: "inline", "data-testid": dataTestId ? `${dataTestId}-count-tooltip` : undefined, disabled: !countTooltip, label: countTooltip ?? "", placement: "bottom", children: jsxs(Tag, { color: "neutral", onMouseEnter: onMouseEnter, size: "small", children: ["+", count - 1] }) })) : null] })) : null;
|
|
466
466
|
};
|
|
467
467
|
|
|
468
468
|
/**
|
|
@@ -471,8 +471,8 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
471
471
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
472
472
|
* @returns {ReactElement} NoticeCell component
|
|
473
473
|
*/
|
|
474
|
-
const NoticeCell = ({ ...rest }) => {
|
|
475
|
-
return jsx(Notice, { ...rest });
|
|
474
|
+
const NoticeCell = ({ ref, ...rest }) => {
|
|
475
|
+
return jsx(Notice, { ref: ref, ...rest });
|
|
476
476
|
};
|
|
477
477
|
|
|
478
478
|
const cvaNumberCell = cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
|
|
@@ -524,8 +524,8 @@ const cvaNumberCell = cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "tex
|
|
|
524
524
|
* @param {NumberCellProps} props - The props for the NumberCell component.
|
|
525
525
|
* @returns {ReactElement} A React JSX element representing the NumberCell component.
|
|
526
526
|
*/
|
|
527
|
-
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId }) => {
|
|
528
|
-
return (jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, children: [jsx("span", { children: value }), value && unit ? jsx("span", { children: unit }) : null] }));
|
|
527
|
+
const NumberCell = ({ value = "", unit, className, "data-testid": dataTestId, ref }) => {
|
|
528
|
+
return (jsxs("div", { className: cvaNumberCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsx("span", { children: value }), value && unit ? jsx("span", { children: unit }) : null] }));
|
|
529
529
|
};
|
|
530
530
|
|
|
531
531
|
const cvaPlainDateCell = cvaMerge([""]);
|
|
@@ -538,12 +538,12 @@ const cvaDateTimeSince = cvaMerge(["slashed-zero", "text-neutral-500", "text-xs"
|
|
|
538
538
|
* @param {PlainDateCellProps} props - The props for the PlainDateCell component
|
|
539
539
|
* @returns {ReactElement} PlainDateCell component
|
|
540
540
|
*/
|
|
541
|
-
const PlainDateCell = ({ locale, date, withDaysSince = true, className, "data-testid": dataTestId, }) => {
|
|
541
|
+
const PlainDateCell = ({ locale, date, withDaysSince = true, className, "data-testid": dataTestId, ref, }) => {
|
|
542
542
|
if (!date) {
|
|
543
543
|
return null;
|
|
544
544
|
}
|
|
545
545
|
const formattedDate = formatDateUtil(date.toZonedDateTime("UTC"), DateTimeFormat.DATE_SHORT, "UTC", locale);
|
|
546
|
-
return (jsxs("div", { className: cvaPlainDateCell({ className }), "data-testid": dataTestId, children: [jsx("p", { className: cvaDateTime(), children: formattedDate }), withDaysSince ? jsx(DaysSince, { date: date, locale: locale }) : null] }));
|
|
546
|
+
return (jsxs("div", { className: cvaPlainDateCell({ className }), "data-testid": dataTestId, ref: ref, children: [jsx("p", { className: cvaDateTime(), children: formattedDate }), withDaysSince ? jsx(DaysSince, { date: date, locale: locale }) : null] }));
|
|
547
547
|
};
|
|
548
548
|
const DaysSince = ({ date, locale }) => {
|
|
549
549
|
let timeSince = null;
|
|
@@ -568,7 +568,7 @@ const DaysSince = ({ date, locale }) => {
|
|
|
568
568
|
* @param {string} [props.className] - Additional CSS classes to apply to the handle.
|
|
569
569
|
* @returns {ReactElement} A React element representing the resizable handle.
|
|
570
570
|
*/
|
|
571
|
-
const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ...rest }) => {
|
|
571
|
+
const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ref, ...rest }) => {
|
|
572
572
|
const onMouseDown = event => {
|
|
573
573
|
const resizeCursorClass = "cursor-col-resize";
|
|
574
574
|
document.addEventListener("mouseup", () => {
|
|
@@ -762,10 +762,11 @@ const IconWithLoader = ({ action, size }) => {
|
|
|
762
762
|
* @param {boolean} [props.sortingState=false] - Indicates the sorting state (ascending/descending).
|
|
763
763
|
* @param {string} [props."data-testid"] - A data-testid attribute for testing purposes.
|
|
764
764
|
* @param {string} [props.className] - Additional CSS classes to apply to the sorting indicator.
|
|
765
|
+
* @param {import('react').Ref<HTMLDivElement>} [props.ref] - Ref forwarded to the root DOM element.
|
|
765
766
|
* @returns {ReactElement} A React element representing the sorting indicator.
|
|
766
767
|
*/
|
|
767
|
-
const SortIndicator = ({ sortingState = false, "data-testid": dataTestId, className, ...rest }) => {
|
|
768
|
-
return (jsx("div", { className: cvaSortIndicator({ sortingState, className }), "data-testid": dataTestId, role: "separator", ...rest }));
|
|
768
|
+
const SortIndicator = ({ sortingState = false, "data-testid": dataTestId, className, ref, ...rest }) => {
|
|
769
|
+
return (jsx("div", { className: cvaSortIndicator({ sortingState, className }), "data-testid": dataTestId, ref: ref, role: "separator", ...rest }));
|
|
769
770
|
};
|
|
770
771
|
const cvaSortIndicator = cvaMerge([
|
|
771
772
|
"before:block",
|
|
@@ -862,8 +863,8 @@ const cvaTagsCell = cvaMerge(["flex", "gap-2"]);
|
|
|
862
863
|
* @param {TagsCellProps} props - The props for the TagsCell component
|
|
863
864
|
* @returns {ReactElement} TagsCell component
|
|
864
865
|
*/
|
|
865
|
-
const TagsCell = ({ className, tags, "data-testid": dataTestId }) => {
|
|
866
|
-
return (jsx("div", { className: cvaTagsCell({ className }), "data-testid": dataTestId, children: tags.map((tag, index) => (jsx(Tag, { color: "primary",
|
|
866
|
+
const TagsCell = ({ className, tags, "data-testid": dataTestId, ref }) => {
|
|
867
|
+
return (jsx("div", { className: cvaTagsCell({ className }), "data-testid": dataTestId, ref: ref, children: tags.map((tag, index) => (jsx(Tag, { color: "primary",
|
|
867
868
|
"data-testid": `${dataTestId}-${index}`,
|
|
868
869
|
...(typeof tag === "string" ? { children: tag } : tag) }, index))) }));
|
|
869
870
|
};
|
|
@@ -892,8 +893,8 @@ const Tbody = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
|
892
893
|
* @param {TdProps} props - The props for the Td component
|
|
893
894
|
* @returns {ReactElement} Td component
|
|
894
895
|
*/
|
|
895
|
-
const Td = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
896
|
-
return (jsx("td", { className: cvaTd({ className }), "data-testid": dataTestId, ...rest, children: Array.isArray(children)
|
|
896
|
+
const Td = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
897
|
+
return (jsx("td", { className: cvaTd({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: Array.isArray(children)
|
|
897
898
|
? children
|
|
898
899
|
.filter(Boolean)
|
|
899
900
|
.map((child, index) => (isValidElement(child) ? cloneElement(child, { key: index }) : child))
|
|
@@ -956,12 +957,13 @@ const cvaTextCellTooltip = cvaMerge(["grid"]);
|
|
|
956
957
|
* @param {TextCellProps} props - The props for the TextCell component
|
|
957
958
|
* @returns {ReactElement} TextCell component
|
|
958
959
|
*/
|
|
959
|
-
const TextCell = ({ content = "", className, "data-testid": dataTestId }) => {
|
|
960
|
+
const TextCell = ({ content = "", className, "data-testid": dataTestId, ref }) => {
|
|
960
961
|
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
|
|
961
962
|
const updateTooltipVisibility = (element) => {
|
|
962
963
|
setIsTooltipVisible(element ? element.scrollWidth > element.clientWidth : false);
|
|
963
964
|
};
|
|
964
|
-
|
|
965
|
+
const mergedRef = useMergeRefs([ref, (elementRef) => updateTooltipVisibility(elementRef)]);
|
|
966
|
+
return (jsx(Tooltip, { asChild: false, className: cvaTextCellTooltip(), disabled: !isTooltipVisible, label: content, placement: "bottom", children: jsx("span", { className: cvaTextCell({ className }), "data-testid": dataTestId, ref: mergedRef, children: content }) }));
|
|
965
967
|
};
|
|
966
968
|
|
|
967
969
|
/**
|
|
@@ -974,8 +976,8 @@ const TextCell = ({ content = "", className, "data-testid": dataTestId }) => {
|
|
|
974
976
|
* @param {TfootProps} props - The props for the Tfoot component
|
|
975
977
|
* @returns {ReactElement} Tfoot component
|
|
976
978
|
*/
|
|
977
|
-
const Tfoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
978
|
-
return (jsx("tfoot", { className: className, "data-testid": dataTestId, ...rest, children: children }));
|
|
979
|
+
const Tfoot = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
980
|
+
return (jsx("tfoot", { className: className, "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
979
981
|
};
|
|
980
982
|
|
|
981
983
|
/**
|
|
@@ -988,8 +990,8 @@ const Tfoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
|
988
990
|
* @param {ThProps} props - The props for the Th component
|
|
989
991
|
* @returns {ReactElement} Th component
|
|
990
992
|
*/
|
|
991
|
-
const Th = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
992
|
-
return (jsx("th", { className: cvaTh({ className }), "data-testid": dataTestId, ...rest, children: jsx("div", { className: cvaChildrenContainer(), children: Array.isArray(children)
|
|
993
|
+
const Th = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
994
|
+
return (jsx("th", { className: cvaTh({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: jsx("div", { className: cvaChildrenContainer(), children: Array.isArray(children)
|
|
993
995
|
? children
|
|
994
996
|
.filter(Boolean)
|
|
995
997
|
.map((child, index) => (isValidElement(child) ? cloneElement(child, { key: index }) : child))
|
|
@@ -1029,8 +1031,8 @@ const cvaChildrenContainer = cvaMerge([
|
|
|
1029
1031
|
* @param {TheadProps} props - The props for the Thead component
|
|
1030
1032
|
* @returns {ReactElement} Thead component
|
|
1031
1033
|
*/
|
|
1032
|
-
const Thead = ({ "data-testid": dataTestId, className, children, sticky = true, ...rest }) => {
|
|
1033
|
-
return (jsx("thead", { className: cvaThead({ sticky, className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
1034
|
+
const Thead = ({ "data-testid": dataTestId, className, children, sticky = true, ref, ...rest }) => {
|
|
1035
|
+
return (jsx("thead", { className: cvaThead({ sticky, className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
1034
1036
|
};
|
|
1035
1037
|
const cvaThead = cvaMerge(["bg-neutral-100", "text-left"], {
|
|
1036
1038
|
variants: {
|
|
@@ -1054,8 +1056,8 @@ const cvaThead = cvaMerge(["bg-neutral-100", "text-left"], {
|
|
|
1054
1056
|
* @param {TrProps} props - The props for the Tr component
|
|
1055
1057
|
* @returns {ReactElement} Tr component
|
|
1056
1058
|
*/
|
|
1057
|
-
const Tr = ({ "data-testid": dataTestId, className, children, layout = "default", ...rest }) => {
|
|
1058
|
-
return (jsx("tr", { className: cvaTr({ layout, className }), "data-testid": dataTestId, role: "row", ...rest, children: children }));
|
|
1059
|
+
const Tr = ({ "data-testid": dataTestId, className, children, layout = "default", ref, ...rest }) => {
|
|
1060
|
+
return (jsx("tr", { className: cvaTr({ layout, className }), "data-testid": dataTestId, ref: ref, role: "row", ...rest, children: children }));
|
|
1059
1061
|
};
|
|
1060
1062
|
const cvaTr = cvaMerge(["w-full", "h-max", "border-b", "border-neutral-200"], {
|
|
1061
1063
|
variants: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.23",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.17.
|
|
12
|
-
"@trackunit/ui-icons": "1.11.
|
|
13
|
-
"@trackunit/react-form-components": "1.14.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.11.
|
|
15
|
-
"@trackunit/date-and-time-utils": "1.11.
|
|
16
|
-
"@trackunit/shared-utils": "1.13.
|
|
11
|
+
"@trackunit/react-components": "1.17.21",
|
|
12
|
+
"@trackunit/ui-icons": "1.11.42",
|
|
13
|
+
"@trackunit/react-form-components": "1.14.23",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.11.43",
|
|
15
|
+
"@trackunit/date-and-time-utils": "1.11.44",
|
|
16
|
+
"@trackunit/shared-utils": "1.13.43",
|
|
17
17
|
"tailwind-merge": "^2.0.0",
|
|
18
18
|
"@js-temporal/polyfill": "^0.5.1"
|
|
19
19
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ButtonCommonProps, IconColors } from "@trackunit/react-components";
|
|
1
|
+
import { ButtonCommonProps, IconColors, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { IconName } from "@trackunit/ui-icons";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
export interface ButtonCellProps extends ButtonCommonProps {
|
|
4
|
+
export interface ButtonCellProps extends ButtonCommonProps, Refable<HTMLButtonElement> {
|
|
5
5
|
/**
|
|
6
6
|
* The content to display inside the button, typically the action text.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemporalFormat } from "@trackunit/date-and-time-utils";
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
-
export interface DateTimeCellProps extends CommonProps {
|
|
2
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
3
|
+
export interface DateTimeCellProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The date to render.
|
|
6
6
|
* If not provided, the component will not render.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
|
-
export interface HighlightCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface HighlightCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -24,4 +24,4 @@ export interface HighlightCellProps extends CommonProps, HTMLAttributes<HTMLTabl
|
|
|
24
24
|
* @param {HighlightCellProps} props - The props for the HighlightCell component
|
|
25
25
|
* @returns {ReactElement} HighlightCell component
|
|
26
26
|
*/
|
|
27
|
-
export declare const HighlightCell: ({ className, highlights, "data-testid": dataTestId }: HighlightCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const HighlightCell: ({ className, highlights, "data-testid": dataTestId, ref }: HighlightCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface IdentityCellProps extends CommonProps {
|
|
3
|
+
export interface IdentityCellProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
className?: string;
|
|
5
5
|
"data-testid"?: string;
|
|
6
6
|
/** The main title or name to display */
|
|
@@ -89,4 +89,4 @@ export interface IdentityCellProps extends CommonProps {
|
|
|
89
89
|
* @param {IdentityCellProps} props - The props for the IdentityCell component
|
|
90
90
|
* @returns {ReactElement} IdentityCell component
|
|
91
91
|
*/
|
|
92
|
-
export declare const IdentityCell: ({ link, className, "data-testid": dataTestId, title, details, thumbnail, }: IdentityCellProps) => ReactElement;
|
|
92
|
+
export declare const IdentityCell: ({ link, className, "data-testid": dataTestId, ref, title, details, thumbnail, }: IdentityCellProps) => ReactElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
-
export interface ImageCellProps extends CommonProps {
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
|
+
export interface ImageCellProps extends CommonProps, Refable<HTMLImageElement> {
|
|
3
3
|
/**
|
|
4
4
|
* The URL of the image to be displayed.
|
|
5
5
|
*/
|
|
@@ -27,4 +27,4 @@ export interface ImageCellProps extends CommonProps {
|
|
|
27
27
|
* @param {ImageCellProps} props - The props for the Image component.
|
|
28
28
|
* @returns {ReactElement} The Image component.
|
|
29
29
|
*/
|
|
30
|
-
export declare const ImageCell: ({ imageUrl, alt, width, height, "data-testid": dataTestId, ...rest }: ImageCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const ImageCell: ({ imageUrl, alt, width, height, "data-testid": dataTestId, ref, ...rest }: ImageCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IndicatorProps } from "@trackunit/react-components";
|
|
1
|
+
import { IndicatorProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface IndicatorCellProps extends IndicatorProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface IndicatorCellProps extends IndicatorProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The icon to be rendered inside the indicator component
|
|
6
6
|
*/
|
|
@@ -36,4 +36,4 @@ export interface IndicatorCellProps extends IndicatorProps, HTMLAttributes<HTMLT
|
|
|
36
36
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
37
37
|
* @returns {ReactElement} LinkCell component
|
|
38
38
|
*/
|
|
39
|
-
export declare const IndicatorCell: ({ withBackground, weight, ...rest }: IndicatorCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const IndicatorCell: ({ withBackground, weight, ref, ...rest }: IndicatorCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface LinkCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface LinkCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLAnchorElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -77,4 +77,4 @@ export interface LinkCellProps extends CommonProps, HTMLAttributes<HTMLTableSect
|
|
|
77
77
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
78
78
|
* @returns {ReactElement} LinkCell component
|
|
79
79
|
*/
|
|
80
|
-
export declare const LinkCell: ({ link, type, className, ...rest }: LinkCellProps) => ReactElement;
|
|
80
|
+
export declare const LinkCell: ({ link, type, className, ref, ...rest }: LinkCellProps) => ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
3
|
-
export interface MultiValueTextCellProps extends CommonProps {
|
|
3
|
+
export interface MultiValueTextCellProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Icon rendered to the left of the text.
|
|
6
6
|
* Provides visual context for the primary value.
|
|
@@ -42,4 +42,4 @@ export interface MultiValueTextCellProps extends CommonProps {
|
|
|
42
42
|
* @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component
|
|
43
43
|
* @returns {ReactElement} MultiValueTextCell component
|
|
44
44
|
*/
|
|
45
|
-
export declare const MultiValueTextCell: ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, }: MultiValueTextCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
45
|
+
export declare const MultiValueTextCell: ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, ref, }: MultiValueTextCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,4 +6,4 @@ export type NoticeCellProps = NoticeProps;
|
|
|
6
6
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
7
7
|
* @returns {ReactElement} NoticeCell component
|
|
8
8
|
*/
|
|
9
|
-
export declare const NoticeCell: ({ ...rest }: NoticeCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const NoticeCell: ({ ref, ...rest }: NoticeCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
-
export interface NumberCellProps extends CommonProps {
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
|
+
export interface NumberCellProps extends CommonProps, Refable<HTMLDivElement> {
|
|
3
3
|
/**
|
|
4
4
|
* The numeric value to be displayed.
|
|
5
5
|
* This can be either a string or a number.
|
|
@@ -65,4 +65,4 @@ export interface NumberCellProps extends CommonProps {
|
|
|
65
65
|
* @param {NumberCellProps} props - The props for the NumberCell component.
|
|
66
66
|
* @returns {ReactElement} A React JSX element representing the NumberCell component.
|
|
67
67
|
*/
|
|
68
|
-
export declare const NumberCell: ({ value, unit, className, "data-testid": dataTestId }: NumberCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare const NumberCell: ({ value, unit, className, "data-testid": dataTestId, ref }: NumberCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
-
export interface PlainDateCellProps extends CommonProps {
|
|
2
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
3
|
+
export interface PlainDateCellProps extends CommonProps, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The PlainDate to render.
|
|
6
6
|
* If not provided, the component will not render.
|
|
@@ -25,7 +25,7 @@ export interface PlainDateCellProps extends CommonProps {
|
|
|
25
25
|
* @param {PlainDateCellProps} props - The props for the PlainDateCell component
|
|
26
26
|
* @returns {ReactElement} PlainDateCell component
|
|
27
27
|
*/
|
|
28
|
-
export declare const PlainDateCell: ({ locale, date, withDaysSince, className, "data-testid": dataTestId, }: PlainDateCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
export declare const PlainDateCell: ({ locale, date, withDaysSince, className, "data-testid": dataTestId, ref, }: PlainDateCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
29
29
|
export interface DaysSinceProps extends Pick<PlainDateCellProps, "date" | "locale"> {
|
|
30
30
|
date: Temporal.PlainDate;
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface ResizeHandelProps extends CommonProps, HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface ResizeHandelProps extends CommonProps, HTMLAttributes<HTMLDivElement>, Refable<HTMLDivElement> {
|
|
4
4
|
isResizing?: boolean;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
@@ -12,4 +12,4 @@ export interface ResizeHandelProps extends CommonProps, HTMLAttributes<HTMLDivEl
|
|
|
12
12
|
* @param {string} [props.className] - Additional CSS classes to apply to the handle.
|
|
13
13
|
* @returns {ReactElement} A React element representing the resizable handle.
|
|
14
14
|
*/
|
|
15
|
-
export declare const ResizeHandle: ({ isResizing, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ...rest }: ResizeHandelProps) => ReactElement;
|
|
15
|
+
export declare const ResizeHandle: ({ isResizing, "data-testid": dataTestId, onMouseDown: onMouseDownHandler, className, ref, ...rest }: ResizeHandelProps) => ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface SortIndicatorProps extends CommonProps, HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
export interface SortIndicatorProps extends CommonProps, HTMLAttributes<HTMLSpanElement>, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -25,6 +25,7 @@ export interface SortIndicatorProps extends CommonProps, HTMLAttributes<HTMLSpan
|
|
|
25
25
|
* @param {boolean} [props.sortingState=false] - Indicates the sorting state (ascending/descending).
|
|
26
26
|
* @param {string} [props."data-testid"] - A data-testid attribute for testing purposes.
|
|
27
27
|
* @param {string} [props.className] - Additional CSS classes to apply to the sorting indicator.
|
|
28
|
+
* @param {import('react').Ref<HTMLDivElement>} [props.ref] - Ref forwarded to the root DOM element.
|
|
28
29
|
* @returns {ReactElement} A React element representing the sorting indicator.
|
|
29
30
|
*/
|
|
30
|
-
export declare const SortIndicator: ({ sortingState, "data-testid": dataTestId, className, ...rest }: SortIndicatorProps) => ReactElement;
|
|
31
|
+
export declare const SortIndicator: ({ sortingState, "data-testid": dataTestId, className, ref, ...rest }: SortIndicatorProps) => ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, TagProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, TagProps } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
|
-
export interface TagsCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface TagsCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -61,4 +61,4 @@ export interface TagsCellProps extends CommonProps, HTMLAttributes<HTMLTableSect
|
|
|
61
61
|
* @param {TagsCellProps} props - The props for the TagsCell component
|
|
62
62
|
* @returns {ReactElement} TagsCell component
|
|
63
63
|
*/
|
|
64
|
-
export declare const TagsCell: ({ className, tags, "data-testid": dataTestId }: TagsCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
export declare const TagsCell: ({ className, tags, "data-testid": dataTestId, ref }: TagsCellProps) => import("react/jsx-runtime").JSX.Element;
|
package/src/components/Td.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TdProps extends CommonProps, HTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
export interface TdProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Refable<HTMLTableCellElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -24,4 +24,4 @@ export interface TdProps extends CommonProps, HTMLAttributes<HTMLTableCellElemen
|
|
|
24
24
|
* @param {TdProps} props - The props for the Td component
|
|
25
25
|
* @returns {ReactElement} Td component
|
|
26
26
|
*/
|
|
27
|
-
export declare const Td: ({ "data-testid": dataTestId, className, children, ...rest }: TdProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const Td: ({ "data-testid": dataTestId, className, children, ref, ...rest }: TdProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
|
-
export interface TextCellProps extends CommonProps {
|
|
3
|
+
export interface TextCellProps extends CommonProps, Refable<HTMLSpanElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The text or React element to display in the cell.
|
|
6
6
|
* When text overflows the cell width, it will be truncated with an ellipsis
|
|
@@ -51,4 +51,4 @@ export interface TextCellProps extends CommonProps {
|
|
|
51
51
|
* @param {TextCellProps} props - The props for the TextCell component
|
|
52
52
|
* @returns {ReactElement} TextCell component
|
|
53
53
|
*/
|
|
54
|
-
export declare const TextCell: ({ content, className, "data-testid": dataTestId }: TextCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const TextCell: ({ content, className, "data-testid": dataTestId, ref }: TextCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TfootProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface TfootProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -24,4 +24,4 @@ export interface TfootProps extends CommonProps, HTMLAttributes<HTMLTableSection
|
|
|
24
24
|
* @param {TfootProps} props - The props for the Tfoot component
|
|
25
25
|
* @returns {ReactElement} Tfoot component
|
|
26
26
|
*/
|
|
27
|
-
export declare const Tfoot: ({ "data-testid": dataTestId, className, children, ...rest }: TfootProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const Tfoot: ({ "data-testid": dataTestId, className, children, ref, ...rest }: TfootProps) => import("react/jsx-runtime").JSX.Element;
|
package/src/components/Th.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface ThProps extends CommonProps, HTMLAttributes<HTMLTableCellElement> {
|
|
3
|
+
export interface ThProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Refable<HTMLTableCellElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -24,4 +24,4 @@ export interface ThProps extends CommonProps, HTMLAttributes<HTMLTableCellElemen
|
|
|
24
24
|
* @param {ThProps} props - The props for the Th component
|
|
25
25
|
* @returns {ReactElement} Th component
|
|
26
26
|
*/
|
|
27
|
-
export declare const Th: ({ "data-testid": dataTestId, className, children, ...rest }: ThProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const Th: ({ "data-testid": dataTestId, className, children, ref, ...rest }: ThProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TheadProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement> {
|
|
3
|
+
export interface TheadProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -31,4 +31,4 @@ export interface TheadProps extends CommonProps, HTMLAttributes<HTMLTableSection
|
|
|
31
31
|
* @param {TheadProps} props - The props for the Thead component
|
|
32
32
|
* @returns {ReactElement} Thead component
|
|
33
33
|
*/
|
|
34
|
-
export declare const Thead: ({ "data-testid": dataTestId, className, children, sticky, ...rest }: TheadProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const Thead: ({ "data-testid": dataTestId, className, children, sticky, ref, ...rest }: TheadProps) => import("react/jsx-runtime").JSX.Element;
|
package/src/components/Tr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TrProps extends CommonProps, HTMLAttributes<HTMLTableRowElement> {
|
|
3
|
+
export interface TrProps extends CommonProps, HTMLAttributes<HTMLTableRowElement>, Refable<HTMLTableRowElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -32,4 +32,4 @@ export interface TrProps extends CommonProps, HTMLAttributes<HTMLTableRowElement
|
|
|
32
32
|
* @param {TrProps} props - The props for the Tr component
|
|
33
33
|
* @returns {ReactElement} Tr component
|
|
34
34
|
*/
|
|
35
|
-
export declare const Tr: ({ "data-testid": dataTestId, className, children, layout, ...rest }: TrProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const Tr: ({ "data-testid": dataTestId, className, children, layout, ref, ...rest }: TrProps) => import("react/jsx-runtime").JSX.Element;
|