@trackunit/react-widgets 2.1.59 → 2.1.62
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
|
@@ -319,7 +319,7 @@ const cvaWidgetList = cssClassVarianceUtilities.cvaMerge(["min-h-0"]);
|
|
|
319
319
|
const cvaWidgetListVirtualizedList = cssClassVarianceUtilities.cvaMerge(["w-full"]);
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
|
-
* WidgetList used for rendering a list of in a widget
|
|
322
|
+
* WidgetList used for rendering a list of in a widget. It is a wrapper component for the ListItem components.
|
|
323
323
|
*
|
|
324
324
|
* @param { WidgetListProps} props - The props for the WidgetList component
|
|
325
325
|
* @returns {Element} WidgetList component
|
|
@@ -330,21 +330,6 @@ const WidgetList = ({ dataTestId, pagination, count, children, className, rowHei
|
|
|
330
330
|
} }) }));
|
|
331
331
|
};
|
|
332
332
|
|
|
333
|
-
const cvaWidgetListItem = cssClassVarianceUtilities.cvaMerge(["py-2", "px-4", "h-14", "w-full"]);
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Widget ListItem component for the WidgetList component this is 1 row in the list
|
|
337
|
-
*
|
|
338
|
-
* @param { WidgetListItemProps} props - The props for the WidgetListItem component
|
|
339
|
-
* @returns {Element} WidgetListItem component
|
|
340
|
-
*/
|
|
341
|
-
const WidgetListItem = ({ className, dataTestId, onClick, details, tableCellComponent, }) => {
|
|
342
|
-
const interactableItemClass = onClick
|
|
343
|
-
? reactComponents.cvaInteractableItem({ cursor: "pointer", className: cvaWidgetListItem({ className }) })
|
|
344
|
-
: cvaWidgetListItem({ className });
|
|
345
|
-
return (jsxRuntime.jsx("div", { className: interactableItemClass, "data-testid": dataTestId, onClick: onClick, children: jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [jsxRuntime.jsx("div", { className: "flex items-center gap-2 overflow-hidden text-ellipsis", children: tableCellComponent }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pl-2", children: [details, onClick ? jsxRuntime.jsx(reactComponents.Icon, { name: "ChevronRight", size: "medium" }) : null] })] }) }));
|
|
346
|
-
};
|
|
347
|
-
|
|
348
333
|
/*
|
|
349
334
|
* ----------------------------
|
|
350
335
|
* | SETUP TRANSLATIONS START |
|
|
@@ -361,6 +346,5 @@ exports.WidgetEditBody = WidgetEditBody;
|
|
|
361
346
|
exports.WidgetError = WidgetError;
|
|
362
347
|
exports.WidgetKPI = WidgetKPI;
|
|
363
348
|
exports.WidgetList = WidgetList;
|
|
364
|
-
exports.WidgetListItem = WidgetListItem;
|
|
365
349
|
exports.WidgetMissingConfiguration = WidgetMissingConfiguration;
|
|
366
350
|
exports.WidgetNoData = WidgetNoData;
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { EmptyState, useScrollDetection, Card, CardHeader, CardBody, CardFooter, Button, SkeletonLines, Icon, Tooltip, Text, VirtualizedList
|
|
3
|
+
import { EmptyState, useScrollDetection, Card, CardHeader, CardBody, CardFooter, Button, SkeletonLines, Icon, Tooltip, Text, VirtualizedList } from '@trackunit/react-components';
|
|
4
4
|
import { Children, Fragment, useState } from 'react';
|
|
5
5
|
import { WidgetConfigRuntime } from '@trackunit/iris-app-runtime-core';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
@@ -317,7 +317,7 @@ const cvaWidgetList = cvaMerge(["min-h-0"]);
|
|
|
317
317
|
const cvaWidgetListVirtualizedList = cvaMerge(["w-full"]);
|
|
318
318
|
|
|
319
319
|
/**
|
|
320
|
-
* WidgetList used for rendering a list of in a widget
|
|
320
|
+
* WidgetList used for rendering a list of in a widget. It is a wrapper component for the ListItem components.
|
|
321
321
|
*
|
|
322
322
|
* @param { WidgetListProps} props - The props for the WidgetList component
|
|
323
323
|
* @returns {Element} WidgetList component
|
|
@@ -328,21 +328,6 @@ const WidgetList = ({ dataTestId, pagination, count, children, className, rowHei
|
|
|
328
328
|
} }) }));
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
-
const cvaWidgetListItem = cvaMerge(["py-2", "px-4", "h-14", "w-full"]);
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Widget ListItem component for the WidgetList component this is 1 row in the list
|
|
335
|
-
*
|
|
336
|
-
* @param { WidgetListItemProps} props - The props for the WidgetListItem component
|
|
337
|
-
* @returns {Element} WidgetListItem component
|
|
338
|
-
*/
|
|
339
|
-
const WidgetListItem = ({ className, dataTestId, onClick, details, tableCellComponent, }) => {
|
|
340
|
-
const interactableItemClass = onClick
|
|
341
|
-
? cvaInteractableItem({ cursor: "pointer", className: cvaWidgetListItem({ className }) })
|
|
342
|
-
: cvaWidgetListItem({ className });
|
|
343
|
-
return (jsx("div", { className: interactableItemClass, "data-testid": dataTestId, onClick: onClick, children: jsxs("div", { className: "flex items-center justify-between", children: [jsx("div", { className: "flex items-center gap-2 overflow-hidden text-ellipsis", children: tableCellComponent }), jsxs("div", { className: "flex items-center gap-2 pl-2", children: [details, onClick ? jsx(Icon, { name: "ChevronRight", size: "medium" }) : null] })] }) }));
|
|
344
|
-
};
|
|
345
|
-
|
|
346
331
|
/*
|
|
347
332
|
* ----------------------------
|
|
348
333
|
* | SETUP TRANSLATIONS START |
|
|
@@ -352,4 +337,4 @@ const WidgetListItem = ({ className, dataTestId, onClick, details, tableCellComp
|
|
|
352
337
|
*/
|
|
353
338
|
setupLibraryTranslations();
|
|
354
339
|
|
|
355
|
-
export { HorizontalWidgetLayout, VerticalSplitWidgetLayout, WidgetBody, WidgetEditBody, WidgetError, WidgetKPI, WidgetList,
|
|
340
|
+
export { HorizontalWidgetLayout, VerticalSplitWidgetLayout, WidgetBody, WidgetEditBody, WidgetError, WidgetKPI, WidgetList, WidgetMissingConfiguration, WidgetNoData };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-widgets",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.62",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.8.
|
|
12
|
-
"@trackunit/iris-app-runtime-core": "1.7.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.6.
|
|
14
|
-
"@trackunit/ui-design-tokens": "1.6.
|
|
15
|
-
"@trackunit/ui-icons": "1.6.
|
|
16
|
-
"@trackunit/react-table-pagination": "1.6.
|
|
17
|
-
"@trackunit/shared-utils": "1.8.
|
|
18
|
-
"@trackunit/i18n-library-translation": "1.6.
|
|
19
|
-
"@trackunit/react-test-setup": "1.3.
|
|
11
|
+
"@trackunit/react-components": "1.8.12",
|
|
12
|
+
"@trackunit/iris-app-runtime-core": "1.7.42",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.6.40",
|
|
14
|
+
"@trackunit/ui-design-tokens": "1.6.42",
|
|
15
|
+
"@trackunit/ui-icons": "1.6.39",
|
|
16
|
+
"@trackunit/react-table-pagination": "1.6.39",
|
|
17
|
+
"@trackunit/shared-utils": "1.8.40",
|
|
18
|
+
"@trackunit/i18n-library-translation": "1.6.44",
|
|
19
|
+
"@trackunit/react-test-setup": "1.3.40"
|
|
20
20
|
},
|
|
21
21
|
"module": "./index.esm.js",
|
|
22
22
|
"main": "./index.cjs.js",
|
|
@@ -18,7 +18,7 @@ export interface WidgetListProps extends CommonProps, MappedOmit<VariantProps<ty
|
|
|
18
18
|
*/
|
|
19
19
|
rowHeight?: number;
|
|
20
20
|
/**
|
|
21
|
-
* The children to render for each item in the list.
|
|
21
|
+
* The children are used to render the ListItem component for each item in the list.
|
|
22
22
|
*/
|
|
23
23
|
children: (index: number) => ReactElement | null;
|
|
24
24
|
/**
|
|
@@ -27,7 +27,7 @@ export interface WidgetListProps extends CommonProps, MappedOmit<VariantProps<ty
|
|
|
27
27
|
scrollRef?: RefObject<HTMLDivElement | null>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* WidgetList used for rendering a list of in a widget
|
|
30
|
+
* WidgetList used for rendering a list of in a widget. It is a wrapper component for the ListItem components.
|
|
31
31
|
*
|
|
32
32
|
* @param { WidgetListProps} props - The props for the WidgetList component
|
|
33
33
|
* @returns {Element} WidgetList component
|
package/src/index.d.ts
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from "@trackunit/css-class-variance-utilities";
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
-
import { MappedOmit } from "@trackunit/shared-utils";
|
|
4
|
-
import { cvaWidgetListItem } from "../WidgetListItem/WidgetListItem.variants";
|
|
5
|
-
export interface WidgetListItemProps extends CommonProps, MappedOmit<VariantProps<typeof cvaWidgetListItem>, "className"> {
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
tableCellComponent: React.ReactNode;
|
|
8
|
-
details?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Widget ListItem component for the WidgetList component this is 1 row in the list
|
|
12
|
-
*
|
|
13
|
-
* @param { WidgetListItemProps} props - The props for the WidgetListItem component
|
|
14
|
-
* @returns {Element} WidgetListItem component
|
|
15
|
-
*/
|
|
16
|
-
export declare const WidgetListItem: ({ className, dataTestId, onClick, details, tableCellComponent, }: WidgetListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const cvaWidgetListItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|