@trackunit/react-table-base-components 1.3.66 → 1.3.69
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
CHANGED
|
@@ -33,8 +33,8 @@ const CheckboxCell = ({ checked, className, dataTestId }) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const cvaDateTimeCell = cssClassVarianceUtilities.cvaMerge([""]);
|
|
36
|
-
const cvaDateTime$1 = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-
|
|
37
|
-
const cvaDateTimeSince$1 = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-neutral-500", "text-
|
|
36
|
+
const cvaDateTime$1 = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-sm", "text-ellipsis"]);
|
|
37
|
+
const cvaDateTimeSince$1 = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-neutral-500", "text-xs", "text-ellipsis"]);
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* DateTimeCell is used for render a date and or time in a table cell.
|
|
@@ -121,28 +121,30 @@ const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, dataTestId,
|
|
|
121
121
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
122
122
|
* @returns {ReactElement} LinkCell component
|
|
123
123
|
*/
|
|
124
|
-
const IndicatorCell = ({ ...rest }) => {
|
|
125
|
-
return jsxRuntime.jsx(reactComponents.Indicator, { ...rest });
|
|
124
|
+
const IndicatorCell = ({ withBackground = false, weight = "normal", ...rest }) => {
|
|
125
|
+
return jsxRuntime.jsx(reactComponents.Indicator, { weight: weight, withBackground: withBackground, ...rest });
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
const cvaLinkCell = cssClassVarianceUtilities.cvaMerge(["text-sm"]);
|
|
129
|
+
|
|
128
130
|
/**
|
|
129
131
|
* The LinkCell is used for render a list of tags in a table cell
|
|
130
132
|
*
|
|
131
133
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
132
134
|
* @returns {ReactElement} LinkCell component
|
|
133
135
|
*/
|
|
134
|
-
const LinkCell = ({ link, type, ...rest }) => {
|
|
136
|
+
const LinkCell = ({ link, type, className, ...rest }) => {
|
|
135
137
|
const linkPrefix = type === "LINK" ? "" : type === "PHONE" ? "tel:" : "mailto:";
|
|
136
138
|
const handleClick = (event) => {
|
|
137
139
|
event.stopPropagation();
|
|
138
140
|
};
|
|
139
|
-
return (jsxRuntime.jsx(reactComponents.ExternalLink, { href: `${linkPrefix}${link}`, ...rest, onClick: handleClick, children: link }));
|
|
141
|
+
return (jsxRuntime.jsx(reactComponents.ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ...rest, onClick: handleClick, children: link }));
|
|
140
142
|
};
|
|
141
143
|
|
|
142
144
|
const cvaMultiRowTableCellSection = cssClassVarianceUtilities.cvaMerge(["flex", "flex-col", "justify-center", "overflow-hidden"]);
|
|
143
145
|
const cvaMultiRowTableCell = cssClassVarianceUtilities.cvaMerge(["flex", "justify-start", "pl-2"]);
|
|
144
|
-
const cvaMainRowText = cssClassVarianceUtilities.cvaMerge(["overflow-hidden", "text-ellipsis", "
|
|
145
|
-
const cvaSecondaryRowText = cssClassVarianceUtilities.cvaMerge(["overflow-hidden", "text-ellipsis", "text-neutral-
|
|
146
|
+
const cvaMainRowText = cssClassVarianceUtilities.cvaMerge(["overflow-hidden", "text-ellipsis", "text-sm"]);
|
|
147
|
+
const cvaSecondaryRowText = cssClassVarianceUtilities.cvaMerge(["overflow-hidden", "text-ellipsis", "text-neutral-500", "text-xs"]);
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* The MultiRowTableCell component helps to display two rows inside a table cell.
|
|
@@ -155,7 +157,12 @@ const MultiRowTableCell = ({ main, secondary, dataTestId, className }) => {
|
|
|
155
157
|
};
|
|
156
158
|
|
|
157
159
|
const cvaMultiValueTextCellWrapper = cssClassVarianceUtilities.cvaMerge(["flex", "flex-row", "items-center", "gap-1", "overflow-hidden"]);
|
|
158
|
-
const cvaMultiValueTextCellTooltip = cssClassVarianceUtilities.cvaMerge([
|
|
160
|
+
const cvaMultiValueTextCellTooltip = cssClassVarianceUtilities.cvaMerge([
|
|
161
|
+
"whitespace-no-wrap",
|
|
162
|
+
"overflow-hidden",
|
|
163
|
+
"text-ellipsis",
|
|
164
|
+
"text-sm",
|
|
165
|
+
]);
|
|
159
166
|
|
|
160
167
|
/**
|
|
161
168
|
* The `<MultiValueTextCell>` component is used for displaying the text values with multiple values in a table cell. First element is displayed as a text, the rest of the values are displayed as a number. Icon can be passed as an optional prop.
|
|
@@ -202,8 +209,8 @@ const NumberCell = ({ value = "", unit, className, dataTestId }) => {
|
|
|
202
209
|
};
|
|
203
210
|
|
|
204
211
|
const cvaPlainDateCell = cssClassVarianceUtilities.cvaMerge([""]);
|
|
205
|
-
const cvaDateTime = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-
|
|
206
|
-
const cvaDateTimeSince = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-neutral-500", "text-
|
|
212
|
+
const cvaDateTime = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-sm", "text-ellipsis"]);
|
|
213
|
+
const cvaDateTimeSince = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "text-neutral-500", "text-xs", "text-ellipsis"]);
|
|
207
214
|
|
|
208
215
|
/**
|
|
209
216
|
* PlainDateCell is used for render a date and or time in a table cell.
|
|
@@ -363,7 +370,7 @@ const Td = ({ dataTestId, className, children, ...rest }) => {
|
|
|
363
370
|
};
|
|
364
371
|
const cvaTd = cssClassVarianceUtilities.cvaMerge(["overflow-hidden", "align-middle", "py-table-spacing", "px-2", "whitespace-nowrap"]);
|
|
365
372
|
|
|
366
|
-
const cvaTextCell = cssClassVarianceUtilities.cvaMerge(["truncate"]);
|
|
373
|
+
const cvaTextCell = cssClassVarianceUtilities.cvaMerge(["truncate", "text-sm"]);
|
|
367
374
|
const cvaTextCellTooltip = cssClassVarianceUtilities.cvaMerge(["grid"]);
|
|
368
375
|
|
|
369
376
|
/**
|
package/index.esm.js
CHANGED
|
@@ -31,8 +31,8 @@ const CheckboxCell = ({ checked, className, dataTestId }) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const cvaDateTimeCell = cvaMerge([""]);
|
|
34
|
-
const cvaDateTime$1 = cvaMerge(["slashed-zero", "text-
|
|
35
|
-
const cvaDateTimeSince$1 = cvaMerge(["slashed-zero", "text-neutral-500", "text-
|
|
34
|
+
const cvaDateTime$1 = cvaMerge(["slashed-zero", "text-sm", "text-ellipsis"]);
|
|
35
|
+
const cvaDateTimeSince$1 = cvaMerge(["slashed-zero", "text-neutral-500", "text-xs", "text-ellipsis"]);
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* DateTimeCell is used for render a date and or time in a table cell.
|
|
@@ -119,28 +119,30 @@ const ImageCell = ({ imageUrl, alt = "", width = 100, height = 100, dataTestId,
|
|
|
119
119
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
120
120
|
* @returns {ReactElement} LinkCell component
|
|
121
121
|
*/
|
|
122
|
-
const IndicatorCell = ({ ...rest }) => {
|
|
123
|
-
return jsx(Indicator, { ...rest });
|
|
122
|
+
const IndicatorCell = ({ withBackground = false, weight = "normal", ...rest }) => {
|
|
123
|
+
return jsx(Indicator, { weight: weight, withBackground: withBackground, ...rest });
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
const cvaLinkCell = cvaMerge(["text-sm"]);
|
|
127
|
+
|
|
126
128
|
/**
|
|
127
129
|
* The LinkCell is used for render a list of tags in a table cell
|
|
128
130
|
*
|
|
129
131
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
130
132
|
* @returns {ReactElement} LinkCell component
|
|
131
133
|
*/
|
|
132
|
-
const LinkCell = ({ link, type, ...rest }) => {
|
|
134
|
+
const LinkCell = ({ link, type, className, ...rest }) => {
|
|
133
135
|
const linkPrefix = type === "LINK" ? "" : type === "PHONE" ? "tel:" : "mailto:";
|
|
134
136
|
const handleClick = (event) => {
|
|
135
137
|
event.stopPropagation();
|
|
136
138
|
};
|
|
137
|
-
return (jsx(ExternalLink, { href: `${linkPrefix}${link}`, ...rest, onClick: handleClick, children: link }));
|
|
139
|
+
return (jsx(ExternalLink, { className: cvaLinkCell({ className }), href: `${linkPrefix}${link}`, ...rest, onClick: handleClick, children: link }));
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
const cvaMultiRowTableCellSection = cvaMerge(["flex", "flex-col", "justify-center", "overflow-hidden"]);
|
|
141
143
|
const cvaMultiRowTableCell = cvaMerge(["flex", "justify-start", "pl-2"]);
|
|
142
|
-
const cvaMainRowText = cvaMerge(["overflow-hidden", "text-ellipsis", "
|
|
143
|
-
const cvaSecondaryRowText = cvaMerge(["overflow-hidden", "text-ellipsis", "text-neutral-
|
|
144
|
+
const cvaMainRowText = cvaMerge(["overflow-hidden", "text-ellipsis", "text-sm"]);
|
|
145
|
+
const cvaSecondaryRowText = cvaMerge(["overflow-hidden", "text-ellipsis", "text-neutral-500", "text-xs"]);
|
|
144
146
|
|
|
145
147
|
/**
|
|
146
148
|
* The MultiRowTableCell component helps to display two rows inside a table cell.
|
|
@@ -153,7 +155,12 @@ const MultiRowTableCell = ({ main, secondary, dataTestId, className }) => {
|
|
|
153
155
|
};
|
|
154
156
|
|
|
155
157
|
const cvaMultiValueTextCellWrapper = cvaMerge(["flex", "flex-row", "items-center", "gap-1", "overflow-hidden"]);
|
|
156
|
-
const cvaMultiValueTextCellTooltip = cvaMerge([
|
|
158
|
+
const cvaMultiValueTextCellTooltip = cvaMerge([
|
|
159
|
+
"whitespace-no-wrap",
|
|
160
|
+
"overflow-hidden",
|
|
161
|
+
"text-ellipsis",
|
|
162
|
+
"text-sm",
|
|
163
|
+
]);
|
|
157
164
|
|
|
158
165
|
/**
|
|
159
166
|
* The `<MultiValueTextCell>` component is used for displaying the text values with multiple values in a table cell. First element is displayed as a text, the rest of the values are displayed as a number. Icon can be passed as an optional prop.
|
|
@@ -200,8 +207,8 @@ const NumberCell = ({ value = "", unit, className, dataTestId }) => {
|
|
|
200
207
|
};
|
|
201
208
|
|
|
202
209
|
const cvaPlainDateCell = cvaMerge([""]);
|
|
203
|
-
const cvaDateTime = cvaMerge(["slashed-zero", "text-
|
|
204
|
-
const cvaDateTimeSince = cvaMerge(["slashed-zero", "text-neutral-500", "text-
|
|
210
|
+
const cvaDateTime = cvaMerge(["slashed-zero", "text-sm", "text-ellipsis"]);
|
|
211
|
+
const cvaDateTimeSince = cvaMerge(["slashed-zero", "text-neutral-500", "text-xs", "text-ellipsis"]);
|
|
205
212
|
|
|
206
213
|
/**
|
|
207
214
|
* PlainDateCell is used for render a date and or time in a table cell.
|
|
@@ -361,7 +368,7 @@ const Td = ({ dataTestId, className, children, ...rest }) => {
|
|
|
361
368
|
};
|
|
362
369
|
const cvaTd = cvaMerge(["overflow-hidden", "align-middle", "py-table-spacing", "px-2", "whitespace-nowrap"]);
|
|
363
370
|
|
|
364
|
-
const cvaTextCell = cvaMerge(["truncate"]);
|
|
371
|
+
const cvaTextCell = cvaMerge(["truncate", "text-sm"]);
|
|
365
372
|
const cvaTextCellTooltip = cvaMerge(["grid"]);
|
|
366
373
|
|
|
367
374
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.69",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"@js-temporal/polyfill": "^0.4.4",
|
|
12
|
-
"@trackunit/react-components": "1.4.
|
|
13
|
-
"@trackunit/ui-icons": "1.3.
|
|
14
|
-
"@trackunit/react-form-components": "1.3.
|
|
15
|
-
"@trackunit/css-class-variance-utilities": "1.3.
|
|
16
|
-
"@trackunit/date-and-time-utils": "1.3.
|
|
17
|
-
"@trackunit/shared-utils": "1.5.
|
|
12
|
+
"@trackunit/react-components": "1.4.60",
|
|
13
|
+
"@trackunit/ui-icons": "1.3.49",
|
|
14
|
+
"@trackunit/react-form-components": "1.3.69",
|
|
15
|
+
"@trackunit/css-class-variance-utilities": "1.3.49",
|
|
16
|
+
"@trackunit/date-and-time-utils": "1.3.49",
|
|
17
|
+
"@trackunit/shared-utils": "1.5.49"
|
|
18
18
|
},
|
|
19
19
|
"module": "./index.esm.js",
|
|
20
20
|
"main": "./index.cjs.js",
|
|
@@ -14,7 +14,7 @@ export interface IndicatorCellProps extends IndicatorProps, React.HTMLAttributes
|
|
|
14
14
|
*/
|
|
15
15
|
label?: string;
|
|
16
16
|
/**
|
|
17
|
-
* A boolean parameter to display or hide icon background, default value is
|
|
17
|
+
* A boolean parameter to display or hide icon background, default value is false
|
|
18
18
|
*/
|
|
19
19
|
withBackground?: boolean;
|
|
20
20
|
/**
|
|
@@ -25,6 +25,10 @@ export interface IndicatorCellProps extends IndicatorProps, React.HTMLAttributes
|
|
|
25
25
|
* A boolean parameter to make the indicator ping thus drawing more attention, default value is false
|
|
26
26
|
*/
|
|
27
27
|
ping?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The weight of the label's text, default value is normal
|
|
30
|
+
*/
|
|
31
|
+
weight?: "normal" | "medium";
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* The IndicatorCell is used for render an indicator in a table cell
|
|
@@ -32,4 +36,4 @@ export interface IndicatorCellProps extends IndicatorProps, React.HTMLAttributes
|
|
|
32
36
|
* @param {IndicatorCellProps} props - The props for the LinkCell component
|
|
33
37
|
* @returns {ReactElement} LinkCell component
|
|
34
38
|
*/
|
|
35
|
-
export declare const IndicatorCell: ({ ...rest }: IndicatorCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const IndicatorCell: ({ withBackground, weight, ...rest }: IndicatorCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,4 +24,4 @@ export interface LinkCellProps extends CommonProps, HTMLAttributes<HTMLTableSect
|
|
|
24
24
|
* @param {LinkCellProps} props - The props for the LinkCell component
|
|
25
25
|
* @returns {ReactElement} LinkCell component
|
|
26
26
|
*/
|
|
27
|
-
export declare const LinkCell: ({ link, type, ...rest }: LinkCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const LinkCell: ({ link, type, className, ...rest }: LinkCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cvaLinkCell: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|