@sphereon/ui-components.ssi-react 0.4.1-unstable.93 → 0.4.1-unstable.95
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/dist/components/views/FormView/index.js +0 -6
- package/dist/components/views/SSITabView/SSITabViewHeader/index.d.ts +3 -3
- package/dist/components/views/SSITabView/SSITabViewHeader/index.js +6 -7
- package/dist/components/views/SSITabView/index.d.ts +3 -2
- package/dist/components/views/SSITabView/index.js +13 -13
- package/package.json +3 -3
|
@@ -33,12 +33,6 @@ const FormView = (props) => {
|
|
|
33
33
|
const data = props.data;
|
|
34
34
|
validate(data);
|
|
35
35
|
setData(data);
|
|
36
|
-
if (onFormStateChange) {
|
|
37
|
-
void onFormStateChange({
|
|
38
|
-
data,
|
|
39
|
-
errors: validate.errors ?? []
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
36
|
}, [schema]);
|
|
43
37
|
return (_jsx("div", { style: style, children: _jsx(JsonForms, { schema: schema, uischema: uiSchema, data: data, renderers: renderers, cells: cells, onChange: onFormStateChange, validationMode: validationMode, middleware: middleware, ajv: ajv, readonly: readonly, config: config }) }));
|
|
44
38
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { TabNavigationState } from '@sphereon/ui-components.core';
|
|
3
3
|
type Props = {
|
|
4
4
|
navigationState: TabNavigationState;
|
|
5
|
-
|
|
5
|
+
onRouteChange: (key: string) => void;
|
|
6
6
|
};
|
|
7
|
-
declare const SSITabViewHeader:
|
|
7
|
+
declare const SSITabViewHeader: FC<Props>;
|
|
8
8
|
export default SSITabViewHeader;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer, SSITabViewHeaderTitleCaptionStyled as TitleCaption, } from '../../../../styles';
|
|
3
3
|
const SSITabViewHeader = (props) => {
|
|
4
|
-
const { navigationState,
|
|
5
|
-
return (_jsx(Container, { children: navigationState.routes.map((value
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, children: _jsx(TitleCaption, { style: { fontWeight: !isActiveTab ? '400' : '600' }, children: value.title }) }, tabIndex));
|
|
4
|
+
const { navigationState, onRouteChange } = props;
|
|
5
|
+
return (_jsx(Container, { children: navigationState.routes.map((value) => {
|
|
6
|
+
const isActiveRoute = value.key === navigationState.activeRoute;
|
|
7
|
+
return (_jsx(TitleContainer, { onClick: () => onRouteChange(value.key), style: {
|
|
8
|
+
...(isActiveRoute && { borderBottom: `2px solid #7276F7`, alignSelf: 'stretch' }),
|
|
9
|
+
}, children: _jsx(TitleCaption, { style: { fontWeight: !isActiveRoute ? '400' : '600' }, children: value.title }) }, value.key));
|
|
11
10
|
}) }));
|
|
12
11
|
};
|
|
13
12
|
export default SSITabViewHeader;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { TabViewRoute } from '@sphereon/ui-components.core';
|
|
3
3
|
type Props = {
|
|
4
4
|
routes: Array<TabViewRoute>;
|
|
5
|
+
onRouteChange?: (key: string) => Promise<void>;
|
|
5
6
|
};
|
|
6
|
-
declare const SSITabView:
|
|
7
|
+
declare const SSITabView: FC<Props>;
|
|
7
8
|
export default SSITabView;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
3
3
|
import SSITabViewHeader from './SSITabViewHeader';
|
|
4
4
|
import { SSITabViewContainerStyled as Container } from '../../../styles';
|
|
5
5
|
const Tab = (props) => {
|
|
6
|
-
return _jsx(
|
|
6
|
+
return _jsx(Fragment, { children: props.children });
|
|
7
7
|
};
|
|
8
8
|
const SSITabView = (props) => {
|
|
9
9
|
const { routes = [] } = props;
|
|
10
|
-
const [
|
|
11
|
-
const [content, setContent] =
|
|
12
|
-
|
|
13
|
-
routes.forEach((route
|
|
14
|
-
if (
|
|
10
|
+
const [activeRoute, setActiveRoute] = useState(routes.length > 0 ? routes[0].key : "");
|
|
11
|
+
const [content, setContent] = useState();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
routes.forEach((route) => {
|
|
14
|
+
if (route.key === activeRoute) {
|
|
15
15
|
setContent(route.content);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
}, [routes,
|
|
19
|
-
const onTabChange = async (
|
|
20
|
-
|
|
18
|
+
}, [routes, activeRoute]);
|
|
19
|
+
const onTabChange = async (key) => {
|
|
20
|
+
setActiveRoute(key);
|
|
21
21
|
};
|
|
22
22
|
return (_jsxs(Container, { children: [_jsx(SSITabViewHeader, { navigationState: {
|
|
23
|
-
routes
|
|
24
|
-
|
|
25
|
-
},
|
|
23
|
+
routes,
|
|
24
|
+
activeRoute,
|
|
25
|
+
}, onRouteChange: onTabChange }), _jsx(Tab, { children: content })] }));
|
|
26
26
|
};
|
|
27
27
|
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.
|
|
4
|
+
"version": "0.4.1-unstable.95+a3cc3d0",
|
|
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.
|
|
53
|
+
"@sphereon/ui-components.core": "0.4.1-unstable.95+a3cc3d0",
|
|
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": "
|
|
75
|
+
"gitHead": "a3cc3d0e2bc5981461074a5fee29c32c86ee6e73"
|
|
76
76
|
}
|