@trackunit/react-table-base-components 2.12.17 → 2.14.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 +14 -13
- package/index.esm.js +16 -15
- package/package.json +9 -9
- package/src/components/CheckboxCell/CheckboxCell.d.ts +3 -3
- package/src/components/HighlightCell/HighlightCell.d.ts +2 -2
- package/src/components/MultiRowTableCell/MultiRowTableCell.d.ts +3 -3
- package/src/components/MultiValueTextCell/ListTooltip.d.ts +3 -5
- package/src/components/ResizeHandle.d.ts +2 -2
- package/src/components/RowActions/RowActions.d.ts +3 -3
- package/src/components/SortIndicator.d.ts +2 -2
- package/src/components/TableRoot.d.ts +3 -3
- package/src/components/TagsCell/TagsCell.d.ts +2 -2
- package/src/components/Tbody.d.ts +2 -2
- package/src/components/Td.d.ts +2 -2
- package/src/components/Tfoot.d.ts +2 -2
- package/src/components/Th.d.ts +2 -2
- package/src/components/Thead.d.ts +2 -2
- package/src/components/Tr.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -147,8 +147,8 @@ const cvaCheckboxCell = cssClassVarianceUtilities.cva({ base: [""] });
|
|
|
147
147
|
* @param {CheckboxCellProps} props - The props for the CheckboxCell component
|
|
148
148
|
* @returns {ReactElement} CheckboxCell component
|
|
149
149
|
*/
|
|
150
|
-
const CheckboxCell = ({ checked, className, "data-testid": dataTestId, style }) => {
|
|
151
|
-
return (jsxRuntime.jsx("div", { className: cvaCheckboxCell({ className }), "data-testid": dataTestId, style: style, children: jsxRuntime.jsx(reactFormComponents.Checkbox, { checked: checked, readOnly: true }) }));
|
|
150
|
+
const CheckboxCell = ({ checked, className, "data-testid": dataTestId, style, ref }) => {
|
|
151
|
+
return (jsxRuntime.jsx("div", { className: cvaCheckboxCell({ className }), "data-testid": dataTestId, ref: ref, style: style, children: jsxRuntime.jsx(reactFormComponents.Checkbox, { checked: checked, readOnly: true }) }));
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
const cvaDateTimeCell = cssClassVarianceUtilities.cva({ base: [""] });
|
|
@@ -528,8 +528,8 @@ const cvaSecondaryRowText = cssClassVarianceUtilities.cva({
|
|
|
528
528
|
* @param {MultiRowTableCellProps} props - The props for the MultiRowTableCell component
|
|
529
529
|
* @returns {ReactElement} MultiRowTableCell component
|
|
530
530
|
*/
|
|
531
|
-
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, style, }) => {
|
|
532
|
-
return (jsxRuntime.jsx("div", { className: cvaMultiRowTableCell({ className }), style: style, 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)] }) }));
|
|
531
|
+
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, style, ref, }) => {
|
|
532
|
+
return (jsxRuntime.jsx("div", { className: cvaMultiRowTableCell({ className }), ref: ref, style: style, 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)] }) }));
|
|
533
533
|
};
|
|
534
534
|
|
|
535
535
|
/**
|
|
@@ -541,7 +541,7 @@ const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, classNa
|
|
|
541
541
|
* @param {ListTooltipProps<TItem>} props Component props.
|
|
542
542
|
* @returns {ReactNode} Tooltip list markup.
|
|
543
543
|
*/
|
|
544
|
-
const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loading = false, style, }) => {
|
|
544
|
+
const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loading = false, className, style, ref, }) => {
|
|
545
545
|
const toDisplay = (item, index) => {
|
|
546
546
|
if (getLabel) {
|
|
547
547
|
return getLabel(item, index);
|
|
@@ -573,7 +573,7 @@ const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loadi
|
|
|
573
573
|
if (loading) {
|
|
574
574
|
return jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", mode: "dark" });
|
|
575
575
|
}
|
|
576
|
-
return (jsxRuntime.jsx("ul", { className: "list-inside !ps-1 pl-1", "data-testid": dataTestId, style: style, children: items.map((item, index) => {
|
|
576
|
+
return (jsxRuntime.jsx("ul", { className: cssClassVarianceUtilities.cx("list-inside !ps-1 pl-1", className), "data-testid": dataTestId, ref: ref, style: style, children: items.map((item, index) => {
|
|
577
577
|
const label = toDisplay(item, index);
|
|
578
578
|
if (label === "" || label === null || label === undefined) {
|
|
579
579
|
return null;
|
|
@@ -753,7 +753,7 @@ const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDo
|
|
|
753
753
|
document.body.classList.add(resizeCursorClass);
|
|
754
754
|
onMouseDownHandler?.(event);
|
|
755
755
|
};
|
|
756
|
-
return (jsxRuntime.jsx("div", { className: cvaResizeHandel({ isResizing, className }), "data-testid": dataTestId, onMouseDown: onMouseDown, role: "separator", ...rest }));
|
|
756
|
+
return (jsxRuntime.jsx("div", { className: cvaResizeHandel({ isResizing, className }), "data-testid": dataTestId, onMouseDown: onMouseDown, ref: ref, role: "separator", ...rest }));
|
|
757
757
|
};
|
|
758
758
|
const cvaResizeHandel = cssClassVarianceUtilities.cva({
|
|
759
759
|
base: [
|
|
@@ -892,8 +892,9 @@ const cvaResizeHandel = cssClassVarianceUtilities.cva({
|
|
|
892
892
|
* @param {RowActionsProps} props - The properties for the component.
|
|
893
893
|
* @returns {ReactElement} A React component rendering the row actions.
|
|
894
894
|
*/
|
|
895
|
-
const RowActions = ({ actions, style }) => {
|
|
895
|
+
const RowActions = ({ actions, className, "data-testid": dataTestId, style, ref }) => {
|
|
896
896
|
const [t] = useTranslation();
|
|
897
|
+
const rootRef = reactComponents.useMergeRefs([ref]);
|
|
897
898
|
const selectedActions = actions.filter(action => action.isSelected);
|
|
898
899
|
const normalActions = actions.filter(action => (action.isVisible ?? true) && action.variant !== "danger");
|
|
899
900
|
const dangerActions = actions.filter(action => (action.isVisible ?? true) && action.variant === "danger");
|
|
@@ -903,12 +904,12 @@ const RowActions = ({ actions, style }) => {
|
|
|
903
904
|
if (actions.length === 1) {
|
|
904
905
|
const [action] = actions;
|
|
905
906
|
return (action &&
|
|
906
|
-
(action.isVisible ?? true) && (jsxRuntime.jsx(reactComponents.Button, { disabled: action.disabled || action.loading, onClick: event => {
|
|
907
|
+
(action.isVisible ?? true) && (jsxRuntime.jsx(reactComponents.Button, { className: className, "data-testid": dataTestId, disabled: action.disabled || action.loading, onClick: event => {
|
|
907
908
|
event.stopPropagation();
|
|
908
909
|
action.onClick(event);
|
|
909
|
-
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "small" }), size: "small", style: style, variant: "secondary", children: action.label })));
|
|
910
|
+
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "small" }), ref: rootRef, size: "small", style: style, variant: "secondary", children: action.label })));
|
|
910
911
|
}
|
|
911
|
-
return (jsxRuntime.jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsxRuntime.jsx(reactComponents.IconButton, { className: "mr-2", icon: jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
912
|
+
return (jsxRuntime.jsxs("div", { className: cssClassVarianceUtilities.cx("flex items-center", className), "data-testid": dataTestId ?? "row-actions", ref: rootRef, style: style, children: [selectedActions.map((action, index) => (jsxRuntime.jsx(reactComponents.IconButton, { className: "mr-2", icon: jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
912
913
|
event.stopPropagation();
|
|
913
914
|
action.onClick(event);
|
|
914
915
|
}, size: "small", title: action.label, variant: "ghost-neutral" }, `selected-action-${index}`))), jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.IconButton, { icon: jsxRuntime.jsx(reactComponents.Icon, { name: "EllipsisHorizontal", size: "medium" }), onClick: event => event.stopPropagation(), size: "small", title: t("rowActions.moreActions"), variant: "ghost-neutral" }), children: close => (jsxRuntime.jsxs(reactComponents.MenuContent, { children: [normalActions.map((action, index) => (jsxRuntime.jsx(reactComponents.MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: event => {
|
|
@@ -1002,8 +1003,8 @@ const cvaSortIndicator = cssClassVarianceUtilities.cva({
|
|
|
1002
1003
|
* @param {TableRootProps} props - The props for the TableRoot component
|
|
1003
1004
|
* @returns {ReactElement} TableRoot component
|
|
1004
1005
|
*/
|
|
1005
|
-
const TableRoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
1006
|
-
return (jsxRuntime.jsx("table", { className: cvaTableRoot({ className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
1006
|
+
const TableRoot = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
1007
|
+
return (jsxRuntime.jsx("table", { className: cvaTableRoot({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
1007
1008
|
};
|
|
1008
1009
|
const cvaTableRoot = cssClassVarianceUtilities.cva({ base: ["border-spacing-0", "min-w-full", "border-collapse", "grid-rows-min-fr", "grid"] });
|
|
1009
1010
|
|
package/index.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { Button, Icon, Highlight, Heading, ExternalLink, DetailsList, Indicator, Spinner, Tooltip, Text, Tag, Notice, IconButton, MoreMenu, MenuContent, MenuItem, MenuDivider, useMeasure
|
|
3
|
+
import { Button, Icon, Highlight, Heading, ExternalLink, DetailsList, Indicator, Spinner, Tooltip, Text, Tag, Notice, useMergeRefs, IconButton, MoreMenu, MenuContent, MenuItem, MenuDivider, useMeasure } from '@trackunit/react-components';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { Checkbox } from '@trackunit/react-form-components';
|
|
6
|
-
import { cva } from '@trackunit/css-class-variance-utilities';
|
|
6
|
+
import { cva, cx } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { formatDateUtil, timeSinceAuto, timeSinceInDays, Temporal } from '@trackunit/date-and-time-utils';
|
|
8
8
|
import { useTimezone, useLocale, useHourCycle } from '@trackunit/react-date-and-time-hooks';
|
|
9
9
|
import { useMemo, useState, useEffect, isValidElement, cloneElement } from 'react';
|
|
@@ -145,8 +145,8 @@ const cvaCheckboxCell = cva({ base: [""] });
|
|
|
145
145
|
* @param {CheckboxCellProps} props - The props for the CheckboxCell component
|
|
146
146
|
* @returns {ReactElement} CheckboxCell component
|
|
147
147
|
*/
|
|
148
|
-
const CheckboxCell = ({ checked, className, "data-testid": dataTestId, style }) => {
|
|
149
|
-
return (jsx("div", { className: cvaCheckboxCell({ className }), "data-testid": dataTestId, style: style, children: jsx(Checkbox, { checked: checked, readOnly: true }) }));
|
|
148
|
+
const CheckboxCell = ({ checked, className, "data-testid": dataTestId, style, ref }) => {
|
|
149
|
+
return (jsx("div", { className: cvaCheckboxCell({ className }), "data-testid": dataTestId, ref: ref, style: style, children: jsx(Checkbox, { checked: checked, readOnly: true }) }));
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
const cvaDateTimeCell = cva({ base: [""] });
|
|
@@ -526,8 +526,8 @@ const cvaSecondaryRowText = cva({
|
|
|
526
526
|
* @param {MultiRowTableCellProps} props - The props for the MultiRowTableCell component
|
|
527
527
|
* @returns {ReactElement} MultiRowTableCell component
|
|
528
528
|
*/
|
|
529
|
-
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, style, }) => {
|
|
530
|
-
return (jsx("div", { className: cvaMultiRowTableCell({ className }), style: style, 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)] }) }));
|
|
529
|
+
const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, className, style, ref, }) => {
|
|
530
|
+
return (jsx("div", { className: cvaMultiRowTableCell({ className }), ref: ref, style: style, 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)] }) }));
|
|
531
531
|
};
|
|
532
532
|
|
|
533
533
|
/**
|
|
@@ -539,7 +539,7 @@ const MultiRowTableCell = ({ main, secondary, "data-testid": dataTestId, classNa
|
|
|
539
539
|
* @param {ListTooltipProps<TItem>} props Component props.
|
|
540
540
|
* @returns {ReactNode} Tooltip list markup.
|
|
541
541
|
*/
|
|
542
|
-
const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loading = false, style, }) => {
|
|
542
|
+
const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loading = false, className, style, ref, }) => {
|
|
543
543
|
const toDisplay = (item, index) => {
|
|
544
544
|
if (getLabel) {
|
|
545
545
|
return getLabel(item, index);
|
|
@@ -571,7 +571,7 @@ const ListTooltip = ({ items, "data-testid": dataTestId, getLabel, getKey, loadi
|
|
|
571
571
|
if (loading) {
|
|
572
572
|
return jsx(Spinner, { centering: "centered", mode: "dark" });
|
|
573
573
|
}
|
|
574
|
-
return (jsx("ul", { className: "list-inside !ps-1 pl-1", "data-testid": dataTestId, style: style, children: items.map((item, index) => {
|
|
574
|
+
return (jsx("ul", { className: cx("list-inside !ps-1 pl-1", className), "data-testid": dataTestId, ref: ref, style: style, children: items.map((item, index) => {
|
|
575
575
|
const label = toDisplay(item, index);
|
|
576
576
|
if (label === "" || label === null || label === undefined) {
|
|
577
577
|
return null;
|
|
@@ -751,7 +751,7 @@ const ResizeHandle = ({ isResizing = false, "data-testid": dataTestId, onMouseDo
|
|
|
751
751
|
document.body.classList.add(resizeCursorClass);
|
|
752
752
|
onMouseDownHandler?.(event);
|
|
753
753
|
};
|
|
754
|
-
return (jsx("div", { className: cvaResizeHandel({ isResizing, className }), "data-testid": dataTestId, onMouseDown: onMouseDown, role: "separator", ...rest }));
|
|
754
|
+
return (jsx("div", { className: cvaResizeHandel({ isResizing, className }), "data-testid": dataTestId, onMouseDown: onMouseDown, ref: ref, role: "separator", ...rest }));
|
|
755
755
|
};
|
|
756
756
|
const cvaResizeHandel = cva({
|
|
757
757
|
base: [
|
|
@@ -890,8 +890,9 @@ const cvaResizeHandel = cva({
|
|
|
890
890
|
* @param {RowActionsProps} props - The properties for the component.
|
|
891
891
|
* @returns {ReactElement} A React component rendering the row actions.
|
|
892
892
|
*/
|
|
893
|
-
const RowActions = ({ actions, style }) => {
|
|
893
|
+
const RowActions = ({ actions, className, "data-testid": dataTestId, style, ref }) => {
|
|
894
894
|
const [t] = useTranslation();
|
|
895
|
+
const rootRef = useMergeRefs([ref]);
|
|
895
896
|
const selectedActions = actions.filter(action => action.isSelected);
|
|
896
897
|
const normalActions = actions.filter(action => (action.isVisible ?? true) && action.variant !== "danger");
|
|
897
898
|
const dangerActions = actions.filter(action => (action.isVisible ?? true) && action.variant === "danger");
|
|
@@ -901,12 +902,12 @@ const RowActions = ({ actions, style }) => {
|
|
|
901
902
|
if (actions.length === 1) {
|
|
902
903
|
const [action] = actions;
|
|
903
904
|
return (action &&
|
|
904
|
-
(action.isVisible ?? true) && (jsx(Button, { disabled: action.disabled || action.loading, onClick: event => {
|
|
905
|
+
(action.isVisible ?? true) && (jsx(Button, { className: className, "data-testid": dataTestId, disabled: action.disabled || action.loading, onClick: event => {
|
|
905
906
|
event.stopPropagation();
|
|
906
907
|
action.onClick(event);
|
|
907
|
-
}, prefix: jsx(IconWithLoader, { action: action, size: "small" }), size: "small", style: style, variant: "secondary", children: action.label })));
|
|
908
|
+
}, prefix: jsx(IconWithLoader, { action: action, size: "small" }), ref: rootRef, size: "small", style: style, variant: "secondary", children: action.label })));
|
|
908
909
|
}
|
|
909
|
-
return (jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsx(IconButton, { className: "mr-2", icon: jsx(Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
910
|
+
return (jsxs("div", { className: cx("flex items-center", className), "data-testid": dataTestId ?? "row-actions", ref: rootRef, style: style, children: [selectedActions.map((action, index) => (jsx(IconButton, { className: "mr-2", icon: jsx(Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
910
911
|
event.stopPropagation();
|
|
911
912
|
action.onClick(event);
|
|
912
913
|
}, size: "small", title: action.label, variant: "ghost-neutral" }, `selected-action-${index}`))), jsx(MoreMenu, { customButton: jsx(IconButton, { icon: jsx(Icon, { name: "EllipsisHorizontal", size: "medium" }), onClick: event => event.stopPropagation(), size: "small", title: t("rowActions.moreActions"), variant: "ghost-neutral" }), children: close => (jsxs(MenuContent, { children: [normalActions.map((action, index) => (jsx(MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: event => {
|
|
@@ -1000,8 +1001,8 @@ const cvaSortIndicator = cva({
|
|
|
1000
1001
|
* @param {TableRootProps} props - The props for the TableRoot component
|
|
1001
1002
|
* @returns {ReactElement} TableRoot component
|
|
1002
1003
|
*/
|
|
1003
|
-
const TableRoot = ({ "data-testid": dataTestId, className, children, ...rest }) => {
|
|
1004
|
-
return (jsx("table", { className: cvaTableRoot({ className }), "data-testid": dataTestId, ...rest, children: children }));
|
|
1004
|
+
const TableRoot = ({ "data-testid": dataTestId, className, children, ref, ...rest }) => {
|
|
1005
|
+
return (jsx("table", { className: cvaTableRoot({ className }), "data-testid": dataTestId, ref: ref, ...rest, children: children }));
|
|
1005
1006
|
};
|
|
1006
1007
|
const cvaTableRoot = cva({ base: ["border-spacing-0", "min-w-full", "border-collapse", "grid-rows-min-fr", "grid"] });
|
|
1007
1008
|
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "3.
|
|
11
|
-
"@trackunit/ui-icons": "1.
|
|
12
|
-
"@trackunit/react-form-components": "2.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "2.
|
|
14
|
-
"@trackunit/date-and-time-utils": "1.
|
|
15
|
-
"@trackunit/react-date-and-time-hooks": "2.
|
|
16
|
-
"@trackunit/shared-utils": "1.
|
|
17
|
-
"@trackunit/i18n-library-translation": "2.
|
|
10
|
+
"@trackunit/react-components": "3.10.0",
|
|
11
|
+
"@trackunit/ui-icons": "1.19.0",
|
|
12
|
+
"@trackunit/react-form-components": "2.12.0",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "2.5.0",
|
|
14
|
+
"@trackunit/date-and-time-utils": "1.19.0",
|
|
15
|
+
"@trackunit/react-date-and-time-hooks": "2.12.0",
|
|
16
|
+
"@trackunit/shared-utils": "1.21.0",
|
|
17
|
+
"@trackunit/i18n-library-translation": "2.10.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommonProps, type Styleable } from "@trackunit/react-components";
|
|
2
|
-
export interface CheckboxCellProps extends CommonProps, Styleable {
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
|
+
export interface CheckboxCellProps extends CommonProps, Styleable, Refable<HTMLDivElement> {
|
|
3
3
|
checked: boolean;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
@@ -21,4 +21,4 @@ export interface CheckboxCellProps extends CommonProps, Styleable {
|
|
|
21
21
|
* @param {CheckboxCellProps} props - The props for the CheckboxCell component
|
|
22
22
|
* @returns {ReactElement} CheckboxCell component
|
|
23
23
|
*/
|
|
24
|
-
export declare const CheckboxCell: ({ checked, className, "data-testid": dataTestId, style }: CheckboxCellProps) => import("react").JSX.Element;
|
|
24
|
+
export declare const CheckboxCell: ({ checked, className, "data-testid": dataTestId, style, ref }: CheckboxCellProps) => import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, HighlightProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, HighlightProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
|
-
export interface HighlightCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLDivElement> {
|
|
3
|
+
export interface HighlightCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Styleable, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, type Styleable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
export interface MultiRowTableCellProps extends CommonProps, Styleable {
|
|
3
|
+
export interface MultiRowTableCellProps extends CommonProps, Styleable, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Main row of the cell.
|
|
6
6
|
*/
|
|
@@ -32,4 +32,4 @@ export interface MultiRowTableCellProps extends CommonProps, Styleable {
|
|
|
32
32
|
* @param {MultiRowTableCellProps} props - The props for the MultiRowTableCell component
|
|
33
33
|
* @returns {ReactElement} MultiRowTableCell component
|
|
34
34
|
*/
|
|
35
|
-
export declare const MultiRowTableCell: ({ main, secondary, "data-testid": dataTestId, className, style, }: MultiRowTableCellProps) => import("react").JSX.Element;
|
|
35
|
+
export declare const MultiRowTableCell: ({ main, secondary, "data-testid": dataTestId, className, style, ref, }: MultiRowTableCellProps) => import("react").JSX.Element;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { type Styleable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { Key, ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Props for a generic tooltip list component.
|
|
5
5
|
*
|
|
6
6
|
* @template TItem Element type of the list.
|
|
7
7
|
*/
|
|
8
|
-
export type ListTooltipProps<TItem = unknown> = Styleable & {
|
|
8
|
+
export type ListTooltipProps<TItem = unknown> = CommonProps & Styleable & Refable<HTMLUListElement> & {
|
|
9
9
|
/** Items to render inside the tooltip. */
|
|
10
10
|
items: Array<TItem>;
|
|
11
|
-
/** Data test id for testing. */
|
|
12
|
-
"data-testid"?: string;
|
|
13
11
|
/**
|
|
14
12
|
* Custom label extractor. If omitted, strings/numbers/booleans are stringified,
|
|
15
13
|
* React elements are returned as-is, and other objects are serialized.
|
|
@@ -32,4 +30,4 @@ export type ListTooltipProps<TItem = unknown> = Styleable & {
|
|
|
32
30
|
* @param {ListTooltipProps<TItem>} props Component props.
|
|
33
31
|
* @returns {ReactNode} Tooltip list markup.
|
|
34
32
|
*/
|
|
35
|
-
export declare const ListTooltip: <TItem = unknown>({ items, "data-testid": dataTestId, getLabel, getKey, loading, style, }: ListTooltipProps<TItem>) => import("react").JSX.Element;
|
|
33
|
+
export declare const ListTooltip: <TItem = unknown>({ items, "data-testid": dataTestId, getLabel, getKey, loading, className, style, ref, }: ListTooltipProps<TItem>) => import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface ResizeHandelProps extends CommonProps, HTMLAttributes<HTMLDivElement>, Refable<HTMLDivElement> {
|
|
3
|
+
export interface ResizeHandelProps extends CommonProps, HTMLAttributes<HTMLDivElement>, Styleable, Refable<HTMLDivElement> {
|
|
4
4
|
isResizing?: boolean;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuItemVariant, type Styleable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, MenuItemVariant, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { IconName } from "@trackunit/ui-icons";
|
|
3
3
|
import { MouseEventHandler } from "react";
|
|
4
4
|
export type Action = {
|
|
@@ -19,7 +19,7 @@ export type Action = {
|
|
|
19
19
|
/** Controls visibility of the action. Defaults to true if not specified */
|
|
20
20
|
isVisible?: boolean | null;
|
|
21
21
|
};
|
|
22
|
-
export interface RowActionsProps extends Styleable {
|
|
22
|
+
export interface RowActionsProps extends CommonProps, Styleable, Refable<HTMLElement> {
|
|
23
23
|
/**
|
|
24
24
|
* Array of actions to display. Single actions render as a button,
|
|
25
25
|
* multiple actions render as a dropdown menu with selected actions as icon buttons.
|
|
@@ -136,4 +136,4 @@ export interface RowActionsProps extends Styleable {
|
|
|
136
136
|
* @param {RowActionsProps} props - The properties for the component.
|
|
137
137
|
* @returns {ReactElement} A React component rendering the row actions.
|
|
138
138
|
*/
|
|
139
|
-
export declare const RowActions: ({ actions, style }: RowActionsProps) => false | import("react").JSX.Element | null | undefined;
|
|
139
|
+
export declare const RowActions: ({ actions, className, "data-testid": dataTestId, style, ref }: RowActionsProps) => false | import("react").JSX.Element | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactElement } from "react";
|
|
3
|
-
export interface SortIndicatorProps extends CommonProps, HTMLAttributes<HTMLSpanElement>, Refable<HTMLDivElement> {
|
|
3
|
+
export interface SortIndicatorProps extends CommonProps, HTMLAttributes<HTMLSpanElement>, Styleable, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TableRootProps extends CommonProps, HTMLAttributes<HTMLTableElement> {
|
|
3
|
+
export interface TableRootProps extends CommonProps, HTMLAttributes<HTMLTableElement>, Styleable, Refable<HTMLTableElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -24,4 +24,4 @@ export interface TableRootProps extends CommonProps, HTMLAttributes<HTMLTableEle
|
|
|
24
24
|
* @param {TableRootProps} props - The props for the TableRoot component
|
|
25
25
|
* @returns {ReactElement} TableRoot component
|
|
26
26
|
*/
|
|
27
|
-
export declare const TableRoot: ({ "data-testid": dataTestId, className, children, ...rest }: TableRootProps) => import("react").JSX.Element;
|
|
27
|
+
export declare const TableRoot: ({ "data-testid": dataTestId, className, children, ref, ...rest }: TableRootProps) => import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable, TagProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable, TagProps } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
|
-
export interface TagsCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLDivElement> {
|
|
3
|
+
export interface TagsCellProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Styleable, Refable<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TbodyProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLTableSectionElement> {
|
|
3
|
+
export interface TbodyProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Styleable, Refable<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
package/src/components/Td.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TdProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Refable<HTMLTableCellElement> {
|
|
3
|
+
export interface TdProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Styleable, Refable<HTMLTableCellElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TfootProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLTableSectionElement> {
|
|
3
|
+
export interface TfootProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Styleable, Refable<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
package/src/components/Th.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface ThProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Refable<HTMLTableCellElement> {
|
|
3
|
+
export interface ThProps extends CommonProps, HTMLAttributes<HTMLTableCellElement>, Styleable, Refable<HTMLTableCellElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TheadProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Refable<HTMLTableSectionElement> {
|
|
3
|
+
export interface TheadProps extends CommonProps, HTMLAttributes<HTMLTableSectionElement>, Styleable, Refable<HTMLTableSectionElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|
package/src/components/Tr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommonProps, Refable } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
export interface TrProps extends CommonProps, HTMLAttributes<HTMLTableRowElement>, Refable<HTMLTableRowElement> {
|
|
3
|
+
export interface TrProps extends CommonProps, HTMLAttributes<HTMLTableRowElement>, Styleable, Refable<HTMLTableRowElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A id that can be used in tests to get the component
|
|
6
6
|
*/
|