@hitachivantara/uikit-cli 6.0.5 → 6.0.7
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/package.json +2 -2
- package/src/baselines/app-shell/vite/_package.json +2 -2
- package/src/baselines/app-shell/vite/src/tests/providers.tsx +2 -2
- package/src/baselines/vite/_package.json +2 -2
- package/src/baselines/vite/src/App.tsx +1 -1
- package/src/baselines/vite/src/pages/layout/navigation.tsx +1 -1
- package/src/package.js +1 -1
- package/src/plop-templates/app-shell/app-shell.config.ts.hbs +1 -10
- package/src/templates/AssetInventory/CardView.tsx +2 -2
- package/src/templates/AssetInventory/ListView.tsx +3 -3
- package/src/templates/AssetInventory/data.tsx +11 -9
- package/src/templates/AssetInventory/index.tsx +4 -4
- package/src/templates/Canvas/Context.tsx +2 -2
- package/src/templates/Canvas/ListView.tsx +4 -5
- package/src/templates/Canvas/Node.tsx +5 -5
- package/src/templates/Canvas/Sidebar.tsx +2 -2
- package/src/templates/Canvas/StatusEdge.tsx +3 -3
- package/src/templates/Canvas/Table.tsx +1 -1
- package/src/templates/Canvas/TreeView.tsx +2 -2
- package/src/templates/Canvas/index.tsx +5 -5
- package/src/templates/Dashboard/GridPanel.tsx +1 -1
- package/src/templates/Dashboard/Kpi.tsx +1 -1
- package/src/templates/Dashboard/Map.tsx +4 -5
- package/src/templates/Dashboard/dependencies.json +1 -1
- package/src/templates/Dashboard/index.tsx +1 -1
- package/src/templates/DetailsView/MetadataItem.tsx +3 -4
- package/src/templates/DetailsView/Properties.tsx +4 -4
- package/src/templates/DetailsView/Table.tsx +2 -2
- package/src/templates/DetailsView/data.ts +6 -4
- package/src/templates/DetailsView/index.tsx +5 -5
- package/src/templates/DetailsView/utils.ts +1 -1
- package/src/templates/KanbanBoard/ColumnContainer.tsx +1 -1
- package/src/templates/KanbanBoard/TaskCard.tsx +1 -1
- package/src/templates/KanbanBoard/data.tsx +1 -1
- package/src/templates/KanbanBoard/dependencies.json +2 -2
- package/src/templates/KanbanBoard/index.tsx +4 -4
- package/src/templates/KanbanBoard/types.ts +1 -1
- package/src/templates/ListView/Indicator.tsx +1 -1
- package/src/templates/ListView/Kpi.tsx +3 -3
- package/src/templates/ListView/Table.tsx +2 -2
- package/src/templates/ListView/data.tsx +10 -8
- package/src/templates/ListView/index.tsx +5 -5
- package/src/baselines/app-shell/vite/src/lib/data/config.ts +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-cli",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Hitachi Vantara UI Kit Team",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public",
|
|
45
45
|
"directory": "package"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b9034f709fcfa749a28a52ed31dab060455493d6"
|
|
48
48
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@mui/material": "^7.0.2",
|
|
25
25
|
"i18next": "^23.7.8",
|
|
26
26
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
27
|
-
"i18next-http-backend": "^
|
|
27
|
+
"i18next-http-backend": "^4.0.0",
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
30
|
"react-i18next": "^14.0.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hitachivantara/app-shell-vite-plugin": "^2.0.0",
|
|
36
|
-
"@hitachivantara/uikit-config": "^0.
|
|
36
|
+
"@hitachivantara/uikit-config": "^0.6.1",
|
|
37
37
|
"@hitachivantara/uikit-uno-preset": "^1.0.0",
|
|
38
38
|
"@testing-library/jest-dom": "^6.1.5",
|
|
39
39
|
"@testing-library/react": "^14.0.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Suspense } from "react";
|
|
2
2
|
import { HvProvider } from "@hitachivantara/uikit-react-core";
|
|
3
3
|
|
|
4
4
|
import { SUSPENSE_LABEL } from "./mocks";
|
|
5
5
|
|
|
6
6
|
/** Base Test Provider */
|
|
7
|
-
export const TestProvider
|
|
7
|
+
export const TestProvider = ({ children }: React.PropsWithChildren) => {
|
|
8
8
|
return (
|
|
9
9
|
<Suspense fallback={SUSPENSE_LABEL}>
|
|
10
10
|
<HvProvider>{children}</HvProvider>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@mui/material": "^7.0.2",
|
|
25
25
|
"i18next": "^22.4.10",
|
|
26
26
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
27
|
-
"i18next-http-backend": "^
|
|
27
|
+
"i18next-http-backend": "^4.0.0",
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
30
|
"react-i18next": "^12.2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"tiny-cookie": "^2.4.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@hitachivantara/uikit-config": "^0.
|
|
35
|
+
"@hitachivantara/uikit-config": "^0.6.1",
|
|
36
36
|
"@hitachivantara/uikit-uno-preset": "^1.0.0",
|
|
37
37
|
"@testing-library/jest-dom": "^6.1.5",
|
|
38
38
|
"@testing-library/react": "^14.0.0",
|
|
@@ -5,11 +5,11 @@ import useMediaQuery from "@mui/material/useMediaQuery";
|
|
|
5
5
|
import {
|
|
6
6
|
HvButton,
|
|
7
7
|
HvContainer,
|
|
8
|
-
HvContainerProps,
|
|
9
8
|
HvHeader,
|
|
10
9
|
HvHeaderBrand,
|
|
11
10
|
HvHeaderNavigation,
|
|
12
11
|
theme,
|
|
12
|
+
type HvContainerProps,
|
|
13
13
|
} from "@hitachivantara/uikit-react-core";
|
|
14
14
|
import { Menu } from "@hitachivantara/uikit-react-icons";
|
|
15
15
|
|
package/src/package.js
CHANGED
|
@@ -2,16 +2,7 @@ import type { HvAppShellConfig } from "@hitachivantara/app-shell-vite-plugin";
|
|
|
2
2
|
|
|
3
3
|
export default (): HvAppShellConfig => ({
|
|
4
4
|
name: "{{appName}}",
|
|
5
|
-
|
|
6
|
-
baseUrl: "/",
|
|
7
|
-
|
|
8
|
-
logo: {
|
|
9
|
-
name: "PENTAHO",
|
|
10
|
-
},
|
|
11
|
-
theming: {
|
|
12
|
-
theme: "pentaho",
|
|
13
|
-
colorMode: "light",
|
|
14
|
-
},
|
|
5
|
+
logo: { name: "PENTAHO" },
|
|
15
6
|
|
|
16
7
|
{{#if feats}}
|
|
17
8
|
header: {
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
HvCheckBox,
|
|
9
9
|
HvSimpleGrid,
|
|
10
10
|
HvSkeleton,
|
|
11
|
-
HvTableInstance,
|
|
12
11
|
HvTypography,
|
|
12
|
+
type HvTableInstance,
|
|
13
13
|
} from "@hitachivantara/uikit-react-core";
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { getStatusIcon, type AssetInventoryEntry } from "./data";
|
|
16
16
|
|
|
17
17
|
interface CardViewProps {
|
|
18
18
|
id?: string;
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
HvTable,
|
|
3
3
|
HvTableBody,
|
|
4
4
|
HvTableCell,
|
|
5
|
-
HvTableColumnConfig,
|
|
6
5
|
HvTableContainer,
|
|
7
6
|
HvTableHead,
|
|
8
7
|
HvTableHeader,
|
|
9
|
-
HvTableInstance,
|
|
10
8
|
HvTableRow,
|
|
9
|
+
type HvTableColumnConfig,
|
|
10
|
+
type HvTableInstance,
|
|
11
11
|
} from "@hitachivantara/uikit-react-core";
|
|
12
12
|
|
|
13
|
-
import { AssetInventoryEntry } from "./data";
|
|
13
|
+
import type { AssetInventoryEntry } from "./data";
|
|
14
14
|
|
|
15
15
|
interface ListViewProps {
|
|
16
16
|
id?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
HvBulkActionsProps,
|
|
3
|
-
HvColor,
|
|
4
|
-
HvControlsProps,
|
|
5
|
-
HvRightControlProps,
|
|
6
2
|
HvSkeleton,
|
|
7
|
-
HvTableColumnConfig,
|
|
8
3
|
HvTooltip,
|
|
4
|
+
type HvBulkActionsProps,
|
|
5
|
+
type HvColor,
|
|
6
|
+
type HvControlsProps,
|
|
7
|
+
type HvRightControlProps,
|
|
8
|
+
type HvTableColumnConfig,
|
|
9
9
|
} from "@hitachivantara/uikit-react-core";
|
|
10
10
|
import {
|
|
11
11
|
Add,
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
} from "@hitachivantara/uikit-react-icons";
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
|
-
DataObject,
|
|
24
|
-
ServerPaginationProps,
|
|
25
23
|
useServerPagination,
|
|
24
|
+
type DataObject,
|
|
25
|
+
type ServerPaginationProps,
|
|
26
26
|
} from "./usePaginationData";
|
|
27
27
|
|
|
28
28
|
// --- Table data utils ---
|
|
@@ -247,8 +247,10 @@ export const createEntry = (i: number): AssetInventoryEntry => {
|
|
|
247
247
|
// --- Data & Endpoint ---
|
|
248
248
|
const db = [...Array(50).keys()].map(createEntry);
|
|
249
249
|
|
|
250
|
-
export interface PaginationDataProps
|
|
251
|
-
|
|
250
|
+
export interface PaginationDataProps extends Omit<
|
|
251
|
+
ServerPaginationProps<AssetInventoryEntry>,
|
|
252
|
+
"endpoint" | "db"
|
|
253
|
+
> {}
|
|
252
254
|
|
|
253
255
|
export const usePaginationData = (props: PaginationDataProps) => {
|
|
254
256
|
return useServerPagination({ endpoint: "/events", db, ...props });
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useEffect, useId, useMemo, useState } from "react";
|
|
2
2
|
import { css } from "@emotion/css";
|
|
3
3
|
import {
|
|
4
|
-
HvActionsGenericProps,
|
|
5
4
|
HvBulkActions,
|
|
6
5
|
HvControls,
|
|
7
6
|
HvLeftControl,
|
|
8
|
-
HvLeftControlProps,
|
|
9
7
|
HvPagination,
|
|
10
8
|
HvRightControl,
|
|
11
9
|
theme,
|
|
@@ -15,17 +13,19 @@ import {
|
|
|
15
13
|
useHvPagination,
|
|
16
14
|
useHvRowSelection,
|
|
17
15
|
useHvSortBy,
|
|
16
|
+
type HvActionsGenericProps,
|
|
17
|
+
type HvLeftControlProps,
|
|
18
18
|
} from "@hitachivantara/uikit-react-core";
|
|
19
19
|
|
|
20
20
|
import { CardView } from "./CardView";
|
|
21
21
|
import {
|
|
22
22
|
actions,
|
|
23
|
-
AssetInventoryEntry,
|
|
24
23
|
getColumns,
|
|
25
|
-
PaginationDataProps,
|
|
26
24
|
rightControlValues,
|
|
27
25
|
usePaginationData,
|
|
28
26
|
views,
|
|
27
|
+
type AssetInventoryEntry,
|
|
28
|
+
type PaginationDataProps,
|
|
29
29
|
} from "./data";
|
|
30
30
|
import { ListView } from "./ListView";
|
|
31
31
|
|
|
@@ -3,18 +3,18 @@ import { useDraggable } from "@dnd-kit/core";
|
|
|
3
3
|
import { css, cx } from "@emotion/css";
|
|
4
4
|
import {
|
|
5
5
|
HvInput,
|
|
6
|
-
HvInputProps,
|
|
7
6
|
HvListContainer,
|
|
8
7
|
HvListItem,
|
|
9
|
-
HvListItemProps,
|
|
10
8
|
HvTypography,
|
|
11
9
|
outlineStyles,
|
|
12
10
|
theme,
|
|
13
11
|
useForkRef,
|
|
12
|
+
type HvInputProps,
|
|
13
|
+
type HvListItemProps,
|
|
14
14
|
} from "@hitachivantara/uikit-react-core";
|
|
15
15
|
import { Drag } from "@hitachivantara/uikit-react-icons";
|
|
16
16
|
|
|
17
|
-
import { NodeData } from "./Node";
|
|
17
|
+
import type { NodeData } from "./Node";
|
|
18
18
|
import { iconsMapping, iconsMappingKeys } from "./utils";
|
|
19
19
|
|
|
20
20
|
const classes = {
|
|
@@ -61,8 +61,7 @@ interface ItemProps {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
interface ItemCardProps
|
|
64
|
-
extends Omit<HvListItemProps, "title">,
|
|
65
|
-
Omit<ItemProps, "id"> {
|
|
64
|
+
extends Omit<HvListItemProps, "title">, Omit<ItemProps, "id"> {
|
|
66
65
|
isDragging?: boolean;
|
|
67
66
|
}
|
|
68
67
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { isValidElement } from "react";
|
|
2
2
|
import { css, cx } from "@emotion/css";
|
|
3
|
-
import { Handle,
|
|
3
|
+
import { Handle, NodeToolbar, Position, type NodeProps } from "reactflow";
|
|
4
4
|
import {
|
|
5
5
|
HvButton,
|
|
6
|
-
HvColorAny,
|
|
7
6
|
HvIconButton,
|
|
8
7
|
HvTooltip,
|
|
9
8
|
HvTypography,
|
|
10
9
|
theme,
|
|
10
|
+
type HvColorAny,
|
|
11
11
|
} from "@hitachivantara/uikit-react-core";
|
|
12
12
|
import {
|
|
13
|
-
HvFlowNodeInput,
|
|
14
|
-
HvFlowNodeOutput,
|
|
15
13
|
useHvNode,
|
|
14
|
+
type HvFlowNodeInput,
|
|
15
|
+
type HvFlowNodeOutput,
|
|
16
16
|
} from "@hitachivantara/uikit-react-lab";
|
|
17
17
|
|
|
18
18
|
import { useCanvasContext } from "./Context";
|
|
19
|
-
import {
|
|
19
|
+
import { flowStatusesSpecs, iconsMapping, type FlowStatus } from "./utils";
|
|
20
20
|
|
|
21
21
|
const classes = {
|
|
22
22
|
root: css({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useId, useState } from "react";
|
|
2
2
|
import {
|
|
3
|
-
DndContextProps,
|
|
4
3
|
DragOverlay,
|
|
5
4
|
useDndMonitor,
|
|
6
5
|
useDroppable,
|
|
6
|
+
type DndContextProps,
|
|
7
7
|
} from "@dnd-kit/core";
|
|
8
8
|
import {
|
|
9
9
|
HvCanvasSidePanel,
|
|
10
|
-
HvCanvasSidePanelProps,
|
|
10
|
+
type HvCanvasSidePanelProps,
|
|
11
11
|
} from "@hitachivantara/uikit-react-pentaho";
|
|
12
12
|
|
|
13
13
|
export const CanvasSidebar = (props: HvCanvasSidePanelProps) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseEdge,
|
|
3
3
|
EdgeLabelRenderer,
|
|
4
|
-
EdgeProps,
|
|
5
4
|
getBezierPath,
|
|
5
|
+
type EdgeProps,
|
|
6
6
|
} from "reactflow";
|
|
7
7
|
import {
|
|
8
8
|
HvDropDownMenu,
|
|
9
|
-
HvDropDownMenuProps,
|
|
9
|
+
type HvDropDownMenuProps,
|
|
10
10
|
} from "@hitachivantara/uikit-react-core";
|
|
11
11
|
import { useFlowInstance } from "@hitachivantara/uikit-react-lab";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { flowStatusesSpecs, type FlowStatus } from "./utils";
|
|
14
14
|
|
|
15
15
|
export type StatusEdgeData =
|
|
16
16
|
| undefined
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
HvTable,
|
|
7
7
|
HvTableBody,
|
|
8
8
|
HvTableCell,
|
|
9
|
-
HvTableColumnConfig,
|
|
10
9
|
HvTableContainer,
|
|
11
10
|
HvTableHead,
|
|
12
11
|
HvTableHeader,
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
16
15
|
useHvData,
|
|
17
16
|
useHvPagination,
|
|
18
17
|
useHvSortBy,
|
|
18
|
+
type HvTableColumnConfig,
|
|
19
19
|
} from "@hitachivantara/uikit-react-core";
|
|
20
20
|
|
|
21
21
|
import { delay } from "./utils";
|
|
@@ -4,15 +4,15 @@ import { css, cx } from "@emotion/css";
|
|
|
4
4
|
import {
|
|
5
5
|
HvOverflowTooltip,
|
|
6
6
|
HvTreeItem,
|
|
7
|
-
HvTreeItemProps,
|
|
8
7
|
HvTreeView,
|
|
9
8
|
theme,
|
|
10
9
|
useForkRef,
|
|
11
10
|
useHvTreeItem,
|
|
11
|
+
type HvTreeItemProps,
|
|
12
12
|
} from "@hitachivantara/uikit-react-core";
|
|
13
13
|
import { DataSource, Drag, Table } from "@hitachivantara/uikit-react-icons";
|
|
14
14
|
|
|
15
|
-
import { NodeData } from "./Node";
|
|
15
|
+
import type { NodeData } from "./Node";
|
|
16
16
|
|
|
17
17
|
const classes = {
|
|
18
18
|
dragging: css({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from "react";
|
|
2
|
-
import { applyNodeChanges, ReactFlowInstance } from "reactflow";
|
|
2
|
+
import { applyNodeChanges, type ReactFlowInstance } from "reactflow";
|
|
3
3
|
import {
|
|
4
4
|
HvButton,
|
|
5
5
|
HvDialog,
|
|
@@ -24,20 +24,20 @@ import {
|
|
|
24
24
|
HvFlowBackground,
|
|
25
25
|
HvFlowControls,
|
|
26
26
|
HvFlowEmpty,
|
|
27
|
-
HvFlowProps,
|
|
28
27
|
StickyNode,
|
|
29
|
-
|
|
28
|
+
type HvFlowProps,
|
|
29
|
+
type StickyNodeData,
|
|
30
30
|
} from "@hitachivantara/uikit-react-lab";
|
|
31
31
|
import {
|
|
32
32
|
HvCanvasBottomPanel,
|
|
33
|
-
HvCanvasBottomPanelProps,
|
|
34
33
|
HvCanvasProvider,
|
|
35
34
|
HvCanvasToolbar,
|
|
35
|
+
type HvCanvasBottomPanelProps,
|
|
36
36
|
} from "@hitachivantara/uikit-react-pentaho";
|
|
37
37
|
|
|
38
38
|
import { CanvasProvider, useCanvasContext } from "./Context";
|
|
39
39
|
import { ListView } from "./ListView";
|
|
40
|
-
import { Node, NodeData } from "./Node";
|
|
40
|
+
import { Node, type NodeData } from "./Node";
|
|
41
41
|
import { CanvasSidebar } from "./Sidebar";
|
|
42
42
|
import { StatusEdge } from "./StatusEdge";
|
|
43
43
|
import { classes } from "./styles";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css } from "@emotion/css";
|
|
2
2
|
import {
|
|
3
3
|
HvGrid,
|
|
4
|
-
HvGridProps,
|
|
5
4
|
HvLoadingContainer,
|
|
6
5
|
HvPanel,
|
|
7
6
|
theme,
|
|
7
|
+
type HvGridProps,
|
|
8
8
|
} from "@hitachivantara/uikit-react-core";
|
|
9
9
|
|
|
10
10
|
/** A `HvGrid` item + styled `HvPanel` container with a loading `Suspense` boundary */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
1
|
import {
|
|
3
2
|
MapContainer,
|
|
4
|
-
MapContainerProps,
|
|
5
3
|
Marker,
|
|
6
|
-
MarkerProps,
|
|
7
4
|
Popup,
|
|
8
|
-
PopupProps,
|
|
9
5
|
TileLayer,
|
|
6
|
+
type MapContainerProps,
|
|
7
|
+
type MarkerProps,
|
|
8
|
+
type PopupProps,
|
|
10
9
|
} from "react-leaflet";
|
|
11
10
|
import { css, cx } from "@emotion/css";
|
|
12
11
|
import { Global } from "@emotion/react";
|
|
@@ -33,7 +32,7 @@ const LevelIcons = [
|
|
|
33
32
|
});
|
|
34
33
|
|
|
35
34
|
interface MapProps extends MapContainerProps {
|
|
36
|
-
children?: ReactNode;
|
|
35
|
+
children?: React.ReactNode;
|
|
37
36
|
markers?: {
|
|
38
37
|
position: MarkerProps["position"];
|
|
39
38
|
label: PopupProps["children"];
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
1
|
import { css } from "@emotion/css";
|
|
3
2
|
import {
|
|
4
3
|
HvGrid,
|
|
5
|
-
HvGridProps,
|
|
6
4
|
HvTypography,
|
|
7
5
|
theme,
|
|
6
|
+
type HvGridProps,
|
|
8
7
|
} from "@hitachivantara/uikit-react-core";
|
|
9
8
|
|
|
10
9
|
export interface MetadataItemProps extends Omit<HvGridProps, "title"> {
|
|
11
|
-
title?: ReactNode;
|
|
12
|
-
children?: ReactNode;
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
children?: React.ReactNode;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export const MetadataItem = ({
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentType } from "react";
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
2
|
import { css } from "@emotion/css";
|
|
3
3
|
import {
|
|
4
|
-
HvColor,
|
|
5
4
|
HvDropdown,
|
|
6
|
-
HvGridProps,
|
|
7
5
|
HvProgressBar,
|
|
8
6
|
HvTag,
|
|
9
7
|
HvTagsInput,
|
|
10
8
|
HvTextArea,
|
|
11
9
|
theme,
|
|
10
|
+
type HvColor,
|
|
11
|
+
type HvGridProps,
|
|
12
12
|
} from "@hitachivantara/uikit-react-core";
|
|
13
13
|
import { Caution, Level4Alt } from "@hitachivantara/uikit-react-icons";
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { useModelData, type ModelDetails } from "./data";
|
|
16
16
|
import { MetadataItem } from "./MetadataItem";
|
|
17
17
|
|
|
18
18
|
const ProgressBar = ({
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
useHvPagination,
|
|
15
15
|
} from "@hitachivantara/uikit-react-core";
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { usePaginationData, type PaginationDataProps } from "./data";
|
|
18
|
+
import { getColumns, type DetailsViewEntry } from "./utils";
|
|
19
19
|
|
|
20
20
|
const PAGE_OPTIONS = [8, 16, 32];
|
|
21
21
|
|
|
@@ -2,10 +2,10 @@ import useSWR from "swr";
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
delay,
|
|
5
|
-
ServerPaginationProps,
|
|
6
5
|
useServerPagination,
|
|
6
|
+
type ServerPaginationProps,
|
|
7
7
|
} from "./usePaginationData";
|
|
8
|
-
import { createEntry, DetailsViewEntry } from "./utils";
|
|
8
|
+
import { createEntry, type DetailsViewEntry } from "./utils";
|
|
9
9
|
|
|
10
10
|
// --- Data ---
|
|
11
11
|
|
|
@@ -42,8 +42,10 @@ const model = {
|
|
|
42
42
|
export type ModelDetails = typeof model;
|
|
43
43
|
|
|
44
44
|
// #region Endpoints
|
|
45
|
-
export interface PaginationDataProps
|
|
46
|
-
|
|
45
|
+
export interface PaginationDataProps extends Omit<
|
|
46
|
+
ServerPaginationProps<DetailsViewEntry>,
|
|
47
|
+
"endpoint" | "db"
|
|
48
|
+
> {
|
|
47
49
|
id: string;
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Suspense, useState } from "react";
|
|
2
2
|
import { css } from "@emotion/css";
|
|
3
3
|
import {
|
|
4
4
|
HvButton,
|
|
5
5
|
HvGlobalActions,
|
|
6
|
-
HvGlobalActionsProps,
|
|
7
6
|
HvGrid,
|
|
8
|
-
HvGridProps,
|
|
9
7
|
HvLoading,
|
|
10
8
|
theme,
|
|
9
|
+
type HvGlobalActionsProps,
|
|
10
|
+
type HvGridProps,
|
|
11
11
|
} from "@hitachivantara/uikit-react-core";
|
|
12
12
|
|
|
13
13
|
import { KPIs } from "./KPIs";
|
|
@@ -18,8 +18,8 @@ const MODEL_ID = "123";
|
|
|
18
18
|
|
|
19
19
|
interface SectionProps extends HvGridProps {
|
|
20
20
|
variant?: HvGlobalActionsProps["variant"];
|
|
21
|
-
actions?: ReactNode;
|
|
22
|
-
component?: ElementType;
|
|
21
|
+
actions?: React.ReactNode;
|
|
22
|
+
component?: React.ElementType;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const Section = ({
|
|
@@ -10,7 +10,7 @@ import { Add } from "@hitachivantara/uikit-react-icons";
|
|
|
10
10
|
|
|
11
11
|
import classes from "./styles";
|
|
12
12
|
import { TaskCard } from "./TaskCard";
|
|
13
|
-
import { Column, Task } from "./types";
|
|
13
|
+
import type { Column, Task } from "./types";
|
|
14
14
|
|
|
15
15
|
interface ColumnProps {
|
|
16
16
|
column: Column;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useMemo, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
DndContext,
|
|
4
|
-
DragEndEvent,
|
|
5
|
-
DragOverEvent,
|
|
6
4
|
DragOverlay,
|
|
7
|
-
DragStartEvent,
|
|
8
5
|
PointerSensor,
|
|
9
6
|
useSensor,
|
|
10
7
|
useSensors,
|
|
8
|
+
type DragEndEvent,
|
|
9
|
+
type DragOverEvent,
|
|
10
|
+
type DragStartEvent,
|
|
11
11
|
} from "@dnd-kit/core";
|
|
12
12
|
import { arrayMove, SortableContext } from "@dnd-kit/sortable";
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ import { ColumnContainer } from "./ColumnContainer";
|
|
|
15
15
|
import { columns as defaultColumns, tasks as defaultTasks } from "./data";
|
|
16
16
|
import classes from "./styles";
|
|
17
17
|
import { TaskCard } from "./TaskCard";
|
|
18
|
-
import { Column, Task } from "./types";
|
|
18
|
+
import type { Column, Task } from "./types";
|
|
19
19
|
|
|
20
20
|
const KanbanBoard = () => {
|
|
21
21
|
const sensors = useSensors(
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { css, cx } from "@emotion/css";
|
|
2
2
|
import {
|
|
3
3
|
HvCard,
|
|
4
|
-
HvCardProps,
|
|
5
4
|
HvLoading,
|
|
6
|
-
HvTableInstance,
|
|
7
5
|
HvTypography,
|
|
8
6
|
theme,
|
|
7
|
+
type HvCardProps,
|
|
8
|
+
type HvTableInstance,
|
|
9
9
|
} from "@hitachivantara/uikit-react-core";
|
|
10
10
|
import { BottomXS, TopXS } from "@hitachivantara/uikit-react-icons";
|
|
11
11
|
|
|
12
|
-
import { getStatusIcon, ListViewEntry, TrendData } from "./data";
|
|
12
|
+
import { getStatusIcon, type ListViewEntry, type TrendData } from "./data";
|
|
13
13
|
import { Indicator } from "./Indicator";
|
|
14
14
|
|
|
15
15
|
const classes = {
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
HvTableContainer,
|
|
7
7
|
HvTableHead,
|
|
8
8
|
HvTableHeader,
|
|
9
|
-
HvTableInstance,
|
|
10
9
|
HvTableRow,
|
|
10
|
+
type HvTableInstance,
|
|
11
11
|
} from "@hitachivantara/uikit-react-core";
|
|
12
12
|
|
|
13
|
-
import { getColumns, ListViewEntry } from "./data";
|
|
13
|
+
import { getColumns, type ListViewEntry } from "./data";
|
|
14
14
|
|
|
15
15
|
interface TableProps {
|
|
16
16
|
instance: HvTableInstance<ListViewEntry, string>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import useSWR from "swr";
|
|
2
2
|
import {
|
|
3
|
-
HvBulkActionsProps,
|
|
4
|
-
HvColor,
|
|
5
|
-
HvTableColumnConfig,
|
|
6
3
|
HvTooltip,
|
|
4
|
+
type HvBulkActionsProps,
|
|
5
|
+
type HvColor,
|
|
6
|
+
type HvTableColumnConfig,
|
|
7
7
|
} from "@hitachivantara/uikit-react-core";
|
|
8
8
|
import {
|
|
9
|
-
IconType,
|
|
10
9
|
Level0Good,
|
|
11
10
|
Level1,
|
|
12
11
|
Level2Average,
|
|
13
12
|
Level3Bad,
|
|
14
13
|
Refresh,
|
|
14
|
+
type IconType,
|
|
15
15
|
} from "@hitachivantara/uikit-react-icons";
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
DataObject,
|
|
19
18
|
delay,
|
|
20
|
-
ServerPaginationProps,
|
|
21
19
|
useServerPagination,
|
|
20
|
+
type DataObject,
|
|
21
|
+
type ServerPaginationProps,
|
|
22
22
|
} from "./usePaginationData";
|
|
23
23
|
|
|
24
24
|
// --- Table data utils ---
|
|
@@ -162,8 +162,10 @@ const requestsSummary = {
|
|
|
162
162
|
},
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
export interface PaginationDataProps
|
|
166
|
-
|
|
165
|
+
export interface PaginationDataProps extends Omit<
|
|
166
|
+
ServerPaginationProps<ListViewEntry>,
|
|
167
|
+
"endpoint" | "db"
|
|
168
|
+
> {}
|
|
167
169
|
|
|
168
170
|
export const usePaginationData = (props: PaginationDataProps) => {
|
|
169
171
|
return useServerPagination({ endpoint: "/requests", db, ...props });
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { useEffect, useId, useMemo, useState } from "react";
|
|
2
2
|
import { css } from "@emotion/css";
|
|
3
3
|
import {
|
|
4
|
-
HvActionsGenericProps,
|
|
5
4
|
HvBulkActions,
|
|
6
5
|
HvButton,
|
|
7
6
|
HvControls,
|
|
8
7
|
HvGlobalActions,
|
|
9
8
|
HvGrid,
|
|
10
|
-
HvGridProps,
|
|
11
9
|
HvLeftControl,
|
|
12
|
-
HvLeftControlProps,
|
|
13
10
|
HvLoadingContainer,
|
|
14
11
|
HvPagination,
|
|
15
12
|
HvRightControl,
|
|
@@ -21,15 +18,18 @@ import {
|
|
|
21
18
|
useHvPagination,
|
|
22
19
|
useHvRowSelection,
|
|
23
20
|
useHvSortBy,
|
|
21
|
+
type HvActionsGenericProps,
|
|
22
|
+
type HvGridProps,
|
|
23
|
+
type HvLeftControlProps,
|
|
24
24
|
} from "@hitachivantara/uikit-react-core";
|
|
25
25
|
|
|
26
26
|
import {
|
|
27
27
|
actions,
|
|
28
28
|
getColumns,
|
|
29
|
-
ListViewEntry,
|
|
30
|
-
PaginationDataProps,
|
|
31
29
|
usePaginationData,
|
|
32
30
|
useSummaryData,
|
|
31
|
+
type ListViewEntry,
|
|
32
|
+
type PaginationDataProps,
|
|
33
33
|
} from "./data";
|
|
34
34
|
import { Kpi } from "./Kpi";
|
|
35
35
|
import { Table } from "./Table";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import baseUseSWR, { Key, SWRConfiguration } from "swr";
|
|
2
|
-
|
|
3
|
-
const fetcher = (url: RequestInfo | URL) =>
|
|
4
|
-
fetch(url).then((res) => res.json());
|
|
5
|
-
|
|
6
|
-
// overload the useSWR function to set the fetcher and add suspense by default
|
|
7
|
-
export default function useSWR<Data, Error = unknown>(
|
|
8
|
-
key: Key,
|
|
9
|
-
options?: SWRConfiguration<Data, Error>,
|
|
10
|
-
) {
|
|
11
|
-
return baseUseSWR<Data, Error>(key, fetcher, {
|
|
12
|
-
suspense: true,
|
|
13
|
-
...options,
|
|
14
|
-
});
|
|
15
|
-
}
|