@sphereon/ui-components.ssi-react 0.4.1-unstable.95 → 0.4.1-unstable.97

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.
@@ -2,6 +2,7 @@ import { FC } from 'react';
2
2
  import { TabViewRoute } from '@sphereon/ui-components.core';
3
3
  type Props = {
4
4
  routes: Array<TabViewRoute>;
5
+ activeRoute?: string;
5
6
  onRouteChange?: (key: string) => Promise<void>;
6
7
  };
7
8
  declare const SSITabView: FC<Props>;
@@ -7,7 +7,7 @@ const Tab = (props) => {
7
7
  };
8
8
  const SSITabView = (props) => {
9
9
  const { routes = [] } = props;
10
- const [activeRoute, setActiveRoute] = useState(routes.length > 0 ? routes[0].key : "");
10
+ const [activeRoute, setActiveRoute] = useState(props.activeRoute ?? routes.length > 0 ? routes[0].key : "");
11
11
  const [content, setContent] = useState();
12
12
  useEffect(() => {
13
13
  routes.forEach((route) => {
@@ -16,12 +16,13 @@ const SSITabView = (props) => {
16
16
  }
17
17
  });
18
18
  }, [routes, activeRoute]);
19
- const onTabChange = async (key) => {
19
+ const onRouteChange = async (key) => {
20
20
  setActiveRoute(key);
21
+ props.onRouteChange?.(key);
21
22
  };
22
23
  return (_jsxs(Container, { children: [_jsx(SSITabViewHeader, { navigationState: {
23
24
  routes,
24
25
  activeRoute,
25
- }, onRouteChange: onTabChange }), _jsx(Tab, { children: content })] }));
26
+ }, onRouteChange: onRouteChange }), _jsx(Tab, { children: content })] }));
26
27
  };
27
28
  export default SSITabView;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sphereon/ui-components.ssi-react",
3
3
  "private": false,
4
- "version": "0.4.1-unstable.95+a3cc3d0",
4
+ "version": "0.4.1-unstable.97+92cd395",
5
5
  "description": "SSI UI components for React",
6
6
  "repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
7
7
  "author": "Sphereon <dev@sphereon.com>",
@@ -50,7 +50,7 @@
50
50
  "@mui/x-date-pickers": "^8.18.0",
51
51
  "@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.45.94",
52
52
  "@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.94",
53
- "@sphereon/ui-components.core": "0.4.1-unstable.95+a3cc3d0",
53
+ "@sphereon/ui-components.core": "0.4.1-unstable.97+92cd395",
54
54
  "@tanstack/react-table": "^8.9.3",
55
55
  "ajv": "^8.17.1",
56
56
  "ajv-formats": "^3.0.1",
@@ -72,5 +72,5 @@
72
72
  "peerDependencies": {
73
73
  "react": ">= 18"
74
74
  },
75
- "gitHead": "a3cc3d0e2bc5981461074a5fee29c32c86ee6e73"
75
+ "gitHead": "92cd395706e91ab4d65c7adf48a34450c5114b7b"
76
76
  }